diff --git a/src/wxxt/contrib/xpm/lib/CrBufFrI.c b/src/wxxt/contrib/xpm/lib/CrBufFrI.c index 3399ba5189..e4ece51c81 100644 --- a/src/wxxt/contrib/xpm/lib/CrBufFrI.c +++ b/src/wxxt/contrib/xpm/lib/CrBufFrI.c @@ -232,7 +232,7 @@ WriteColors(dataptr, data_size, used_size, colors, ncolors, cpp) s += cpp; for (key = 1; key <= NKEYS; key++, defaults++) { - if (s2 = *defaults) { + if ((s2 = *defaults)) { sprintf(s, "\t%s %s", xpmColorKeys[key - 1], s2); s += strlen(s); } diff --git a/src/wxxt/contrib/xpm/lib/CrDatFrI.c b/src/wxxt/contrib/xpm/lib/CrDatFrI.c index ca898d120a..3ef3954b62 100644 --- a/src/wxxt/contrib/xpm/lib/CrDatFrI.c +++ b/src/wxxt/contrib/xpm/lib/CrDatFrI.c @@ -219,7 +219,7 @@ CreateColors(dataptr, data_size, colors, ncolors, cpp) s = buf + cpp; for (key = 1; key <= NKEYS; key++, defaults++) { - if (s2 = *defaults) { + if ((s2 = *defaults)) { sprintf(s, "\t%s %s", xpmColorKeys[key - 1], s2); s += strlen(s); } diff --git a/src/wxxt/contrib/xpm/lib/WrFFrI.c b/src/wxxt/contrib/xpm/lib/WrFFrI.c index 7a004d9dce..73413f8728 100644 --- a/src/wxxt/contrib/xpm/lib/WrFFrI.c +++ b/src/wxxt/contrib/xpm/lib/WrFFrI.c @@ -110,23 +110,23 @@ XpmWriteFileFromXpmImage(filename, image, info) name++; #endif /* let's try to make a valid C syntax name */ - if (dot = index(name, '.')) { + if ((dot = index(name, '.'))) { strcpy(new_name, name); /* change '.' to '_' */ name = s = new_name; - while (dot = index(s, '.')) { + while ((dot = index(s, '.'))) { *dot = '_'; s = dot; } } - if (dot = index(name, '-')) { + if ((dot = index(name, '-'))) { if (name != new_name) { strcpy(new_name, name); name = new_name; } /* change '-' to '_' */ s = name; - while (dot = index(s, '-')) { + while ((dot = index(s, '-'))) { *dot = '_'; s = dot; } @@ -217,7 +217,7 @@ WriteColors(file, colors, ncolors) fprintf(file, "\"%s", *defaults++); for (key = 1; key <= NKEYS; key++, defaults++) { - if (s = *defaults) + if ((s = *defaults)) fprintf(file, "\t%s %s", xpmColorKeys[key - 1], s); } fprintf(file, "\",\n"); diff --git a/src/wxxt/contrib/xpm/lib/data.c b/src/wxxt/contrib/xpm/lib/data.c index 351068a8e0..3957f35e97 100644 --- a/src/wxxt/contrib/xpm/lib/data.c +++ b/src/wxxt/contrib/xpm/lib/data.c @@ -32,9 +32,6 @@ * Developed by Arnaud Le Hors * \*****************************************************************************/ -/* Official version number */ -static char *RCS_Version = "$XpmVersion: 3.4g $"; - /* Internal version number */ #include "xpmP.h" @@ -45,6 +42,8 @@ static char *RCS_Version = "$XpmVersion: 3.4g $"; #include #endif +/* Official version number */ +MAYBE_UNUSED static char *RCS_Version = "$XpmVersion: 3.4g $"; LFUNC(ParseComment, int, (xpmData * mdata)); @@ -386,13 +385,13 @@ xpmGetCmt(mdata, cmt) xpmDataType xpmDataTypes[] = { - "", "!", "\n", '\0', '\n', "", "", "", "", /* Natural type */ - "C", "/*", "*/", '"', '"', ",\n", "static char *", "[] = {\n", "};\n", - "Lisp", ";", "\n", '"', '"', "\n", "(setq ", " '(\n", "))\n", + {"", "!", "\n", '\0', '\n', "", "", "", ""}, /* Natural type */ + {"C", "/*", "*/", '"', '"', ",\n", "static char *", "[] = {\n", "};\n"}, + {"Lisp", ";", "\n", '"', '"', "\n", "(setq ", " '(\n", "))\n"}, #ifdef VMS NULL #else - NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL + {NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL} #endif }; diff --git a/src/wxxt/contrib/xpm/lib/parse.c b/src/wxxt/contrib/xpm/lib/parse.c index d847365e5e..69ae6be624 100644 --- a/src/wxxt/contrib/xpm/lib/parse.c +++ b/src/wxxt/contrib/xpm/lib/parse.c @@ -39,6 +39,7 @@ */ #include "xpmP.h" +#include #include #if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(__GNUC__) #include @@ -179,7 +180,7 @@ xpmParseData(data, image, info) /* * parse extensions */ - if (info && (info->valuemask & XpmReturnExtensions)) + if (info && (info->valuemask & XpmReturnExtensions)) { if (extensions) { ErrorStatus = ParseExtensions(data, &info->extensions, &info->nextensions); @@ -189,6 +190,7 @@ xpmParseData(data, image, info) info->extensions = NULL; info->nextensions = 0; } + } /* * store found informations in the XpmImage structure @@ -333,7 +335,8 @@ ParseColors(data, ncolors, cpp, colorTablePtr, hashtable) XpmColor **colorTablePtr; xpmHashTable *hashtable; { - unsigned int key, l, a, b; + uintptr_t a; + unsigned int key, l, b; unsigned int curkey; /* current color key */ unsigned int lastwaskey; /* key read */ char buf[BUFSIZ]; @@ -383,7 +386,7 @@ ParseColors(data, ncolors, cpp, colorTablePtr, hashtable) curkey = 0; lastwaskey = 0; *curbuf = '\0'; /* init curbuf */ - while (l = xpmNextWord(data, buf, BUFSIZ)) { + while ((l = xpmNextWord(data, buf, BUFSIZ))) { if (!lastwaskey) { for (key = 0, sptr = xpmColorKeys; key < NKEYS; key++, sptr++) @@ -463,7 +466,7 @@ ParseColors(data, ncolors, cpp, colorTablePtr, hashtable) */ xpmNextString(data); /* get to the next string */ *curbuf = '\0'; /* init curbuf */ - while (l = xpmNextWord(data, buf, BUFSIZ)) { + while ((l = xpmNextWord(data, buf, BUFSIZ))) { if (*curbuf != '\0') strcat(curbuf, " ");/* append space */ buf[l] = '\0'; diff --git a/src/wxxt/contrib/xpm/lib/scan.c b/src/wxxt/contrib/xpm/lib/scan.c index b889bd23ba..2b3dc8c8ae 100644 --- a/src/wxxt/contrib/xpm/lib/scan.c +++ b/src/wxxt/contrib/xpm/lib/scan.c @@ -38,6 +38,11 @@ */ #include "xpmP.h" +#if defined(SYSV) || defined(SVR4) || defined(VMS) || defined(__GNUC__) +#include +#else +#include +#endif #define MAXPRINTABLE 92 /* number of printable ascii chars * minus \ and " for string compat @@ -352,7 +357,7 @@ ScanTransparentColor(color, cpp, attributes) ((XpmColor **) attributes->colorTable)[attributes->mask_pixel]; /* end 3.2 bc */ for (key = 1; key <= NKEYS; key++) { - if (s = mask_defaults[key]) { + if ((s = mask_defaults[key])) { defaults[key] = (char *) strdup(s); if (!defaults[key]) return (XpmNoMemory); @@ -390,10 +395,11 @@ ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes) XpmColor *color; XColor *xcolors = NULL, *xcolor; char *colorname, *s; - XpmColor *colorTable, **oldColorTable = NULL; + XpmColor *colorTable = NULL; + XpmColor **oldColorTable = NULL; unsigned int ancolors = 0; - Pixel *apixels; - unsigned int mask_pixel; + Pixel *apixels = NULL; + unsigned int mask_pixel = 0; Bool found; /* retrieve information from the XpmAttributes */ @@ -495,7 +501,7 @@ ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes) found = True; for (key = 1; key <= NKEYS; key++) { - if (s = adefaults[key]) + if ((s = adefaults[key])) defaults[key] = (char *) strdup(s); } } diff --git a/src/wxxt/contrib/xpm/lib/xpmP.h b/src/wxxt/contrib/xpm/lib/xpmP.h index de7cccac9d..af632f8059 100644 --- a/src/wxxt/contrib/xpm/lib/xpmP.h +++ b/src/wxxt/contrib/xpm/lib/xpmP.h @@ -46,6 +46,7 @@ * lets try to solve include files */ +#include #include #include /* stdio.h doesn't declare popen on a Sequent DYNIX OS */ @@ -53,6 +54,12 @@ extern FILE *popen(); #endif +#if defined(__GNUC__) +# define MAYBE_UNUSED __attribute__((unused)) +#else +# define MAYBE_UNUSED +#endif + #if defined(__FreeBSD__) || defined(SYSV) || defined(SVR4) || defined(VMS) #include @@ -291,7 +298,7 @@ FUNC(xpmHashSlot, xpmHashAtom *, (xpmHashTable *table, char *s)); FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data)); #define HashAtomData(i) ((void *)i) -#define HashColorIndex(slot) ((unsigned int)((*slot)->data)) +#define HashColorIndex(slot) ((uintptr_t)((*slot)->data)) #define USE_HASHTABLE (cpp > 2 && ncolors > 4) #ifdef NEED_STRDUP