-#define ST_POP() { struct stack_element *s; llist_pop(st,&s); lx = s->myLx; rx = s->myRx; dadLx = s->dadLx; dadRx = s->dadRx; y = s->myY; direction= s->myDirection; myfree(s); }
-
-#define ST_STACK(dir,dadLx,dadRx,lx,rx,y) { int pushrx = rx+1; int pushlx = lx-1; ST_PUSH(lx,rx,pushlx,pushrx,y+dir,dir); if (rx > dadRx) ST_PUSH(dadRx+1,rx,pushlx,pushrx,y-dir,-dir); if (lx < dadLx) ST_PUSH(lx,dadLx-1,pushlx,pushrx,y-dir,-dir); }
-
-#define SET(x,y) btm_set(btm,x,y);
+#define ST_POP() do { \
+ struct stack_element *s; \
+ llist_pop(st,&s); \
+ lx = s->myLx; \
+ rx = s->myRx; \
+ dadLx = s->dadLx; \
+ dadRx = s->dadRx; \
+ y = s->myY; \
+ direction = s->myDirection; \
+ myfree(s); \
+} while (0)
+
+#define ST_STACK(dir,dadLx,dadRx,lx,rx,y) do { \
+ int pushrx = rx+1; \
+ int pushlx = lx-1; \
+ ST_PUSH(lx,rx,pushlx,pushrx,y+dir,dir); \
+ if (rx > dadRx) \
+ ST_PUSH(dadRx+1,rx,pushlx,pushrx,y-dir,-dir); \
+ if (lx < dadLx) ST_PUSH(lx,dadLx-1,pushlx,pushrx,y-dir,-dir); \
+} while (0)
+
+#define SET(x,y) btm_set(btm,x,y)