diff options
Diffstat (limited to 'lib/libXpm/src')
30 files changed, 652 insertions, 665 deletions
diff --git a/lib/libXpm/src/Attrib.c b/lib/libXpm/src/Attrib.c index a6feb5268..cb304df1f 100644 --- a/lib/libXpm/src/Attrib.c +++ b/lib/libXpm/src/Attrib.c @@ -49,10 +49,10 @@ LFUNC(FreeOldColorTable, void, (XpmColor **colorTable, unsigned int ncolors)); * Create a colortable compatible with the old style colortable */ static int -CreateOldColorTable(ct, ncolors, oldct) - XpmColor *ct; - unsigned int ncolors; - XpmColor ***oldct; +CreateOldColorTable( + XpmColor *ct, + unsigned int ncolors, + XpmColor ***oldct) { XpmColor **colorTable, **color; unsigned int a; @@ -72,9 +72,9 @@ CreateOldColorTable(ct, ncolors, oldct) } static void -FreeOldColorTable(colorTable, ncolors) - XpmColor **colorTable; - unsigned int ncolors; +FreeOldColorTable( + XpmColor **colorTable, + unsigned int ncolors) { unsigned int a, b; XpmColor **color; @@ -97,9 +97,9 @@ FreeOldColorTable(colorTable, ncolors) * Free the computed color table */ void -xpmFreeColorTable(colorTable, ncolors) - XpmColor *colorTable; - int ncolors; +xpmFreeColorTable( + XpmColor *colorTable, + int ncolors) { int a, b; XpmColor *color; @@ -119,9 +119,9 @@ xpmFreeColorTable(colorTable, ncolors) * Free array of extensions */ void -XpmFreeExtensions(extensions, nextensions) - XpmExtension *extensions; - int nextensions; +XpmFreeExtensions( + XpmExtension *extensions, + int nextensions) { unsigned int i, j, nlines; XpmExtension *ext; @@ -147,7 +147,7 @@ XpmFreeExtensions(extensions, nextensions) */ int -XpmAttributesSize() +XpmAttributesSize(void) { return sizeof(XpmAttributes); } @@ -156,8 +156,7 @@ XpmAttributesSize() * Init returned data to free safely later on */ void -xpmInitAttributes(attributes) - XpmAttributes *attributes; +xpmInitAttributes(XpmAttributes *attributes) { if (attributes) { attributes->pixels = NULL; @@ -184,10 +183,10 @@ xpmInitAttributes(attributes) * Fill in the XpmAttributes with the XpmImage and the XpmInfo */ void -xpmSetAttributes(attributes, image, info) - XpmAttributes *attributes; - XpmImage *image; - XpmInfo *info; +xpmSetAttributes( + XpmAttributes *attributes, + XpmImage *image, + XpmInfo *info) { if (attributes->valuemask & XpmReturnColorTable) { attributes->colorTable = image->colorTable; @@ -254,8 +253,7 @@ xpmSetAttributes(attributes, image, info) * but the structure itself */ void -XpmFreeAttributes(attributes) - XpmAttributes *attributes; +XpmFreeAttributes(XpmAttributes *attributes) { if (attributes->valuemask & XpmReturnPixels && attributes->npixels) { XpmFree(attributes->pixels); diff --git a/lib/libXpm/src/CrBufFrI.c b/lib/libXpm/src/CrBufFrI.c index b87971542..a53b1177b 100644 --- a/lib/libXpm/src/CrBufFrI.c +++ b/lib/libXpm/src/CrBufFrI.c @@ -59,12 +59,12 @@ LFUNC(ExtensionsSize, unsigned int, (XpmExtension *ext, unsigned int num)); LFUNC(CommentsSize, int, (XpmInfo *info)); int -XpmCreateBufferFromImage(display, buffer_return, image, shapeimage, attributes) - Display *display; - char **buffer_return; - XImage *image; - XImage *shapeimage; - XpmAttributes *attributes; +XpmCreateBufferFromImage( + Display *display, + char **buffer_return, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes) { XpmImage xpmimage; XpmInfo info; @@ -105,10 +105,10 @@ do \ }while(0) int -XpmCreateBufferFromXpmImage(buffer_return, image, info) - char **buffer_return; - XpmImage *image; - XpmInfo *info; +XpmCreateBufferFromXpmImage( + char **buffer_return, + XpmImage *image, + XpmInfo *info) { /* calculation variables */ int ErrorStatus; @@ -271,13 +271,13 @@ error: static int -WriteColors(dataptr, data_size, used_size, colors, ncolors, cpp) - char **dataptr; - unsigned int *data_size; - unsigned int *used_size; - XpmColor *colors; - unsigned int ncolors; - unsigned int cpp; +WriteColors( + char **dataptr, + unsigned int *data_size, + unsigned int *used_size, + XpmColor *colors, + unsigned int ncolors, + unsigned int cpp) { char buf[BUFSIZ] = {0}; unsigned int a, key, l; @@ -329,15 +329,15 @@ WriteColors(dataptr, data_size, used_size, colors, ncolors, cpp) } static void -WritePixels(dataptr, data_size, used_size, width, height, cpp, pixels, colors) - char *dataptr; - unsigned int data_size; - unsigned int *used_size; - unsigned int width; - unsigned int height; - unsigned int cpp; - unsigned int *pixels; - XpmColor *colors; +WritePixels( + char *dataptr, + unsigned int data_size, + unsigned int *used_size, + unsigned int width, + unsigned int height, + unsigned int cpp, + unsigned int *pixels, + XpmColor *colors) { char *s = dataptr; unsigned int x, y, h; @@ -372,9 +372,9 @@ WritePixels(dataptr, data_size, used_size, width, height, cpp, pixels, colors) } static unsigned int -ExtensionsSize(ext, num) - XpmExtension *ext; - unsigned int num; +ExtensionsSize( + XpmExtension *ext, + unsigned int num) { unsigned int x, y, a, size; char **line; @@ -397,12 +397,12 @@ ExtensionsSize(ext, num) } static void -WriteExtensions(dataptr, data_size, used_size, ext, num) - char *dataptr; - unsigned int data_size; - unsigned int *used_size; - XpmExtension *ext; - unsigned int num; +WriteExtensions( + char *dataptr, + unsigned int data_size, + unsigned int *used_size, + XpmExtension *ext, + unsigned int num) { unsigned int x, y, a; char **line; @@ -432,8 +432,7 @@ WriteExtensions(dataptr, data_size, used_size, ext, num) } static int -CommentsSize(info) - XpmInfo *info; +CommentsSize(XpmInfo *info) { int size = 0; diff --git a/lib/libXpm/src/CrBufFrP.c b/lib/libXpm/src/CrBufFrP.c index 44eb56d7d..de3e7764c 100644 --- a/lib/libXpm/src/CrBufFrP.c +++ b/lib/libXpm/src/CrBufFrP.c @@ -38,13 +38,12 @@ #include "XpmI.h" int -XpmCreateBufferFromPixmap(display, buffer_return, pixmap, shapemask, - attributes) - Display *display; - char **buffer_return; - Pixmap pixmap; - Pixmap shapemask; - XpmAttributes *attributes; +XpmCreateBufferFromPixmap( + Display *display, + char **buffer_return, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes) { XImage *ximage = NULL; XImage *shapeimage = NULL; diff --git a/lib/libXpm/src/CrDatFrI.c b/lib/libXpm/src/CrDatFrI.c index 90999665b..aa1d893b7 100644 --- a/lib/libXpm/src/CrDatFrI.c +++ b/lib/libXpm/src/CrDatFrI.c @@ -59,12 +59,12 @@ LFUNC(CreateExtensions, void, (char **dataptr, unsigned int data_size, unsigned int ext_nlines)); int -XpmCreateDataFromImage(display, data_return, image, shapeimage, attributes) - Display *display; - char ***data_return; - XImage *image; - XImage *shapeimage; - XpmAttributes *attributes; +XpmCreateDataFromImage( + Display *display, + char ***data_return, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes) { XpmImage xpmimage; XpmInfo info; @@ -102,10 +102,10 @@ do \ } while(0) int -XpmCreateDataFromXpmImage(data_return, image, info) - char ***data_return; - XpmImage *image; - XpmInfo *info; +XpmCreateDataFromXpmImage( + char ***data_return, + XpmImage *image, + XpmInfo *info) { /* calculation variables */ int ErrorStatus; @@ -244,12 +244,12 @@ exit: } static int -CreateColors(dataptr, data_size, colors, ncolors, cpp) - char **dataptr; - unsigned int *data_size; - XpmColor *colors; - unsigned int ncolors; - unsigned int cpp; +CreateColors( + char **dataptr, + unsigned int *data_size, + XpmColor *colors, + unsigned int ncolors, + unsigned int cpp) { char buf[BUFSIZ]; unsigned int a, key, l; @@ -295,14 +295,14 @@ CreateColors(dataptr, data_size, colors, ncolors, cpp) } static void -CreatePixels(dataptr, data_size, width, height, cpp, pixels, colors) - char **dataptr; - unsigned int data_size; - unsigned int width; - unsigned int height; - unsigned int cpp; - unsigned int *pixels; - XpmColor *colors; +CreatePixels( + char **dataptr, + unsigned int data_size, + unsigned int width, + unsigned int height, + unsigned int cpp, + unsigned int *pixels, + XpmColor *colors) { char *s; unsigned int x, y, h, offset; @@ -345,11 +345,11 @@ CreatePixels(dataptr, data_size, width, height, cpp, pixels, colors) } static void -CountExtensions(ext, num, ext_size, ext_nlines) - XpmExtension *ext; - unsigned int num; - unsigned int *ext_size; - unsigned int *ext_nlines; +CountExtensions( + XpmExtension *ext, + unsigned int num, + unsigned int *ext_size, + unsigned int *ext_nlines) { unsigned int x, y, a, size, nlines; char **line; @@ -371,13 +371,13 @@ CountExtensions(ext, num, ext_size, ext_nlines) } static void -CreateExtensions(dataptr, data_size, offset, ext, num, ext_nlines) - char **dataptr; - unsigned int data_size; - unsigned int offset; - XpmExtension *ext; - unsigned int num; - unsigned int ext_nlines; +CreateExtensions( + char **dataptr, + unsigned int data_size, + unsigned int offset, + XpmExtension *ext, + unsigned int num, + unsigned int ext_nlines) { unsigned int x, y, a, b; char **line; diff --git a/lib/libXpm/src/CrDatFrP.c b/lib/libXpm/src/CrDatFrP.c index 20981b70c..0e17fee14 100644 --- a/lib/libXpm/src/CrDatFrP.c +++ b/lib/libXpm/src/CrDatFrP.c @@ -38,12 +38,12 @@ #include "XpmI.h" int -XpmCreateDataFromPixmap(display, data_return, pixmap, shapemask, attributes) - Display *display; - char ***data_return; - Pixmap pixmap; - Pixmap shapemask; - XpmAttributes *attributes; +XpmCreateDataFromPixmap( + Display *display, + char ***data_return, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes) { XImage *ximage = NULL; XImage *shapeimage = NULL; diff --git a/lib/libXpm/src/CrIFrBuf.c b/lib/libXpm/src/CrIFrBuf.c index d98e65887..b6b12cad1 100644 --- a/lib/libXpm/src/CrIFrBuf.c +++ b/lib/libXpm/src/CrIFrBuf.c @@ -40,13 +40,12 @@ LFUNC(OpenBuffer, void, (char *buffer, xpmData *mdata)); int -XpmCreateImageFromBuffer(display, buffer, image_return, - shapeimage_return, attributes) - Display *display; - char *buffer; - XImage **image_return; - XImage **shapeimage_return; - XpmAttributes *attributes; +XpmCreateImageFromBuffer( + Display *display, + char *buffer, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes) { XpmImage image; XpmInfo info; @@ -83,10 +82,10 @@ XpmCreateImageFromBuffer(display, buffer, image_return, } int -XpmCreateXpmImageFromBuffer(buffer, image, info) - char *buffer; - XpmImage *image; - XpmInfo *info; +XpmCreateXpmImageFromBuffer( + char *buffer, + XpmImage *image, + XpmInfo *info) { xpmData mdata; int ErrorStatus; @@ -108,9 +107,9 @@ XpmCreateXpmImageFromBuffer(buffer, image, info) * open the given buffer to be read or written as an xpmData which is returned */ static void -OpenBuffer(buffer, mdata) - char *buffer; - xpmData *mdata; +OpenBuffer( + char *buffer, + xpmData *mdata) { mdata->type = XPMBUFFER; mdata->cptr = buffer; diff --git a/lib/libXpm/src/CrIFrDat.c b/lib/libXpm/src/CrIFrDat.c index ab93a499b..9ef155721 100644 --- a/lib/libXpm/src/CrIFrDat.c +++ b/lib/libXpm/src/CrIFrDat.c @@ -40,13 +40,12 @@ LFUNC(OpenArray, void, (char **data, xpmData *mdata)); int -XpmCreateImageFromData(display, data, image_return, - shapeimage_return, attributes) - Display *display; - char **data; - XImage **image_return; - XImage **shapeimage_return; - XpmAttributes *attributes; +XpmCreateImageFromData( + Display *display, + char **data, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes) { XpmImage image; XpmInfo info; @@ -83,10 +82,10 @@ XpmCreateImageFromData(display, data, image_return, } int -XpmCreateXpmImageFromData(data, image, info) - char **data; - XpmImage *image; - XpmInfo *info; +XpmCreateXpmImageFromData( + char **data, + XpmImage *image, + XpmInfo *info) { xpmData mdata; int ErrorStatus; @@ -108,9 +107,9 @@ XpmCreateXpmImageFromData(data, image, info) * open the given array to be read or written as an xpmData which is returned */ static void -OpenArray(data, mdata) - char **data; - xpmData *mdata; +OpenArray( + char **data, + xpmData *mdata) { mdata->type = XPMARRAY; mdata->stream.data = data; diff --git a/lib/libXpm/src/CrIFrP.c b/lib/libXpm/src/CrIFrP.c index 144acc42c..79c4c49c5 100644 --- a/lib/libXpm/src/CrIFrP.c +++ b/lib/libXpm/src/CrIFrP.c @@ -38,12 +38,12 @@ #include "XpmI.h" void -xpmCreateImageFromPixmap(display, pixmap, ximage_return, width, height) - Display *display; - Pixmap pixmap; - XImage **ximage_return; - unsigned int *width; - unsigned int *height; +xpmCreateImageFromPixmap( + Display *display, + Pixmap pixmap, + XImage **ximage_return, + unsigned int *width, + unsigned int *height) { unsigned int dum; int dummy; diff --git a/lib/libXpm/src/CrPFrBuf.c b/lib/libXpm/src/CrPFrBuf.c index f3f903053..2c28a4137 100644 --- a/lib/libXpm/src/CrPFrBuf.c +++ b/lib/libXpm/src/CrPFrBuf.c @@ -38,14 +38,13 @@ #include "XpmI.h" int -XpmCreatePixmapFromBuffer(display, d, buffer, pixmap_return, - shapemask_return, attributes) - Display *display; - Drawable d; - char *buffer; - Pixmap *pixmap_return; - Pixmap *shapemask_return; - XpmAttributes *attributes; +XpmCreatePixmapFromBuffer( + Display *display, + Drawable d, + char *buffer, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes) { XImage *ximage, *shapeimage; int ErrorStatus; diff --git a/lib/libXpm/src/CrPFrDat.c b/lib/libXpm/src/CrPFrDat.c index 483b3afe7..b65771d19 100644 --- a/lib/libXpm/src/CrPFrDat.c +++ b/lib/libXpm/src/CrPFrDat.c @@ -38,14 +38,13 @@ #include "XpmI.h" int -XpmCreatePixmapFromData(display, d, data, pixmap_return, - shapemask_return, attributes) - Display *display; - Drawable d; - char **data; - Pixmap *pixmap_return; - Pixmap *shapemask_return; - XpmAttributes *attributes; +XpmCreatePixmapFromData( + Display *display, + Drawable d, + char **data, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes) { XImage *ximage, *shapeimage; int ErrorStatus; diff --git a/lib/libXpm/src/CrPFrI.c b/lib/libXpm/src/CrPFrI.c index 2f555dd94..8f6f4aa46 100644 --- a/lib/libXpm/src/CrPFrI.c +++ b/lib/libXpm/src/CrPFrI.c @@ -38,11 +38,11 @@ #include "XpmI.h" void -xpmCreatePixmapFromImage(display, d, ximage, pixmap_return) - Display *display; - Drawable d; - XImage *ximage; - Pixmap *pixmap_return; +xpmCreatePixmapFromImage( + Display *display, + Drawable d, + XImage *ximage, + Pixmap *pixmap_return) { GC gc; XGCValues values; diff --git a/lib/libXpm/src/Image.c b/lib/libXpm/src/Image.c index 2179d4e03..e0223cc2a 100644 --- a/lib/libXpm/src/Image.c +++ b/lib/libXpm/src/Image.c @@ -41,8 +41,7 @@ * Init returned data to free safely later on */ void -xpmInitXpmImage(image) - XpmImage *image; +xpmInitXpmImage(XpmImage *image) { image->ncolors = 0; image->colorTable = NULL; @@ -53,8 +52,7 @@ xpmInitXpmImage(image) * Free the XpmImage data which have been allocated */ void -XpmFreeXpmImage(image) - XpmImage *image; +XpmFreeXpmImage(XpmImage *image) { if (image->colorTable) xpmFreeColorTable(image->colorTable, image->ncolors); diff --git a/lib/libXpm/src/Info.c b/lib/libXpm/src/Info.c index f35abd931..e975a6dce 100644 --- a/lib/libXpm/src/Info.c +++ b/lib/libXpm/src/Info.c @@ -41,8 +41,7 @@ * Init returned data to free safely later on */ void -xpmInitXpmInfo(info) - XpmInfo *info; +xpmInitXpmInfo(XpmInfo *info) { if (info) { info->hints_cmt = NULL; @@ -57,8 +56,7 @@ xpmInitXpmInfo(info) * Free the XpmInfo data which have been allocated */ void -XpmFreeXpmInfo(info) - XpmInfo *info; +XpmFreeXpmInfo(XpmInfo *info) { if (info) { if (info->valuemask & XpmComments) { @@ -88,9 +86,9 @@ XpmFreeXpmInfo(info) * Set the XpmInfo valuemask to retrieve required info */ void -xpmSetInfoMask(info, attributes) - XpmInfo *info; - XpmAttributes *attributes; +xpmSetInfoMask( + XpmInfo *info, + XpmAttributes *attributes) { info->valuemask = 0; if (attributes->valuemask & XpmReturnInfos) @@ -103,9 +101,9 @@ xpmSetInfoMask(info, attributes) * Fill in the XpmInfo with the XpmAttributes */ void -xpmSetInfo(info, attributes) - XpmInfo *info; - XpmAttributes *attributes; +xpmSetInfo( + XpmInfo *info, + XpmAttributes *attributes) { info->valuemask = 0; if (attributes->valuemask & XpmInfos) { diff --git a/lib/libXpm/src/Makefile.am b/lib/libXpm/src/Makefile.am index 2329daf08..0c8652a8f 100644 --- a/lib/libXpm/src/Makefile.am +++ b/lib/libXpm/src/Makefile.am @@ -2,9 +2,8 @@ lib_LTLIBRARIES=libXpm.la -AM_CFLAGS = -I. \ - -I$(top_srcdir)/include/X11/ \ - $(XPM_CFLAGS) +AM_CPPFLAGS = -I. -I$(top_srcdir)/include/X11/ +AM_CFLAGS = $(CWARNFLAGS) $(XPM_CFLAGS) libXpm_la_LDFLAGS = -version-number 4:11:0 -no-undefined libXpm_la_LIBADD = $(XPM_LIBS) diff --git a/lib/libXpm/src/Makefile.in b/lib/libXpm/src/Makefile.in index 89eb02730..7f08fef90 100644 --- a/lib/libXpm/src/Makefile.in +++ b/lib/libXpm/src/Makefile.in @@ -105,8 +105,10 @@ BUILD_SXPM_TRUE = @BUILD_SXPM_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -116,6 +118,7 @@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -126,6 +129,7 @@ F77 = @F77@ FFLAGS = @FFLAGS@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -145,6 +149,7 @@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -155,6 +160,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -165,13 +171,9 @@ USE_GETTEXT_TRUE = @USE_GETTEXT_TRUE@ VERSION = @VERSION@ XPM_CFLAGS = @XPM_CFLAGS@ XPM_LIBS = @XPM_LIBS@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -188,30 +190,38 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +distcleancheck_listfiles = @distcleancheck_listfiles@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LTLIBRARIES = libXpm.la AM_CPPFLAGS = -I. -I$(top_srcdir)/include/X11/ -AM_CFLAGS = $(XPM_CFLAGS) +AM_CFLAGS = $(CWARNFLAGS) $(XPM_CFLAGS) libXpm_la_LDFLAGS = -version-number 4:11:0 -no-undefined libXpm_la_LIBADD = $(XPM_LIBS) libXpm_la_SOURCES = \ diff --git a/lib/libXpm/src/RdFToBuf.c b/lib/libXpm/src/RdFToBuf.c index 222bf1868..b719960af 100644 --- a/lib/libXpm/src/RdFToBuf.c +++ b/lib/libXpm/src/RdFToBuf.c @@ -59,9 +59,9 @@ #endif int -XpmReadFileToBuffer(filename, buffer_return) - char *filename; - char **buffer_return; +XpmReadFileToBuffer( + char *filename, + char **buffer_return) { int fd, fcheck; off_t len; diff --git a/lib/libXpm/src/RdFToDat.c b/lib/libXpm/src/RdFToDat.c index 11f753b18..87f7f1ec8 100644 --- a/lib/libXpm/src/RdFToDat.c +++ b/lib/libXpm/src/RdFToDat.c @@ -38,9 +38,9 @@ #include "XpmI.h" int -XpmReadFileToData(filename, data_return) - char *filename; - char ***data_return; +XpmReadFileToData( + char *filename, + char ***data_return) { XpmImage image; XpmInfo info; diff --git a/lib/libXpm/src/RdFToI.c b/lib/libXpm/src/RdFToI.c index 35fe78e27..bc05fe624 100644 --- a/lib/libXpm/src/RdFToI.c +++ b/lib/libXpm/src/RdFToI.c @@ -44,20 +44,28 @@ #include <errno.h> #include <sys/types.h> #include <sys/wait.h> +#else +#ifdef FOR_MSW +#include <fcntl.h> +#endif #endif LFUNC(OpenReadFile, int, (char *filename, xpmData *mdata)); LFUNC(xpmDataClose, void, (xpmData *mdata)); +FUNC(xpmPipeThrough, FILE*, (int fd, + const char *cmd, + const char *arg1, + const char *mode)); + #ifndef CXPMPROG int -XpmReadFileToImage(display, filename, - image_return, shapeimage_return, attributes) - Display *display; - char *filename; - XImage **image_return; - XImage **shapeimage_return; - XpmAttributes *attributes; +XpmReadFileToImage( + Display *display, + char *filename, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes) { XpmImage image; XpmInfo info; @@ -96,10 +104,10 @@ XpmReadFileToImage(display, filename, } int -XpmReadFileToXpmImage(filename, image, info) - char *filename; - XpmImage *image; - XpmInfo *info; +XpmReadFileToXpmImage( + char *filename, + XpmImage *image, + XpmInfo *info) { xpmData mdata; int ErrorStatus; @@ -124,11 +132,11 @@ XpmReadFileToXpmImage(filename, image, info) #ifndef NO_ZPIPE /* Do not depend on errno after read_through */ FILE* -xpmPipeThrough(fd, cmd, arg1, mode) - int fd; - const char* cmd; - const char* arg1; - const char* mode; +xpmPipeThrough( + int fd, + const char *cmd, + const char *arg1, + const char *mode) { FILE* fp; int status, fds[2], in = 0, out = 1; @@ -186,9 +194,9 @@ fail2: * open the given file to be read as an xpmData which is returned. */ static int -OpenReadFile(filename, mdata) - char *filename; - xpmData *mdata; +OpenReadFile( + char *filename, + xpmData *mdata) { if (!filename) { mdata->stream.file = (stdin); @@ -259,8 +267,7 @@ OpenReadFile(filename, mdata) * close the file related to the xpmData if any */ static void -xpmDataClose(mdata) - xpmData *mdata; +xpmDataClose(xpmData *mdata) { if (mdata->stream.file != (stdin)) fclose(mdata->stream.file); diff --git a/lib/libXpm/src/RdFToP.c b/lib/libXpm/src/RdFToP.c index 993824e99..baceddae9 100644 --- a/lib/libXpm/src/RdFToP.c +++ b/lib/libXpm/src/RdFToP.c @@ -38,14 +38,13 @@ #include "XpmI.h" int -XpmReadFileToPixmap(display, d, filename, pixmap_return, - shapemask_return, attributes) - Display *display; - Drawable d; - char *filename; - Pixmap *pixmap_return; - Pixmap *shapemask_return; - XpmAttributes *attributes; +XpmReadFileToPixmap( + Display *display, + Drawable d, + char *filename, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes) { XImage *ximage, *shapeimage; int ErrorStatus; diff --git a/lib/libXpm/src/WrFFrBuf.c b/lib/libXpm/src/WrFFrBuf.c index 9e0497a9e..bd1c45b91 100644 --- a/lib/libXpm/src/WrFFrBuf.c +++ b/lib/libXpm/src/WrFFrBuf.c @@ -40,9 +40,9 @@ #include "XpmI.h" int -XpmWriteFileFromBuffer(filename, buffer) - char *filename; - char *buffer; +XpmWriteFileFromBuffer( + char *filename, + char *buffer) { int fcheck, len; FILE *fp = fopen(filename, "w"); diff --git a/lib/libXpm/src/WrFFrDat.c b/lib/libXpm/src/WrFFrDat.c index bc0a94468..dc738b9a0 100644 --- a/lib/libXpm/src/WrFFrDat.c +++ b/lib/libXpm/src/WrFFrDat.c @@ -38,9 +38,9 @@ #include "XpmI.h" int -XpmWriteFileFromData(filename, data) - char *filename; - char **data; +XpmWriteFileFromData( + char *filename, + char **data) { XpmImage image; XpmInfo info; diff --git a/lib/libXpm/src/WrFFrI.c b/lib/libXpm/src/WrFFrI.c index 363f6c47d..3eeaf2a1d 100644 --- a/lib/libXpm/src/WrFFrI.c +++ b/lib/libXpm/src/WrFFrI.c @@ -68,12 +68,12 @@ LFUNC(OpenWriteFile, int, (char *filename, xpmData *mdata)); LFUNC(xpmDataClose, void, (xpmData *mdata)); int -XpmWriteFileFromImage(display, filename, image, shapeimage, attributes) - Display *display; - char *filename; - XImage *image; - XImage *shapeimage; - XpmAttributes *attributes; +XpmWriteFileFromImage( + Display *display, + char *filename, + XImage *image, + XImage *shapeimage, + XpmAttributes *attributes) { XpmImage xpmimage; XpmInfo info; @@ -99,10 +99,10 @@ XpmWriteFileFromImage(display, filename, image, shapeimage, attributes) } int -XpmWriteFileFromXpmImage(filename, image, info) - char *filename; - XpmImage *image; - XpmInfo *info; +XpmWriteFileFromXpmImage( + char *filename, + XpmImage *image, + XpmInfo *info) { xpmData mdata; char *name, *dot, *s, new_name[BUFSIZ] = {0}; @@ -117,9 +117,9 @@ XpmWriteFileFromXpmImage(filename, image, info) #ifdef VMS name = filename; #else - if (!(name = rindex(filename, '/')) + if (!(name = strrchr(filename, '/')) #ifdef AMIGA - && !(name = rindex(filename, ':')) + && !(name = strrchr(filename, ':')) #endif ) name = filename; @@ -127,24 +127,25 @@ XpmWriteFileFromXpmImage(filename, image, info) name++; #endif /* let's try to make a valid C syntax name */ - if (index(name, '.')) { + if (strchr(name, '.')) { strncpy(new_name, name, sizeof(new_name)); new_name[sizeof(new_name)-1] = '\0'; /* change '.' to '_' */ name = s = new_name; - while ((dot = index(s, '.'))) { + while ((dot = strchr(s, '.'))) { *dot = '_'; s = dot; } } - if (index(name, '-')) { + if (strchr(name, '-')) { if (name != new_name) { - strcpy(new_name, name); + strncpy(new_name, name, sizeof(new_name)); + new_name[sizeof(new_name)-1] = '\0'; name = new_name; } /* change '-' to '_' */ s = name; - while ((dot = index(s, '-'))) { + while ((dot = strchr(s, '-'))) { *dot = '_'; s = dot; } @@ -162,11 +163,11 @@ XpmWriteFileFromXpmImage(filename, image, info) } static int -xpmWriteFile(file, image, name, info) - FILE *file; - XpmImage *image; - char *name; - XpmInfo *info; +xpmWriteFile( + FILE *file, + XpmImage *image, + char *name, + XpmInfo *info) { /* calculation variables */ unsigned int cmts, extensions; @@ -220,10 +221,10 @@ xpmWriteFile(file, image, name, info) } static void -WriteColors(file, colors, ncolors) - FILE *file; - XpmColor *colors; - unsigned int ncolors; +WriteColors( + FILE *file, + XpmColor *colors, + unsigned int ncolors) { unsigned int a, key; char *s; @@ -244,13 +245,13 @@ WriteColors(file, colors, ncolors) static int -WritePixels(file, width, height, cpp, pixels, colors) - FILE *file; - unsigned int width; - unsigned int height; - unsigned int cpp; - unsigned int *pixels; - XpmColor *colors; +WritePixels( + FILE *file, + unsigned int width, + unsigned int height, + unsigned int cpp, + unsigned int *pixels, + XpmColor *colors) { char *s, *p, *buf; unsigned int x, y, h; @@ -288,10 +289,10 @@ WritePixels(file, width, height, cpp, pixels, colors) } static void -WriteExtensions(file, ext, num) - FILE *file; - XpmExtension *ext; - unsigned int num; +WriteExtensions( + FILE *file, + XpmExtension *ext, + unsigned int num) { unsigned int x, y, n; char **line; @@ -317,9 +318,9 @@ FUNC(xpmPipeThrough, FILE*, (int fd, * open the given file to be written as an xpmData which is returned */ static int -OpenWriteFile(filename, mdata) - char *filename; - xpmData *mdata; +OpenWriteFile( + char *filename, + xpmData *mdata) { if (!filename) { mdata->stream.file = (stdout); @@ -355,8 +356,7 @@ OpenWriteFile(filename, mdata) * close the file related to the xpmData if any */ static void -xpmDataClose(mdata) - xpmData *mdata; +xpmDataClose(xpmData *mdata) { if (mdata->stream.file != (stdout)) fclose(mdata->stream.file); diff --git a/lib/libXpm/src/WrFFrP.c b/lib/libXpm/src/WrFFrP.c index 87ceb8890..497ba56d7 100644 --- a/lib/libXpm/src/WrFFrP.c +++ b/lib/libXpm/src/WrFFrP.c @@ -38,12 +38,12 @@ #include "XpmI.h" int -XpmWriteFileFromPixmap(display, filename, pixmap, shapemask, attributes) - Display *display; - char *filename; - Pixmap pixmap; - Pixmap shapemask; - XpmAttributes *attributes; +XpmWriteFileFromPixmap( + Display *display, + char *filename, + Pixmap pixmap, + Pixmap shapemask, + XpmAttributes *attributes) { XImage *ximage = NULL; XImage *shapeimage = NULL; diff --git a/lib/libXpm/src/create.c b/lib/libXpm/src/create.c index 9e333737c..acae3218c 100644 --- a/lib/libXpm/src/create.c +++ b/lib/libXpm/src/create.c @@ -163,8 +163,9 @@ FUNC(xpmstrcasecmp, int, (char *s1, char *s2)); * which does the trick */ int -xpmstrcasecmp(s1, s2) - register char *s1, *s2; +xpmstrcasecmp( + register char *s1, + register char *s2) { register int c1, c2; @@ -185,8 +186,7 @@ xpmstrcasecmp(s1, s2) * return the default color key related to the given visual */ static int -xpmVisualType(visual) - Visual *visual; +xpmVisualType(Visual *visual) { #ifndef FOR_MSW # ifndef AMIGA @@ -235,12 +235,12 @@ closeness_cmp(Const void *a, Const void *b) * call XAllocColor and return 0 if failure, positive otherwise */ static int -AllocColor(display, colormap, colorname, xcolor, closure) - Display *display; - Colormap colormap; - char *colorname; - XColor *xcolor; - void *closure; /* not used */ +AllocColor( + Display *display, + Colormap colormap, + char *colorname, + XColor *xcolor, + void *closure) /* not used */ { int status; if (colorname) @@ -258,21 +258,20 @@ AllocColor(display, colormap, colorname, xcolor, closure) */ static int -SetCloseColor(display, colormap, visual, col, image_pixel, mask_pixel, - alloc_pixels, nalloc_pixels, attributes, cols, ncols, - allocColor, closure) - Display *display; - Colormap colormap; - Visual *visual; - XColor *col; - Pixel *image_pixel, *mask_pixel; - Pixel *alloc_pixels; - unsigned int *nalloc_pixels; - XpmAttributes *attributes; - XColor *cols; - int ncols; - XpmAllocColorFunc allocColor; - void *closure; +SetCloseColor( + Display *display, + Colormap colormap, + Visual *visual, + XColor *col, + Pixel *image_pixel, + Pixel *mask_pixel, + Pixel *alloc_pixels, + unsigned int *nalloc_pixels, + XpmAttributes *attributes, + XColor *cols, + int ncols, + XpmAllocColorFunc allocColor, + void *closure) { /* @@ -443,26 +442,24 @@ SetCloseColor(display, colormap, visual, col, image_pixel, mask_pixel, */ static int -SetColor(display, colormap, visual, colorname, color_index, - image_pixel, mask_pixel, mask_pixel_index, - alloc_pixels, nalloc_pixels, used_pixels, nused_pixels, - attributes, cols, ncols, allocColor, closure) - Display *display; - Colormap colormap; - Visual *visual; - char *colorname; - unsigned int color_index; - Pixel *image_pixel, *mask_pixel; - unsigned int *mask_pixel_index; - Pixel *alloc_pixels; - unsigned int *nalloc_pixels; - Pixel *used_pixels; - unsigned int *nused_pixels; - XpmAttributes *attributes; - XColor *cols; - int ncols; - XpmAllocColorFunc allocColor; - void *closure; +SetColor( + Display *display, + Colormap colormap, + Visual *visual, + char *colorname, + unsigned int color_index, + Pixel *image_pixel, + Pixel *mask_pixel, + unsigned int *mask_pixel_index, + Pixel *alloc_pixels, + unsigned int *nalloc_pixels, + Pixel *used_pixels, + unsigned int *nused_pixels, + XpmAttributes *attributes, + XColor *cols, + int ncols, + XpmAllocColorFunc allocColor, + void *closure) { XColor xcolor; int status; @@ -507,20 +504,18 @@ SetColor(display, colormap, visual, colorname, color_index, static int -CreateColors(display, attributes, colors, ncolors, image_pixels, mask_pixels, - mask_pixel_index, alloc_pixels, nalloc_pixels, - used_pixels, nused_pixels) - Display *display; - XpmAttributes *attributes; - XpmColor *colors; - unsigned int ncolors; - Pixel *image_pixels; - Pixel *mask_pixels; - unsigned int *mask_pixel_index; - Pixel *alloc_pixels; - unsigned int *nalloc_pixels; - Pixel *used_pixels; - unsigned int *nused_pixels; +CreateColors( + Display *display, + XpmAttributes *attributes, + XpmColor *colors, + unsigned int ncolors, + Pixel *image_pixels, + Pixel *mask_pixels, + unsigned int *mask_pixel_index, + Pixel *alloc_pixels, + unsigned int *nalloc_pixels, + Pixel *used_pixels, + unsigned int *nused_pixels) { /* variables stored in the XpmAttributes structure */ Visual *visual; @@ -739,12 +734,12 @@ CreateColors(display, attributes, colors, ncolors, image_pixels, mask_pixels, /* default FreeColors function, simply call XFreeColors */ static int -FreeColors(display, colormap, pixels, n, closure) - Display *display; - Colormap colormap; - Pixel *pixels; - int n; - void *closure; /* not used */ +FreeColors( + Display *display, + Colormap colormap, + Pixel *pixels, + int n, + void *closure) /* not used */ { return XFreeColors(display, colormap, pixels, n, 0); } @@ -761,13 +756,12 @@ do \ } while(0) int -XpmCreateImageFromXpmImage(display, image, - image_return, shapeimage_return, attributes) - Display *display; - XpmImage *image; - XImage **image_return; - XImage **shapeimage_return; - XpmAttributes *attributes; +XpmCreateImageFromXpmImage( + Display *display, + XpmImage *image, + XImage **image_return, + XImage **shapeimage_return, + XpmAttributes *attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; @@ -973,14 +967,14 @@ error: * Create an XImage with its data */ static int -CreateXImage(display, visual, depth, format, width, height, image_return) - Display *display; - Visual *visual; - unsigned int depth; - int format; - unsigned int width; - unsigned int height; - XImage **image_return; +CreateXImage( + Display *display, + Visual *visual, + unsigned int depth, + int format, + unsigned int width, + unsigned int height, + XImage **image_return) { int bitmap_pad; @@ -1072,9 +1066,9 @@ static unsigned char Const _reverse_byte[0x100] = { }; static int -_XReverse_Bytes(bpt, nb) - register unsigned char *bpt; - register unsigned int nb; +_XReverse_Bytes( + register unsigned char *bpt, + register unsigned int nb) { do { *bpt = _reverse_byte[*bpt]; @@ -1085,9 +1079,9 @@ _XReverse_Bytes(bpt, nb) void -xpm_xynormalizeimagebits(bp, img) - register unsigned char *bp; - register XImage *img; +xpm_xynormalizeimagebits( + register unsigned char *bp, + register XImage *img) { register unsigned char c; @@ -1115,9 +1109,9 @@ xpm_xynormalizeimagebits(bp, img) } void -xpm_znormalizeimagebits(bp, img) - register unsigned char *bp; - register XImage *img; +xpm_znormalizeimagebits( + register unsigned char *bp, + register XImage *img) { register unsigned char c; @@ -1160,13 +1154,13 @@ static unsigned char Const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static void -_putbits(src, dstoffset, numbits, dst) - register char *src; /* address of source bit string */ - int dstoffset; /* bit offset into destination; +_putbits( + register char *src, /* address of source bit string */ + int dstoffset, /* bit offset into destination; * range is 0-31 */ - register int numbits; /* number of bits to copy to + register int numbits, /* number of bits to copy to * destination */ - register char *dst; /* address of destination bit string */ + register char *dst) /* address of destination bit string */ { register unsigned char chlo, chhi; int hibits; @@ -1208,12 +1202,12 @@ _putbits(src, dstoffset, numbits, dst) */ static void -PutImagePixels(image, width, height, pixelindex, pixels) - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +PutImagePixels( + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { register char *src; register char *dst; @@ -1295,12 +1289,12 @@ static unsigned long byteorderpixel = MSBFirst << 24; */ static void -PutImagePixels32(image, width, height, pixelindex, pixels) - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +PutImagePixels32( + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { unsigned char *data; unsigned int *iptr; @@ -1405,12 +1399,12 @@ PutImagePixels32(image, width, height, pixelindex, pixels) */ static void -PutImagePixels16(image, width, height, pixelindex, pixels) - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +PutImagePixels16( + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { unsigned char *data; unsigned int *iptr; @@ -1486,12 +1480,12 @@ PutImagePixels16(image, width, height, pixelindex, pixels) */ static void -PutImagePixels8(image, width, height, pixelindex, pixels) - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +PutImagePixels8( + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { char *data; unsigned int *iptr; @@ -1533,12 +1527,12 @@ PutImagePixels8(image, width, height, pixelindex, pixels) */ static void -PutImagePixels1(image, width, height, pixelindex, pixels) - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +PutImagePixels1( + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { if (image->byte_order != image->bitmap_bit_order) PutImagePixels(image, width, height, pixelindex, pixels); @@ -1647,14 +1641,13 @@ PutImagePixels1(image, width, height, pixelindex, pixels) } int -XpmCreatePixmapFromXpmImage(display, d, image, - pixmap_return, shapemask_return, attributes) - Display *display; - Drawable d; - XpmImage *image; - Pixmap *pixmap_return; - Pixmap *shapemask_return; - XpmAttributes *attributes; +XpmCreatePixmapFromXpmImage( + Display *display, + Drawable d, + XpmImage *image, + Pixmap *pixmap_return, + Pixmap *shapemask_return, + XpmAttributes *attributes) { XImage *ximage, *shapeimage; int ErrorStatus; @@ -1732,13 +1725,13 @@ APutImagePixels ( # endif/* AMIGA */ #else /* FOR_MSW part follows */ static void -MSWPutImagePixels(dc, image, width, height, pixelindex, pixels) - Display *dc; - XImage *image; - unsigned int width; - unsigned int height; - unsigned int *pixelindex; - Pixel *pixels; +MSWPutImagePixels( + Display *dc, + XImage *image, + unsigned int width, + unsigned int height, + unsigned int *pixelindex, + Pixel *pixels) { unsigned int *data = pixelindex; unsigned int x, y; @@ -1760,11 +1753,11 @@ MSWPutImagePixels(dc, image, width, height, pixelindex, pixels) #if !defined(FOR_MSW) && !defined(AMIGA) static int -PutPixel1(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel1( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { register char *src; register char *dst; @@ -1795,11 +1788,11 @@ PutPixel1(ximage, x, y, pixel) } static int -PutPixel(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { register char *src; register char *dst; @@ -1834,11 +1827,11 @@ PutPixel(ximage, x, y, pixel) #if !defined(WORD64) && !defined(LONG64) static int -PutPixel32(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel32( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { unsigned char *addr; @@ -1852,11 +1845,11 @@ PutPixel32(ximage, x, y, pixel) #endif static int -PutPixel32MSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel32MSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { unsigned char *addr; @@ -1872,11 +1865,11 @@ PutPixel32MSB(ximage, x, y, pixel) } static int -PutPixel32LSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel32LSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { unsigned char *addr; @@ -1892,11 +1885,11 @@ PutPixel32LSB(ximage, x, y, pixel) } static int -PutPixel16MSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel16MSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { unsigned char *addr; @@ -1910,11 +1903,11 @@ PutPixel16MSB(ximage, x, y, pixel) } static int -PutPixel16LSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel16LSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { unsigned char *addr; @@ -1928,11 +1921,11 @@ PutPixel16LSB(ximage, x, y, pixel) } static int -PutPixel8(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel8( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { if(x < 0 || y < 0) return 0; @@ -1942,11 +1935,11 @@ PutPixel8(ximage, x, y, pixel) } static int -PutPixel1MSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel1MSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { if(x < 0 || y < 0) return 0; @@ -1959,11 +1952,11 @@ PutPixel1MSB(ximage, x, y, pixel) } static int -PutPixel1LSB(ximage, x, y, pixel) - register XImage *ximage; - int x; - int y; - unsigned long pixel; +PutPixel1LSB( + register XImage *ximage, + int x, + int y, + unsigned long pixel) { if(x < 0 || y < 0) return 0; @@ -1981,15 +1974,14 @@ PutPixel1LSB(ximage, x, y, pixel) * This function parses an Xpm file or data and directly create an XImage */ int -xpmParseDataAndCreate(display, data, image_return, shapeimage_return, - image, info, attributes) - Display *display; - xpmData *data; - XImage **image_return; - XImage **shapeimage_return; - XpmImage *image; - XpmInfo *info; - XpmAttributes *attributes; +xpmParseDataAndCreate( + Display *display, + xpmData *data, + XImage **image_return, + XImage **shapeimage_return, + XpmImage *image, + XpmInfo *info, + XpmAttributes *attributes) { /* variables stored in the XpmAttributes structure */ Visual *visual; @@ -2080,12 +2072,12 @@ xpmParseDataAndCreate(display, data, image_return, shapeimage_return, xpmGetCmt(data, &hints_cmt); /* - * init the hastable + * init the hashtable */ if (USE_HASHTABLE) { ErrorStatus = xpmHashTableInit(&hashtable); if (ErrorStatus != XpmSuccess) - return (ErrorStatus); + RETURN(ErrorStatus); } /* @@ -2320,24 +2312,19 @@ error: static int ParseAndPutPixels( #ifdef FOR_MSW - dc, -#endif - data, width, height, ncolors, cpp, colorTable, hashtable, - image, image_pixels, shapeimage, shape_pixels) -#ifdef FOR_MSW - Display *dc; + Display *dc, #endif - xpmData *data; - unsigned int width; - unsigned int height; - unsigned int ncolors; - unsigned int cpp; - XpmColor *colorTable; - xpmHashTable *hashtable; - XImage *image; - Pixel *image_pixels; - XImage *shapeimage; - Pixel *shape_pixels; + xpmData *data, + unsigned int width, + unsigned int height, + unsigned int ncolors, + unsigned int cpp, + XpmColor *colorTable, + xpmHashTable *hashtable, + XImage *image, + Pixel *image_pixels, + XImage *shapeimage, + Pixel *shape_pixels) { unsigned int a, x, y; diff --git a/lib/libXpm/src/data.c b/lib/libXpm/src/data.c index d0b86ee92..94caa61bf 100644 --- a/lib/libXpm/src/data.c +++ b/lib/libXpm/src/data.c @@ -182,8 +182,7 @@ ParseComment(xpmData *data) * skip to the end of the current string and the beginning of the next one */ int -xpmNextString(data) - xpmData *data; +xpmNextString(xpmData *data) { if (!data->type) data->cptr = (data->stream.data)[++data->line]; @@ -238,10 +237,10 @@ xpmNextString(data) * skip whitespace and return the following word */ unsigned int -xpmNextWord(data, buf, buflen) - xpmData *data; - char *buf; - unsigned int buflen; +xpmNextWord( + xpmData *data, + char *buf, + unsigned int buflen) { register unsigned int n = 0; int c; @@ -275,9 +274,9 @@ xpmNextWord(data, buf, buflen) * returns 1 if one is found and 0 if not */ int -xpmNextUI(data, ui_return) - xpmData *data; - unsigned int *ui_return; +xpmNextUI( + xpmData *data, + unsigned int *ui_return) { char buf[BUFSIZ]; int l; @@ -290,10 +289,10 @@ xpmNextUI(data, ui_return) * return end of string - WARNING: malloc! */ int -xpmGetString(data, sptr, l) - xpmData *data; - char **sptr; - unsigned int *l; +xpmGetString( + xpmData *data, + char **sptr, + unsigned int *l) { unsigned int i, n = 0; int c; @@ -374,9 +373,9 @@ xpmGetString(data, sptr, l) * get the current comment line */ int -xpmGetCmt(data, cmt) - xpmData *data; - char **cmt; +xpmGetCmt( + xpmData *data, + char **cmt) { if (!data->type) *cmt = NULL; @@ -403,8 +402,7 @@ xpmDataType xpmDataTypes[] = * parse xpm header */ int -xpmParseHeader(data) - xpmData *data; +xpmParseHeader(xpmData *data) { char buf[BUFSIZ+1] = {0}; int l, n = 0; @@ -422,7 +420,7 @@ xpmParseHeader(data) if (!l) return (XpmFileInvalid); buf[l] = '\0'; - ptr = rindex(buf, '_'); + ptr = strrchr(buf, '_'); if (!ptr || strncmp("_format", ptr, l - (ptr - buf))) return XpmFileInvalid; /* this is definitely an XPM 1 file */ diff --git a/lib/libXpm/src/hashtab.c b/lib/libXpm/src/hashtab.c index d2383a4b1..49e6e4831 100644 --- a/lib/libXpm/src/hashtab.c +++ b/lib/libXpm/src/hashtab.c @@ -42,9 +42,9 @@ LFUNC(AtomMake, xpmHashAtom, (char *name, void *data)); LFUNC(HashTableGrows, int, (xpmHashTable * table)); static xpmHashAtom -AtomMake(name, data) /* makes an atom */ - char *name; /* WARNING: is just pointed to */ - void *data; +AtomMake( /* makes an atom */ + char *name, /* WARNING: is just pointed to */ + void *data) { xpmHashAtom object = (xpmHashAtom) XpmMalloc(sizeof(struct _xpmHashAtom)); @@ -107,9 +107,9 @@ AtomMake(name, data) /* makes an atom */ */ xpmHashAtom * -xpmHashSlot(table, s) - xpmHashTable *table; - char *s; +xpmHashSlot( + xpmHashTable *table, + char *s) { xpmHashAtom *atomTable = table->atomTable; unsigned int hash; @@ -134,8 +134,7 @@ xpmHashSlot(table, s) } static int -HashTableGrows(table) - xpmHashTable *table; +HashTableGrows(xpmHashTable *table) { xpmHashAtom *atomTable = table->atomTable; unsigned int size = table->size; @@ -171,10 +170,10 @@ HashTableGrows(table) */ int -xpmHashIntern(table, tag, data) - xpmHashTable *table; - char *tag; - void *data; +xpmHashIntern( + xpmHashTable *table, + char *tag, + void *data) { xpmHashAtom *slot; @@ -200,8 +199,7 @@ xpmHashIntern(table, tag, data) */ int -xpmHashTableInit(table) - xpmHashTable *table; +xpmHashTableInit(xpmHashTable *table) { xpmHashAtom *p; xpmHashAtom *atomTable; @@ -209,6 +207,7 @@ xpmHashTableInit(table) table->size = INITIAL_HASH_SIZE; table->limit = table->size / 3; table->used = 0; + table->atomTable = NULL; if (table->size >= UINT_MAX / sizeof(*atomTable)) return (XpmNoMemory); atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable)); @@ -225,8 +224,7 @@ xpmHashTableInit(table) */ void -xpmHashTableFree(table) - xpmHashTable *table; +xpmHashTableFree(xpmHashTable *table) { xpmHashAtom *p; xpmHashAtom *atomTable = table->atomTable; diff --git a/lib/libXpm/src/misc.c b/lib/libXpm/src/misc.c index d842e0e4b..e5bc0f6b6 100644 --- a/lib/libXpm/src/misc.c +++ b/lib/libXpm/src/misc.c @@ -43,8 +43,7 @@ * which does the trick */ char * -xpmstrdup(s1) - char *s1; +xpmstrdup(char *s1) { char *s2; size_t l = strlen(s1) + 1; @@ -57,10 +56,10 @@ xpmstrdup(s1) #endif unsigned int -xpmatoui(p, l, ui_return) - register char *p; - unsigned int l; - unsigned int *ui_return; +xpmatoui( + register char *p, + unsigned int l, + unsigned int *ui_return) { register unsigned int n, i; @@ -82,8 +81,7 @@ xpmatoui(p, l, ui_return) * Function returning a character string related to an error code. */ char * -XpmGetErrorString(errcode) - int errcode; +XpmGetErrorString(int errcode) { switch (errcode) { case XpmColorError: @@ -108,7 +106,7 @@ XpmGetErrorString(errcode) * newer or older than the one with which a program has been first compiled. */ int -XpmLibraryVersion() +XpmLibraryVersion(void) { return XpmIncludeVersion; } @@ -120,8 +118,7 @@ XpmLibraryVersion() #endif void -XpmFree(ptr) - void *ptr; +XpmFree(void *ptr) { free(ptr); } 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); } /* diff --git a/lib/libXpm/src/rgb.c b/lib/libXpm/src/rgb.c index 0a5af8b8f..848ae1f11 100644 --- a/lib/libXpm/src/rgb.c +++ b/lib/libXpm/src/rgb.c @@ -56,10 +56,9 @@ * number of entries stored. */ int -xpmReadRgbNames(rgb_fname, rgbn) - char *rgb_fname; - xpmRgbName rgbn[]; - +xpmReadRgbNames( + char *rgb_fname, + xpmRgbName rgbn[]) { FILE *rgbf; int n, items, red, green, blue; @@ -118,11 +117,12 @@ xpmReadRgbNames(rgb_fname, rgbn) * Return the color name corresponding to the given rgb values */ char * -xpmGetRgbName(rgbn, rgbn_max, red, green, blue) - xpmRgbName rgbn[]; /* rgb mnemonics from rgb text file */ - int rgbn_max; /* number of rgb mnemonics in table */ - int red, green, blue; /* rgb values */ - +xpmGetRgbName( + xpmRgbName rgbn[], /* rgb mnemonics from rgb text file */ + int rgbn_max, /* number of rgb mnemonics in table */ + int red, /* rgb values */ + int green, + int blue) { int i; xpmRgbName *rgb; @@ -144,10 +144,9 @@ xpmGetRgbName(rgbn, rgbn_max, red, green, blue) * Free the strings which have been malloc'ed in xpmReadRgbNames */ void -xpmFreeRgbNames(rgbn, rgbn_max) - xpmRgbName rgbn[]; - int rgbn_max; - +xpmFreeRgbNames( + xpmRgbName rgbn[], + int rgbn_max) { int i; xpmRgbName *rgb; @@ -162,9 +161,9 @@ xpmFreeRgbNames(rgbn, rgbn_max) #include "rgbtab.h" /* hard coded rgb.txt table */ int -xpmReadRgbNames(rgb_fname, rgbn) - char *rgb_fname; - xpmRgbName rgbn[]; +xpmReadRgbNames( + char *rgb_fname, + xpmRgbName rgbn[]) { /* * check for consistency??? @@ -178,11 +177,13 @@ xpmReadRgbNames(rgb_fname, rgbn) * which has something like #0303 for one color */ char * -xpmGetRgbName(rgbn, rgbn_max, red, green, blue) - xpmRgbName rgbn[]; /* rgb mnemonics from rgb text file - * not used */ - int rgbn_max; /* not used */ - int red, green, blue; /* rgb values */ +xpmGetRgbName( + xpmRgbName rgbn[], /* rgb mnemonics from rgb text file + * not used */ + int rgbn_max, /* not used */ + int red, /* rgb values */ + int green, + int blue) { int i; @@ -202,9 +203,11 @@ xpmGetRgbName(rgbn, rgbn_max, red, green, blue) /* used in XParseColor in simx.c */ int -xpmGetRGBfromName(inname, r, g, b) - char *inname; - int *r, *g, *b; +xpmGetRGBfromName( + char *inname, + int *r, + int *g, + int *b) { int left, right, middle; int cmp; @@ -274,10 +277,9 @@ xpmGetRGBfromName(inname, r, g, b) } void -xpmFreeRgbNames(rgbn, rgbn_max) - xpmRgbName rgbn[]; - int rgbn_max; - +xpmFreeRgbNames( + xpmRgbName rgbn[], + int rgbn_max) { /* nothing to do */ } diff --git a/lib/libXpm/src/scan.c b/lib/libXpm/src/scan.c index e8e4c276a..eab1c434c 100644 --- a/lib/libXpm/src/scan.c +++ b/lib/libXpm/src/scan.c @@ -122,10 +122,10 @@ LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, * if not large enough. */ static int -storePixel(pixel, pmap, index_return) - Pixel pixel; - PixelsMap *pmap; - unsigned int *index_return; +storePixel( + Pixel pixel, + PixelsMap *pmap, + unsigned int *index_return) { unsigned int i; Pixel *p; @@ -157,10 +157,10 @@ storePixel(pixel, pmap, index_return) } static int -storeMaskPixel(pixel, pmap, index_return) - Pixel pixel; - PixelsMap *pmap; - unsigned int *index_return; +storeMaskPixel( + Pixel pixel, + PixelsMap *pmap, + unsigned int *index_return) { if (!pixel) { if (!pmap->ncolors) { @@ -187,13 +187,12 @@ do { \ * the given XpmImage structure. */ int -XpmCreateXpmImageFromImage(display, image, shapeimage, - xpmimage, attributes) - Display *display; - XImage *image; - XImage *shapeimage; - XpmImage *xpmimage; - XpmAttributes *attributes; +XpmCreateXpmImageFromImage( + Display *display, + XImage *image, + XImage *shapeimage, + XpmImage *xpmimage, + XpmAttributes *attributes) { /* variables stored in the XpmAttributes structure */ unsigned int cpp; @@ -363,10 +362,10 @@ error: } static int -ScanTransparentColor(color, cpp, attributes) - XpmColor *color; - unsigned int cpp; - XpmAttributes *attributes; +ScanTransparentColor( + XpmColor *color, + unsigned int cpp, + XpmAttributes *attributes) { char *s; unsigned int a, b, c; @@ -419,14 +418,14 @@ ScanTransparentColor(color, cpp, attributes) } static int -ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes) - Display *display; - XpmColor *colors; - unsigned int ncolors; - Pixel *pixels; - unsigned int mask; - unsigned int cpp; - XpmAttributes *attributes; +ScanOtherColors( + Display *display, + XpmColor *colors, + unsigned int ncolors, + Pixel *pixels, + unsigned int mask, + unsigned int cpp, + XpmAttributes *attributes) { /* variables stored in the XpmAttributes structure */ Colormap colormap; @@ -614,11 +613,11 @@ static unsigned long Const low_bits_table[] = { */ static int -GetImagePixels(image, width, height, pmap) - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; +GetImagePixels( + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap) { char *src; char *dst; @@ -720,11 +719,11 @@ static unsigned long byteorderpixel = MSBFirst << 24; #endif static int -GetImagePixels32(image, width, height, pmap) - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; +GetImagePixels32( + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap) { unsigned char *addr; unsigned char *data; @@ -785,11 +784,11 @@ GetImagePixels32(image, width, height, pmap) */ static int -GetImagePixels16(image, width, height, pmap) - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; +GetImagePixels16( + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap) { unsigned char *addr; unsigned char *data; @@ -831,11 +830,11 @@ GetImagePixels16(image, width, height, pmap) */ static int -GetImagePixels8(image, width, height, pmap) - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; +GetImagePixels8( + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap) { unsigned int *iptr; unsigned char *data; @@ -864,12 +863,12 @@ GetImagePixels8(image, width, height, pmap) */ static int -GetImagePixels1(image, width, height, pmap, storeFunc) - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; - storeFuncPtr storeFunc; +GetImagePixels1( + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap, + storeFuncPtr storeFunc) { unsigned int *iptr; unsigned int x, y; @@ -920,7 +919,7 @@ AGetImagePixels ( unsigned int width, unsigned int height, PixelsMap *pmap, - int (*storeFunc) ()) + int (*storeFunc) (Pixel, PixelsMap *, unsigned int *)) { unsigned int *iptr; unsigned int x, y; @@ -954,13 +953,13 @@ AGetImagePixels ( # endif/* AMIGA */ #else /* ndef FOR_MSW */ static int -MSWGetImagePixels(display, image, width, height, pmap, storeFunc) - Display *display; - XImage *image; - unsigned int width; - unsigned int height; - PixelsMap *pmap; - int (*storeFunc) (); +MSWGetImagePixels( + Display *display, + XImage *image, + unsigned int width, + unsigned int height, + PixelsMap *pmap, + int (*storeFunc) (Pixel, PixelsMap*, unsigned int *)) { unsigned int *iptr; unsigned int x, y; @@ -984,13 +983,12 @@ MSWGetImagePixels(display, image, width, height, pmap, storeFunc) #ifndef FOR_MSW # ifndef AMIGA int -XpmCreateXpmImageFromPixmap(display, pixmap, shapemask, - xpmimage, attributes) - Display *display; - Pixmap pixmap; - Pixmap shapemask; - XpmImage *xpmimage; - XpmAttributes *attributes; +XpmCreateXpmImageFromPixmap( + Display *display, + Pixmap pixmap, + Pixmap shapemask, + XpmImage *xpmimage, + XpmAttributes *attributes) { XImage *ximage = NULL; XImage *shapeimage = NULL; |