On 6/27/06, Richard Kralovic <Richard.Kralovic@xxxxxxxxxxx> wrote:
I changed the definition of REMAINDER to this: #define REMAINDER(dividend, divisor) \ ((((dividend)%(divisor) < 0) ? \ (divisor) - ((-(dividend)) % (divisor)) : \ ((dividend) % (divisor)))) Is this the right fix?
The new version of the tile_offset function (earlier toff) using the REMAINDER macro is indeed buggy. Your fix is almost correct, the coorect fix was: #define REMAINDER(dividend, divisor) \ ((((dividend) < 0) ? \ ((divisor) - ((-(dividend)) % (divisor))) % (divisor) : \ ((dividend) % (divisor)))) (the whole point of this macro is that the result of %'ing a negative number is not defined in C, thus using it in the computation doesn't seem the right thing to do ;) /Øyvind K. -- «The future is already here. It's just not very evenly distributed» -- William Gibson http://pippin.gimp.org/ http://ffii.org/ _______________________________________________ Gegl-developer@xxxxxxxxxxxxxxxxxxxxxx https://lists.XCF.Berkeley.EDU/mailman/listinfo/gegl-developer