From 02517a9c7b706ceaca97d34413debb829e23389c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 13 Nov 2022 12:41:41 -0800 Subject: Use C99 loop variable declarations Signed-off-by: Alan Coopersmith --- xstdcmap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/xstdcmap.c b/xstdcmap.c index 99fcf4b..3d9a0f7 100644 --- a/xstdcmap.c +++ b/xstdcmap.c @@ -148,8 +148,7 @@ parse(int argc, char **argv) snprintf(option, sizeof(option), "%s%s", program_name, ".delete"); if (XrmGetResource(database, option, (char *) NULL, &type, &value)) { - unsigned int i; - for (i=0; i < NPROPERTIES; i++) { + for (unsigned int i = 0; i < NPROPERTIES; i++) { if (strcmp((char *) value.addr, propertyTable[i].nickname) == 0) { propertyTable[i].delete++; break; @@ -212,16 +211,16 @@ getDeepestVisual(int visual_class, /* specifies the desired visual class */ XVisualInfo *vinfo, /* specifies all visuals for a screen */ int nvisuals) /* specifies number of visuals in the list */ { - register int i; int maxdepth = 0; XVisualInfo *v = NULL; - for (i=0; i < nvisuals; i++, vinfo++) + for (int i = 0; i < nvisuals; i++, vinfo++) { if (vinfo->class == visual_class && vinfo->depth > maxdepth) { maxdepth = vinfo->depth; v = vinfo; } + } return(v); } @@ -276,7 +275,6 @@ visualStringFromClass(int class) static int doIndividualColormaps(void) { - unsigned int i; int screen, nvisuals; Status status = -1; XVisualInfo *vinfo = NULL, *v = NULL, template; @@ -286,7 +284,7 @@ doIndividualColormaps(void) vinfo = XGetVisualInfo(dpy, VisualScreenMask, &template, &nvisuals); /* check for individual standard colormap requests */ - for (i=0; i < NPROPERTIES; i++) { + for (unsigned int i = 0; i < NPROPERTIES; i++) { if (propertyTable[i].delete) { XmuDeleteStandardColormap(dpy, screen, propertyTable[i].property); -- cgit v1.2.3