diff options
-rw-r--r-- | generic/tk3d.c | 21 | ||||
-rw-r--r-- | generic/tkArgv.c | 12 | ||||
-rw-r--r-- | generic/tkAtom.c | 6 | ||||
-rw-r--r-- | generic/tkBind.c | 10 | ||||
-rw-r--r-- | generic/tkConsole.c | 52 | ||||
-rw-r--r-- | generic/tkStubLib.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkStubLib.c | 4 | ||||
-rwxr-xr-x | unix/configure | 10 | ||||
-rw-r--r-- | unix/tkUnixMenubu.c | 7 | ||||
-rw-r--r-- | unix/tkUnixScale.c | 6 | ||||
-rwxr-xr-x | win/configure | 19 | ||||
-rw-r--r-- | win/tkWin32Dll.c | 1 | ||||
-rw-r--r-- | win/tkWin3d.c | 2 | ||||
-rw-r--r-- | win/tkWinButton.c | 7 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 16 | ||||
-rw-r--r-- | win/tkWinColor.c | 26 | ||||
-rw-r--r-- | win/tkWinCursor.c | 15 | ||||
-rw-r--r-- | win/tkWinDialog.c | 19 | ||||
-rw-r--r-- | xlib/xcolors.c | 3 | ||||
-rw-r--r-- | xlib/xgc.c | 158 | ||||
-rw-r--r-- | xlib/xutil.c | 4 |
21 files changed, 316 insertions, 86 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c index 9ed419a..faa12b7 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -90,7 +90,7 @@ Tk_Alloc3DBorderFromObj( if (objPtr->typePtr != &tkBorderObjType) { InitBorderObj(objPtr); } - borderPtr = objPtr->internalRep.twoPtrValue.ptr1; + borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1; /* * If the object currently points to a TkBorder, see if it's the one we @@ -127,7 +127,7 @@ Tk_Alloc3DBorderFromObj( */ if (borderPtr != NULL) { - TkBorder *firstBorderPtr = Tcl_GetHashValue(borderPtr->hashPtr); + TkBorder *firstBorderPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr); FreeBorderObj(objPtr); for (borderPtr = firstBorderPtr ; borderPtr != NULL; @@ -200,7 +200,7 @@ Tk_Get3DBorder( hashPtr = Tcl_CreateHashEntry(&dispPtr->borderTable, colorName, &isNew); if (!isNew) { - existingBorderPtr = Tcl_GetHashValue(hashPtr); + existingBorderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr); for (borderPtr = existingBorderPtr; borderPtr != NULL; borderPtr = borderPtr->nextPtr) { if ((Tk_Screen(tkwin) == borderPtr->screen) @@ -420,12 +420,11 @@ Tk_Free3DBorder( Display *display = DisplayOfScreen(borderPtr->screen); TkBorder *prevPtr; - borderPtr->resourceRefCount--; - if (borderPtr->resourceRefCount > 0) { + if (borderPtr->resourceRefCount-- > 1) { return; } - prevPtr = Tcl_GetHashValue(borderPtr->hashPtr); + prevPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr); TkpFreeBorder(borderPtr); if (borderPtr->bgColorPtr != NULL) { Tk_FreeColor(borderPtr->bgColorPtr); @@ -527,7 +526,7 @@ static void FreeBorderObj( Tcl_Obj *objPtr) /* The object we are releasing. */ { - TkBorder *borderPtr = objPtr->internalRep.twoPtrValue.ptr1; + TkBorder *borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1; if (borderPtr != NULL) { borderPtr->objRefCount--; @@ -562,7 +561,7 @@ DupBorderObjProc( Tcl_Obj *srcObjPtr, /* The object we are copying from. */ Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { - TkBorder *borderPtr = srcObjPtr->internalRep.twoPtrValue.ptr1; + TkBorder *borderPtr = (TkBorder *)srcObjPtr->internalRep.twoPtrValue.ptr1; dupObjPtr->typePtr = srcObjPtr->typePtr; dupObjPtr->internalRep.twoPtrValue.ptr1 = borderPtr; @@ -1253,7 +1252,7 @@ Tk_Get3DBorderFromObj( * cached in the internal representation of the Tcl_Obj. Check it out... */ - borderPtr = objPtr->internalRep.twoPtrValue.ptr1; + borderPtr = (TkBorder *)objPtr->internalRep.twoPtrValue.ptr1; if ((borderPtr != NULL) && (borderPtr->resourceRefCount > 0) && (Tk_Screen(tkwin) == borderPtr->screen) @@ -1281,7 +1280,7 @@ Tk_Get3DBorderFromObj( if (hashPtr == NULL) { goto error; } - for (borderPtr = Tcl_GetHashValue(hashPtr); borderPtr != NULL; + for (borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr); borderPtr != NULL; borderPtr = borderPtr->nextPtr) { if ((Tk_Screen(tkwin) == borderPtr->screen) && (Tk_Colormap(tkwin) == borderPtr->colormap)) { @@ -1371,7 +1370,7 @@ TkDebugBorder( resultPtr = Tcl_NewObj(); hashPtr = Tcl_FindHashEntry(&dispPtr->borderTable, name); if (hashPtr != NULL) { - TkBorder *borderPtr = Tcl_GetHashValue(hashPtr); + TkBorder *borderPtr = (TkBorder *)Tcl_GetHashValue(hashPtr); if (borderPtr == NULL) { Tcl_Panic("TkDebugBorder found empty hash table entry"); diff --git a/generic/tkArgv.c b/generic/tkArgv.c index ca5ecc0..807a145 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -228,9 +228,9 @@ Tk_ParseArgv( break; case TK_ARGV_FUNC: { typedef int (ArgvFunc)(char *, const char *, const char *); - ArgvFunc *handlerProc = infoPtr->src; + ArgvFunc *handlerProc = (ArgvFunc *)infoPtr->src; - if (handlerProc(infoPtr->dst, infoPtr->key, argv[srcIndex])) { + if (handlerProc((char *)infoPtr->dst, infoPtr->key, argv[srcIndex])) { srcIndex++; argc--; } @@ -239,9 +239,9 @@ Tk_ParseArgv( case TK_ARGV_GENFUNC: { typedef int (ArgvGenFunc)(char *, Tcl_Interp *, const char *, int, const char **); - ArgvGenFunc *handlerProc = infoPtr->src; + ArgvGenFunc *handlerProc = (ArgvGenFunc *)infoPtr->src; - argc = handlerProc(infoPtr->dst, interp, infoPtr->key, argc, + argc = handlerProc((char *)infoPtr->dst, interp, infoPtr->key, argc, argv+srcIndex); if (argc < 0) { return TCL_ERROR; @@ -253,14 +253,14 @@ Tk_ParseArgv( Tcl_SetErrorCode(interp, "TK", "ARG", "HELP", NULL); return TCL_ERROR; case TK_ARGV_CONST_OPTION: - Tk_AddOption(tkwin, infoPtr->dst, infoPtr->src, + Tk_AddOption(tkwin, (char *)infoPtr->dst, (char *)infoPtr->src, TK_INTERACTIVE_PRIO); break; case TK_ARGV_OPTION_VALUE: if (argc < 1) { goto missingArg; } - Tk_AddOption(tkwin, infoPtr->dst, argv[srcIndex], + Tk_AddOption(tkwin, (char *)infoPtr->dst, argv[srcIndex], TK_INTERACTIVE_PRIO); srcIndex++; argc--; diff --git a/generic/tkAtom.c b/generic/tkAtom.c index ddfa97f..a4e1e11 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -154,11 +154,11 @@ Tk_GetAtomName( if (mustFree) { XFree(mustFree); } - name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr); + name = (const char *)Tcl_GetHashKey(&dispPtr->nameTable, hPtr); hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew); Tcl_SetHashValue(hPtr, (char *)name); } - return Tcl_GetHashValue(hPtr); + return (const char *)Tcl_GetHashValue(hPtr); } /* @@ -200,7 +200,7 @@ AtomInit( name = atomNameArray[atom - 1]; hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew); Tcl_SetHashValue(hPtr, INT2PTR(atom)); - name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr); + name = (const char *)Tcl_GetHashKey(&dispPtr->nameTable, hPtr); hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew); Tcl_SetHashValue(hPtr, (char *)name); } diff --git a/generic/tkBind.c b/generic/tkBind.c index ed81584..371482e 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -4681,7 +4681,7 @@ FindSequence( unsigned sequenceSize = numPats*sizeof(TkPattern); PatSeq *psPtr2; - for (psPtr2 = Tcl_GetHashValue(hPtr); psPtr2; psPtr2 = psPtr2->nextSeqPtr) { + for (psPtr2 = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr2; psPtr2 = psPtr2->nextSeqPtr) { assert(TEST_PSENTRY(psPtr2)); if (numPats == psPtr2->numPats && memcmp(patPtr, psPtr2->pats, sequenceSize) == 0) { ckfree(psPtr); @@ -4717,7 +4717,7 @@ FindSequence( psPtr->added = 0; psPtr->modMaskUsed = (modMask != 0); psPtr->script = NULL; - psPtr->nextSeqPtr = Tcl_GetHashValue(hPtr); + psPtr->nextSeqPtr = (PatSeq *)Tcl_GetHashValue(hPtr); psPtr->hPtr = hPtr; psPtr->ptr.nextObj = NULL; assert(psPtr->ptr.owners == NULL); @@ -4859,7 +4859,7 @@ ParseEventDescription( size = p - field; if (size >= sizeof(buf)) { - bufPtr = ckalloc(size + 1); + bufPtr = (char *)ckalloc(size + 1); } strncpy(bufPtr, field, size); bufPtr[size] = '\0'; @@ -4891,7 +4891,7 @@ ParseEventDescription( if (!(hPtr = Tcl_FindHashEntry(&modTable, field))) { break; } - modPtr = Tcl_GetHashValue(hPtr); + modPtr = (ModInfo *)Tcl_GetHashValue(hPtr); patPtr->modMask |= modPtr->mask; if (modPtr->flags & MULT_CLICKS) { unsigned i = modPtr->flags & MULT_CLICKS; @@ -4906,7 +4906,7 @@ ParseEventDescription( eventFlags = 0; if ((hPtr = Tcl_FindHashEntry(&eventTable, field))) { - const EventInfo *eiPtr = Tcl_GetHashValue(hPtr); + const EventInfo *eiPtr = (const EventInfo *)Tcl_GetHashValue(hPtr); patPtr->eventType = eiPtr->type; eventFlags = flagArray[eiPtr->type]; diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 7a74344..c1d4c42 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -227,7 +227,7 @@ Tk_InitConsoleChannels( return; } - consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int)); + consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int)); if (*consoleInitPtr) { /* * We've already initialized console channels in this thread. @@ -255,13 +255,13 @@ Tk_InitConsoleChannels( * interp for it to live in. */ - info = ckalloc(sizeof(ConsoleInfo)); + info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo)); info->consoleInterp = NULL; info->interp = NULL; info->refCount = 0; if (doIn) { - ChannelData *data = ckalloc(sizeof(ChannelData)); + ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData)); data->info = info; data->info->refCount++; @@ -278,7 +278,7 @@ Tk_InitConsoleChannels( } if (doOut) { - ChannelData *data = ckalloc(sizeof(ChannelData)); + ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData)); data->info = info; data->info->refCount++; @@ -295,7 +295,7 @@ Tk_InitConsoleChannels( } if (doErr) { - ChannelData *data = ckalloc(sizeof(ChannelData)); + ChannelData *data = (ChannelData *)ckalloc(sizeof(ChannelData)); data->info = info; data->info->refCount++; @@ -377,7 +377,7 @@ Tk_CreateConsoleWindow( * New ConsoleInfo for a new console window. */ - info = ckalloc(sizeof(ConsoleInfo)); + info = (ConsoleInfo *)ckalloc(sizeof(ConsoleInfo)); info->refCount = 0; /* @@ -407,7 +407,7 @@ Tk_CreateConsoleWindow( } } } else { - info = ckalloc(sizeof(ConsoleInfo)); + info = (ConsoleInfo *)ckalloc(sizeof(ConsoleInfo)); info->refCount = 0; } @@ -497,7 +497,7 @@ ConsoleOutput( int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { - ChannelData *data = instanceData; + ChannelData *data = (ChannelData *)instanceData; ConsoleInfo *info = data->info; *errorCode = 0; @@ -561,12 +561,17 @@ ConsoleOutput( /* ARGSUSED */ static int ConsoleInput( - ClientData instanceData, /* Unused. */ + void *dummy, /* Unused. */ char *buf, /* Where to store data read. */ int bufSize, /* How much space is available in the * buffer? */ int *errorCode) /* Where to store error code. */ { + (void)dummy; + (void)buf; + (void)bufSize; + (void)errorCode; + return 0; /* Always return EOF. */ } @@ -589,11 +594,12 @@ ConsoleInput( /* ARGSUSED */ static int ConsoleClose( - ClientData instanceData, /* Unused. */ - Tcl_Interp *interp) /* Unused. */ + ClientData instanceData, + Tcl_Interp *dummy) /* Unused. */ { - ChannelData *data = instanceData; + ChannelData *data = (ChannelData *)instanceData; ConsoleInfo *info = data->info; + (void)dummy; if (info) { if (info->refCount-- <= 1) { @@ -629,11 +635,13 @@ ConsoleClose( /* ARGSUSED */ static void ConsoleWatch( - ClientData instanceData, /* Device ID for the channel. */ + ClientData dummy, /* Device ID for the channel. */ int mask) /* OR-ed combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION, for the * events we are interested in. */ { + (void)dummy; + (void)mask; } /* @@ -656,12 +664,16 @@ ConsoleWatch( /* ARGSUSED */ static int ConsoleHandle( - ClientData instanceData, /* Device ID for the channel. */ + ClientData dummy, /* Device ID for the channel. */ int direction, /* TCL_READABLE or TCL_WRITABLE to indicate * which direction of the channel is being * requested. */ ClientData *handlePtr) /* Where to store handle */ { + (void)dummy; + (void)direction; + (void)handlePtr; + return TCL_ERROR; } @@ -694,7 +706,7 @@ ConsoleObjCmd( "eval", "hide", "show", "title", NULL}; enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE}; Tcl_Obj *cmd = NULL; - ConsoleInfo *info = clientData; + ConsoleInfo *info = (ConsoleInfo *)clientData; Tcl_Interp *consoleInterp = info->consoleInterp; if (objc < 2) { @@ -784,7 +796,7 @@ InterpreterObjCmd( int index, result = TCL_OK; static const char *const options[] = {"eval", "record", NULL}; enum option {OTHER_EVAL, OTHER_RECORD}; - ConsoleInfo *info = clientData; + ConsoleInfo *info = (ConsoleInfo *)clientData; Tcl_Interp *otherInterp = info->interp; if (objc < 2) { @@ -852,7 +864,7 @@ static void DeleteConsoleInterp( ClientData clientData) { - Tcl_Interp *interp = clientData; + Tcl_Interp *interp = (Tcl_Interp *)clientData; Tcl_DeleteInterp(interp); } @@ -879,7 +891,7 @@ InterpDeleteProc( ClientData clientData, Tcl_Interp *interp) { - ConsoleInfo *info = clientData; + ConsoleInfo *info = (ConsoleInfo *)clientData; if (info->consoleInterp == interp) { Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, info->consoleInterp); @@ -911,7 +923,7 @@ static void ConsoleDeleteProc( ClientData clientData) { - ConsoleInfo *info = clientData; + ConsoleInfo *info = (ConsoleInfo *)clientData; if (info->consoleInterp) { Tcl_DeleteInterp(info->consoleInterp); @@ -946,7 +958,7 @@ ConsoleEventProc( XEvent *eventPtr) { if (eventPtr->type == DestroyNotify) { - ConsoleInfo *info = clientData; + ConsoleInfo *info = (ConsoleInfo *)clientData; Tcl_Interp *consoleInterp = info->consoleInterp; if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index ea48894..aed0b80 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -77,10 +77,10 @@ Tk_InitStubs( { const char *packageName = "Tk"; const char *errMsg = NULL; - ClientData clientData = NULL; + void *clientData = NULL; const char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp, packageName, version, 0, &clientData); - const TkStubs *stubsPtr = clientData; + const TkStubs *stubsPtr = (const TkStubs *)clientData; if (actualVersion == NULL) { return NULL; diff --git a/generic/ttk/ttkStubLib.c b/generic/ttk/ttkStubLib.c index c17f1e9..5675416 100644 --- a/generic/ttk/ttkStubLib.c +++ b/generic/ttk/ttkStubLib.c @@ -36,10 +36,10 @@ TtkInitializeStubs( int exact = 0; const char *packageName = "Ttk"; const char *errMsg = NULL; - ClientData pkgClientData = NULL; + void *pkgClientData = NULL; const char *actualVersion = Tcl_PkgRequireEx( interp, packageName, version, exact, &pkgClientData); - const TtkStubs *stubsPtr = pkgClientData; + const TtkStubs *stubsPtr = (const TtkStubs *)pkgClientData; if (!actualVersion) { return NULL; diff --git a/unix/configure b/unix/configure index 8628eec..571b9ec 100755 --- a/unix/configure +++ b/unix/configure @@ -4249,7 +4249,12 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith" + case "${CC}" in + *++) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wunused-parameter" + ;; + esac else @@ -6196,6 +6201,9 @@ fi if test "${tcl_cv_type_64bit}" = none ; then +$as_echo "#define MP_32BIT 1" >>confdefs.h + + $as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index eb0af47..407dc30 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -34,7 +34,9 @@ TkMenuButton * TkpCreateMenuButton( Tk_Window tkwin) { - return ckalloc(sizeof(TkMenuButton)); + (void)tkwin; + + return (TkMenuButton *)ckalloc(sizeof(TkMenuButton)); } /* @@ -58,7 +60,7 @@ void TkpDisplayMenuButton( ClientData clientData) /* Information about widget. */ { - TkMenuButton *mbPtr = clientData; + TkMenuButton *mbPtr = (TkMenuButton *)clientData; GC gc; Tk_3DBorder border; Pixmap pixmap; @@ -321,6 +323,7 @@ void TkpDestroyMenuButton( TkMenuButton *mbPtr) { + (void)mbPtr; } /* diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index ca5183d..b090c4f 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -52,7 +52,9 @@ TkScale * TkpCreateScale( Tk_Window tkwin) { - return ckalloc(sizeof(TkScale)); + (void)tkwin; + + return (TkScale *)ckalloc(sizeof(TkScale)); } /* @@ -546,7 +548,7 @@ void TkpDisplayScale( ClientData clientData) /* Widget record for scale. */ { - TkScale *scalePtr = clientData; + TkScale *scalePtr = (TkScale *)clientData; Tk_Window tkwin = scalePtr->tkwin; Tcl_Interp *interp = scalePtr->interp; Pixmap pixmap; diff --git a/win/configure b/win/configure index 33e23ac..95a550c 100755 --- a/win/configure +++ b/win/configure @@ -4026,14 +4026,14 @@ $as_echo "$ac_cv_cross" >&6; } if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) - CC="x86_64-w64-mingw32-gcc" + CC="x86_64-w64-mingw32-${CC}" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; *) - CC="i686-w64-mingw32-gcc" + CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" @@ -4267,10 +4267,19 @@ $as_echo "using shared flags" >&6; } CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= + case "${CC}" in + *++) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format -Wunused-parameter" + ;; + *) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement" + ;; + esac + # Specify the CC output file names based on the target name CC_OBJNAME="-o \$@" CC_EXENAME="-o \$@" @@ -4639,6 +4648,10 @@ $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi fi + +$as_echo "#define MP_32BIT 1" >>confdefs.h + + # DL_LIBS is empty, but then we match the Unix version diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c index 88b0507..49ffd83 100644 --- a/win/tkWin32Dll.c +++ b/win/tkWin32Dll.c @@ -104,6 +104,7 @@ DllMain( #ifdef HAVE_NO_SEH TCLEXCEPTION_REGISTRATION registration; #endif + (void)reserved; /* * If we are attaching to the DLL from a new process, tell Tk about the diff --git a/win/tkWin3d.c b/win/tkWin3d.c index 9f7ca22..3684400 100644 --- a/win/tkWin3d.c +++ b/win/tkWin3d.c @@ -43,7 +43,7 @@ typedef struct { TkBorder * TkpGetBorder(void) { - WinBorder *borderPtr = ckalloc(sizeof(WinBorder)); + WinBorder *borderPtr = (WinBorder *)ckalloc(sizeof(WinBorder)); borderPtr->light2ColorPtr = NULL; borderPtr->dark2ColorPtr = NULL; diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 3ba3be5..0dca943 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -149,7 +149,7 @@ InitBoxes(void) size = tsdPtr->boxesPtr->biSize + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount) + tsdPtr->boxesPtr->biSizeImage; - newBitmap = ckalloc(size); + newBitmap = (LPBITMAPINFOHEADER)ckalloc(size); memcpy(newBitmap, tsdPtr->boxesPtr, size); tsdPtr->boxesPtr = newBitmap; tsdPtr->boxWidth = tsdPtr->boxesPtr->biWidth / 4; @@ -211,8 +211,9 @@ TkpCreateButton( Tk_Window tkwin) { WinButton *butPtr; + (void)tkwin; - butPtr = ckalloc(sizeof(WinButton)); + butPtr = (WinButton *)ckalloc(sizeof(WinButton)); butPtr->hwnd = NULL; return (TkButton *) butPtr; } @@ -316,7 +317,7 @@ TkpDisplayButton( { TkWinDCState state; HDC dc; - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; GC gc; Tk_3DBorder border; Pixmap pixmap; diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 06eebbd..2b009af 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -78,7 +78,7 @@ TkSelGetSelection( CloseClipboard(); goto error; } - data = GlobalLock(handle); + data = (char *)GlobalLock(handle); Tcl_DStringInit(&ds); Tcl_WCharToUtfDString((WCHAR *)data, wcslen((WCHAR *)data), &ds); GlobalUnlock(handle); @@ -101,7 +101,7 @@ TkSelGetSelection( Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "cp######", -1); - data = GlobalLock(handle); + data = (char *)GlobalLock(handle); /* * Even though the documentation claims that GetLocaleInfo expects @@ -131,7 +131,7 @@ TkSelGetSelection( CloseClipboard(); goto error; } - data = GlobalLock(handle); + data = (char *)GlobalLock(handle); Tcl_ExternalToUtfDString(encoding, data, -1, &ds); GlobalUnlock(handle); if (encoding) { @@ -234,6 +234,8 @@ XSetSelectionOwner( { HWND hwnd = owner ? TkWinGetHWND(owner) : NULL; Tk_Window tkwin; + (void)display; + (void)time; /* * This is a gross hack because the Tk_InternAtom interface is broken. It @@ -283,6 +285,7 @@ TkWinClipboardRender( char *buffer, *p, *rawText, *endPtr; int length; Tcl_DString ds; + (void)format; for (targetPtr = dispPtr->clipTargetPtr; targetPtr != NULL; targetPtr = targetPtr->nextPtr) { @@ -314,7 +317,7 @@ TkWinClipboardRender( * Copy the data and change EOL characters. */ - buffer = rawText = ckalloc(length + 1); + buffer = rawText = (char *)ckalloc(length + 1); if (targetPtr != NULL) { for (cbPtr = targetPtr->firstBufferPtr; cbPtr != NULL; cbPtr = cbPtr->nextPtr) { @@ -338,7 +341,7 @@ TkWinClipboardRender( Tcl_DStringFree(&ds); return; } - buffer = GlobalLock(handle); + buffer = (char *)GlobalLock(handle); memcpy(buffer, Tcl_DStringValue(&ds), (unsigned) Tcl_DStringLength(&ds) + 2); GlobalUnlock(handle); @@ -369,6 +372,8 @@ TkSelUpdateClipboard( TkClipboardTarget *targetPtr) { HWND hwnd = TkWinGetHWND(winPtr->window); + (void)targetPtr; + UpdateClipboard(hwnd); } @@ -450,6 +455,7 @@ void TkSelPropProc( XEvent *eventPtr) /* X PropertyChange event. */ { + (void)eventPtr; } /* diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 8a1273a..78e3b6c 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -173,7 +173,7 @@ TkpGetColor( && FindSystemColor(name+6, &color, &index)) || TkParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), name, &color)) { - winColPtr = ckalloc(sizeof(WinColor)); + winColPtr = (WinColor *)ckalloc(sizeof(WinColor)); winColPtr->info.color = color; winColPtr->index = index; @@ -211,7 +211,7 @@ TkpGetColorByValue( XColor *colorPtr) /* Red, green, and blue fields indicate * desired color. */ { - WinColor *tkColPtr = ckalloc(sizeof(WinColor)); + WinColor *tkColPtr = (WinColor *)ckalloc(sizeof(WinColor)); tkColPtr->info.color.red = colorPtr->red; tkColPtr->info.color.green = colorPtr->green; @@ -307,6 +307,7 @@ XAllocColor( TkWinColormap *cmap = (TkWinColormap *) colormap; PALETTEENTRY entry, closeEntry; HDC dc = GetDC(NULL); + (void)display; entry.peRed = (color->red) >> 8; entry.peGreen = (color->green) >> 8; @@ -316,7 +317,7 @@ XAllocColor( if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) { unsigned long sizePalette = GetDeviceCaps(dc, SIZEPALETTE); UINT newPixel, closePixel; - int new; + int isNew; size_t refCount; Tcl_HashEntry *entryPtr; UINT index; @@ -358,8 +359,8 @@ XAllocColor( color->pixel = PALETTERGB(entry.peRed, entry.peGreen, entry.peBlue); entryPtr = Tcl_CreateHashEntry(&cmap->refCounts, - INT2PTR(color->pixel), &new); - if (new) { + INT2PTR(color->pixel), &isNew); + if (isNew) { refCount = 1; } else { refCount = (size_t)Tcl_GetHashValue(entryPtr) + 1; @@ -414,6 +415,8 @@ XFreeColors( PALETTEENTRY entry, *entries; Tcl_HashEntry *entryPtr; HDC dc = GetDC(NULL); + (void)display; + (void)planes; /* * We don't have to do anything for non-palette devices. @@ -436,7 +439,7 @@ XFreeColors( GetPaletteEntries(cmap->palette, index, 1, &entry); if (cref == RGB(entry.peRed, entry.peGreen, entry.peBlue)) { count = cmap->size - index; - entries = ckalloc(sizeof(PALETTEENTRY) * count); + entries = (PALETTEENTRY *)ckalloc(sizeof(PALETTEENTRY) * count); GetPaletteEntries(cmap->palette, index+1, count, entries); SetPaletteEntries(cmap->palette, index, count, entries); ckfree(entries); @@ -482,9 +485,13 @@ XCreateColormap( PALETTEENTRY *entryPtr; TkWinColormap *cmap; Tcl_HashEntry *hashPtr; - int new; + int isNew; UINT i; HPALETTE sysPal; + (void)display; + (void)w; + (void)visual; + (void)alloc; /* * Allocate a starting palette with all of the reserved colors. @@ -496,7 +503,7 @@ XCreateColormap( logPalettePtr->palNumEntries = GetPaletteEntries(sysPal, 0, 256, logPalettePtr->palPalEntry); - cmap = ckalloc(sizeof(TkWinColormap)); + cmap = (TkWinColormap *)ckalloc(sizeof(TkWinColormap)); cmap->size = logPalettePtr->palNumEntries; cmap->stale = 0; cmap->palette = CreatePalette(logPalettePtr); @@ -509,7 +516,7 @@ XCreateColormap( for (i = 0; i < logPalettePtr->palNumEntries; i++) { entryPtr = logPalettePtr->palPalEntry + i; hashPtr = Tcl_CreateHashEntry(&cmap->refCounts, INT2PTR(PALETTERGB( - entryPtr->peRed, entryPtr->peGreen, entryPtr->peBlue)), &new); + entryPtr->peRed, entryPtr->peGreen, entryPtr->peBlue)), &isNew); Tcl_SetHashValue(hashPtr, INT2PTR(1)); } @@ -539,6 +546,7 @@ XFreeColormap( Colormap colormap) { TkWinColormap *cmap = (TkWinColormap *) colormap; + (void)display; if (!DeleteObject(cmap->palette)) { Tcl_Panic("Unable to free colormap, palette is still selected"); diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index 3cf33e8..63f3add 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -100,6 +100,7 @@ TkGetCursorByName( TkWinCursor *cursorPtr; int argc; const char **argv = NULL; + (void)tkwin; /* * All cursor names are valid lists of one element (for @@ -113,7 +114,7 @@ TkGetCursorByName( goto badCursorSpec; } - cursorPtr = ckalloc(sizeof(TkWinCursor)); + cursorPtr = (TkWinCursor *)ckalloc(sizeof(TkWinCursor)); cursorPtr->info.cursor = (Tk_Cursor) cursorPtr; cursorPtr->winCursor = NULL; cursorPtr->system = 0; @@ -201,6 +202,16 @@ TkCreateCursorFromData( XColor fgColor, /* Foreground color for cursor. */ XColor bgColor) /* Background color for cursor. */ { + (void)tkwin; + (void)source; + (void)mask; + (void)width; + (void)height; + (void)xHot; + (void)yHot; + (void)fgColor; + (void)bgColor; + return NULL; } @@ -225,6 +236,8 @@ void TkpFreeCursor( TkCursor *cursorPtr) { + (void)cursorPtr; + /* TkWinCursor *winCursorPtr = (TkWinCursor *) cursorPtr; */ } diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index b145476..6059d21 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -3444,6 +3444,8 @@ FontchooserShowCmd( HDC hdc; HookData *hdPtr; int r = TCL_OK, oldMode = 0; + (void)objc; + (void)objv; hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); @@ -3546,12 +3548,15 @@ FontchooserShowCmd( static int FontchooserHideCmd( - ClientData clientData, /* Main window */ + ClientData dummy, /* Main window */ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - HookData *hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); + HookData *hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); + (void)dummy; + (void)objc; + (void)objv; if (hdPtr->hwnd && IsWindow(hdPtr->hwnd)) { EndDialog(hdPtr->hwnd, 0); @@ -3571,9 +3576,10 @@ FontchooserHideCmd( */ static void -DeleteHookData(ClientData clientData, Tcl_Interp *interp) +DeleteHookData(ClientData clientData, Tcl_Interp *dummy) { - HookData *hdPtr = clientData; + HookData *hdPtr = (HookData *)clientData; + (void)dummy; if (hdPtr->parentObj) { Tcl_DecrRefCount(hdPtr->parentObj); @@ -3610,9 +3616,10 @@ const TkEnsemble tkFontchooserEnsemble[] = { }; int -TkInitFontchooser(Tcl_Interp *interp, ClientData clientData) +TkInitFontchooser(Tcl_Interp *interp, ClientData dummy) { - HookData *hdPtr = ckalloc(sizeof(HookData)); + HookData *hdPtr = (HookData *)ckalloc(sizeof(HookData)); + (void)dummy; memset(hdPtr, 0, sizeof(HookData)); Tcl_SetAssocData(interp, "::tk::fontchooser", DeleteHookData, hdPtr); diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 31db297..f2d3d2e 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -341,6 +341,9 @@ XParseColor( const char *spec, XColor *colorPtr) { + (void)display; + (void)map; + if (spec[0] == '#') { char *p; Tcl_WideInt value = parseHex64bit(++spec, &p); @@ -48,7 +48,7 @@ static TkpClipMask *AllocClipMask(GC gc) { TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask; if (clip_mask == NULL) { - clip_mask = ckalloc(sizeof(TkpClipMask)); + clip_mask = (TkpClipMask *)ckalloc(sizeof(TkpClipMask)); gc->clip_mask = (Pixmap) clip_mask; #ifdef MAC_OSX_TK } else if (clip_mask->type == TKP_CLIP_REGION) { @@ -110,6 +110,7 @@ XCreateGC( XGCValues *values) { GC gp; + (void)d; /* * In order to have room for a dash list, MAX_DASH_LIST_SIZE extra chars @@ -120,7 +121,7 @@ XCreateGC( #define MAX_DASH_LIST_SIZE 10 - gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize); + gp = (GC)ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize); if (!gp) { return NULL; } @@ -265,6 +266,8 @@ int XFreeGC( Display *d, GC gc) { + (void)d; + if (gc != NULL) { FreeClipMask(gc); TkpFreeGCCache(gc); @@ -296,6 +299,8 @@ XSetForeground( GC gc, unsigned long foreground) { + (void)display; + gc->foreground = foreground; return Success; } @@ -306,6 +311,8 @@ XSetBackground( GC gc, unsigned long background) { + (void)display; + gc->background = background; return Success; } @@ -319,6 +326,7 @@ XSetDashes( int n) { char *p = &(gc->dashes); + (void)display; #ifdef TkWinDeleteBrush TkWinDeleteBrush(gc->fgBrush); @@ -341,6 +349,8 @@ XSetFunction( GC gc, int function) { + (void)display; + gc->function = function; return Success; } @@ -351,6 +361,8 @@ XSetFillRule( GC gc, int fill_rule) { + (void)display; + gc->fill_rule = fill_rule; return Success; } @@ -361,6 +373,8 @@ XSetFillStyle( GC gc, int fill_style) { + (void)display; + gc->fill_style = fill_style; return Success; } @@ -371,6 +385,8 @@ XSetTSOrigin( GC gc, int x, int y) { + (void)display; + gc->ts_x_origin = x; gc->ts_y_origin = y; return Success; @@ -382,6 +398,8 @@ XSetFont( GC gc, Font font) { + (void)display; + gc->font = font; return Success; } @@ -392,6 +410,8 @@ XSetArcMode( GC gc, int arc_mode) { + (void)display; + gc->arc_mode = arc_mode; return Success; } @@ -402,6 +422,8 @@ XSetStipple( GC gc, Pixmap stipple) { + (void)display; + gc->stipple = stipple; return Success; } @@ -415,6 +437,8 @@ XSetLineAttributes( int cap_style, int join_style) { + (void)display; + gc->line_width = line_width; gc->line_style = line_style; gc->cap_style = cap_style; @@ -429,6 +453,8 @@ XSetClipOrigin( int clip_x_origin, int clip_y_origin) { + (void)display; + gc->clip_x_origin = clip_x_origin; gc->clip_y_origin = clip_y_origin; return Success; @@ -461,6 +487,8 @@ TkSetRegion( GC gc, TkRegion r) { + (void)display; + if (r == NULL) { Tcl_Panic("must not pass NULL to TkSetRegion for compatibility with X11; use XSetClipMask instead"); } else { @@ -481,6 +509,8 @@ XSetClipMask( GC gc, Pixmap pixmap) { + (void)display; + if (pixmap == None) { FreeClipMask(gc); } else { @@ -539,6 +569,7 @@ XDrawPoints( int mode) { int res = Success; + (void)mode; while (npoints-- > 0) { res = XDrawLine(display, d, gc, @@ -558,6 +589,12 @@ XDrawSegments( XSegment *segments, int nsegments) { + (void)display; + (void)d; + (void)gc; + (void)segments; + (void)nsegments; + return BadDrawable; } #endif @@ -568,6 +605,10 @@ XFetchBuffer( int *nbytes_return, int buffer) { + (void)display; + (void)nbytes_return; + (void)buffer; + return (char *) 0; } @@ -577,6 +618,10 @@ XFetchName( Window w, char **window_name_return) { + (void)display; + (void)w; + (void)window_name_return; + return Success; } @@ -586,6 +631,10 @@ XListProperties( Window w, int *num_prop_return) { + (void)display; + (void)w; + (void)num_prop_return; + return (Atom *) 0; } @@ -594,7 +643,10 @@ XMapRaised( Display *display, Window w) { - return Success; + (void)display; + (void)w; + + return Success; } int @@ -608,6 +660,15 @@ XQueryTextExtents( int *font_descent_return, XCharStruct *overall_return) { + (void)display; + (void)font_ID; + (void)string; + (void)nchars; + (void)direction_return; + (void)font_ascent_return; + (void)font_descent_return; + (void)overall_return; + return Success; } @@ -619,6 +680,12 @@ XReparentWindow( int x, int y) { + (void)display; + (void)w; + (void)parent; + (void)x; + (void)y; + return BadWindow; } @@ -627,6 +694,9 @@ XUndefineCursor( Display *display, Window w) { + (void)display; + (void)w; + return Success; } @@ -634,6 +704,7 @@ XVaNestedList XVaCreateNestedList( int unused, ...) { + (void)unused; return NULL; } @@ -641,6 +712,7 @@ char * XSetICValues( XIC xic, ...) { + (void)xic; return NULL; } @@ -648,6 +720,7 @@ char * XGetICValues( XIC xic, ...) { + (void)xic; return NULL; } @@ -655,6 +728,7 @@ void XSetICFocus( XIC xic) { + (void)xic; } Window @@ -672,6 +746,19 @@ XCreateWindow( unsigned long value_mask, XSetWindowAttributes *attributes) { + (void)display; + (void)parent; + (void)x; + (void)y; + (void)width; + (void)height; + (void)border_width; + (void)depth; + (void)clazz; + (void)visual; + (void)value_mask; + (void)attributes; + return 0; } @@ -681,6 +768,10 @@ XPointInRegion( int x, int y) { + (void)rgn; + (void)x; + (void)y; + return 0; } @@ -690,6 +781,10 @@ XUnionRegion( Region srcb, Region dr_return) { + (void)srca; + (void)srcb; + (void)dr_return; + return 0; } @@ -699,6 +794,10 @@ XPolygonRegion( int n, int rule) { + (void)pts; + (void)n; + (void)rule; + return 0; } @@ -706,6 +805,7 @@ void XDestroyIC( XIC ic) { + (void)ic; } Cursor @@ -718,6 +818,14 @@ XCreatePixmapCursor( unsigned int x, unsigned int y) { + (void)display; + (void)source; + (void)mask; + (void)foreground_color; + (void)background_color; + (void)x; + (void)y; + return (Cursor) NULL; } @@ -731,6 +839,14 @@ XCreateGlyphCursor( XColor _Xconst *foreground_color, XColor _Xconst *background_color) { + (void)display; + (void)source_font; + (void)mask_font; + (void)source_char; + (void)mask_char; + (void)foreground_color; + (void)background_color; + return 1; } @@ -742,6 +858,12 @@ XCreateFontSet( int *missing_charset_count /* missing_charset_count */, char **def_string /* def_string */ ) { + (void)display; + (void)base_font_name_list; + (void)missing_charset_list; + (void)missing_charset_count; + (void)def_string; + return (XFontSet)0; } @@ -750,18 +872,23 @@ XFreeFontSet( Display *display, /* display */ XFontSet fontset /* font_set */ ) { + (void)display; + (void)fontset; } void XFreeStringList( char **list /* list */ ) { + (void)list; } Status XCloseIM( XIM im /* im */ ) { + (void)im; + return Success; } @@ -774,6 +901,13 @@ XRegisterIMInstantiateCallback( XIDProc callback /* callback */, XPointer client_data /* client_data */ ) { + (void)dpy; + (void)rdb; + (void)res_name; + (void)res_class; + (void)callback; + (void)client_data; + return False; } @@ -786,6 +920,13 @@ XUnregisterIMInstantiateCallback( XIDProc callback /* callback */, XPointer client_data /* client_data */ ) { + (void)dpy; + (void)rdb; + (void)res_name; + (void)res_class; + (void)callback; + (void)client_data; + return False; } @@ -793,6 +934,8 @@ char * XSetLocaleModifiers( const char *modifier_list /* modifier_list */ ) { + (void)modifier_list; + return NULL; } @@ -802,6 +945,11 @@ XIM XOpenIM( char *res_name /* res_name */, char *res_class /* res_class */ ) { + (void)dpy; + (void)rdb; + (void)res_name; + (void)res_class; + return NULL; } @@ -809,6 +957,8 @@ char * XGetIMValues( XIM im /* im */, ... ) { + (void)im; + return NULL; } @@ -816,6 +966,8 @@ char * XSetIMValues( XIM im /* im */, ... ) { + (void)im; + return NULL; } diff --git a/xlib/xutil.c b/xlib/xutil.c index d80b742..a5f3b99 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -36,6 +36,8 @@ XInternAtom( Bool only_if_exists) { static Atom atom = XA_LAST_PREDEFINED; + (void)atom_name; + (void)only_if_exists; display->request++; return ++atom; @@ -64,7 +66,7 @@ XGetVisualInfo( XVisualInfo *vinfo_template, int *nitems_return) { - XVisualInfo *info = ckalloc(sizeof(XVisualInfo)); + XVisualInfo *info = (XVisualInfo *)ckalloc(sizeof(XVisualInfo)); info->visual = DefaultVisual(display, 0); info->visualid = info->visual->visualid; |