[gs-devel] Another good excercise

Leonardo leonardo at artifex.com
Wed Jan 10 07:04:57 PST 2007


Folks,

I'll appreciate suggestions how to code this better :


#define signed_eo(a) ((a) < 0 ? -((a) & 1) : (a) > 0 ? ((a) & 1) : 0)
#define ADVANCE_WINDING(inside, alp, ll) \
{ int k = alp->contour_count; \
   int v = ll->windings[k]; \
   inside -= signed_eo(v); \
   v = ll->windings[k] += alp->direction; \
   inside += signed_eo(v); \
}

This code falls into a performance critical branch in gxfill.c .
Please portable solutions only.
Thanks.

Leo.






More information about the gs-devel mailing list