| Alfons Hoogervorst ( @ 2004-03-14 13:16:00 |
Bits
Saw the following thing in sylpheed-claws source code:
In 99% of the cases, constraining the bit length of a type is not necessary at all. The 1% case is when interfacing with system layers, but even in that case you need to be aware that C and the C standard library don't assume anything about the bit length of a type. (guint32 happens to be an unsigned int on 32-bit i386 architecture: this is a bug waiting to strike back hard with other archs around the corner.)
Saw the following thing in sylpheed-claws source code:
guint32 low, high;
.
.
.
sscanf(*range, "%u:%u", &low, &high);
In 99% of the cases, constraining the bit length of a type is not necessary at all. The 1% case is when interfacing with system layers, but even in that case you need to be aware that C and the C standard library don't assume anything about the bit length of a type. (guint32 happens to be an unsigned int on 32-bit i386 architecture: this is a bug waiting to strike back hard with other archs around the corner.)