diff options
Diffstat (limited to 'lib/libXpm/src/parse.c')
-rw-r--r-- | lib/libXpm/src/parse.c | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/lib/libXpm/src/parse.c b/lib/libXpm/src/parse.c index f2588b3c5..b1838661b 100644 --- a/lib/libXpm/src/parse.c +++ b/lib/libXpm/src/parse.c @@ -82,12 +82,16 @@ char *xpmColorKeys[] = { }; int -xpmParseValues(data, width, height, ncolors, cpp, - x_hotspot, y_hotspot, hotspot, extensions) - xpmData *data; - unsigned int *width, *height, *ncolors, *cpp; - unsigned int *x_hotspot, *y_hotspot, *hotspot; - unsigned int *extensions; +xpmParseValues( + xpmData *data, + unsigned int *width, + unsigned int *height, + unsigned int *ncolors, + unsigned int *cpp, + unsigned int *x_hotspot, + unsigned int *y_hotspot, + unsigned int *hotspot, + unsigned int *extensions) { unsigned int l; char buf[BUFSIZ + 1]; @@ -138,7 +142,7 @@ xpmParseValues(data, width, height, ncolors, cpp, ptr = buf; got_one = False; while (!got_one) { - ptr = index(ptr, '_'); + ptr = strchr(ptr, '_'); if (!ptr) return (XpmFileInvalid); switch (l - (ptr - buf)) { @@ -192,12 +196,12 @@ xpmParseValues(data, width, height, ncolors, cpp, } int -xpmParseColors(data, ncolors, cpp, colorTablePtr, hashtable) - xpmData *data; - unsigned int ncolors; - unsigned int cpp; - XpmColor **colorTablePtr; - xpmHashTable *hashtable; +xpmParseColors( + xpmData *data, + unsigned int ncolors, + unsigned int cpp, + XpmColor **colorTablePtr, + xpmHashTable *hashtable) { unsigned int key = 0, l, a, b, len; unsigned int curkey; /* current color key */ @@ -365,15 +369,15 @@ xpmParseColors(data, ncolors, cpp, colorTablePtr, hashtable) } static int -ParsePixels(data, width, height, ncolors, cpp, colorTable, hashtable, pixels) - xpmData *data; - unsigned int width; - unsigned int height; - unsigned int ncolors; - unsigned int cpp; - XpmColor *colorTable; - xpmHashTable *hashtable; - unsigned int **pixels; +ParsePixels( + xpmData *data, + unsigned int width, + unsigned int height, + unsigned int ncolors, + unsigned int cpp, + XpmColor *colorTable, + xpmHashTable *hashtable, + unsigned int **pixels) { unsigned int *iptr, *iptr2 = NULL; /* found by Egbert Eich */ unsigned int a, x, y; @@ -538,10 +542,10 @@ do \ } int -xpmParseExtensions(data, extensions, nextensions) - xpmData *data; - XpmExtension **extensions; - unsigned int *nextensions; +xpmParseExtensions( + xpmData *data, + XpmExtension **extensions, + unsigned int *nextensions) { XpmExtension *exts = NULL, *ext; unsigned int num = 0; @@ -659,10 +663,10 @@ do { \ * in an an XpmImage structure which is returned. */ int -xpmParseData(data, image, info) - xpmData *data; - XpmImage *image; - XpmInfo *info; +xpmParseData( + xpmData *data, + XpmImage *image, + XpmInfo *info) { /* variables to return */ unsigned int width, height, ncolors, cpp; @@ -702,12 +706,12 @@ xpmParseData(data, image, info) xpmGetCmt(data, &hints_cmt); /* - * init the hastable + * init the hashtable */ if (USE_HASHTABLE) { ErrorStatus = xpmHashTableInit(&hashtable); if (ErrorStatus != XpmSuccess) - return (ErrorStatus); + RETURN(ErrorStatus); } /* |