]> git.pond.sub.org Git - empserver/commitdiff
Make snxtsct_area() expect correct range width and height
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 17 Aug 2008 13:23:22 +0000 (09:23 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Aug 2008 12:54:05 +0000 (08:54 -0400)
snxtsct_area() computed width and height, overwriting the values
passed in, even though all but two callers passed correct values.  The
exceptions were snxtsct() in case NS_ALL, and snxtsct_all().  Change
them to pass correct values, and drop the recomputation from
snxtsct_area().  Simplifies the interface between snxtsct_area() and
its callers.

src/lib/subs/snxtsct.c

index 97992f70423be8299457e58707eb4103d7df06a5..79f15c24212470ce58262a1763f8ae6bc97f6cb9 100644 (file)
@@ -85,7 +85,7 @@ snxtsct(struct nstr_sect *np, char *str)
        range.ly = yabs(natp, -WORLD_Y / 2);
        range.hx = xabs(natp, WORLD_X / 2);
        range.hy = yabs(natp, WORLD_Y / 2);
-       range.width = range.height = 0;
+       xysize_range(&range);
        snxtsct_area(np, &range);
        break;
     default:
@@ -108,7 +108,7 @@ snxtsct_all(struct nstr_sect *np)
     worldrange.ly = -WORLD_Y / 2;
     worldrange.hx = WORLD_X / 2;
     worldrange.hy = WORLD_Y / 2;
-    worldrange.width = worldrange.height = 0;
+    xysize_range(&worldrange);
     snxtsct_area(np, &worldrange);
 }
 
@@ -124,7 +124,6 @@ snxtsct_area(struct nstr_sect *np, struct range *range)
     np->y = np->range.ly;
     np->dx = -1;
     np->dy = 0;
-    xysize_range(&np->range);
 }
 
 void