Skip to content

Proposal: use hex numbers in bitwise operations #1796

@greenozon

Description

@greenozon

ILSpy version 6.0.0.5369-alpha1

Right now it looks a bit funny, despite it is OK from compiler point of view
but having hex numbers the readablity will be much bigger I guess

ref to class BaseTypes.ChannelID for example

public ushort Position
	{
		get
		{
			return (ushort)((ulong)((long)m_TransponderID & -281474976710656L) >> 48);
		}
		set
		{
			m_TransponderID = ((m_TransponderID & 0xFFFFFFFFFFFF) | ((ulong)value << 48));
		}
	}
		public int Frequency
		{
			get
			{
				return (int)(m_TransponderID & int.MaxValue);
			}
			set
			{
				m_TransponderID = (ulong)(((long)m_TransponderID & -2147483648L) | value);
			}
		}

Proposal is to use hex at least in bitwise &, | and ^ operations..

etc

https://www.sendspace.com/file/4obei6

Metadata

Metadata

Assignees

No one assigned

    Labels

    C#DecompilerThe decompiler engine itselfEnhancementAreas for improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions