altos/draw: Add transforms to polygon code
[fw/altos] / src / draw / ao_copy.c
index 47067bb829a2fc62240cff5e2f32ddc7647fda1b..312d1d72bc9603ed26f155b527f0de495ccab369 100644 (file)
  * General Public License for more details.
  */
 
-#include "ao.h"
 #include "ao_draw.h"
 #include "ao_draw_int.h"
 
 #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)