diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 12:41:41 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 14:17:11 -0800 |
commit | 02517a9c7b706ceaca97d34413debb829e23389c (patch) | |
tree | 9d8d66b7e9cc4bc311b6b004bd4847e16e583d86 | |
parent | 75bfd01910347d18e461529bc99ad17d1f82a464 (diff) |
Use C99 loop variable declarations
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xstdcmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); |