summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-03 20:53:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-03 20:53:24 (GMT)
commitd2747a371058fa4128dbd7896fe040f0b3ee6be7 (patch)
tree636e7fd05c44d1f45b621dad17cfeed7d672199b /win
parentf2b5a87d6dc6d3468828d48929583d950690a40b (diff)
downloadtk-d2747a371058fa4128dbd7896fe040f0b3ee6be7.zip
tk-d2747a371058fa4128dbd7896fe040f0b3ee6be7.tar.gz
tk-d2747a371058fa4128dbd7896fe040f0b3ee6be7.tar.bz2
Bring back more original "None" usages, and fix other warnings which gradually slipped in.
Wherever possible, pragma's are used in MSVC to silence useless compiler warnings.
Diffstat (limited to 'win')
-rw-r--r--win/stubs.c2
-rw-r--r--win/tkWin3d.c12
-rw-r--r--win/tkWinButton.c15
-rw-r--r--win/tkWinDraw.c14
-rw-r--r--win/tkWinEmbed.c6
-rw-r--r--win/tkWinFont.c12
-rw-r--r--win/tkWinImage.c2
-rw-r--r--win/tkWinMenu.c4
-rw-r--r--win/tkWinPixmap.c2
-rw-r--r--win/tkWinPointer.c6
-rw-r--r--win/tkWinPort.h9
-rw-r--r--win/tkWinScrlbr.c2
-rw-r--r--win/tkWinWindow.c6
-rw-r--r--win/tkWinWm.c42
-rw-r--r--win/tkWinX.c18
-rw-r--r--win/ttkWinXPTheme.c2
16 files changed, 80 insertions, 74 deletions
diff --git a/win/stubs.c b/win/stubs.c
index 7e791b5..4564639 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -397,7 +397,7 @@ XGetWindowProperty(
unsigned long *bytes_after_return,
unsigned char **prop_return)
{
- *actual_type_return = 0;
+ *actual_type_return = None;
*actual_format_return = 0;
*nitems_return = 0;
*bytes_after_return = 0;
diff --git a/win/tkWin3d.c b/win/tkWin3d.c
index aa026e8..df6aa95 100644
--- a/win/tkWin3d.c
+++ b/win/tkWin3d.c
@@ -127,7 +127,7 @@ Tk_3DVerticalBevel(
HDC dc = TkWinGetDrawableDC(display, drawable, &state);
int half;
- if (!borderPtr->lightGC && (relief != TK_RELIEF_FLAT)) {
+ if ((borderPtr->lightGC == None) && (relief != TK_RELIEF_FLAT)) {
TkpGetShadows(borderPtr, tkwin);
}
@@ -222,7 +222,7 @@ Tk_3DHorizontalBevel(
HDC dc = TkWinGetDrawableDC(display, drawable, &state);
int topColor, bottomColor;
- if (!borderPtr->lightGC && (relief != TK_RELIEF_FLAT)) {
+ if ((borderPtr->lightGC == None) && (relief != TK_RELIEF_FLAT)) {
TkpGetShadows(borderPtr, tkwin);
}
@@ -339,7 +339,7 @@ TkpGetShadows(
int r, g, b;
XGCValues gcValues;
- if (borderPtr->lightGC) {
+ if (borderPtr->lightGC != None) {
return;
}
@@ -465,10 +465,10 @@ TkpGetShadows(
return;
}
- if (!borderPtr->shadow) {
+ if (borderPtr->shadow == None) {
borderPtr->shadow = Tk_GetBitmap((Tcl_Interp *) NULL, tkwin,
Tk_GetUid("gray50"));
- if (!borderPtr->shadow) {
+ if (borderPtr->shadow == None) {
Tcl_Panic("TkpGetShadows couldn't allocate bitmap for border");
}
}
@@ -540,7 +540,7 @@ TkWinGetBorderPixels(
{
WinBorder *borderPtr = (WinBorder *) border;
- if (!borderPtr->info.lightGC) {
+ if (borderPtr->info.lightGC == None) {
TkpGetShadows(&borderPtr->info, tkwin);
}
switch (which) {
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 0a11a20..c36932d 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -127,7 +127,7 @@ InitBoxes(void)
HRSRC hrsrc;
HGLOBAL hblk;
LPBITMAPINFOHEADER newBitmap;
- DWORD size;
+ size_t size;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -146,8 +146,9 @@ InitBoxes(void)
if (tsdPtr->boxesPtr != NULL && !(tsdPtr->boxesPtr->biWidth % 4)
&& !(tsdPtr->boxesPtr->biHeight % 2)) {
- size = tsdPtr->boxesPtr->biSize + (1 << tsdPtr->boxesPtr->biBitCount)
- * sizeof(RGBQUAD) + tsdPtr->boxesPtr->biSizeImage;
+ size = tsdPtr->boxesPtr->biSize
+ + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount)
+ + tsdPtr->boxesPtr->biSizeImage;
newBitmap = (LPBITMAPINFOHEADER) ckalloc(size);
memcpy(newBitmap, tsdPtr->boxesPtr, size);
tsdPtr->boxesPtr = newBitmap;
@@ -156,7 +157,7 @@ InitBoxes(void)
tsdPtr->boxesPalette = (DWORD*) (((LPSTR) tsdPtr->boxesPtr)
+ tsdPtr->boxesPtr->biSize);
tsdPtr->boxesBits = ((LPSTR) tsdPtr->boxesPalette)
- + ((1 << tsdPtr->boxesPtr->biBitCount) * sizeof(RGBQUAD));
+ + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount);
} else {
tsdPtr->boxesPtr = NULL;
}
@@ -433,10 +434,10 @@ TkpDisplayButton(
* Display image or bitmap or text for button.
*/
- if (butPtr->image) {
+ if (butPtr->image != None) {
Tk_SizeOfImage(butPtr->image, &width, &height);
haveImage = 1;
- } else if (butPtr->bitmap) {
+ } else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
haveImage = 1;
}
@@ -839,7 +840,7 @@ TkpComputeButtonGeometry(
if (butPtr->image != NULL) {
Tk_SizeOfImage(butPtr->image, &imgWidth, &imgHeight);
haveImage = 1;
- } else if (butPtr->bitmap) {
+ } else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap,
&imgWidth, &imgHeight);
haveImage = 1;
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index e94c893..1897bc8 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -631,7 +631,7 @@ XFillRectangles(
TkWinDCState state;
HBRUSH brush, oldBrush;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -641,7 +641,7 @@ XFillRectangles(
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HBRUSH stipple;
HBITMAP oldBitmap, bitmap;
@@ -756,7 +756,7 @@ RenderObject(
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HDC dcMem;
@@ -882,7 +882,7 @@ XDrawLines(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -927,7 +927,7 @@ XFillPolygon(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -969,7 +969,7 @@ XDrawRectangle(
HBRUSH oldBrush;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -1085,7 +1085,7 @@ DrawOrFillArc(
int xstart, ystart, xend, yend;
double radian_start, radian_end, xr, yr;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 539349f..1b0d2cf 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -242,7 +242,7 @@ TkpUseWindow(
*/
/*
- if (winPtr->window) {
+ if (winPtr->window != None) {
Tcl_AppendResult(interp,
"can't modify container after widget is created", NULL);
return TCL_ERROR;
@@ -298,9 +298,9 @@ TkpUseWindow(
* order to avoid bug 1096074 in future.
*/
- char msg[260];
+ char msg[256];
- sprintf(msg, "Unable to get information of window \"%.80s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string);
+ sprintf(msg, "Unable to get information of window \"%.79s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string);
if (IDCANCEL == MessageBox(hwnd, msg, "Tk Warning",
MB_OKCANCEL | MB_ICONWARNING)) {
Tcl_SetResult(interp, "Operation has been canceled", TCL_STATIC);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index b60a918..1292772 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -519,7 +519,7 @@ TkpGetFontFromAttributes(
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
/*
@@ -631,7 +631,7 @@ TkpGetFontFamilies(
Window window;
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
/*
@@ -1095,7 +1095,7 @@ Tk_DrawChars(
fontPtr = (WinFont *) gc->font;
display->request++;
- if (!drawable) {
+ if (drawable == None) {
return;
}
@@ -1103,14 +1103,14 @@ Tk_DrawChars(
SetROP2(dc, tkpWinRopModes[gc->function]);
- if (gc->clip_mask &&
+ if ((gc->clip_mask != None) &&
((TkpClipMask*)gc->clip_mask)->type == TKP_CLIP_REGION) {
SelectClipRgn(dc, (HRGN)((TkpClipMask*)gc->clip_mask)->value.region);
}
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HBRUSH oldBrush, stipple;
HBITMAP oldBitmap, bitmap;
@@ -1395,7 +1395,7 @@ InitFont(
char buf[LF_FACESIZE * sizeof(WCHAR)];
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
oldFont = SelectObject(hdc, hFont);
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index 8e6ef38..07aa1d3 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -348,7 +348,7 @@ XGetImageZPixmap(
size = sizeof(BITMAPINFO);
if (depth <= 8) {
- size += sizeof(unsigned short) * (1 << depth);
+ size += sizeof(unsigned short) << depth;
}
bmInfo = (BITMAPINFO *) ckalloc((unsigned)size);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 6240ceb..9a35266 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -2345,7 +2345,7 @@ DrawMenuEntryLabel(
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
(unsigned) width, (unsigned) height);
} else if ((mePtr->image != NULL)
- && menuPtr->disabledImageGC) {
+ && (menuPtr->disabledImageGC != None)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
leftEdge + imageXOffset,
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
@@ -2990,7 +2990,7 @@ MenuSelectEvent(
Tk_MakeWindowExist(menuPtr->tkwin);
event.event = Tk_WindowId(menuPtr->tkwin);
event.root = XRootWindow(menuPtr->display, 0);
- event.subwindow = 0;
+ event.subwindow = None;
event.time = TkpGetMS();
root.msgpos = GetMessagePos();
diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c
index 60e218d..51f0f59 100644
--- a/win/tkWinPixmap.c
+++ b/win/tkWinPixmap.c
@@ -115,7 +115,7 @@ Tk_GetPixmap(
if (newTwdPtr->bitmap.handle == NULL) {
ckfree((char *) newTwdPtr);
- return 0;
+ return None;
}
return (Pixmap) newTwdPtr;
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index d5706ac..dcddb8f 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -387,7 +387,7 @@ XGetInputFocus(
{
Tk_Window tkwin = Tk_HWNDToWindow(GetFocus());
- *focus_return = tkwin ? Tk_WindowId(tkwin) : 0;
+ *focus_return = tkwin ? Tk_WindowId(tkwin) : None;
*revert_to_return = RevertToParent;
display->request++;
return Success;
@@ -418,7 +418,7 @@ XSetInputFocus(
Time time)
{
display->request++;
- if (focus) {
+ if (focus != None) {
SetFocus(Tk_GetHWND(focus));
}
return Success;
@@ -465,7 +465,7 @@ TkpChangeFocus(
}
}
- if (!winPtr->window) {
+ if (winPtr->window == None) {
Tcl_Panic("ChangeXFocus got null X window");
}
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index aec5a66..2925dae 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -83,6 +83,11 @@
* See ticket [916c1095438eae56]: GetVersionExW triggers warnings
*/
#if defined(_MSC_VER)
+# pragma warning(disable:4047)
+# pragma warning(disable:4267)
+# pragma warning(disable:4244)
+# pragma warning(disable:4311)
+# pragma warning(disable:4312)
# pragma warning(disable:4996)
#endif
@@ -118,7 +123,7 @@
*/
#define TkpDefineNativeBitmaps()
-#define TkpCreateNativeBitmap(display, source) 0
-#define TkpGetNativeAppBitmap(display, name, w, h) 0
+#define TkpCreateNativeBitmap(display, source) None
+#define TkpGetNativeAppBitmap(display, name, w, h) None
#endif /* _WINPORT */
diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c
index f30a957..fc9685d 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -238,7 +238,7 @@ CreateProc(
for (winPtr = ((TkWindow*)tkwin)->nextPtr; winPtr != NULL;
winPtr = winPtr->nextPtr) {
- if ((winPtr->window) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
+ if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
TkWinSetWindowPos(scrollPtr->hwnd, Tk_GetHWND(winPtr->window),
Below);
break;
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index 0675bc6..3dfc078 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -228,7 +228,7 @@ TkpScanWindowId(
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
} else {
- *idPtr = 0;
+ *idPtr = None;
}
return TCL_OK;
}
@@ -259,7 +259,7 @@ TkpMakeWindow(
int style;
HWND hwnd;
- if (parent) {
+ if (parent != None) {
parentWin = Tk_GetHWND(parent);
style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
} else {
@@ -657,7 +657,7 @@ XConfigureWindow(
if (valueMask & CWStackMode) {
HWND sibling;
- if ((valueMask & CWSibling) && values->sibling) {
+ if ((valueMask & CWSibling) && (values->sibling != None)) {
sibling = Tk_GetHWND(values->sibling);
} else {
sibling = NULL;
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 8e6683f..9d706fa 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -1035,7 +1035,7 @@ WinSetIcon(
"\" isn't a top-level window", NULL);
return TCL_ERROR;
}
- if (!Tk_WindowId(tkw)) {
+ if (Tk_WindowId(tkw) == None) {
Tk_MakeWindowExist(tkw);
}
@@ -1198,7 +1198,7 @@ TkWinGetIcon(
}
}
- if (!Tk_WindowId(tkwin)) {
+ if (Tk_WindowId(tkwin) == None) {
Tk_MakeWindowExist(tkwin);
}
@@ -1977,11 +1977,11 @@ TkWmNewWindow(
wmPtr->hints.flags = InputHint | StateHint;
wmPtr->hints.input = True;
wmPtr->hints.initial_state = NormalState;
- wmPtr->hints.icon_pixmap = 0;
- wmPtr->hints.icon_window = 0;
+ wmPtr->hints.icon_pixmap = None;
+ wmPtr->hints.icon_window = None;
wmPtr->hints.icon_x = wmPtr->hints.icon_y = 0;
- wmPtr->hints.icon_mask = 0;
- wmPtr->hints.window_group = 0;
+ wmPtr->hints.icon_mask = None;
+ wmPtr->hints.window_group = None;
/*
* Default the maximum dimensions to the size of the display.
@@ -2062,7 +2062,7 @@ UpdateWrapper(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (!winPtr->window) {
+ if (winPtr->window == None) {
/*
* Ensure existence of the window to update the wrapper for.
*/
@@ -2683,7 +2683,7 @@ TkWmDeadWindow(
VisibilityChangeMask|StructureNotifyMask,
WmWaitVisibilityOrMapProc, (ClientData) wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
- if (wmPtr2->wrapper
+ if ((wmPtr2->wrapper != None)
&& !(wmPtr2->flags & (WM_NEVER_MAPPED))) {
UpdateWrapper(wmPtr2->winPtr);
}
@@ -3474,7 +3474,7 @@ WmColormapwindowsCmd(
if (winPtr2 == winPtr) {
gotToplevel = 1;
}
- if (!winPtr2->window) {
+ if (winPtr2->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr2);
}
cmapList[i] = winPtr2;
@@ -3750,7 +3750,7 @@ WmFrameCmd(
Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- if (!Tk_WindowId((Tk_Window) winPtr)) {
+ if (Tk_WindowId((Tk_Window) winPtr) == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
hwnd = wmPtr->wrapper;
@@ -4044,9 +4044,9 @@ WmIconbitmapCmd(
string = Tcl_GetString(objv[objc-1]);
if (*string == '\0') {
- if (wmPtr->hints.icon_pixmap) {
+ if (wmPtr->hints.icon_pixmap != None) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
- wmPtr->hints.icon_pixmap = 0;
+ wmPtr->hints.icon_pixmap = None;
}
wmPtr->hints.flags &= ~IconPixmapHint;
if (WinSetIcon(interp, NULL, (Tk_Window) useWinPtr) != TCL_OK) {
@@ -4098,7 +4098,7 @@ WmIconbitmapCmd(
Pixmap pixmap;
Tcl_ResetResult(interp);
pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, string);
- if (!pixmap) {
+ if (pixmap == None) {
return TCL_ERROR;
}
wmPtr->hints.icon_pixmap = pixmap;
@@ -4217,13 +4217,13 @@ WmIconmaskCmd(
}
argv3 = Tcl_GetString(objv[3]);
if (*argv3 == '\0') {
- if (wmPtr->hints.icon_mask) {
+ if (wmPtr->hints.icon_mask != None) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
}
wmPtr->hints.flags &= ~IconMaskHint;
} else {
pixmap = Tk_GetBitmap(interp, tkwin, argv3);
- if (!pixmap) {
+ if (pixmap == None) {
return TCL_ERROR;
}
wmPtr->hints.icon_mask = pixmap;
@@ -6388,7 +6388,7 @@ Tk_GetRootCoords(
* If the window is mapped, let Windows figure out the translation.
*/
- if (winPtr->window) {
+ if (winPtr->window != None) {
HWND hwnd = Tk_GetHWND(winPtr->window);
POINT point;
@@ -6816,7 +6816,7 @@ TkWmRestackToplevel(
* (mapping it may give it a reparent window).
*/
- if (!winPtr->window) {
+ if (winPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
@@ -6826,7 +6826,7 @@ TkWmRestackToplevel(
? winPtr->wmInfoPtr->wrapper : Tk_GetHWND(winPtr->window);
if (otherPtr != NULL) {
- if (!otherPtr->window) {
+ if (otherPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) otherPtr);
}
if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
@@ -6877,7 +6877,7 @@ TkWmAddToColormapWindows(
TkWindow **oldPtr, **newPtr;
int count, i;
- if (!winPtr->window) {
+ if (winPtr->window == None) {
return;
}
@@ -7312,7 +7312,7 @@ GenerateConfigureNotify(
event.xconfigure.y = winPtr->changes.y;
event.xconfigure.width = winPtr->changes.width;
event.xconfigure.height = winPtr->changes.height;
- event.xconfigure.above = 0;
+ event.xconfigure.above = None;
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
}
@@ -8586,7 +8586,7 @@ TkpWinToplevelDetachWindow(
SendMessage(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0);
winPtr->flags &= ~TK_EMBEDDED;
winPtr->privatePtr = NULL;
- wmPtr->wrapper = 0;
+ wmPtr->wrapper = NULL;
if (state >= 0 && state <= 3) {
wmPtr->hints.initial_state = state;
}
diff --git a/win/tkWinX.c b/win/tkWinX.c
index ce639a0..2f9565d 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -573,10 +573,10 @@ TkWinDisplayChanged(
screen->root_visual->bits_per_rgb = screen->root_depth;
ReleaseDC(NULL, dc);
- if (screen->cmap) {
+ if (screen->cmap != None) {
XFreeColormap(display, screen->cmap);
}
- screen->cmap = XCreateColormap(display, 0, screen->root_visual,
+ screen->cmap = XCreateColormap(display, None, screen->root_visual,
AllocNone);
}
@@ -636,7 +636,7 @@ TkpOpenDisplay(
twdPtr = (TkWinDrawable*) ckalloc(sizeof(TkWinDrawable));
if (twdPtr == NULL) {
- return 0;
+ return NULL;
}
twdPtr->type = TWD_WINDOW;
twdPtr->window.winPtr = NULL;
@@ -649,7 +649,7 @@ TkpOpenDisplay(
screen->white_pixel = RGB(255, 255, 255);
screen->black_pixel = RGB(0, 0, 0);
- screen->cmap = 0;
+ screen->cmap = None;
display->screens = screen;
display->nscreens = 1;
@@ -704,10 +704,10 @@ TkpCloseDisplay(
if (display->screens->root_visual != NULL) {
ckfree((char *) display->screens->root_visual);
}
- if (display->screens->root) {
+ if (display->screens->root != None) {
ckfree((char *) display->screens->root);
}
- if (display->screens->cmap) {
+ if (display->screens->cmap != None) {
XFreeColormap(display, display->screens->cmap);
}
ckfree((char *) display->screens);
@@ -1018,7 +1018,7 @@ GenerateXEvent(
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd);
- if (!winPtr || !winPtr->window) {
+ if (!winPtr || winPtr->window == None) {
return;
}
@@ -1146,7 +1146,7 @@ GenerateXEvent(
*/
event.xbutton.root = RootWindow(winPtr->display, winPtr->screenNum);
- event.xbutton.subwindow = 0;
+ event.xbutton.subwindow = None;
event.xbutton.x = clientPoint.x;
event.xbutton.y = clientPoint.y;
event.xbutton.x_root = root.point.x;
@@ -1654,7 +1654,7 @@ HandleIMEComposition(
event.xkey.display = winPtr->display;
event.xkey.window = winPtr->window;
event.xkey.root = RootWindow(winPtr->display, winPtr->screenNum);
- event.xkey.subwindow = 0;
+ event.xkey.subwindow = None;
event.xkey.state = TkWinGetModifierState();
event.xkey.time = TkpGetMS();
event.xkey.same_screen = True;
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index 65b7240..6359891 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -453,7 +453,7 @@ InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d)
{
Window win = Tk_WindowId(tkwin);
- if (win) {
+ if (win != None) {
elementData->hwnd = Tk_GetHWND(win);
} else {
elementData->hwnd = elementData->procs->stubWindow;