summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
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/tkWinDialog.c4
-rw-r--r--win/tkWinDraw.c14
-rw-r--r--win/tkWinEmbed.c2
-rw-r--r--win/tkWinFont.c20
-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.h8
-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
17 files changed, 83 insertions, 78 deletions
diff --git a/win/stubs.c b/win/stubs.c
index 24df27c..1cf23ef 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 bf7a539..9f7ca22 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 == NULL) && (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 == NULL) && (relief != TK_RELIEF_FLAT)) {
TkpGetShadows(borderPtr, tkwin);
}
@@ -339,7 +339,7 @@ TkpGetShadows(
int r, g, b;
XGCValues gcValues;
- if (borderPtr->lightGC) {
+ if (borderPtr->lightGC != NULL) {
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 == NULL) {
TkpGetShadows(&borderPtr->info, tkwin);
}
switch (which) {
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 32c2499..ee0ce82 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 = 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 != NULL) {
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/tkWinDialog.c b/win/tkWinDialog.c
index 6795ef3..366485b 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -3351,7 +3351,7 @@ FontchooserConfigureCmd(
Tk_Window parent = Tk_NameToWindow(interp,
Tcl_GetString(objv[i+1]), tkwin);
- if (!parent) {
+ if (parent == NULL) {
return TCL_ERROR;
}
if (hdPtr->parentObj) {
@@ -3446,7 +3446,7 @@ FontchooserShowCmd(
if (hdPtr->parentObj) {
parent = Tk_NameToWindow(interp, Tcl_GetString(hdPtr->parentObj),
tkwin);
- if (!parent) {
+ if (parent == NULL) {
return TCL_ERROR;
}
}
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 2c35d3b..e13a5e5 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -644,7 +644,7 @@ XFillRectangles(
TkWinDCState state;
HBRUSH brush, oldBrush;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -654,7 +654,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;
@@ -818,7 +818,7 @@ RenderObject(
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
- && gc->stipple) {
+ && gc->stipple != None) {
TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple;
HDC dcMem;
@@ -942,7 +942,7 @@ XDrawLines(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -987,7 +987,7 @@ XFillPolygon(
TkWinDCState state;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -1029,7 +1029,7 @@ XDrawRectangle(
HBRUSH oldBrush;
HDC dc;
- if (!d) {
+ if (d == None) {
return BadDrawable;
}
@@ -1214,7 +1214,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 25bb6f8..43c5e25 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -242,7 +242,7 @@ TkpUseWindow(
*/
/*
- if (winPtr->window) {
+ if (winPtr->window != None) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"can't modify container after widget is created", -1));
Tcl_SetErrorCode(interp, "TK", "EMBED", "POST_CREATE", NULL);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 977086b..e47637c 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);
/*
@@ -632,7 +632,7 @@ TkpGetFontFamilies(
Tcl_Obj *resultObj;
window = Tk_WindowId(tkwin);
- hwnd = window ? TkWinGetHWND(window) : NULL;
+ hwnd = (window == None) ? NULL : TkWinGetHWND(window);
hdc = GetDC(hwnd);
resultObj = Tcl_NewObj();
@@ -988,7 +988,7 @@ Tk_MeasureChars(
}
*lengthPtr = curX;
- return p - source;
+ return (int)(p - source);
}
/*
@@ -1089,7 +1089,7 @@ Tk_DrawChars(
fontPtr = (WinFont *) gc->font;
display->request++;
- if (!drawable) {
+ if (drawable == None) {
return;
}
@@ -1097,14 +1097,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;
@@ -1237,7 +1237,7 @@ TkDrawAngledChars(
fontPtr = (WinFont *) gc->font;
display->request++;
- if (!drawable) {
+ if (drawable == None) {
return;
}
@@ -1245,14 +1245,14 @@ TkDrawAngledChars(
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;
@@ -1568,7 +1568,7 @@ InitFont(
TCHAR buf[LF_FACESIZE];
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 d61b84a..0a8ef73 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -347,7 +347,7 @@ XGetImageZPixmap(
size = sizeof(BITMAPINFO);
if (depth <= 8) {
- size += sizeof(unsigned short) * (1 << depth);
+ size += sizeof(unsigned short) << depth;
}
bmInfo = ckalloc(size);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index b03cf6d..dd7d1cb 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -2364,7 +2364,7 @@ DrawMenuEntryLabel(
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
(unsigned) width, (unsigned) height);
} else if ((mePtr->image != NULL)
- && menuPtr->disabledImageGC) {
+ && (menuPtr->disabledImageGC != NULL)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
leftEdge + imageXOffset,
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
@@ -3005,7 +3005,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 a45a322..aa1ebde 100644
--- a/win/tkWinPixmap.c
+++ b/win/tkWinPixmap.c
@@ -115,7 +115,7 @@ Tk_GetPixmap(
if (newTwdPtr->bitmap.handle == NULL) {
ckfree(newTwdPtr);
- return 0;
+ return None;
}
return (Pixmap) newTwdPtr;
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index 869c059..6f1f840 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -401,7 +401,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;
@@ -432,7 +432,7 @@ XSetInputFocus(
Time time)
{
display->request++;
- if (focus) {
+ if (focus != None) {
SetFocus(Tk_GetHWND(focus));
}
return Success;
@@ -479,7 +479,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 d9e7812..f5ac68b 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -90,6 +90,10 @@
* See ticket [916c1095438eae56]: GetVersionExW triggers warnings
*/
#if defined(_MSC_VER)
+# pragma warning(disable:4267)
+# pragma warning(disable:4244)
+# pragma warning(disable:4311)
+# pragma warning(disable:4312)
# pragma warning(disable:4996)
#endif
@@ -117,7 +121,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 5393054..1b3717e 100644
--- a/win/tkWinScrlbr.c
+++ b/win/tkWinScrlbr.c
@@ -237,7 +237,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 d037f07..385e72b 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -233,7 +233,7 @@ TkpScanWindowId(
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
} else {
- *idPtr = 0;
+ *idPtr = None;
}
return TCL_OK;
}
@@ -264,7 +264,7 @@ TkpMakeWindow(
int style;
HWND hwnd;
- if (parent) {
+ if (parent != None) {
parentWin = Tk_GetHWND(parent);
style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
} else {
@@ -674,7 +674,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 7c73094..97cf255 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -978,7 +978,7 @@ WinSetIcon(
NULL);
return TCL_ERROR;
}
- if (!Tk_WindowId(tkw)) {
+ if (Tk_WindowId(tkw) == None) {
Tk_MakeWindowExist(tkw);
}
@@ -1144,7 +1144,7 @@ TkWinGetIcon(
}
}
- if (!Tk_WindowId(tkwin)) {
+ if (Tk_WindowId(tkwin) == None) {
Tk_MakeWindowExist(tkwin);
}
@@ -1922,11 +1922,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.
@@ -2007,7 +2007,7 @@ UpdateWrapper(
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (!winPtr->window) {
+ if (winPtr->window == None) {
/*
* Ensure existence of the window to update the wrapper for.
*/
@@ -2625,7 +2625,7 @@ TkWmDeadWindow(
VisibilityChangeMask|StructureNotifyMask,
WmWaitVisibilityOrMapProc, wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
- if (wmPtr2->wrapper
+ if ((wmPtr2->wrapper != NULL)
&& !(wmPtr2->flags & (WM_NEVER_MAPPED))) {
UpdateWrapper(wmPtr2->winPtr);
}
@@ -3433,7 +3433,7 @@ WmColormapwindowsCmd(
if (winPtr2 == winPtr) {
gotToplevel = 1;
}
- if (!winPtr2->window) {
+ if (winPtr2->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr2);
}
cmapList[i] = winPtr2;
@@ -3721,7 +3721,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;
@@ -4023,9 +4023,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) {
@@ -4078,7 +4078,7 @@ WmIconbitmapCmd(
Tcl_ResetResult(interp);
pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, string);
- if (!pixmap) {
+ if (pixmap == None) {
return TCL_ERROR;
}
wmPtr->hints.icon_pixmap = pixmap;
@@ -4206,13 +4206,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;
@@ -6427,7 +6427,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;
@@ -6854,7 +6854,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) {
@@ -6864,7 +6864,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) {
@@ -6915,7 +6915,7 @@ TkWmAddToColormapWindows(
TkWindow **oldPtr, **newPtr;
int count, i;
- if (!winPtr->window) {
+ if (winPtr->window == None) {
return;
}
@@ -7350,7 +7350,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);
}
@@ -8623,7 +8623,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 661be57..ec1fef3 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -522,10 +522,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);
}
@@ -585,7 +585,7 @@ TkpOpenDisplay(
twdPtr = ckalloc(sizeof(TkWinDrawable));
if (twdPtr == NULL) {
- return 0;
+ return NULL;
}
twdPtr->type = TWD_WINDOW;
twdPtr->window.winPtr = NULL;
@@ -598,7 +598,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;
@@ -655,10 +655,10 @@ TkpCloseDisplay(
if (display->screens->root_visual != NULL) {
ckfree(display->screens->root_visual);
}
- if (display->screens->root) {
+ if (display->screens->root != None) {
ckfree(display->screens->root);
}
- if (display->screens->cmap) {
+ if (display->screens->cmap != None) {
XFreeColormap(display, display->screens->cmap);
}
ckfree(display->screens);
@@ -998,7 +998,7 @@ GenerateXEvent(
}
winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd);
- if (!winPtr || !winPtr->window) {
+ if (!winPtr || winPtr->window == None) {
return;
}
@@ -1121,7 +1121,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;
@@ -1623,7 +1623,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 de207ad..3de1504 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -455,7 +455,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;