Robert Shearman rob@codeweavers.com writes:
Alexandre Julliard wrote:
sparse should be taught that 0 is a perfectly fine value (and IMO preferable to NULL) for handles.
I don't really understand this reasoning. Should gcc also be taught not to warn when we try to assign -1 to a handle? Are we using the wrong type for usr_handle_t then?
In a sense, yes. Handles are conceptually much closer to integers than pointers, but they are pointers in the Windows API so that the different handles can have distinct types. It's really just a workaround for the fact that all integer types are freely interchangeable in C.