diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-19 14:48:46 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-19 14:48:46 -0800 |
commit | 73b69d794d98e0ccfada48836c4b28280353180f (patch) | |
tree | 9c0dccb4ad7e7c8d45995ee238c579f82e01b4db | |
parent | b30fd0918f8d99aa718ede3da30f9d29f87063e1 (diff) |
Remove xpmstrcasecmp fallback for strcasecmp
It was only ever used when FOR_MSW was defined, never in the autoconf builds
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/XpmI.h | 9 | ||||
-rw-r--r-- | src/create.c | 33 |
2 files changed, 4 insertions, 38 deletions
@@ -47,6 +47,7 @@ #include <stdio.h> #include <stdlib.h> #include <limits.h> +#include <strings.h> #include <X11/Xos.h> #include <X11/Xfuncs.h> @@ -297,14 +298,6 @@ HFUNC(xpmstrdup, char *, (char *s1)); #include <string.h> #endif -#ifdef NEED_STRCASECMP -HFUNC(xpmstrcasecmp, int, (char *s1, char *s2)); -#else -#undef xpmstrcasecmp -#define xpmstrcasecmp strcasecmp -#include <strings.h> -#endif - HFUNC(xpmatoui, unsigned int, (char *p, unsigned int l, unsigned int *ui_return)); diff --git a/src/create.c b/src/create.c index 42a5312..95a3df4 100644 --- a/src/create.c +++ b/src/create.c @@ -116,33 +116,6 @@ LFUNC(PutPixel8, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel1MSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); LFUNC(PutPixel1LSB, int, (XImage *ximage, int x, int y, unsigned long pixel)); -#ifdef NEED_STRCASECMP -FUNC(xpmstrcasecmp, int, (char *s1, char *s2)); - -/* - * in case strcasecmp is not provided by the system here is one - * which does the trick - */ -int -xpmstrcasecmp( - register char *s1, - register char *s2) -{ - register int c1, c2; - - while (*s1 && *s2) { - c1 = tolower(*s1); - c2 = tolower(*s2); - if (c1 != c2) - return (c1 - c2); - s1++; - s2++; - } - return (int) (*s1 - *s2); -} - -#endif - /* * return the default color key related to the given visual */ @@ -410,7 +383,7 @@ SetColor( XColor xcolor; int status; - if (xpmstrcasecmp(colorname, TRANSPARENT_COLOR)) { + if (strcasecmp(colorname, TRANSPARENT_COLOR)) { status = (*allocColor)(display, colormap, colorname, &xcolor, closure); if (status < 0) /* parse color failed */ return (1); @@ -581,7 +554,7 @@ CreateColors( } if (def_index >= 2 && def_index <= 5 && defaults[def_index] != NULL && - !xpmstrcasecmp(symbol->value, defaults[def_index])) + !strcasecmp(symbol->value, defaults[def_index])) break; } } @@ -649,7 +622,7 @@ CreateColors( /* the following makes the mask to be built even if none is given a particular pixel */ if (symbol->value - && !xpmstrcasecmp(symbol->value, TRANSPARENT_COLOR)) { + && !strcasecmp(symbol->value, TRANSPARENT_COLOR)) { *mask_pixels = 0; *mask_pixel_index = color; } else |