I need all bits to 1 on a char size, while I know in C there is limits.h, and vala has int.MAX, Iām not sure of the char size.
How could I find it - a char size - and generate my bitmask for sure, instead of using 0xFFFF ?
I need all bits to 1 on a char size, while I know in C there is limits.h, and vala has int.MAX, Iām not sure of the char size.
How could I find it - a char size - and generate my bitmask for sure, instead of using 0xFFFF ?
apmasell is right, but I don't really like his answer. If you want the size of char (in bytes), you should use sizeof(char)
instead of depending on that value in the glib vapi staying the same.
char.MAX
, if it existed, wouldn't be 0xff (255), it would be 0x7f (127), but that isn't the right value for a mask since the. From a practical perspective it's probably safe to assume 0xff is the right value, but if you want to be safe you could just use ~((char) 0)
.
In Vala, char
is one byte. Here is the VAPI declaration:
[IntegerType (rank = 2, min = 0, max = 127)]
public struct char {