diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-13 15:59:06 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-13 15:59:06 -0700 |
commit | fc54ce8a6f248e465a518f807dd5e51657b6e535 (patch) | |
tree | 58cc48404380e7f682253ee21df46cbfb7ae1206 | |
parent | 9e5fe5ae18c3f6eae93cd1521645717295ce2c23 (diff) |
Rename global "poly" to fix gcc -Wshadow warnings
ico.c: In function ‘initPoly’:
ico.c:472:45: warning: declaration of ‘poly’ shadows a global declaration [-Wshadow]
initPoly(struct closure *closure, Polyinfo *poly, int icoW, int icoH)
^~~~
ico.c:238:18: note: shadowed declaration is here
static Polyinfo *poly; /* -obj: the poly to draw */
^~~~
ico.c: In function ‘drawPoly’:
ico.c:567:45: warning: declaration of ‘poly’ shadows a global declaration [-Wshadow]
drawPoly(struct closure *closure, Polyinfo *poly, GC gc,
^~~~
ico.c:238:18: note: shadowed declaration is here
static Polyinfo *poly; /* -obj: the poly to draw */
^~~~
ico.c: In function ‘giveObjHelp’:
ico.c:1137:13: warning: declaration of ‘poly’ shadows a global declaration [-Wshadow]
Polyinfo *poly = polygons+i;
^~~~
ico.c:238:18: note: shadowed declaration is here
static Polyinfo *poly; /* -obj: the poly to draw */
^~~~
ico.c: In function ‘findpoly’:
ico.c:1152:13: warning: declaration of ‘poly’ shadows a global declaration [-Wshadow]
Polyinfo *poly = polygons+i;
^~~~
ico.c:238:18: note: shadowed declaration is here
static Polyinfo *poly; /* -obj: the poly to draw */
^~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | ico.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -235,7 +235,7 @@ static int dofaces = 0; /* -faces */ static int invert = 0; /* -i */ static const char *ico_geom = NULL; /* -size: size of object in window */ static const char *delta_geom = NULL; /* -delta: amount by which to move object */ -static Polyinfo *poly; /* -obj: the poly to draw */ +static Polyinfo *polyobj; /* -obj: the poly to draw */ static int dsync = 0; /* -dsync */ static int xsync = 0; /* -sync */ static int msleepcount = 0; /* -sleep value in milliseconds*/ @@ -1022,7 +1022,7 @@ do_ico_window(void *ptr) icodeltax2 = icoDeltaX * 2; icodeltay2 = icoDeltaY * 2; - initPoly(closure, poly, icoW, icoH); + initPoly(closure, polyobj, icoW, icoH); while (do_it) { int prevX; @@ -1105,7 +1105,7 @@ do_ico_window(void *ptr) icodeltay2 = icoDeltaY * 2; } - drawPoly(closure, poly, closure->gcontext, + drawPoly(closure, polyobj, closure->gcontext, icoX, icoY, icoW, icoH, prevX, prevY); } XDestroyWindow(dpy, closure->win); @@ -1173,7 +1173,7 @@ int main(int argc, const char **argv) /* Process arguments: */ - poly = findpoly("icosahedron"); /* default */ + polyobj = findpoly("icosahedron"); /* default */ for (argv++, argc--; argc > 0; argv++, argc--) { if (!strcmp (*argv, "-display")) { @@ -1269,7 +1269,7 @@ int main(int argc, const char **argv) } else if (!strcmp (*argv, "-obj")) { if (argc < 2) icoFatal("missing argument for %s", *argv); - poly = findpoly(*++argv); argc--; + polyobj = findpoly(*++argv); argc--; } else if (!strcmp(*argv, "-dsync")) dsync = 1; else if (!strncmp(*argv, "-sync", 5)) |