altos/draw: Add transforms to polygon code
[fw/altos] / src / draw / ao_copy.c
index 0e822932d652ebb7315214b92de829c8ad42ab0a..312d1d72bc9603ed26f155b527f0de495ccab369 100644 (file)
 
 #define bound(val,max,other) do {              \
                if (val < 0) {                  \
-                       other -= val;           \
+                       other += (typeof(other)) (-val);        \
                        val = 0;                \
                }                               \
                if (val > max) {                \
-                       other -= (val - max);   \
+                       other -= (typeof(other)) (val - max);   \
                        val = max;              \
                }                               \
        } while (0)