diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 07:57:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 07:57:18 (GMT) |
commit | e6fe5e1f356751dea5d391b25a6f2437ffebae5f (patch) | |
tree | 4810edcd3b39814a55c1d5fb235d768f181bc42a /win | |
parent | 52482ab5023994148201c6b4e71c40b62809b205 (diff) | |
download | tk-e6fe5e1f356751dea5d391b25a6f2437ffebae5f.zip tk-e6fe5e1f356751dea5d391b25a6f2437ffebae5f.tar.gz tk-e6fe5e1f356751dea5d391b25a6f2437ffebae5f.tar.bz2 |
[Bug 3388350] mingw64 compiler warnings
Diffstat (limited to 'win')
-rwxr-xr-x | win/configure | 2 | ||||
-rw-r--r-- | win/tcl.m4 | 2 | ||||
-rw-r--r-- | win/tkWin3d.c | 4 | ||||
-rw-r--r-- | win/tkWinButton.c | 3 | ||||
-rw-r--r-- | win/tkWinCursor.c | 1 | ||||
-rw-r--r-- | win/tkWinDraw.c | 2 | ||||
-rw-r--r-- | win/tkWinImage.c | 28 | ||||
-rw-r--r-- | win/tkWinKey.c | 1 | ||||
-rw-r--r-- | win/tkWinMenu.c | 4 | ||||
-rw-r--r-- | win/tkWinWm.c | 28 | ||||
-rw-r--r-- | win/tkWinX.c | 2 |
11 files changed, 30 insertions, 47 deletions
diff --git a/win/configure b/win/configure index 18a1f7d..211b35c 100755 --- a/win/configure +++ b/win/configure @@ -1336,7 +1336,7 @@ echo "configure:1262: checking compiler flags" >&5 CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wconversion" + CFLAGS_WARNING="-Wall -fno-strict-aliasing" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= @@ -519,7 +519,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wconversion" + CFLAGS_WARNING="-Wall -fno-strict-aliasing" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= diff --git a/win/tkWin3d.c b/win/tkWin3d.c index 7016db9..8b541e7 100644 --- a/win/tkWin3d.c +++ b/win/tkWin3d.c @@ -123,7 +123,7 @@ Tk_3DVerticalBevel(tkwin, drawable, border, x, y, width, height, * exterior. */ { TkBorder *borderPtr = (TkBorder *) border; - int left, right; + int left = 0, right = 0; Display *display = Tk_Display(tkwin); TkWinDCState state; HDC dc = TkWinGetDrawableDC(display, drawable, &state); @@ -223,7 +223,7 @@ Tk_3DHorizontalBevel(tkwin, drawable, border, x, y, width, height, int bottom, halfway, x1, x2, x1Delta, x2Delta; TkWinDCState state; HDC dc = TkWinGetDrawableDC(display, drawable, &state); - int topColor, bottomColor; + int topColor = 0, bottomColor = 0; if ((borderPtr->lightGC == None) && (relief != TK_RELIEF_FLAT)) { TkpGetShadows(borderPtr, tkwin); diff --git a/win/tkWinButton.c b/win/tkWinButton.c index f1d4626..a002b9c 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -1004,6 +1004,9 @@ TkpComputeButtonGeometry(butPtr) } break; } + case COMPOUND_NONE: { + break; + } } /* switch */ /* Fix up for minimum width */ diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index 9f3763b..4a0f11a 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -219,7 +219,6 @@ void TkpFreeCursor(cursorPtr) TkCursor *cursorPtr; { - TkWinCursor *winCursorPtr = (TkWinCursor *) cursorPtr; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index b2480d6..d0a609f 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -750,7 +750,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) HPEN pen; WinDrawFunc func; { - RECT rect; + RECT rect = {0, 0, 0, 0}; HPEN oldPen; HBRUSH oldBrush; POINT *winPoints = ConvertPoints(points, npoints, mode, &rect); diff --git a/win/tkWinImage.c b/win/tkWinImage.c index 90627f8..9e927fe 100644 --- a/win/tkWinImage.c +++ b/win/tkWinImage.c @@ -68,7 +68,7 @@ ImageGetPixel(image, x, y) int x, y; { unsigned long pixel = 0; - unsigned char *srcPtr = &(image->data[(y * image->bytes_per_line) + unsigned char *srcPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line) + ((x * image->bits_per_pixel) / NBBY)]); switch (image->bits_per_pixel) { @@ -116,7 +116,7 @@ PutPixel(image, x, y, pixel) int x, y; unsigned long pixel; { - unsigned char *destPtr = &(image->data[(y * image->bytes_per_line) + unsigned char *destPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line) + ((x * image->bits_per_pixel) / NBBY)]); switch (image->bits_per_pixel) { @@ -289,7 +289,7 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) int format; { TkWinDrawable *twdPtr = (TkWinDrawable *)d; - XImage *ret_image; + XImage *ret_image = NULL; HDC hdc, hdcMem; HBITMAP hbmp, hbmpPrev; BITMAPINFO *bmInfo = NULL; @@ -364,16 +364,16 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) if (depth == 1) { unsigned char *p, *pend; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; goto cleanup; } - ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, data, + ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, (char *) data, width, height, 32, ((width + 31) >> 3) & ~1); if (ret_image == NULL) { - ckfree(data); + ckfree((char *)data); goto cleanup; } @@ -397,13 +397,13 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) unsigned char *p; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; goto cleanup; } - ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, data, + ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, (char *) data, width, height, 8, width); if (ret_image == NULL) { ckfree((char *) data); @@ -425,13 +425,13 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) } } else if (depth == 16) { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; goto cleanup; } - ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, data, + ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, (char *) data, width, height, 16, 0 /* will be calc'ed from bitmap_pad */); if (ret_image == NULL) { ckfree((char *) data); @@ -448,13 +448,13 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) } } else { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(width * height * 4); + data = (unsigned char *) ckalloc(width * height * 4); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; goto cleanup; } - ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, data, + ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, (char *) data, width, height, 0, width * 4); if (ret_image == NULL) { ckfree((char *) data); @@ -470,7 +470,7 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) unsigned int byte_width, h, w; byte_width = ((width * 3 + 3) & ~3); - smallBitBase = ckalloc(byte_width * height); + smallBitBase = (unsigned char *) ckalloc(byte_width * height); if (!smallBitBase) { ckfree((char *) ret_image->data); ckfree((char *) ret_image); @@ -490,7 +490,7 @@ XGetImageZPixmap(display, d, x, y, width, height, plane_mask, format) } /* Copy the 24 Bit Pixmap to a 32-Bit one. */ for (h = 0; h < height; h++) { - bigBitData = ret_image->data + h * ret_image->bytes_per_line; + bigBitData = (unsigned char *)ret_image->data + h * ret_image->bytes_per_line; smallBitData = smallBitBase + h * byte_width; for (w = 0; w < width; w++) { diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 6f288ed..aa532bf 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -85,7 +85,6 @@ TkpGetString(winPtr, eventPtr, dsPtr) * result. */ { KeySym keysym; - XKeyEvent* keyEv = &eventPtr->xkey; Tcl_DStringInit(dsPtr); if (eventPtr->xkey.send_event == -1) { diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 280f74e..fe6132f 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -545,7 +545,7 @@ ReconfigureWindowsMenu( UINT flags; UINT itemID; int i, count, systemMenu = 0, base; - int width, height; + int width = 0, height = 0; Tcl_DString translatedText; if (NULL == winMenuHdl) { @@ -1672,7 +1672,7 @@ DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr, { int baseline; int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth; - char *accel; + char *accel = NULL; if (mePtr->accelPtr != NULL) { accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 06bc985..2097938 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -1482,23 +1482,6 @@ GetIcon(WinIconPtr titlebaricon, int icon_size) return NULL; } -static HCURSOR -TclWinReadCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName) -{ - BlockOfIconImagesPtr lpIR; - HICON res = NULL; - - lpIR = ReadIconOrCursorFromFile(interp, fileName, FALSE); - if (lpIR == NULL) { - return NULL; - } - if (lpIR->nNumImages >= 1) { - res = CopyImage(lpIR->IconImages[0].hIcon, IMAGE_CURSOR,0,0,0); - } - FreeIconBlock(lpIR); - return res; -} - /* *---------------------------------------------------------------------- * @@ -1603,7 +1586,7 @@ ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) goto readError; } /* Read it in */ - dwBytesRead = Tcl_Read( channel, lpIR->IconImages[i].lpBits, + dwBytesRead = Tcl_Read(channel, (char *) lpIR->IconImages[i].lpBits, lpIDE[i].dwBytesInRes); if (dwBytesRead != lpIDE[i].dwBytesInRes) { Tcl_AppendResult(interp,"Error reading file",(char*)NULL); @@ -2371,7 +2354,7 @@ TkpWmSetState(winPtr, state) * or WithdrawnState. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; - int cmd; + int cmd = 0; if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; @@ -4001,7 +3984,6 @@ WmIconphotoCmd(tkwin, winPtr, interp, objc, objv) int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument objects. */ { - register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */ Tk_PhotoHandle photo; Tk_PhotoImageBlock block; @@ -4057,7 +4039,7 @@ WmIconphotoCmd(tkwin, winPtr, interp, objc, objv) * encode the image data into an HICON. */ bufferSize = height * width * block.pixelSize; - bgraPixelPtr = ckalloc(bufferSize); + bgraPixelPtr = (unsigned char *) ckalloc(bufferSize); for (idx = 0 ; idx < bufferSize ; idx += 4) { bgraPixelPtr[idx] = block.pixelPtr[idx+2]; bgraPixelPtr[idx+1] = block.pixelPtr[idx+1]; @@ -4066,7 +4048,7 @@ WmIconphotoCmd(tkwin, winPtr, interp, objc, objv) } hIcon = CreateIcon(Tk_GetHINSTANCE(), width, height, 1, 32, NULL, (BYTE *) bgraPixelPtr); - ckfree(bgraPixelPtr); + ckfree((char *) bgraPixelPtr); if (hIcon == NULL) { /* XXX should free up created icons */ Tcl_Free((char *) lpIR); @@ -6625,7 +6607,7 @@ ConfigureTopLevel(pos) { TkWindow *winPtr = GetTopLevel(pos->hwnd); WmInfo *wmPtr; - int state; /* Current window state. */ + int state = 0; /* Current window state. */ RECT rect; WINDOWPLACEMENT windowPos; diff --git a/win/tkWinX.c b/win/tkWinX.c index a592056..cdbdc84 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -380,7 +380,7 @@ TkWinGetPlatformId() KEY_READ, &hKey) != ERROR_SUCCESS) { tkWinTheme = TK_THEME_WIN_XP; } else { - RegQueryValueEx(hKey, szCurrent, NULL, NULL, pBuffer, &dwSize); + RegQueryValueEx(hKey, szCurrent, NULL, NULL, (BYTE *) pBuffer, &dwSize); RegCloseKey(hKey); if (strcmp(pBuffer, "Windows Standard") == 0) { tkWinTheme = TK_THEME_WIN_CLASSIC; |