I'm maintaining a project which contains following enum type definition. enum values are used in a combobox.
Why this enum type is defined in hex like this, for performance improvement?
xxxxx920P3 is actually a negative value -2147483648 and xxxxx920P2 is positive, it causes the conditional code to fail.The next value will be twice bigger as the xxxxx920P3, so any alternative solution for this enum definition rule? thanks.
It is a QT c++ project. Can I define a enum type to ULONGLONG?
enum Version { xxxxx = 0x00000000, xxxxx400 = 0x00000001, xxxxx401 = 0x00000002, xxxxx410 = 0x00000004, xxxxx411 = 0x00000008, xxxxx412 = 0x00000010, xxxxx420 = 0x00000020, xxxxx430 = 0x00000040, xxxxx431 = 0x00000080, xxxxx432 = 0x00000100, xxxxx440 = 0x00000200, xxxxx500 = 0x00000400, xxxxx510 = 0x00000800, xxxxx520 = 0x00001000, xxxxx521 = 0x00002000, xxxxx600 = 0x00004000, xxxxx611 = 0x00008000, xxxxx620 = 0x00010000, xxxxx621 = 0x00020000, xxxxx700 = 0x00040000, xxxxx910 = 0x00080000, xxxxx910P5 = 0x00100000, xxxxx910P6 = 0x00200000, xxxxx910P11 = 0x00400000, xxxxx910P12 = 0x00800000, xxxxx910P13 = 0x01000000, xxxxx910P14 = 0x02000000, xxxxx910P15 = 0x04000000, xxxxx910P16 = 0x08000000, xxxxx920 = 0x10000000, xxxxx920P1 = 0x20000000, xxxxx920P2 = 0x40000000, xxxxx920P3 = 0x80000000, }; Versions newVersions = (Version)mComboBox->itemData(inIndex).toUInt(); if ( newVersions < xxxxx500) //now newVersions is a negative value { } else { }