diff options
Diffstat (limited to 'win')
-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 |
8 files changed, 77 insertions, 28 deletions
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); |