X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cfbe03c9c3ffecd6363dcc63e6fc27b8c6ed70aa..5333ab8e8ef81e3ae71fef22b42542c51b122258:/src/xpm/scan.c diff --git a/src/xpm/scan.c b/src/xpm/scan.c index fb16180fd8..620657a346 100644 --- a/src/xpm/scan.c +++ b/src/xpm/scan.c @@ -240,10 +240,10 @@ XpmCreateXpmImageFromImage(Display *display, XImage *image, XImage *shapeimage, /* * 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) { @@ -369,8 +369,8 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, #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; @@ -398,7 +398,7 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, return (XpmNoMemory); for (i = 0, i2 = (mask ? i + 1 : i), color = colors, xcolor = xcolors; - i < ncolors; i++, i2++, color++, xcolor++, pixels++) { + i < (unsigned int)ncolors; i++, i2++, color++, xcolor++, pixels++) { if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) { XpmFree(xcolors); @@ -411,7 +411,7 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, xcolor->pixel = *pixels; } -#ifdef wx_msw +#if defined(wx_msw) || defined(wx_pm) XQueryColors(display, (Colormap *)colormap, xcolors, ncolors); #else XQueryColors(display, (Colormap)colormap, xcolors, ncolors); @@ -441,7 +441,7 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, } /* end 3.2 bc */ - for (i = 0, color = colors, xcolor = xcolors; i < ncolors; + for (i = 0, color = colors, xcolor = xcolors; i < (unsigned int)ncolors; i++, color++, xcolor++) { /* look for related info from the attributes if any */ @@ -490,7 +490,7 @@ ScanOtherColors(Display *display, XpmColor *colors, int ncolors, Pixel *pixels, #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 @@ -792,12 +792,14 @@ MSWGetImagePixels(Display *display, XImage *image, unsigned int width, unsigned iptr = pmap->pixelindex; for (y = 0; y < height; y++) { +#if !defined(__VISAGECPP__) /* fixme for OS/2 */ for (x = 0; x < width; x++, iptr++) { /* bitmap must be selected !!! ??? */ pixel = GetPixel(*display, x, y); if (storePixel(pixel, pmap, iptr)) return (XpmNoMemory); } +#endif } return (XpmSuccess); }