difference of non negative enums is never negative
Submitted by Massimo
Assigned to Chris Wilson @ickle
Description
Gcc treats enum with non negative values as unsigned, so using the difference in a comparison function is questionable:
http://cgit.freedesktop.org/cairo/tree/src/cairo-polygon-intersect.c#n794
for example adding a
assert (a->type - b->type >= 0);
gcc prints
src/cairo-polygon-intersect.c|795 col 15| warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] assert (a->type - b->type >= 0);
this means that three events (START, STOP, INTERSECTION) in the same place will be potentially each one after each other, making difficult to understand whether equally located STOP/INTER/START events should be really processed in that order or not.