diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-16 22:48:53 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-16 22:48:53 -0700 |
commit | 3ea70059805b3ebc795f797b5880b90b6b3a9235 (patch) | |
tree | 580e215d33f103506e983e4b67739c587d8f8c5a | |
parent | 0c9e200c3975917f5d78eac67b1f4cedefd73079 (diff) |
Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | COPYRIGHT | 4 | ||||
-rw-r--r-- | NEWS.old | 16 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | cxpm/cxpm.c | 4 | ||||
-rw-r--r-- | doc/FAQ.html | 20 | ||||
-rw-r--r-- | doc/README.MSW | 20 | ||||
-rw-r--r-- | doc/README.html | 4 | ||||
-rw-r--r-- | src/Attrib.c | 2 | ||||
-rw-r--r-- | src/CrBufFrI.c | 2 | ||||
-rw-r--r-- | src/RdFToBuf.c | 12 | ||||
-rw-r--r-- | src/WrFFrI.c | 4 | ||||
-rw-r--r-- | src/XpmI.h | 4 | ||||
-rw-r--r-- | src/amigax.c | 60 | ||||
-rw-r--r-- | src/create.c | 18 | ||||
-rw-r--r-- | src/hashtab.c | 2 | ||||
-rw-r--r-- | src/parse.c | 2 | ||||
-rw-r--r-- | src/rgb.c | 2 | ||||
-rw-r--r-- | src/scan.c | 26 | ||||
-rw-r--r-- | src/simx.c | 18 | ||||
-rw-r--r-- | sxpm/plaid.xpm | 42 | ||||
-rw-r--r-- | sxpm/plaid_ext.xpm | 42 | ||||
-rw-r--r-- | sxpm/plaid_mask.xpm | 42 | ||||
-rw-r--r-- | sxpm/sxpm.c | 12 |
23 files changed, 180 insertions, 180 deletions
@@ -23,9 +23,9 @@ * in this Software without prior written authorization from GROUPE BULL. */ -Arnaud LE HORS BULL Research FRANCE -- Koala Project +Arnaud LE HORS BULL Research FRANCE -- Koala Project (XPM - X PixMap format version 2 & 3) Internet: lehors@sophia.inria.fr -Surface Mail: Arnaud LE HORS, INRIA - Sophia Antipolis, +Surface Mail: Arnaud LE HORS, INRIA - Sophia Antipolis, 2004, route des Lucioles, 06565 Valbonne Cedex -- FRANCE Voice phone: (33) 93.65.77.71, Fax: (33) 93 65 77 66, Telex: 97 00 50 F @@ -53,7 +53,7 @@ fixed creation of the mask in SetColor() - patch from Jan Wielemaker <jan@swi.psy.uva.nl> - makefiles are provided for VMS - - given by Martin P.J. Zinser m.zinser@gsi.de + - given by Martin P.J. Zinser m.zinser@gsi.de - Imakefiles reworked to get smoother builds and fixes from: - Paul DuBois dubois@primate.wisc.edu - Larry Schwimmer schwim@cyclone.stanford.edu @@ -513,7 +513,7 @@ increasing this became a requisite). BUGS CORRECTED: - - Many warnings have been fixed - patch from Daniel Dardailler + - Many warnings have been fixed - patch from Daniel Dardailler daniel@osf.org 3.2e (93/02/05) @@ -544,7 +544,7 @@ ENHANCEMENTS: - parsing optimized for single and double characters color - - patch originally from Martin Brunecky + - patch originally from Martin Brunecky marbru@build1.auto-trol.com BUGS CORRECTED: @@ -578,7 +578,7 @@ BUGS CORRECTED: - SVR4 defines for including <string.h> instead of <strings.h> - Jason Patterson <jasonp@fitmail.qut.edu.au> - - attributes->extensions and attributes->nextensions fields were not + - attributes->extensions and attributes->nextensions fields were not set correctly when no extensions present in file. - Simon_Scott Cornish <cornish@ecr.mu.oz.au> @@ -640,7 +640,7 @@ 3.1 (92/02/03) ENHANCEMENTS: - - sxpm now have more standard options (mainly suggested by + - sxpm now have more standard options (mainly suggested by Rainer Sinkwitz <sinkwitz@ifi.unizh.ch>): Usage: sxpm [options...] @@ -743,7 +743,7 @@ - xpmtoppm.c has is own strstr function which is used if NEED_STRSTR is defined when compiling - Hugues.Leroy@irisa.fr (Hugues Leroy). - + BUGS CORRECTED: - many bugs have been fixed, especially for ansi compilers - Doyle C. Davidson (doyle@doyled.b23b.ingr.com) and @@ -802,7 +802,7 @@ word colorname. Lionel Mallet (mallet@ipvpel.unipv.it). - parser was triggered by the "/" character inside string. Doyle C. Davidson (doyle@doyled.b23b.ingr.com). This is corrected. - - sxpm maps the window only if the option "-nod" is not selected. + - sxpm maps the window only if the option "-nod" is not selected. CHANGES TO THE DOC: - the documentation presents the new API and features. @@ -868,7 +868,7 @@ to override default colors by giving a pixel value (in such a case symbol value must be set to NULL), - the XpmInfo struct contains the new member 'rgb_fname' in which one - can specify an rgb text file name while writing a pixmap with the + can specify an rgb text file name while writing a pixmap with the XWritePixmapFile function (otherwise this member should be set to NULL). This way colorname will be searched and written out if found instead of the RGB value, diff --git a/configure.ac b/configure.ac index 3514053..5577803 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ else fi if test "x$USE_GETTEXT" = "xyes" ; then - AC_DEFINE([USE_GETTEXT], 1, + AC_DEFINE([USE_GETTEXT], 1, [Define to 1 if you want to use the gettext() function.]) fi AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes") diff --git a/cxpm/cxpm.c b/cxpm/cxpm.c index 49296ee..8b8af9a 100644 --- a/cxpm/cxpm.c +++ b/cxpm/cxpm.c @@ -100,7 +100,7 @@ ErrorMessage( case XpmSuccess: return; case XpmOpenFailed: - /* L10N_Comments : Error produced when filename does not exist + /* L10N_Comments : Error produced when filename does not exist or insufficient permissions to open (i.e. cxpm /no/such/file ) */ error = gettext("Cannot open file"); break; @@ -111,7 +111,7 @@ ErrorMessage( break; case XpmNoMemory: /* L10N_Comments : Error produced when filename can be read, but - is too big for memory + is too big for memory (i.e. limit datasize 32 ; cxpm /usr/dt/backdrops/Crochet.pm ) */ error = gettext("Not enough memory"); break; diff --git a/doc/FAQ.html b/doc/FAQ.html index 18d4ee6..3ac9c0d 100644 --- a/doc/FAQ.html +++ b/doc/FAQ.html @@ -291,26 +291,26 @@ href="mailto:dan@bristol.com">dan@bristol.com</a> --- xpm-A4.PS Thu Nov 21 09:27:28 1996 *************** *** 647,668 **** - 0 ne /edown exch def + 0 ne /edown exch def /yscale exch def /xscale exch def - FMLevel1 { - manualfeed {setmanualfeed} if -- /FMdicttop countdictstack 1 add def -- /FMoptop count def -- setpapername -- manualfeed {true} {papersize} ifelse -- {manualpapersize} {false} ifelse -- {desperatepapersize} {false} ifelse +- /FMdicttop countdictstack 1 add def +- /FMoptop count def +- setpapername +- manualfeed {true} {papersize} ifelse +- {manualpapersize} {false} ifelse +- {desperatepapersize} {false} ifelse - { (Can't select requested paper size for Frame print job!) FMFAILURE } if - count -1 FMoptop {pop pop} for -- countdictstack -1 FMdicttop {pop end} for +- countdictstack -1 FMdicttop {pop end} for - } - {{1 dict dup /PageSize [paperwidth paperheight]put setpagedevice}stopped - { (Can't select requested paper size for Frame print job!) FMFAILURE } if - {1 dict dup /ManualFeed manualfeed put setpagedevice } stopped pop } -- ifelse - +- ifelse + FMPColor { currentcolorscreen --- 647,652 ---- diff --git a/doc/README.MSW b/doc/README.MSW index f631525..6746bc8 100644 --- a/doc/README.MSW +++ b/doc/README.MSW @@ -2,15 +2,15 @@ README.MSW hedu@cul-ipn.uni-kiel.de 5/94 The XPM library for MS-Windows - + Motivated by the wxWindows library, which is a (freely available) toolkit -for developing multi-platform, graphical applications from the same body -of C++ code, I wanted to have XPM pixmaps for MS-windows. Instead of rewriting +for developing multi-platform, graphical applications from the same body +of C++ code, I wanted to have XPM pixmaps for MS-windows. Instead of rewriting a XPM-parser I managed to port the XPM-library-code to MS-windows. Thanks to Anaud Le Hors this became a part of the official XPM-library. -Until now it's only used together with wxWindows. And even there it's more -a kind of beta. But it should be possible to run it as a simple libxpm.a +Until now it's only used together with wxWindows. And even there it's more +a kind of beta. But it should be possible to run it as a simple libxpm.a without wxWindows. The key is a transformation of some X types plus some basic X functions. @@ -36,12 +36,12 @@ typedef struct { With these defines and the according functions from simx.c you can call XPM-functions the way it's done under X windows. It can look like this: - ErrorStatus=XpmCreateImageFromData(&dc, data, + ErrorStatus=XpmCreateImageFromData(&dc, data, &ximage,(XImage **)NULL, &xpmAttr); ms_bitmap = ximage->bitmap; // releases the malloc,but do not destroy the bitmap XImageFree(ximage); - + Supported functions are the Xpm*Image* but not the Xpm*Pixmap*. DRAWBACKS: @@ -62,7 +62,7 @@ into your project except the files related to Pixmap operations: *P*.c. (You might uncomment NEED_STRCASECMP in xpm.h if it's in your lib) This should compile into libxpm.a. Good luck... -FTP: +FTP: wxWindows is currently available from the Artificial Intelligence Applications Institute (University of Edinburgh) by anonymous FTP. skye.aiai.ed.ac.uk pub/wxwin/ @@ -71,7 +71,7 @@ or read http://burray.aiai.ed.ac.uk/aiai/aiai.html wxxpm, XPM support for wxWindows, the latest version is available at yoda.cul-ipn.uni-kiel.de pub/wxxpm/ and maybe in the contrib or tools of wxWindows - + Please contact me if you have suggestions, comments or problems! ================================================================ @@ -87,7 +87,7 @@ Changes: * I've used the xpm package under NT 4.0 and MSVC++ 4.2. - * I've made a big performance improvement in + * I've made a big performance improvement in ParseAndPutPixels(), fixed creation of the mask in SetColor() in create.c. I looked into XCreateImage() in simx.c, but commented out my improvement for reasons diff --git a/doc/README.html b/doc/README.html index 6711f23..c3175c1 100644 --- a/doc/README.html +++ b/doc/README.html @@ -127,12 +127,12 @@ Then you can either compile XPM via "imake" or in a stand-alone way. make depend (optional) </pre> <p> - Then simply execute: + Then simply execute: <pre> make </pre> <p> - which will build the XPM library and the sxpm application. + which will build the XPM library and the sxpm application. Then do: <pre> make install diff --git a/src/Attrib.c b/src/Attrib.c index cb304df..1b38047 100644 --- a/src/Attrib.c +++ b/src/Attrib.c @@ -57,7 +57,7 @@ CreateOldColorTable( XpmColor **colorTable, **color; unsigned int a; - if (ncolors >= UINT_MAX / sizeof(XpmColor *)) + if (ncolors >= UINT_MAX / sizeof(XpmColor *)) return XpmNoMemory; colorTable = (XpmColor **) XpmMalloc(ncolors * sizeof(XpmColor *)); diff --git a/src/CrBufFrI.c b/src/CrBufFrI.c index 113a45c..398c645 100644 --- a/src/CrBufFrI.c +++ b/src/CrBufFrI.c @@ -214,7 +214,7 @@ XpmCreateBufferFromXpmImage( } ErrorStatus = WriteColors(&ptr, &ptr_size, &used_size, image->colorTable, image->ncolors, image->cpp); - + if (ErrorStatus != XpmSuccess) RETURN(ErrorStatus); diff --git a/src/RdFToBuf.c b/src/RdFToBuf.c index b719960..8501d23 100644 --- a/src/RdFToBuf.c +++ b/src/RdFToBuf.c @@ -98,12 +98,12 @@ XpmReadFileToBuffer( fclose(fp); #ifdef VMS /* VMS often stores text files in a variable-length record format, - where there are two bytes of size followed by the record. fread - converts this so it looks like a record followed by a newline. - Unfortunately, the size reported by fstat() (and fseek/ftell) - counts the two bytes for the record terminator, while fread() - counts only one. So, fread() sees fewer bytes in the file (size - minus # of records) and thus when asked to read the amount + where there are two bytes of size followed by the record. fread + converts this so it looks like a record followed by a newline. + Unfortunately, the size reported by fstat() (and fseek/ftell) + counts the two bytes for the record terminator, while fread() + counts only one. So, fread() sees fewer bytes in the file (size + minus # of records) and thus when asked to read the amount returned by stat(), it fails. The best solution, suggested by DEC, seems to consider the length returned from fstat() as an upper bound and call fread() with diff --git a/src/WrFFrI.c b/src/WrFFrI.c index f2726f9..83c11fa 100644 --- a/src/WrFFrI.c +++ b/src/WrFFrI.c @@ -256,8 +256,8 @@ WritePixels( unsigned int x, y, h; h = height - 1; - if (cpp != 0 && width >= (UINT_MAX - 3)/cpp) - return XpmNoMemory; + if (cpp != 0 && width >= (UINT_MAX - 3)/cpp) + return XpmNoMemory; p = buf = (char *) XpmMalloc(width * cpp + 3); if (!buf) return (XpmNoMemory); @@ -98,7 +98,7 @@ extern FILE *popen(); #ifndef SIZE_MAX # ifdef ULONG_MAX # define SIZE_MAX ULONG_MAX -# else +# else # define SIZE_MAX UINT_MAX # endif #endif @@ -319,7 +319,7 @@ FUNC(xpmstrdup, char *, (char *s1)); #define xpmstrdup strdup #endif -#ifdef NEED_STRCASECMP +#ifdef NEED_STRCASECMP FUNC(xpmstrcasecmp, int, (char *s1, char *s2)); #else #undef xpmstrcasecmp diff --git a/src/amigax.c b/src/amigax.c index eb3bc3a..f163960 100644 --- a/src/amigax.c +++ b/src/amigax.c @@ -58,7 +58,7 @@ AllocRastPort ( unsigned int depth) { struct RastPort *rp; - + rp = XpmMalloc (sizeof (*rp)); if (rp != NULL) { @@ -75,14 +75,14 @@ AllocRastPort ( else { unsigned int i; - + rp->BitMap = XpmMalloc (sizeof (*rp->BitMap)); if (rp->BitMap == NULL) { FreeRastPort (rp, width, height); return NULL; } - + InitBitMap (rp->BitMap, depth, width, height); for (i = 0; i < depth; ++i) rp->BitMap->Planes[i] = NULL; @@ -97,7 +97,7 @@ AllocRastPort ( } } } - + return rp; } @@ -118,7 +118,7 @@ FreeRastPort ( else { unsigned int i; - + for (i = 0; i < rp->BitMap->Depth; ++i) { if (rp->BitMap->Planes[i] != NULL) @@ -139,7 +139,7 @@ AllocXImage ( unsigned int depth) { XImage *img; - + img = XpmMalloc (sizeof (*img)); if (img != NULL) { @@ -152,7 +152,7 @@ AllocXImage ( return NULL; } } - + return img; } @@ -166,7 +166,7 @@ FreeXImage ( FreeRastPort (ximage->rp, ximage->width, ximage->height); XpmFree (ximage); } - + return Success; } @@ -180,7 +180,7 @@ XPutPixel ( { SetAPen (ximage->rp, pixel); WritePixel (ximage->rp, x, y); - + return Success; } @@ -195,7 +195,7 @@ AllocBestPen ( if (GfxBase->LibNode.lib_Version >= 39) { unsigned long r, g, b; - + r = screen_in_out->red * 0x00010001; g = screen_in_out->green * 0x00010001; b = screen_in_out->blue * 0x00010001; @@ -205,7 +205,7 @@ AllocBestPen ( TAG_DONE); if (screen_in_out->pixel == -1) return False; - + QueryColor (colormap, screen_in_out); } else @@ -213,7 +213,7 @@ AllocBestPen ( XColor nearest, trial; long nearest_delta, trial_delta; int num_cells, i; - + num_cells = colormap->Count; nearest.pixel = 0; QueryColor (colormap, &nearest); @@ -249,7 +249,7 @@ AllocBestPen ( screen_in_out->green = nearest.green; screen_in_out->blue = nearest.blue; } - + return True; } @@ -263,11 +263,11 @@ FreePens ( if (GfxBase->LibNode.lib_Version >= 39) { int i; - + for (i = 0; i < npixels; i++) ReleasePen (colormap, pixels[i]); } - + return Success; } @@ -278,20 +278,20 @@ ParseColor ( XColor *exact_def_return) { int spec_length; - + if (spec == 0) return False; - + spec_length = strlen(spec); if (spec[0] == '#') { int hexlen; char hexstr[10]; - + hexlen = (spec_length - 1) / 3; if (hexlen < 1 || hexlen > 4 || hexlen * 3 != spec_length - 1) return False; - + hexstr[hexlen] = '\0'; strncpy (hexstr, spec + 1, hexlen); exact_def_return->red = strtoul (hexstr, NULL, 16) << (16 - 4*hexlen); @@ -299,7 +299,7 @@ ParseColor ( exact_def_return->green = strtoul (hexstr, NULL, 16) << (16 - 4*hexlen); strncpy (hexstr, spec + 1 + 2 * hexlen, hexlen); exact_def_return->blue = strtoul (hexstr, NULL, 16) << (16 - 4*hexlen); - + return True; } else @@ -308,25 +308,25 @@ ParseColor ( int items, red, green, blue; char line[512], name[512]; Bool success = False; - + rgbf = fopen ("LIBS:rgb.txt", "r"); if (rgbf == NULL) return False; - + while (fgets(line, sizeof (line), rgbf) && !success) { items = sscanf (line, "%d %d %d %[^\n]\n", &red, &green, &blue, name); if (items != 4) continue; - + if (red < 0 || red > 0xFF || green < 0 || green > 0xFF || blue < 0 || blue > 0xFF) { continue; } - + if (0 == xpmstrcasecmp (spec, name)) { exact_def_return->red = red * 0x0101; @@ -336,7 +336,7 @@ ParseColor ( } } fclose (rgbf); - + return success; } } @@ -350,7 +350,7 @@ QueryColor ( if (GfxBase->LibNode.lib_Version >= 39) { unsigned long rgb[3]; - + GetRGB32 (colormap, def_in_out->pixel, 1, rgb); def_in_out->red = rgb[0] >> 16; def_in_out->green = rgb[1] >> 16; @@ -359,13 +359,13 @@ QueryColor ( else { unsigned short rgb; - + rgb = GetRGB4 (colormap, def_in_out->pixel); def_in_out->red = ((rgb >> 8) & 0xF) * 0x1111; def_in_out->green = ((rgb >> 4) & 0xF) * 0x1111; def_in_out->blue = (rgb & 0xF) * 0x1111; } - + return Success; } @@ -377,9 +377,9 @@ QueryColors ( int ncolors) { int i; - + for (i = 0; i < ncolors; i++) QueryColor (colormap, &defs_in_out[i]); - + return Success; } diff --git a/src/create.c b/src/create.c index 7c75a42..00084d4 100644 --- a/src/create.c +++ b/src/create.c @@ -309,17 +309,17 @@ SetCloseColor( * occurred, so we try the next closest color, and so on, until no more * colors are within closeness of the target. If we knew that the * colormap had changed, we could skip this sequence. - * + * * If _none_ of the colors within closeness of the target can be allocated, * then we can finally be pretty sure that the colormap has actually * changed. In this case we try to allocate the original color (again), * then try the closecolor stuff (again)... - * + * * In theory it would be possible for an infinite loop to occur if another * process kept changing the colormap every time we sorted it, so we set * a maximum on the number of iterations. After this many tries, we use * XGrabServer() to ensure that the colormap remains unchanged. - * + * * This approach gives particularly bad worst case performance - as many as * <MaximumIterations> colormap reads and sorts may be needed, and as * many as <MaximumIterations> * <ColormapSize> attempted allocations @@ -816,7 +816,7 @@ XpmCreateImageFromXpmImage( ErrorStatus = XpmSuccess; - if (image->ncolors >= UINT_MAX / sizeof(Pixel)) + if (image->ncolors >= UINT_MAX / sizeof(Pixel)) return (XpmNoMemory); /* malloc pixels index tables */ @@ -1692,7 +1692,7 @@ APutImagePixels ( unsigned char *array; XImage *tmp_img; BOOL success = FALSE; - + array = XpmMalloc ((((width+15)>>4)<<4)*sizeof (*array)); if (array != NULL) { @@ -1711,7 +1711,7 @@ APutImagePixels ( } XpmFree (array); } - + if (!success) { for (y = 0; y < height; ++y) @@ -1890,7 +1890,7 @@ PutPixel16MSB( unsigned long pixel) { unsigned char *addr; - + if(x < 0 || y < 0) return 0; @@ -1908,7 +1908,7 @@ PutPixel16LSB( unsigned long pixel) { unsigned char *addr; - + if(x < 0 || y < 0) return 0; @@ -2092,7 +2092,7 @@ xpmParseDataAndCreate( xpmGetCmt(data, &colors_cmt); /* malloc pixels index tables */ - if (ncolors >= UINT_MAX / sizeof(Pixel)) + if (ncolors >= UINT_MAX / sizeof(Pixel)) RETURN(XpmNoMemory); image_pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * ncolors); diff --git a/src/hashtab.c b/src/hashtab.c index 49e6e48..1bd4109 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -146,7 +146,7 @@ HashTableGrows(xpmHashTable *table) HASH_TABLE_GROWS table->size = size; table->limit = size / 3; - if (size >= UINT_MAX / sizeof(*atomTable)) + if (size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(size * sizeof(*atomTable)); if (!atomTable) diff --git a/src/parse.c b/src/parse.c index 5c7915f..7dc2aa7 100644 --- a/src/parse.c +++ b/src/parse.c @@ -380,7 +380,7 @@ ParsePixels( unsigned int a, x, y; if ((height > 0 && width >= UINT_MAX / height) || - width * height >= UINT_MAX / sizeof(unsigned int)) + width * height >= UINT_MAX / sizeof(unsigned int)) return XpmNoMemory; #ifndef FOR_MSW iptr2 = (unsigned int *) XpmMalloc(sizeof(unsigned int) * width * height); @@ -71,7 +71,7 @@ xpmReadRgbNames( /* Loop reading each line in the file. */ n = 0; - rgb = rgbn; + rgb = rgbn; /* Quit if rgb text file has too many entries. */ while (fgets(line, sizeof(line), rgbf) && n < MAX_RGBNAMES) { @@ -111,8 +111,8 @@ LFUNC(MSWGetImagePixels, int, (Display *d, XImage *image, unsigned int width, LFUNC(ScanTransparentColor, int, (XpmColor *color, unsigned int cpp, XpmAttributes *attributes)); -LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, - unsigned int ncolors, +LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, + unsigned int ncolors, Pixel *pixels, unsigned int mask, unsigned int cpp, XpmAttributes *attributes)); @@ -244,7 +244,7 @@ XpmCreateXpmImageFromImage( if (!pmap.pixelindex) RETURN(XpmNoMemory); - if (pmap.size >= UINT_MAX / sizeof(Pixel)) + if (pmap.size >= UINT_MAX / sizeof(Pixel)) RETURN(XpmNoMemory); pmap.pixels = (Pixel *) XpmMalloc(sizeof(Pixel) * pmap.size); @@ -273,10 +273,10 @@ XpmCreateXpmImageFromImage( /* * scan the image data - * + * * In case depth is 1 or bits_per_pixel is 4, 6, 8, 24 or 32 use optimized * functions, otherwise use slower but sure general one. - * + * */ if (image) { @@ -433,8 +433,8 @@ ScanOtherColors( #ifndef FOR_MSW xpmRgbName rgbn[MAX_RGBNAMES]; #else - xpmRgbName *rgbn = NULL; -#endif + xpmRgbName *rgbn = NULL; +#endif int rgbn_max = 0; unsigned int i, j, c, i2; XpmColor *color; @@ -559,10 +559,10 @@ ScanOtherColors( #ifndef FOR_MSW sprintf(buf, "#%04X%04X%04X", xcolor->red, xcolor->green, xcolor->blue); -#else +#else sprintf(buf, "#%02x%02x%02x", xcolor->red, xcolor->green, xcolor->blue); -#endif +#endif color->c_color = (char *) xpmstrdup(buf); } if (!color->c_color) { @@ -924,15 +924,15 @@ AGetImagePixels ( unsigned int x, y; unsigned char *pixels; XImage *tmp_img; - + pixels = XpmMalloc ((((width+15)>>4)<<4)*sizeof (*pixels)); if (pixels == NULL) return XpmNoMemory; - + tmp_img = AllocXImage ((((width+15)>>4)<<4), 1, image->rp->BitMap->Depth); if (tmp_img == NULL) CLEAN_UP (XpmNoMemory); - + iptr = pmap->pixelindex; for (y = 0; y < height; ++y) { @@ -943,7 +943,7 @@ AGetImagePixels ( CLEAN_UP (XpmNoMemory); } } - + CLEAN_UP (XpmSuccess); } @@ -122,7 +122,7 @@ XDefaultScreen(Display *d) /* I get only 1 plane but 8 bits per pixel, so I think BITSPIXEL should be depth */ -int +int XDefaultDepth(Display *display, Screen *screen) { int d, b; @@ -140,7 +140,7 @@ XDefaultColormap(Display *display, Screen *screen) /* convert hex color names, wrong digits (not a-f,A-F,0-9) are treated as zero */ -static int +static int hexCharToInt(c) { int r; @@ -157,7 +157,7 @@ hexCharToInt(c) return (r); } -static int +static int rgbFromHex(char *hex, int *r, int *g, int *b) { int len; @@ -187,7 +187,7 @@ rgbFromHex(char *hex, int *r, int *g, int *b) } /* Color related functions */ -int +int XParseColor(Display *d, Colormap *cmap, char *name, XColor *color) { int r, g, b; /* only 8 bit values used */ @@ -215,14 +215,14 @@ XParseColor(Display *d, Colormap *cmap, char *name, XColor *color) } -int +int XAllocColor(Display *d, Colormap cmap, XColor *color) { /* colormap not used yet so color->pixel is the real COLORREF (RBG) and not an index in some colormap as in X */ return (1); } -void +void XQueryColors(Display *display, Colormap *colormap, XColor *xcolors, int ncolors) { @@ -238,7 +238,7 @@ XQueryColors(Display *display, Colormap *colormap, } return; } -int +int XFreeColors(Display *d, Colormap cmap, unsigned long pixels[], int npixels, unsigned long planes) { @@ -274,14 +274,14 @@ XCreateImage(Display *d, Visual *v, } -void +void XImageFree(XImage *img) { if (img) { XpmFree(img); } } -void +void XDestroyImage(XImage *img) { if (img) { diff --git a/sxpm/plaid.xpm b/sxpm/plaid.xpm index b0e9200..6befe8b 100644 --- a/sxpm/plaid.xpm +++ b/sxpm/plaid.xpm @@ -1,6 +1,6 @@ /* XPM */ static char * plaid[] = { -/* plaid pixmap +/* plaid pixmap * width height ncolors chars_per_pixel */ "22 22 4 2 ", /* colors */ @@ -9,26 +9,26 @@ static char * plaid[] = { "+ c yellow m white s lines_in_dark ", "x m black s dark_color ", /* pixels */ -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x Y x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", " x x x Y x x ", -" x x x x Y x x x ", -" x x x Y x x ", -" x x x x Y x x x ", -"x x x x x x x x x x x x x x x x x x x x x x ", -" x x x x Y x x x ", -" x x x Y x x ", -" x x x x Y x x x ", -" x x x Y x x ", " x x x x Y x x x " } ; diff --git a/sxpm/plaid_ext.xpm b/sxpm/plaid_ext.xpm index 8538952..c8429d3 100644 --- a/sxpm/plaid_ext.xpm +++ b/sxpm/plaid_ext.xpm @@ -1,6 +1,6 @@ /* XPM */ static char * plaid[] = { -/* plaid pixmap +/* plaid pixmap * width height ncolors chars_per_pixel */ "22 22 4 2 XPMEXT", /* colors */ @@ -9,27 +9,27 @@ static char * plaid[] = { "+ c yellow m white s lines_in_dark ", "x m black s dark_color ", /* pixels */ -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x x x x x x x x x x x x x ", -"x x x x x x x x x x x x + x x x x x ", -" x x x x Y x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +"Y Y Y Y Y x Y Y Y Y Y + x + x + x + x + x + ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x x x x x x x x x x x x x ", +"x x x x x x x x x x x x + x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +" x x x x Y x x x ", +" x x x Y x x ", +" x x x x Y x x x ", " x x x Y x x ", -" x x x x Y x x x ", -" x x x Y x x ", -" x x x x Y x x x ", -"x x x x x x x x x x x x x x x x x x x x x x ", -" x x x x Y x x x ", -" x x x Y x x ", -" x x x x Y x x x ", -" x x x Y x x ", " x x x x Y x x x ", "XPMEXT ext1 data1", "XPMEXT ext2", diff --git a/sxpm/plaid_mask.xpm b/sxpm/plaid_mask.xpm index 167d338..f8e7876 100644 --- a/sxpm/plaid_mask.xpm +++ b/sxpm/plaid_mask.xpm @@ -1,6 +1,6 @@ /* XPM */ static char * plaid[] = { -/* plaid pixmap +/* plaid pixmap * width height ncolors chars_per_pixel */ "22 22 5 2", /* colors */ @@ -10,26 +10,26 @@ static char * plaid[] = { "x m black s dark_color ", " c none s mask ", /* pixels */ -" x x x x x + x x x x x ", -" . x x x x x x x x x x x ", -" . x x x x x x + x x x x x ", -" . x . x x x x x x x x x x x ", -" . x . x x x x x x + x x x x x ", -" Y Y Y Y Y + x + x + x + x + x + ", -" x x . x . x x x x x x + x x x x x ", -" . x . x . x . x x x x x x x x x x x ", -" . x x x . x . x x x x x x + x x x x x ", -" . x . x . x . x . x x x x x x x x x x x ", -" . x . x x x . x . x x x x x x + x x x x x ", -". . . . . x . . . . . x . x . x Y x . x . x ", +" x x x x x + x x x x x ", +" . x x x x x x x x x x x ", +" . x x x x x x + x x x x x ", +" . x . x x x x x x x x x x x ", +" . x . x x x x x x + x x x x x ", +" Y Y Y Y Y + x + x + x + x + x + ", +" x x . x . x x x x x x + x x x x x ", +" . x . x . x . x x x x x x x x x x x ", +" . x x x . x . x x x x x x + x x x x x ", +" . x . x . x . x . x x x x x x x x x x x ", +" . x . x x x . x . x x x x x x + x x x x x ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", +"x x x x x x x x x x x x x x x x x x x x x x ", +". . . . . x . . . . . x . x . x Y x . x . x ", +". . . . . x . . . . . . x . x . Y . x . x . ", +". . . . . x . . . . . x . x . x Y x . x . x ", ". . . . . x . . . . . . x . x . Y . x . x . ", -". . . . . x . . . . . x . x . x Y x . x . x ", -". . . . . x . . . . . . x . x . Y . x . x . ", -". . . . . x . . . . . x . x . x Y x . x . x ", -"x x x x x x x x x x x x x x x x x x x x x x ", -". . . . . x . . . . . x . x . x Y x . x . x ", -". . . . . x . . . . . . x . x . Y . x . x . ", -". . . . . x . . . . . x . x . x Y x . x . x ", -". . . . . x . . . . . . x . x . Y . x . x . ", ". . . . . x . . . . . x . x . x Y x . x . x " } ; diff --git a/sxpm/sxpm.c b/sxpm/sxpm.c index ea4dde3..9585abe 100644 --- a/sxpm/sxpm.c +++ b/sxpm/sxpm.c @@ -483,7 +483,7 @@ main( unsigned int i, j; for (i = 0; i < view.attributes.nextensions; i++) { - /* L10N_Comments : Output when -v & file has extensions + /* L10N_Comments : Output when -v & file has extensions %s is replaced by extension name */ fprintf(stderr, gettext("Xpm extension : %s\n"), view.attributes.extensions[i].name); @@ -577,7 +577,7 @@ main( void Usage(void) { - /* L10N_Comments : Usage message (sxpm -h) in two parts. + /* L10N_Comments : Usage message (sxpm -h) in two parts. In the first part %s is replaced by the command name. */ fprintf(stderr, gettext("\nUsage: %s [options...]\n"), command[0]); fprintf(stderr, gettext("Where options are:\n\ @@ -624,16 +624,16 @@ ErrorMessage( case XpmSuccess: return; case XpmColorError: -/* L10N_Comments : The following set of messages are classified as +/* L10N_Comments : The following set of messages are classified as either errors or warnings. Based on the class of message, different - wrappers are selected at the end to state the message source & class. + wrappers are selected at the end to state the message source & class. L10N_Comments : WARNING produced when filename can be read, but contains an invalid color specification (need to create test case)*/ warning = gettext("Could not parse or alloc requested color"); break; case XpmOpenFailed: - /* L10N_Comments : ERROR produced when filename does not exist + /* L10N_Comments : ERROR produced when filename does not exist or insufficient permissions to open (i.e. sxpm /no/such/file ) */ error = gettext("Cannot open file"); break; @@ -644,7 +644,7 @@ ErrorMessage( break; case XpmNoMemory: /* L10N_Comments : ERROR produced when filename can be read, but - is too big for memory + is too big for memory (i.e. limit datasize 32 ; sxpm /usr/dt/backdrops/Crochet.pm ) */ error = gettext("Not enough memory"); break; |