What is the logic behind "possible misuse of hexadecimal literal notation"? #1
-
|
This code Gets warning: For me those Hex codes are clearly being used to set bits, rather than as numbers. So what is the logic there? this looks similar but there is no warning |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Those aren't the same thing. |
Beta Was this translation helpful? Give feedback.
-
|
Put simply
Bits are numbers :) |
Beta Was this translation helpful? Give feedback.
Those aren't the same thing.
&H8000evaluates to -32768 whereas&H8000&evaluates to 32768. If the terms are allIntegers you won't notice any difference. However if they areLong, what you are doing is the difference between&HFFFF8000&vs&H00008000&which can mess up the bits in the upper portion of the value.