On 18.09.2008, at 17:01, Roman Kantor wrote: > OK, the other possibility would be that the negative size values would > indicate a position within some size table. But this would be ugly too > so I will drop the idea.
Nagtive values are perfectly legal on any machine. Even if there is less that 4GB of RAM, the MMU may still position the physical RAM anywhere in the address space, including 0x80000000 and above (which would be "negative"). A possible hack would be masking out the lowest bit, because structures and classes are word or longword aligned on pretty much every CPU. But it is still a dirty hack which may fail one day for some obscure reason. My favourite OS, MS Windows in most (all?) of its iterations actually uses your originally proposed hack for HANDLE! Quite a pitfall if the implementation is hidden and a programmer expects a pointer, but gets an index, or vice versa. Or in short: -1 ---- http://robowerk.com/ _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev