diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-06-26 10:42:55 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-06-26 10:42:55 (GMT) |
commit | e8c84a297a502e5e9e366fe2dcaef0d81e66e6c2 (patch) | |
tree | ac554b431af249ec4cbc915bbb11d923694286a6 | |
parent | 246f4bdf0e2faf107137e3c9596be285a0daebea (diff) | |
download | tk-e8c84a297a502e5e9e366fe2dcaef0d81e66e6c2.zip tk-e8c84a297a502e5e9e366fe2dcaef0d81e66e6c2.tar.gz tk-e8c84a297a502e5e9e366fe2dcaef0d81e66e6c2.tar.bz2 |
Make C++ compiler more happy (for Travis build)
-rw-r--r-- | generic/tkImgGIF.c | 33 | ||||
-rw-r--r-- | generic/tkImgPNG.c | 50 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 12 |
3 files changed, 34 insertions, 61 deletions
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 7dc78d8..93a891e 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -356,20 +356,17 @@ static void FlushChar(GIFState_t *statePtr); static int FileMatchGIF( - Tcl_Interp *dummy, /* not used */ + TCL_UNUSED(Tcl_Interp *), /* not used */ Tcl_Channel chan, /* The image file, open for reading. */ - const char *fileName, /* The name of the image file. */ - Tcl_Obj *format, /* User-specified format object, or NULL. */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(const char *), /* The name of the image file. */ + TCL_UNUSED(Tcl_Obj *), /* User-specified format object, or NULL. */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ int *widthPtr, int *heightPtr, /* The dimensions of the image are returned * here if the file is a valid raw GIF file. */ - Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ + TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { GIFImageConfig gifConf; - (void)fileName; - (void)format; - (void)dummy; memset(&gifConf, 0, sizeof(GIFImageConfig)); return ReadGIFHeader(&gifConf, chan, widthPtr, heightPtr); @@ -400,7 +397,7 @@ FileReadGIF( Tcl_Channel chan, /* The image file, open for reading. */ const char *fileName, /* The name of the image file. */ Tcl_Obj *format, /* User-specified format object, or NULL. */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ @@ -417,7 +414,6 @@ FileReadGIF( unsigned char buf[100]; unsigned char *trashBuffer = NULL; int bitPixel; - int dictSize = 0; int gifLabel; unsigned char colorMap[MAXCOLORMAPSIZE][4]; int transparent = -1; @@ -846,19 +842,17 @@ ReadOneByte( static int StringMatchGIF( - Tcl_Interp *dummy, /* not used */ + TCL_UNUSED(Tcl_Interp *), /* not used */ Tcl_Obj *dataObj, /* the object containing the image data */ - Tcl_Obj *format, /* the image format object, or NULL */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj *), /* the image format object, or NULL */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ int *widthPtr, /* where to put the string width */ int *heightPtr, /* where to put the string height */ - Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ + TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { unsigned char *data, header[10]; TkSizeT got, length; MFile handle; - (void)format; - (void)dummy; data = TkGetByteArrayFromObj(dataObj, &length); @@ -1187,7 +1181,7 @@ ReadImage( Tcl_Channel chan, int len, int rows, unsigned char cmap[MAXCOLORMAPSIZE][4], - int srcX, int srcY, + TCL_UNUSED(int), TCL_UNUSED(int), int interlace, int transparent) { @@ -1202,8 +1196,6 @@ ReadImage( unsigned char *top; int codeSize, clearCode, inCode, endCode, oldCode, maxCode; int code, firstCode, v; - (void)srcX; - (void)srcY; /* * Initialize the decoder @@ -1867,7 +1859,7 @@ CommonWriteGIF( Tcl_Interp *interp, ClientData handle, WriteBytesFunc *writeProc, - Tcl_Obj *format, + TCL_UNUSED(Tcl_Obj *), Tcl_Obj *metadataInObj, Tk_PhotoImageBlock *blockPtr) { @@ -1876,7 +1868,6 @@ CommonWriteGIF( long width, height, x; unsigned char c; unsigned int top, left; - (void)format; top = 0; left = 0; diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 1ead8c0..1476de4 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -1717,7 +1717,7 @@ ReadPHYS( if (ReadInt32(interp, pngPtr, &PPUy, &crc) == TCL_ERROR) { return TCL_ERROR; } - if (ReadData(interp, pngPtr, &unitSpecifier, 1, &crc) == TCL_ERROR) { + if (ReadData(interp, pngPtr, (unsigned char *)&unitSpecifier, 1, &crc) == TCL_ERROR) { return TCL_ERROR; } @@ -2817,18 +2817,16 @@ static int FileMatchPNG( Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ Tcl_Channel chan, /* The image file, open for reading. */ - const char *fileName, /* The name of the image file. */ - Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(const char *), /* The name of the image file. */ + TCL_UNUSED(Tcl_Obj *), /* User-specified format object, or NULL. */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ int *widthPtr, int *heightPtr, /* The dimensions of the image are returned * here if the file is a valid raw GIF file. */ - Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ + TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { PNGImage png; int match = 0; - (void)fileName; - (void)fmtObj; InitPNGImage(NULL, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE); @@ -2866,25 +2864,20 @@ static int FileReadPNG( Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ Tcl_Channel chan, /* The image file, open for reading. */ - const char *fileName, /* The name of the image file. */ + TCL_UNUSED(const char *), /* The name of the image file. */ Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ - int width, int height, /* Dimensions of block of photo image to be + TCL_UNUSED(int), TCL_UNUSED(int), /* Dimensions of block of photo image to be * written to. */ - int srcX, int srcY, /* Coordinates of top-left pixel to be used in + TCL_UNUSED(int), TCL_UNUSED(int), /* Coordinates of top-left pixel to be used in * image being read. */ Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; int result = TCL_ERROR; - (void)fileName; - (void)width; - (void)height; - (void)srcX; - (void)srcY; result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE); @@ -2930,15 +2923,14 @@ static int StringMatchPNG( Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ Tcl_Obj *pObjData, /* the object containing the image data */ - Tcl_Obj *fmtObj, /* the image format object, or NULL */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj *), /* the image format object, or NULL */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ int *widthPtr, /* where to put the string width */ int *heightPtr, /* where to put the string height */ - Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ + TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { PNGImage png; int match = 0; - (void)fmtObj; InitPNGImage(NULL, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE); @@ -2977,19 +2969,15 @@ StringReadPNG( Tcl_Interp *interp, /* interpreter for reporting errors in */ Tcl_Obj *pObjData, /* object containing the image */ Tcl_Obj *fmtObj, /* format object, or NULL */ - Tcl_Obj *metadataInObj, /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* the image to write this data into */ int destX, int destY, /* The rectangular region of the */ - int width, int height, /* image to copy */ - int srcX, int srcY, + TCL_UNUSED(int), TCL_UNUSED(int), /* image to copy */ + TCL_UNUSED(int), TCL_UNUSED(int), Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; int result = TCL_ERROR; - (void)width; - (void)height; - (void)srcX; - (void)srcY; result = InitPNGImage(interp, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE); @@ -3532,7 +3520,7 @@ WriteExtraChunks( Tcl_Obj *aspectObj, *DPIObj; double aspectValue=-1, DPIValue=-1; - unsigned long PPUx, PPUy; + unsigned long PPUx = 65536, PPUy = 65536; char unitSpecifier; if (TCL_ERROR == Tcl_DictObjGet(interp, metadataInObj, @@ -3741,14 +3729,13 @@ static int FileWritePNG( Tcl_Interp *interp, const char *filename, - Tcl_Obj *fmtObj, + TCL_UNUSED(Tcl_Obj *), Tcl_Obj *metadataInObj, Tk_PhotoImageBlock *blockPtr) { Tcl_Channel chan; PNGImage png; int result = TCL_ERROR; - (void)fmtObj; /* * Open a Tcl file channel where the image data will be stored. Tk ought @@ -3813,14 +3800,13 @@ FileWritePNG( static int StringWritePNG( Tcl_Interp *interp, - Tcl_Obj *fmtObj, + TCL_UNUSED(Tcl_Obj *), Tcl_Obj *metadataInObj, Tk_PhotoImageBlock *blockPtr) { Tcl_Obj *resultObj = Tcl_NewObj(); PNGImage png; int result = TCL_ERROR; - (void)fmtObj; /* * Initalize PNGImage instance for encoding. diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 92e4670..91b7ec1 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -234,13 +234,12 @@ static const char * GetExtension(const char *path); static void PhotoFormatThreadExitProc( - ClientData dummy) /* not used */ + TCL_UNUSED(void *)) /* not used */ { Tk_PhotoImageFormat *freePtr; Tk_PhotoImageFormatVersion3 *freePtrVersion3; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void)dummy; #if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 while (tsdPtr->oldFormatList != NULL) { @@ -390,14 +389,13 @@ ImgPhotoCreate( int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects for options (doesn't * include image name or type). */ - const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */ + TCL_UNUSED(const Tk_ImageType *),/* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later * callbacks. */ ClientData *clientDataPtr) /* Store manager's token for image here; it * will be returned in later callbacks. */ { PhotoMaster *masterPtr; - (void)typePtr; /* * Allocate and initialize the photo image master record. @@ -4489,15 +4487,13 @@ static int ImgPhotoPostscript( ClientData clientData, /* Handle for the photo image. */ Tcl_Interp *interp, /* Interpreter. */ - Tk_Window tkwin, /* (unused) */ + TCL_UNUSED(Tk_Window), /* (unused) */ Tk_PostscriptInfo psInfo, /* Postscript info. */ int x, int y, /* First pixel to output. */ int width, int height, /* Width and height of area. */ - int prepass) /* (unused) */ + TCL_UNUSED(int)) /* (unused) */ { Tk_PhotoImageBlock block; - (void)tkwin; - (void)prepass; Tk_PhotoGetImage(clientData, &block); block.pixelPtr += y * block.pitch + x * block.pixelSize; |