diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-01-08 08:31:34 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-01-08 08:31:34 (GMT) |
commit | 1cf82956754b0b42ef212635195b5c29fc93a0fc (patch) | |
tree | b6bf6eaff55be5c6fd20363aea6473c6bfbd76ad | |
parent | 726546cf2742672ce6de89b0500b3e750c6fe3b7 (diff) | |
parent | d2747a371058fa4128dbd7896fe040f0b3ee6be7 (diff) | |
download | tk-1cf82956754b0b42ef212635195b5c29fc93a0fc.zip tk-1cf82956754b0b42ef212635195b5c29fc93a0fc.tar.gz tk-1cf82956754b0b42ef212635195b5c29fc93a0fc.tar.bz2 |
Fix [9e31fd944934e269121fa78ff56b7b86f33e6db6|9e31fd9449]: X11/X.h and Windows.h have conflicting symbols.
*** POTENTIAL INCOMPATIBILITY *** on Windows only: gcc/clang/MSVC will generate new warnings in extensions when the "None" symbol is used incorrectly.
Those warnings are all fixed in the core, that's what most of this commit is doing.
66 files changed, 323 insertions, 309 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c index caa40dd..4697415 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -237,9 +237,9 @@ Tk_Get3DBorder( borderPtr->darkColorPtr = NULL; borderPtr->lightColorPtr = NULL; borderPtr->shadow = None; - borderPtr->bgGC = None; - borderPtr->darkGC = None; - borderPtr->lightGC = None; + borderPtr->bgGC = NULL; + borderPtr->darkGC = NULL; + borderPtr->lightGC = NULL; borderPtr->hashPtr = hashPtr; borderPtr->nextPtr = existingBorderPtr; Tcl_SetHashValue(hashPtr, borderPtr); @@ -375,7 +375,7 @@ Tk_3DBorderGC( { TkBorder * borderPtr = (TkBorder *) border; - if ((borderPtr->lightGC == None) && (which != TK_3D_FLAT_GC)) { + if ((borderPtr->lightGC == NULL) && (which != TK_3D_FLAT_GC)) { TkpGetShadows(borderPtr, tkwin); } if (which == TK_3D_FLAT_GC) { @@ -392,7 +392,7 @@ Tk_3DBorderGC( * compilers happy. */ - return (GC) None; + return NULL; } /* @@ -440,13 +440,13 @@ Tk_Free3DBorder( if (borderPtr->shadow != None) { Tk_FreeBitmap(display, borderPtr->shadow); } - if (borderPtr->bgGC != None) { + if (borderPtr->bgGC != NULL) { Tk_FreeGC(display, borderPtr->bgGC); } - if (borderPtr->darkGC != None) { + if (borderPtr->darkGC != NULL) { Tk_FreeGC(display, borderPtr->darkGC); } - if (borderPtr->lightGC != None) { + if (borderPtr->lightGC != NULL) { Tk_FreeGC(display, borderPtr->lightGC); } if (prevPtr == borderPtr) { @@ -759,7 +759,7 @@ Tk_Draw3DPolygon( int i, lightOnLeft, dx, dy, parallel, pointsSeen; Display *display = Tk_Display(tkwin); - if (borderPtr->lightGC == None) { + if (borderPtr->lightGC == NULL) { TkpGetShadows(borderPtr, tkwin); } diff --git a/generic/tk3d.h b/generic/tk3d.h index 5e0a0cf..30a35c5 100644 --- a/generic/tk3d.h +++ b/generic/tk3d.h @@ -60,10 +60,10 @@ typedef struct TkBorder { GC bgGC; /* Used (if necessary) to draw areas in the * background color. */ GC darkGC; /* Used to draw darker parts of the border. - * None means the shadow colors haven't been + * NULL means the shadow colors haven't been * allocated yet.*/ GC lightGC; /* Used to draw lighter parts of the border. - * None means the shadow colors haven't been + * NULL means the shadow colors haven't been * allocated yet. */ Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to * delete structure). */ diff --git a/generic/tkBind.c b/generic/tkBind.c index c4f8226..98c491a 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -3870,7 +3870,7 @@ DoWarp( { TkDisplay *dispPtr = (TkDisplay *) clientData; - XWarpPointer(dispPtr->display, (Window) None, (Window) dispPtr->warpWindow, + XWarpPointer(dispPtr->display, None, (Window) dispPtr->warpWindow, 0, 0, 0, 0, (int) dispPtr->warpX, (int) dispPtr->warpY); XForceScreenSaver(dispPtr->display, ScreenSaverReset); dispPtr->flags &= ~TK_DISPLAY_IN_WARP; diff --git a/generic/tkButton.c b/generic/tkButton.c index 70bba83..0de949c 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -710,12 +710,12 @@ ButtonCreate( butPtr->normalFg = NULL; butPtr->activeFg = NULL; butPtr->disabledFg = NULL; - butPtr->normalTextGC = None; - butPtr->activeTextGC = None; - butPtr->disabledGC = None; - butPtr->stippleGC = None; + butPtr->normalTextGC = NULL; + butPtr->activeTextGC = NULL; + butPtr->disabledGC = NULL; + butPtr->stippleGC = NULL; butPtr->gray = None; - butPtr->copyGC = None; + butPtr->copyGC = NULL; butPtr->widthPtr = NULL; butPtr->width = 0; butPtr->heightPtr = NULL; @@ -740,7 +740,7 @@ ButtonCreate( butPtr->onValuePtr = NULL; butPtr->offValuePtr = NULL; butPtr->tristateValuePtr = NULL; - butPtr->cursor = None; + butPtr->cursor = NULL; butPtr->takeFocusPtr = NULL; butPtr->commandPtr = NULL; butPtr->flags = 0; @@ -978,22 +978,22 @@ DestroyButton( if (butPtr->tristateImage != NULL) { Tk_FreeImage(butPtr->tristateImage); } - if (butPtr->normalTextGC != None) { + if (butPtr->normalTextGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->normalTextGC); } - if (butPtr->activeTextGC != None) { + if (butPtr->activeTextGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->activeTextGC); } - if (butPtr->disabledGC != None) { + if (butPtr->disabledGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->disabledGC); } - if (butPtr->stippleGC != None) { + if (butPtr->stippleGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->stippleGC); } if (butPtr->gray != None) { Tk_FreeBitmap(butPtr->display, butPtr->gray); } - if (butPtr->copyGC != None) { + if (butPtr->copyGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->copyGC); } if (butPtr->textLayout != NULL) { @@ -1366,7 +1366,7 @@ TkButtonWorldChanged( gcValues.graphics_exposures = False; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); - if (butPtr->normalTextGC != None) { + if (butPtr->normalTextGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->normalTextGC); } butPtr->normalTextGC = newGC; @@ -1376,7 +1376,7 @@ TkButtonWorldChanged( gcValues.background = Tk_3DBorderColor(butPtr->activeBorder)->pixel; mask = GCForeground | GCBackground | GCFont; newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); - if (butPtr->activeTextGC != None) { + if (butPtr->activeTextGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->activeTextGC); } butPtr->activeTextGC = newGC; @@ -1388,7 +1388,7 @@ TkButtonWorldChanged( * Create the GC that can be used for stippling */ - if (butPtr->stippleGC == None) { + if (butPtr->stippleGC == NULL) { gcValues.foreground = gcValues.background; mask = GCForeground; if (butPtr->gray == None) { @@ -1414,12 +1414,12 @@ TkButtonWorldChanged( gcValues.foreground = gcValues.background; } newGC = Tk_GetGC(butPtr->tkwin, mask, &gcValues); - if (butPtr->disabledGC != None) { + if (butPtr->disabledGC != NULL) { Tk_FreeGC(butPtr->display, butPtr->disabledGC); } butPtr->disabledGC = newGC; - if (butPtr->copyGC == None) { + if (butPtr->copyGC == NULL) { butPtr->copyGC = Tk_GetGC(butPtr->tkwin, 0, &gcValues); } diff --git a/generic/tkButton.h b/generic/tkButton.h index 09aaee2..d669b02 100644 --- a/generic/tkButton.h +++ b/generic/tkButton.h @@ -235,7 +235,7 @@ typedef struct { * Miscellaneous information: */ - Tk_Cursor cursor; /* Value of -cursor option: if not None, + Tk_Cursor cursor; /* Value of -cursor option: if not NULL, * specifies current cursor for window. */ Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index ecd57b8..55012a8 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -300,7 +300,7 @@ CreateArc( arcPtr->activeFillStipple = None; arcPtr->disabledFillStipple = None; arcPtr->style = PIESLICE_STYLE; - arcPtr->fillGC = None; + arcPtr->fillGC = NULL; /* * Process the arguments to fill in the item record. @@ -493,9 +493,9 @@ ConfigureArc( mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc); } arcPtr->outline.gc = newGC; @@ -527,9 +527,9 @@ ConfigureArc( } if (arcPtr->style == ARC_STYLE) { - newGC = None; + newGC = NULL; } else if (color == NULL) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = color->pixel; if (arcPtr->style == CHORD_STYLE) { @@ -545,7 +545,7 @@ ConfigureArc( } newGC = Tk_GetGC(tkwin, mask, &gcValues); } - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), arcPtr->fillGC); } arcPtr->fillGC = newGC; @@ -618,7 +618,7 @@ DeleteArc( if (arcPtr->disabledFillStipple != None) { Tk_FreeBitmap(display, arcPtr->disabledFillStipple); } - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC != NULL) { Tk_FreeGC(display, arcPtr->fillGC); } } @@ -749,7 +749,7 @@ ComputeArcBbox( * drawn) and add one extra pixel just for safety. */ - if (arcPtr->outline.gc == None) { + if (arcPtr->outline.gc == NULL) { tmp = 1; } else { tmp = (int) ((width + 1.0)/2.0 + 1); @@ -848,7 +848,7 @@ DisplayArc( * window servers to crash and should be a no-op anyway. */ - if ((arcPtr->fillGC != None) && (extent != 0)) { + if ((arcPtr->fillGC != NULL) && (extent != 0)) { if (stipple != None) { int w = 0; int h = 0; @@ -882,7 +882,7 @@ DisplayArc( XSetTSOrigin(display, arcPtr->fillGC, 0, 0); } } - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc != NULL) { Tk_ChangeOutlineGC(canvas, itemPtr, &(arcPtr->outline)); if (extent != 0) { @@ -920,13 +920,13 @@ DisplayArc( } else { if (arcPtr->style == CHORD_STYLE) { TkFillPolygon(canvas, arcPtr->outlinePtr, CHORD_OUTLINE_PTS, - display, drawable, arcPtr->outline.gc, None); + display, drawable, arcPtr->outline.gc, NULL); } else if (arcPtr->style == PIESLICE_STYLE) { TkFillPolygon(canvas, arcPtr->outlinePtr, PIE_OUTLINE1_PTS, - display, drawable, arcPtr->outline.gc, None); + display, drawable, arcPtr->outline.gc, NULL); TkFillPolygon(canvas, arcPtr->outlinePtr + 2*PIE_OUTLINE1_PTS, PIE_OUTLINE2_PTS, display, drawable, - arcPtr->outline.gc, None); + arcPtr->outline.gc, NULL); } } @@ -1032,12 +1032,12 @@ ArcToPoint( return dist; } - if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { + if ((arcPtr->fillGC != NULL) || (arcPtr->outline.gc == NULL)) { filled = 1; } else { filled = 0; } - if (arcPtr->outline.gc == None) { + if (arcPtr->outline.gc == NULL) { width = 0.0; } @@ -1159,12 +1159,12 @@ ArcToArea( } } - if ((arcPtr->fillGC != None) || (arcPtr->outline.gc == None)) { + if ((arcPtr->fillGC != NULL) || (arcPtr->outline.gc == NULL)) { filled = 1; } else { filled = 0; } - if (arcPtr->outline.gc == None) { + if (arcPtr->outline.gc == NULL) { width = 0.0; } @@ -1891,7 +1891,7 @@ ArcToPostscript( * arc. */ - if (arcPtr->fillGC != None) { + if (arcPtr->fillGC != NULL) { sprintf(buffer, "matrix currentmatrix\n%.15g %.15g translate %.15g %.15g scale\n", (arcPtr->bbox[0] + arcPtr->bbox[2])/2, (y1 + y2)/2, (arcPtr->bbox[2] - arcPtr->bbox[0])/2, (y1 - y2)/2); @@ -1913,7 +1913,7 @@ ArcToPostscript( if (Tk_CanvasPsStipple(interp, canvas, fillStipple) != TCL_OK) { return TCL_ERROR; } - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc != NULL) { Tcl_AppendResult(interp, "grestore gsave\n", NULL); } } else { @@ -1925,7 +1925,7 @@ ArcToPostscript( * If there's an outline for the arc, draw it. */ - if (arcPtr->outline.gc != None) { + if (arcPtr->outline.gc != NULL) { sprintf(buffer, "matrix currentmatrix\n%.15g %.15g translate %.15g %.15g scale\n", (arcPtr->bbox[0] + arcPtr->bbox[2])/2, (y1 + y2)/2, (arcPtr->bbox[2] - arcPtr->bbox[0])/2, (y1 - y2)/2); diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 30aa429..fd8532f 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -191,7 +191,7 @@ TkcCreateBitmap( bmapPtr->bgColor = NULL; bmapPtr->activeBgColor = NULL; bmapPtr->disabledBgColor = NULL; - bmapPtr->gc = None; + bmapPtr->gc = NULL; /* * Process the arguments to fill in the item record. Only 1 (list) or 2 (x @@ -377,7 +377,7 @@ ConfigureBitmap( } if (bitmap == None) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = fgColor->pixel; mask = GCForeground; @@ -390,7 +390,7 @@ ConfigureBitmap( } newGC = Tk_GetGC(tkwin, mask, &gcValues); } - if (bmapPtr->gc != None) { + if (bmapPtr->gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), bmapPtr->gc); } bmapPtr->gc = newGC; diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 9e928c7..81971c1 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -453,7 +453,7 @@ ComputeImageBbox( x = (int) (imgPtr->x + ((imgPtr->x >= 0) ? 0.5 : - 0.5)); y = (int) (imgPtr->y + ((imgPtr->y >= 0) ? 0.5 : - 0.5)); - if ((state == TK_STATE_HIDDEN) || (image == None)) { + if ((state == TK_STATE_HIDDEN) || (image == NULL)) { imgPtr->header.x1 = imgPtr->header.x2 = x; imgPtr->header.y1 = imgPtr->header.y2 = y; return; diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index cce3460..0294aa8 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -303,7 +303,7 @@ CreateLine( linePtr->coordPtr = NULL; linePtr->capStyle = CapButt; linePtr->joinStyle = JoinRound; - linePtr->arrowGC = None; + linePtr->arrowGC = NULL; linePtr->arrow = ARROWS_NONE; linePtr->arrowShapeA = (float)8.0; linePtr->arrowShapeB = (float)10.0; @@ -531,12 +531,12 @@ ConfigureLine( #endif arrowGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = arrowGC = None; + newGC = arrowGC = NULL; } - if (linePtr->outline.gc != None) { + if (linePtr->outline.gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc); } - if (linePtr->arrowGC != None) { + if (linePtr->arrowGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), linePtr->arrowGC); } linePtr->outline.gc = newGC; @@ -621,7 +621,7 @@ DeleteLine( if (linePtr->coordPtr != NULL) { ckfree((char *) linePtr->coordPtr); } - if (linePtr->arrowGC != None) { + if (linePtr->arrowGC != NULL) { Tk_FreeGC(display, linePtr->arrowGC); } if (linePtr->firstArrowPtr != NULL) { @@ -846,7 +846,7 @@ DisplayLine( int numPoints; Tk_State state = itemPtr->state; - if ((!linePtr->numPoints)||(linePtr->outline.gc==None)) { + if (!linePtr->numPoints || (linePtr->outline.gc == NULL)) { return; } @@ -2251,7 +2251,7 @@ LineToPostscript( * being created. */ { LineItem *linePtr = (LineItem *) itemPtr; - char buffer[64 + TCL_INTEGER_SPACE]; + char buffer[64 + 4*TCL_INTEGER_SPACE]; char *style; double width; diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index b86bc63..630400f 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -279,7 +279,7 @@ CreatePolygon( polyPtr->fillStipple = None; polyPtr->activeFillStipple = None; polyPtr->disabledFillStipple = None; - polyPtr->fillGC = None; + polyPtr->fillGC = NULL; polyPtr->smooth = NULL; polyPtr->splineSteps = 12; polyPtr->autoClosed = 0; @@ -484,9 +484,9 @@ ConfigurePolygon( mask |= GCCapStyle|GCJoinStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } - if (polyPtr->outline.gc != None) { + if (polyPtr->outline.gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), polyPtr->outline.gc); } polyPtr->outline.gc = newGC; @@ -510,7 +510,7 @@ ConfigurePolygon( } if (color == NULL) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = color->pixel; mask = GCForeground; @@ -530,7 +530,7 @@ ConfigurePolygon( #endif newGC = Tk_GetGC(tkwin, mask, &gcValues); } - if (polyPtr->fillGC != None) { + if (polyPtr->fillGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), polyPtr->fillGC); } polyPtr->fillGC = newGC; @@ -596,7 +596,7 @@ DeletePolygon( if (polyPtr->disabledFillStipple != None) { Tk_FreeBitmap(display, polyPtr->disabledFillStipple); } - if (polyPtr->fillGC != None) { + if (polyPtr->fillGC != NULL) { Tk_FreeGC(display, polyPtr->fillGC); } } @@ -698,7 +698,7 @@ ComputePolygonBbox( } } - if (polyPtr->outline.gc != None) { + if (polyPtr->outline.gc != NULL) { tsoffset = &polyPtr->outline.tsoffset; if (tsoffset) { if (tsoffset->flags & TK_OFFSET_INDEX) { @@ -840,11 +840,11 @@ TkFillPolygon( * allocated. */ - if (gc != None && numPoints>3) { + if (gc != NULL && numPoints>3) { XFillPolygon(display, drawable, gc, pointPtr, numPoints, Complex, CoordModeOrigin); } - if (outlineGC != None) { + if (outlineGC != NULL) { XDrawLines(display, drawable, outlineGC, pointPtr, numPoints, CoordModeOrigin); } @@ -885,9 +885,9 @@ DisplayPolygon( Pixmap stipple = polyPtr->fillStipple; double linewidth = polyPtr->outline.width; - if (((polyPtr->fillGC == None) && (polyPtr->outline.gc == None)) || + if (((polyPtr->fillGC == NULL) && (polyPtr->outline.gc == NULL)) || (polyPtr->numPoints < 1) || - (polyPtr->numPoints < 3 && polyPtr->outline.gc == None)) { + (polyPtr->numPoints < 3 && polyPtr->outline.gc == NULL)) { return; } @@ -915,7 +915,7 @@ DisplayPolygon( * reset the offset when done, since the GC is supposed to be read-only. */ - if ((stipple != None) && (polyPtr->fillGC != None)) { + if ((stipple != None) && (polyPtr->fillGC != NULL)) { Tk_TSOffset *tsoffset = &polyPtr->tsoffset; int w=0; int h=0; int flags = tsoffset->flags; @@ -977,11 +977,11 @@ DisplayPolygon( } numPoints = polyPtr->smooth->coordProc(canvas, polyPtr->coordPtr, polyPtr->numPoints, polyPtr->splineSteps, pointPtr, NULL); - if (polyPtr->fillGC != None) { + if (polyPtr->fillGC != NULL) { XFillPolygon(display, drawable, polyPtr->fillGC, pointPtr, numPoints, Complex, CoordModeOrigin); } - if (polyPtr->outline.gc != None) { + if (polyPtr->outline.gc != NULL) { XDrawLines(display, drawable, polyPtr->outline.gc, pointPtr, numPoints, CoordModeOrigin); } @@ -990,7 +990,7 @@ DisplayPolygon( } } Tk_ResetOutlineGC(canvas, itemPtr, &(polyPtr->outline)); - if ((stipple != None) && (polyPtr->fillGC != None)) { + if ((stipple != None) && (polyPtr->fillGC != NULL)) { XSetTSOrigin(display, polyPtr->fillGC, 0, 0); } } @@ -1303,7 +1303,7 @@ PolygonToPoint( if (bestDist<=0.0) { goto donepoint; } - if ((polyPtr->outline.gc != None) && (polyPtr->joinStyle == JoinRound)) { + if ((polyPtr->outline.gc != NULL) && (polyPtr->joinStyle == JoinRound)) { dist = bestDist - radius; if (dist <= 0.0) { bestDist = 0.0; @@ -1313,7 +1313,7 @@ PolygonToPoint( } } - if ((polyPtr->outline.gc == None) || (width <= 1)) { + if ((polyPtr->outline.gc == NULL) || (width <= 1)) { goto donepoint; } @@ -1520,7 +1520,7 @@ PolygonToArea( goto donearea; } - if (polyPtr->outline.gc == None) { + if (polyPtr->outline.gc == NULL) { goto donearea; } diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 24c3c7f..717184a 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -265,9 +265,9 @@ CreateText( textPtr->textLayout = NULL; textPtr->leftEdge = 0; textPtr->rightEdge = 0; - textPtr->gc = None; - textPtr->selTextGC = None; - textPtr->cursorOffGC = None; + textPtr->gc = NULL; + textPtr->selTextGC = NULL; + textPtr->cursorOffGC = NULL; /* * Process the arguments to fill in the item record. Only 1 (list) or 2 (x @@ -442,7 +442,7 @@ ConfigureText( } } - newGC = newSelGC = None; + newGC = newSelGC = NULL; if (textPtr->tkfont != NULL) { gcValues.font = Tk_FontId(textPtr->tkfont); mask = GCFont; @@ -467,11 +467,11 @@ ConfigureText( } newSelGC = Tk_GetGC(tkwin, mask|GCForeground, &gcValues); } - if (textPtr->gc != None) { + if (textPtr->gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->gc); } textPtr->gc = newGC; - if (textPtr->selTextGC != None) { + if (textPtr->selTextGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->selTextGC); } textPtr->selTextGC = newSelGC; @@ -486,9 +486,9 @@ ConfigureText( } newGC = Tk_GetGC(tkwin, GCForeground, &gcValues); } else { - newGC = None; + newGC = NULL; } - if (textPtr->cursorOffGC != None) { + if (textPtr->cursorOffGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC); } textPtr->cursorOffGC = newGC; @@ -572,13 +572,13 @@ DeleteText( } Tk_FreeTextLayout(textPtr->textLayout); - if (textPtr->gc != None) { + if (textPtr->gc != NULL) { Tk_FreeGC(display, textPtr->gc); } - if (textPtr->selTextGC != None) { + if (textPtr->selTextGC != NULL) { Tk_FreeGC(display, textPtr->selTextGC); } - if (textPtr->cursorOffGC != None) { + if (textPtr->cursorOffGC != NULL) { Tk_FreeGC(display, textPtr->cursorOffGC); } } @@ -740,7 +740,7 @@ DisplayCanvText( } } - if (textPtr->gc == None) { + if (textPtr->gc == NULL) { return; } @@ -830,7 +830,7 @@ DisplayCanvText( drawableX, drawableY, textInfoPtr->insertWidth, height, textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED); - } else if (textPtr->cursorOffGC != None) { + } else if (textPtr->cursorOffGC != NULL) { /* * Redraw the background over the area of the cursor, even * though the cursor is turned off. This guarantees that the diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 08aeab7..d051e27 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -959,7 +959,7 @@ void Tk_CreateOutline( Tk_Outline *outline) /* Outline structure to be filled in. */ { - outline->gc = None; + outline->gc = NULL; outline->width = 1.0; outline->activeWidth = 0.0; outline->disabledWidth = 0.0; @@ -1000,7 +1000,7 @@ Tk_DeleteOutline( Display *display, /* Display containing window. */ Tk_Outline *outline) { - if (outline->gc != None) { + if (outline->gc != NULL) { Tk_FreeGC(display, outline->gc); } if ((unsigned int)ABS(outline->dash.number) > sizeof(char *)) { diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 8ebe9ba..dbb927b 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -417,7 +417,7 @@ Tk_CanvasObjCmd( canvasPtr->highlightBgColorPtr = NULL; canvasPtr->highlightColorPtr = NULL; canvasPtr->inset = 0; - canvasPtr->pixmapGC = None; + canvasPtr->pixmapGC = NULL; canvasPtr->width = None; canvasPtr->height = None; canvasPtr->confine = 0; @@ -463,7 +463,7 @@ Tk_CanvasObjCmd( canvasPtr->scanYOrigin = 0; canvasPtr->hotPtr = NULL; canvasPtr->hotPrevPtr = NULL; - canvasPtr->cursor = None; + canvasPtr->cursor = NULL; canvasPtr->takeFocus = NULL; canvasPtr->pixelsPerMM = WidthOfScreen(Tk_Screen(newWin)); canvasPtr->pixelsPerMM /= WidthMMOfScreen(Tk_Screen(newWin)); @@ -1834,7 +1834,7 @@ DestroyCanvas( */ Tcl_DeleteHashTable(&canvasPtr->idTable); - if (canvasPtr->pixmapGC != None) { + if (canvasPtr->pixmapGC != NULL) { Tk_FreeGC(canvasPtr->display, canvasPtr->pixmapGC); } #ifndef USE_OLD_TAG_SEARCH @@ -1910,7 +1910,7 @@ ConfigureCanvas( gcValues.foreground = Tk_3DBorderColor(canvasPtr->bgBorder)->pixel; newGC = Tk_GetGC(canvasPtr->tkwin, GCFunction|GCGraphicsExposures|GCForeground, &gcValues); - if (canvasPtr->pixmapGC != None) { + if (canvasPtr->pixmapGC != NULL) { Tk_FreeGC(canvasPtr->display, canvasPtr->pixmapGC); } canvasPtr->pixmapGC = newGC; diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index d009cfa..5e784e3 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -206,7 +206,7 @@ typedef struct TkCanvas { * Miscellaneous information: */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ diff --git a/generic/tkColor.c b/generic/tkColor.c index 76d0baa..bd14f87 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -242,7 +242,7 @@ Tk_GetColor( */ tkColPtr->magic = COLOR_MAGIC; - tkColPtr->gc = None; + tkColPtr->gc = NULL; tkColPtr->screen = Tk_Screen(tkwin); tkColPtr->colormap = Tk_Colormap(tkwin); tkColPtr->visual = Tk_Visual(tkwin); @@ -323,7 +323,7 @@ Tk_GetColorByValue( tkColPtr = TkpGetColorByValue(tkwin, colorPtr); tkColPtr->magic = COLOR_MAGIC; - tkColPtr->gc = None; + tkColPtr->gc = NULL; tkColPtr->screen = Tk_Screen(tkwin); tkColPtr->colormap = valueKey.colormap; tkColPtr->visual = Tk_Visual(tkwin); @@ -414,7 +414,7 @@ Tk_GCForColor( Tcl_Panic("Tk_GCForColor called with bogus color"); } - if (tkColPtr->gc == None) { + if (tkColPtr->gc == NULL) { gcValues.foreground = tkColPtr->color.pixel; tkColPtr->gc = XCreateGC(DisplayOfScreen(tkColPtr->screen), drawable, GCForeground, &gcValues); @@ -469,9 +469,9 @@ Tk_FreeColor( * longer any objects referencing it. */ - if (tkColPtr->gc != None) { + if (tkColPtr->gc != NULL) { XFreeGC(DisplayOfScreen(screen), tkColPtr->gc); - tkColPtr->gc = None; + tkColPtr->gc = NULL; } TkpFreeColor(tkColPtr); diff --git a/generic/tkColor.h b/generic/tkColor.h index d4679cf..12c6662 100644 --- a/generic/tkColor.h +++ b/generic/tkColor.h @@ -37,7 +37,7 @@ typedef struct TkColor { * COLOR_MAGIC. */ GC gc; /* Simple gc with this color as foreground * color and all other fields defaulted. May - * be None. */ + * be NULL. */ Screen *screen; /* Screen where this color is valid. Used to * delete it, and to find its display. */ Colormap colormap; /* Colormap from which this entry was diff --git a/generic/tkConfig.c b/generic/tkConfig.c index f2eaa33..d586787 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -854,11 +854,11 @@ DoObjConfig( Tk_Cursor newCursor; if (nullOK && ObjectIsEmpty(valuePtr)) { - newCursor = None; + newCursor = NULL; valuePtr = NULL; } else { newCursor = Tk_AllocCursorFromObj(interp, tkwin, valuePtr); - if (newCursor == None) { + if (newCursor == NULL) { return TCL_ERROR; } } @@ -916,7 +916,7 @@ DoObjConfig( if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; - newWin = None; + newWin = NULL; } else { if (TkGetWindowFromObj(interp, tkwin, valuePtr, &newWin) != TCL_OK) { @@ -1700,9 +1700,9 @@ FreeResources( break; case TK_OPTION_CURSOR: if (internalFormExists) { - if (*((Tk_Cursor *) internalPtr) != None) { + if (*((Tk_Cursor *) internalPtr) != NULL) { Tk_FreeCursor(Tk_Display(tkwin), *((Tk_Cursor *) internalPtr)); - *((Tk_Cursor *) internalPtr) = None; + *((Tk_Cursor *) internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_FreeCursorFromObj(tkwin, objPtr); @@ -1974,7 +1974,7 @@ GetObjectForOption( case TK_OPTION_CURSOR: { Tk_Cursor cursor = *((Tk_Cursor *) internalPtr); - if (cursor != None) { + if (cursor != NULL) { objPtr = Tcl_NewStringObj( Tk_NameOfCursor(Tk_Display(tkwin), cursor), -1); } diff --git a/generic/tkCursor.c b/generic/tkCursor.c index 410aea9..e5b5df5 100644 --- a/generic/tkCursor.c +++ b/generic/tkCursor.c @@ -149,7 +149,7 @@ Tk_AllocCursorFromObj( cursorPtr = TkcGetCursor(interp, tkwin, Tcl_GetString(objPtr)); objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr; if (cursorPtr == NULL) { - return None; + return NULL; } cursorPtr->objRefCount++; return cursorPtr->cursor; @@ -188,7 +188,7 @@ Tk_GetCursor( { TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string); if (cursorPtr == NULL) { - return None; + return NULL; } return cursorPtr->cursor; } @@ -382,7 +382,7 @@ Tk_GetCursorFromData( error: Tcl_DeleteHashEntry(dataHashPtr); - return None; + return NULL; } /* diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 9f43f90..f35d2b7 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -523,16 +523,16 @@ Tk_EntryObjCmd( entryPtr->selectFirst = -1; entryPtr->selectLast = -1; - entryPtr->cursor = None; + entryPtr->cursor = NULL; entryPtr->exportSelection = 1; entryPtr->justify = TK_JUSTIFY_LEFT; entryPtr->relief = TK_RELIEF_FLAT; entryPtr->state = STATE_NORMAL; entryPtr->displayString = entryPtr->string; entryPtr->inset = XPAD; - entryPtr->textGC = None; - entryPtr->selTextGC = None; - entryPtr->highlightGC = None; + entryPtr->textGC = NULL; + entryPtr->selTextGC = NULL; + entryPtr->highlightGC = NULL; entryPtr->avgWidth = 1; entryPtr->validate = VALIDATE_NONE; @@ -1030,10 +1030,10 @@ DestroyEntry( EntryTextVarProc, (ClientData) entryPtr); entryPtr->flags &= ~ENTRY_VAR_TRACED; } - if (entryPtr->textGC != None) { + if (entryPtr->textGC != NULL) { Tk_FreeGC(entryPtr->display, entryPtr->textGC); } - if (entryPtr->selTextGC != None) { + if (entryPtr->selTextGC != NULL) { Tk_FreeGC(entryPtr->display, entryPtr->selTextGC); } Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler); @@ -1423,7 +1423,7 @@ EntryWorldChanged( ClientData instanceData) /* Information about widget. */ { XGCValues gcValues; - GC gc = None; + GC gc = NULL; unsigned long mask; Tk_3DBorder border; XColor *colorPtr; @@ -1475,7 +1475,7 @@ EntryWorldChanged( gcValues.graphics_exposures = False; mask = GCForeground | GCFont | GCGraphicsExposures; gc = Tk_GetGC(entryPtr->tkwin, mask, &gcValues); - if (entryPtr->textGC != None) { + if (entryPtr->textGC != NULL) { Tk_FreeGC(entryPtr->display, entryPtr->textGC); } entryPtr->textGC = gc; @@ -1486,7 +1486,7 @@ EntryWorldChanged( gcValues.font = Tk_FontId(entryPtr->tkfont); mask = GCForeground | GCFont; gc = Tk_GetGC(entryPtr->tkwin, mask, &gcValues); - if (entryPtr->selTextGC != None) { + if (entryPtr->selTextGC != NULL) { Tk_FreeGC(entryPtr->display, entryPtr->selTextGC); } entryPtr->selTextGC = gc; @@ -2451,9 +2451,9 @@ EntryEventProc( } else if ((elem == SEL_BUTTONDOWN) || (elem == SEL_BUTTONUP)) { cursor = sbPtr->bCursor; } else { - cursor = None; + cursor = NULL; } - if (cursor != None) { + if (cursor != NULL) { Tk_DefineCursor(entryPtr->tkwin, cursor); } else { Tk_UndefineCursor(entryPtr->tkwin); @@ -3591,22 +3591,22 @@ Tk_SpinboxObjCmd( entryPtr->selectFirst = -1; entryPtr->selectLast = -1; - entryPtr->cursor = None; + entryPtr->cursor = NULL; entryPtr->exportSelection = 1; entryPtr->justify = TK_JUSTIFY_LEFT; entryPtr->relief = TK_RELIEF_FLAT; entryPtr->state = STATE_NORMAL; entryPtr->displayString = entryPtr->string; entryPtr->inset = XPAD; - entryPtr->textGC = None; - entryPtr->selTextGC = None; - entryPtr->highlightGC = None; + entryPtr->textGC = NULL; + entryPtr->selTextGC = NULL; + entryPtr->highlightGC = NULL; entryPtr->avgWidth = 1; entryPtr->validate = VALIDATE_NONE; sbPtr->selElement = SEL_NONE; sbPtr->curElement = SEL_NONE; - sbPtr->bCursor = None; + sbPtr->bCursor = NULL; sbPtr->repeatDelay = 400; sbPtr->repeatInterval = 100; sbPtr->fromValue = 0.0; diff --git a/generic/tkEntry.h b/generic/tkEntry.h index 2ea7936..da06408 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -87,7 +87,7 @@ typedef struct { * in readonly state, plus used for * background. */ int borderWidth; /* Width of 3-D border around window. */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ int exportSelection; /* Non-zero means tie internal entry selection * to X selection. */ Tk_Font tkfont; /* Information about text font, or NULL. */ @@ -197,7 +197,7 @@ typedef struct { Tk_3DBorder activeBorder; /* Used for drawing border around active * buttons. */ Tk_3DBorder buttonBorder; /* Used for drawing border around buttons. */ - Tk_Cursor bCursor; /* cursor for buttons, or None. */ + Tk_Cursor bCursor; /* cursor for buttons, or NULL. */ int bdRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ int buRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ char *command; /* Command to invoke for spin buttons. NULL diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 747555e..0dd13dc 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -1365,7 +1365,7 @@ Tk_HandleEvent( * handle CreateNotify events, so we gotta pass 'em through. */ - if ((ip.winPtr != None) + if ((ip.winPtr != NULL) && ((mask != SubstructureNotifyMask) || (eventPtr->type == CreateNotify))) { TkBindEventProc(winPtr, eventPtr); @@ -1436,7 +1436,7 @@ TkEventDeadWindow( ipPtr->nextHandler = NULL; } if (ipPtr->winPtr == winPtr) { - ipPtr->winPtr = None; + ipPtr->winPtr = NULL; } } ckfree((char *) handlerPtr); diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 0c3c016..01621dd 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -637,12 +637,12 @@ CreateFrame( framePtr->type = type; framePtr->colormap = colormap; framePtr->relief = TK_RELIEF_FLAT; - framePtr->cursor = None; + framePtr->cursor = NULL; if (framePtr->type == TYPE_LABELFRAME) { Labelframe *labelframePtr = (Labelframe *) framePtr; labelframePtr->labelAnchor = LABELANCHOR_NW; - labelframePtr->textGC = None; + labelframePtr->textGC = NULL; } /* @@ -840,7 +840,7 @@ DestroyFrame( if (framePtr->type == TYPE_LABELFRAME) { Tk_FreeTextLayout(labelframePtr->textLayout); - if (labelframePtr->textGC != None) { + if (labelframePtr->textGC != NULL) { Tk_FreeGC(framePtr->display, labelframePtr->textGC); } } @@ -1096,7 +1096,7 @@ FrameWorldChanged( gcValues.graphics_exposures = False; gc = Tk_GetGC(tkwin, GCForeground | GCFont | GCGraphicsExposures, &gcValues); - if (labelframePtr->textGC != None) { + if (labelframePtr->textGC != NULL) { Tk_FreeGC(framePtr->display, labelframePtr->textGC); } labelframePtr->textGC = gc; diff --git a/generic/tkImage.c b/generic/tkImage.c index 6c7c9cd..8c70a2e 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -759,7 +759,7 @@ Tk_PostscriptImage( gcValues.foreground = WhitePixelOfScreen(Tk_Screen(tkwin)); newGC = Tk_GetGC(tkwin, GCForeground, &gcValues); - if (newGC != None) { + if (newGC != NULL) { XFillRectangle(Tk_Display(tkwin), pmap, newGC, 0, 0, (unsigned int)width, (unsigned int)height); Tk_FreeGC(Tk_Display(tkwin), newGC); diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 4f5c6ac..b5bf49a 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -424,9 +424,9 @@ ImgBmapConfigureInstance( } gc = Tk_GetGC(instancePtr->tkwin, mask, &gcValues); } else { - gc = None; + gc = NULL; } - if (instancePtr->gc != None) { + if (instancePtr->gc != NULL) { Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc); } instancePtr->gc = gc; @@ -438,10 +438,10 @@ ImgBmapConfigureInstance( * it clear that this instance cannot be displayed. Then report the error. */ - if (instancePtr->gc != None) { + if (instancePtr->gc != NULL) { Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc); } - instancePtr->gc = None; + instancePtr->gc = NULL; Tcl_AddErrorInfo(masterPtr->interp, "\n (while configuring image \""); Tcl_AddErrorInfo(masterPtr->interp, Tk_NameOfImage(masterPtr->tkMaster)); Tcl_AddErrorInfo(masterPtr->interp, "\")"); @@ -836,7 +836,7 @@ ImgBmapGet( instancePtr->bg = NULL; instancePtr->bitmap = None; instancePtr->mask = None; - instancePtr->gc = None; + instancePtr->gc = NULL; instancePtr->nextPtr = masterPtr->instancePtr; masterPtr->instancePtr = instancePtr; ImgBmapConfigureInstance(instancePtr); @@ -890,7 +890,7 @@ ImgBmapDisplay( * creating the image instance so it can't be displayed. */ - if (instancePtr->gc == None) { + if (instancePtr->gc == NULL) { return; } @@ -961,7 +961,7 @@ ImgBmapFree( if (instancePtr->mask != None) { Tk_FreePixmap(display, instancePtr->mask); } - if (instancePtr->gc != None) { + if (instancePtr->gc != NULL) { Tk_FreeGC(display, instancePtr->gc); } if (instancePtr->masterPtr->instancePtr == instancePtr) { diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 4e1aa01..56217c4 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3998,7 +3998,7 @@ DisposeInstance( if (instancePtr->pixels != None) { Tk_FreePixmap(instancePtr->display, instancePtr->pixels); } - if (instancePtr->gc != None) { + if (instancePtr->gc != NULL) { Tk_FreeGC(instancePtr->display, instancePtr->gc); } if (instancePtr->imagePtr != NULL) { diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 86fb671..dfd0dd3 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -534,13 +534,13 @@ Tk_ListboxObjCmd( ckalloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(listPtr->itemAttrTable, TCL_ONE_WORD_KEYS); listPtr->relief = TK_RELIEF_RAISED; - listPtr->textGC = None; - listPtr->selFgColorPtr = None; - listPtr->selTextGC = None; + listPtr->textGC = NULL; + listPtr->selFgColorPtr = NULL; + listPtr->selTextGC = NULL; listPtr->fullLines = 1; listPtr->xScrollUnit = 1; listPtr->exportSelection = 1; - listPtr->cursor = None; + listPtr->cursor = NULL; listPtr->state = STATE_NORMAL; listPtr->gray = None; @@ -1474,10 +1474,10 @@ DestroyListbox( * Tk_FreeOptions handle all the standard option-related stuff. */ - if (listPtr->textGC != None) { + if (listPtr->textGC != NULL) { Tk_FreeGC(listPtr->display, listPtr->textGC); } - if (listPtr->selTextGC != None) { + if (listPtr->selTextGC != NULL) { Tk_FreeGC(listPtr->display, listPtr->selTextGC); } if (listPtr->gray != None) { @@ -1777,7 +1777,7 @@ ListboxWorldChanged( gcValues.font = Tk_FontId(listPtr->tkfont); gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues); - if (listPtr->textGC != None) { + if (listPtr->textGC != NULL) { Tk_FreeGC(listPtr->display, listPtr->textGC); } listPtr->textGC = gc; @@ -1788,7 +1788,7 @@ ListboxWorldChanged( gcValues.font = Tk_FontId(listPtr->tkfont); mask = GCForeground | GCFont; gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues); - if (listPtr->selTextGC != None) { + if (listPtr->selTextGC != NULL) { Tk_FreeGC(listPtr->display, listPtr->selTextGC); } listPtr->selTextGC = gc; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index b35be24..171087a 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -506,7 +506,7 @@ MenuCmd( Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, (ClientData) menuPtr, MenuCmdDeletedProc); menuPtr->active = -1; - menuPtr->cursorPtr = None; + menuPtr->cursorPtr = NULL; menuPtr->masterMenuPtr = menuPtr; menuPtr->menuType = UNKNOWN_TYPE; menuPtr->optionTablesPtr = optionTablesPtr; diff --git a/generic/tkMenu.h b/generic/tkMenu.h index e8470ca..b1536df 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -80,8 +80,8 @@ typedef struct TkMenuEntry { * of character to underline (<0 means don't * underline anything). */ Tcl_Obj *underlinePtr; /* Index of character to underline. */ - Tcl_Obj *bitmapPtr; /* Bitmap to display in menu entry, or None. - * If not None then label is ignored. */ + Tcl_Obj *bitmapPtr; /* Bitmap to display in menu entry, or NULL. + * If not NULL then label is ignored. */ Tcl_Obj *imagePtr; /* Name of image to display, or NULL. If not * NULL, bitmap, text, and textVarName are * ignored. */ @@ -180,7 +180,7 @@ typedef struct TkMenuEntry { * NULL means use overall disabledGC from menu * structure. See comments for disabledFg in * menu structure for more information. */ - GC indicatorGC; /* For drawing indicators. None means use GC + GC indicatorGC; /* For drawing indicators. NULL means use GC * from menu. */ /* @@ -347,7 +347,7 @@ typedef struct TkMenu { Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ - Tcl_Obj *cursorPtr; /* Current cursor for window, or None. */ + Tcl_Obj *cursorPtr; /* Current cursor for window, or NULL. */ Tcl_Obj *postCommandPtr; /* Used to detect cycles in cascade hierarchy * trees when preprocessing postcommands on * some platforms. See PostMenu for more diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index c49f513..37147bd 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -43,12 +43,12 @@ void TkMenuInitializeDrawingFields( TkMenu *menuPtr) /* The menu we are initializing. */ { - menuPtr->textGC = None; + menuPtr->textGC = NULL; menuPtr->gray = None; - menuPtr->disabledGC = None; - menuPtr->activeGC = None; - menuPtr->indicatorGC = None; - menuPtr->disabledImageGC = None; + menuPtr->disabledGC = NULL; + menuPtr->activeGC = NULL; + menuPtr->indicatorGC = NULL; + menuPtr->disabledImageGC = NULL; menuPtr->totalWidth = menuPtr->totalHeight = 0; } @@ -79,10 +79,10 @@ TkMenuInitializeEntryDrawingFields( mePtr->y = 0; mePtr->indicatorSpace = 0; mePtr->labelWidth = 0; - mePtr->textGC = None; - mePtr->activeGC = None; - mePtr->disabledGC = None; - mePtr->indicatorGC = None; + mePtr->textGC = NULL; + mePtr->activeGC = NULL; + mePtr->disabledGC = NULL; + mePtr->indicatorGC = NULL; } /* @@ -106,22 +106,22 @@ void TkMenuFreeDrawOptions( TkMenu *menuPtr) { - if (menuPtr->textGC != None) { + if (menuPtr->textGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->textGC); } - if (menuPtr->disabledImageGC != None) { + if (menuPtr->disabledImageGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->disabledImageGC); } if (menuPtr->gray != None) { Tk_FreeBitmap(menuPtr->display, menuPtr->gray); } - if (menuPtr->disabledGC != None) { + if (menuPtr->disabledGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->disabledGC); } - if (menuPtr->activeGC != None) { + if (menuPtr->activeGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->activeGC); } - if (menuPtr->indicatorGC != None) { + if (menuPtr->indicatorGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->indicatorGC); } } @@ -147,16 +147,16 @@ void TkMenuEntryFreeDrawOptions( TkMenuEntry *mePtr) { - if (mePtr->textGC != None) { + if (mePtr->textGC != NULL) { Tk_FreeGC(mePtr->menuPtr->display, mePtr->textGC); } - if (mePtr->disabledGC != None) { + if (mePtr->disabledGC != NULL) { Tk_FreeGC(mePtr->menuPtr->display, mePtr->disabledGC); } - if (mePtr->activeGC != None) { + if (mePtr->activeGC != NULL) { Tk_FreeGC(mePtr->menuPtr->display, mePtr->activeGC); } - if (mePtr->indicatorGC != None) { + if (mePtr->indicatorGC != NULL) { Tk_FreeGC(mePtr->menuPtr->display, mePtr->indicatorGC); } } @@ -205,7 +205,7 @@ TkMenuConfigureDrawOptions( gcValues.background = Tk_3DBorderColor(border)->pixel; newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont, &gcValues); - if (menuPtr->textGC != None) { + if (menuPtr->textGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->textGC); } menuPtr->textGC = newGC; @@ -233,7 +233,7 @@ TkMenuConfigureDrawOptions( } } newGC = Tk_GetGC(menuPtr->tkwin, mask, &gcValues); - if (menuPtr->disabledGC != None) { + if (menuPtr->disabledGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->disabledGC); } menuPtr->disabledGC = newGC; @@ -249,7 +249,7 @@ TkMenuConfigureDrawOptions( newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCFillStyle|GCStipple, &gcValues); } - if (menuPtr->disabledImageGC != None) { + if (menuPtr->disabledImageGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->disabledImageGC); } menuPtr->disabledImageGC = newGC; @@ -262,7 +262,7 @@ TkMenuConfigureDrawOptions( gcValues.background = Tk_3DBorderColor(activeBorder)->pixel; newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont, &gcValues); - if (menuPtr->activeGC != None) { + if (menuPtr->activeGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->activeGC); } menuPtr->activeGC = newGC; @@ -273,7 +273,7 @@ TkMenuConfigureDrawOptions( gcValues.background = Tk_3DBorderColor(border)->pixel; newGC = Tk_GetGC(menuPtr->tkwin, GCForeground|GCBackground|GCFont, &gcValues); - if (menuPtr->indicatorGC != None) { + if (menuPtr->indicatorGC != NULL) { Tk_FreeGC(menuPtr->display, menuPtr->indicatorGC); } menuPtr->indicatorGC = newGC; @@ -385,24 +385,24 @@ TkMenuConfigureEntryDrawOptions( GCForeground|GCBackground|GCFont|GCGraphicsExposures, &gcValues); } else { - newGC = None; - newActiveGC = None; - newDisabledGC = None; - newIndicatorGC = None; + newGC = NULL; + newActiveGC = NULL; + newDisabledGC = NULL; + newIndicatorGC = NULL; } - if (mePtr->textGC != None) { + if (mePtr->textGC != NULL) { Tk_FreeGC(menuPtr->display, mePtr->textGC); } mePtr->textGC = newGC; - if (mePtr->activeGC != None) { + if (mePtr->activeGC != NULL) { Tk_FreeGC(menuPtr->display, mePtr->activeGC); } mePtr->activeGC = newActiveGC; - if (mePtr->disabledGC != None) { + if (mePtr->disabledGC != NULL) { Tk_FreeGC(menuPtr->display, mePtr->disabledGC); } mePtr->disabledGC = newDisabledGC; - if (mePtr->indicatorGC != None) { + if (mePtr->indicatorGC != NULL) { Tk_FreeGC(menuPtr->display, mePtr->indicatorGC); } mePtr->indicatorGC = newIndicatorGC; diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 94ac8b2..17fd106 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -267,11 +267,11 @@ Tk_MenubuttonObjCmd( mbPtr->normalFg = NULL; mbPtr->activeFg = NULL; mbPtr->disabledFg = NULL; - mbPtr->normalTextGC = None; - mbPtr->activeTextGC = None; + mbPtr->normalTextGC = NULL; + mbPtr->activeTextGC = NULL; mbPtr->gray = None; - mbPtr->disabledGC = None; - mbPtr->stippleGC = None; + mbPtr->disabledGC = NULL; + mbPtr->stippleGC = NULL; mbPtr->leftBearing = 0; mbPtr->rightBearing = 0; mbPtr->widthString = NULL; @@ -288,7 +288,7 @@ Tk_MenubuttonObjCmd( mbPtr->indicatorWidth = 0; mbPtr->indicatorHeight = 0; mbPtr->direction = DIRECTION_FLUSH; - mbPtr->cursor = None; + mbPtr->cursor = NULL; mbPtr->takeFocus = NULL; mbPtr->flags = 0; @@ -433,16 +433,16 @@ DestroyMenuButton( if (mbPtr->image != NULL) { Tk_FreeImage(mbPtr->image); } - if (mbPtr->normalTextGC != None) { + if (mbPtr->normalTextGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC); } - if (mbPtr->activeTextGC != None) { + if (mbPtr->activeTextGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC); } - if (mbPtr->disabledGC != None) { + if (mbPtr->disabledGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->disabledGC); } - if (mbPtr->stippleGC != None) { + if (mbPtr->stippleGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->stippleGC); } if (mbPtr->gray != None) { @@ -683,7 +683,7 @@ TkMenuButtonWorldChanged( gcValues.graphics_exposures = False; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); - if (mbPtr->normalTextGC != None) { + if (mbPtr->normalTextGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC); } mbPtr->normalTextGC = gc; @@ -692,7 +692,7 @@ TkMenuButtonWorldChanged( gcValues.background = Tk_3DBorderColor(mbPtr->activeBorder)->pixel; mask = GCForeground | GCBackground | GCFont; gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); - if (mbPtr->activeTextGC != None) { + if (mbPtr->activeTextGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC); } mbPtr->activeTextGC = gc; @@ -703,7 +703,7 @@ TkMenuButtonWorldChanged( * Create the GC that can be used for stippling */ - if (mbPtr->stippleGC == None) { + if (mbPtr->stippleGC == NULL) { gcValues.foreground = gcValues.background; mask = GCForeground; if (mbPtr->gray == None) { @@ -729,7 +729,7 @@ TkMenuButtonWorldChanged( gcValues.foreground = gcValues.background; } gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); - if (mbPtr->disabledGC != None) { + if (mbPtr->disabledGC != NULL) { Tk_FreeGC(mbPtr->display, mbPtr->disabledGC); } mbPtr->disabledGC = gc; diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index 41af675..f190c81 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -175,7 +175,7 @@ typedef struct { * "left" and "right" will pop the menu left * or right, and the active item will be next * to the button. */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 0fd57a9..17659ac 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -254,11 +254,11 @@ Tk_MessageObjCmd( (ClientData) msgPtr, MessageCmdDeletedProc); msgPtr->optionTable = optionTable; msgPtr->relief = TK_RELIEF_FLAT; - msgPtr->textGC = None; + msgPtr->textGC = NULL; msgPtr->anchor = TK_ANCHOR_CENTER; msgPtr->aspect = 150; msgPtr->justify = TK_JUSTIFY_LEFT; - msgPtr->cursor = None; + msgPtr->cursor = NULL; Tk_SetClass(msgPtr->tkwin, "Message"); Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr); @@ -396,7 +396,7 @@ DestroyMessage( * Tk_FreeConfigOptions handle all the standard option-related stuff. */ - if (msgPtr->textGC != None) { + if (msgPtr->textGC != NULL) { Tk_FreeGC(msgPtr->display, msgPtr->textGC); } if (msgPtr->textLayout != NULL) { @@ -523,7 +523,7 @@ MessageWorldChanged( ClientData instanceData) /* Information about widget. */ { XGCValues gcValues; - GC gc = None; + GC gc = NULL; Tk_FontMetrics fm; Message *msgPtr; @@ -536,7 +536,7 @@ MessageWorldChanged( gcValues.font = Tk_FontId(msgPtr->tkfont); gcValues.foreground = msgPtr->fgColorPtr->pixel; gc = Tk_GetGC(msgPtr->tkwin, GCForeground | GCFont, &gcValues); - if (msgPtr->textGC != None) { + if (msgPtr->textGC != NULL) { Tk_FreeGC(msgPtr->display, msgPtr->textGC); } msgPtr->textGC = gc; diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index d7a33f7..0231014 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -476,16 +476,16 @@ DoConfig( Tk_Cursor newCursor, oldCursor; if (nullValue) { - newCursor = None; + newCursor = NULL; } else { uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); newCursor = Tk_GetCursor(interp, tkwin, uid); - if (newCursor == None) { + if (newCursor == NULL) { return TCL_ERROR; } } oldCursor = *((Tk_Cursor *) ptr); - if (oldCursor != None) { + if (oldCursor != NULL) { Tk_FreeCursor(Tk_Display(tkwin), oldCursor); } *((Tk_Cursor *) ptr) = newCursor; @@ -838,7 +838,7 @@ FormatConfigValue( case TK_CONFIG_ACTIVE_CURSOR: { Tk_Cursor cursor = *((Tk_Cursor *) ptr); - if (cursor != None) { + if (cursor != NULL) { result = Tk_NameOfCursor(Tk_Display(tkwin), cursor); } break; @@ -1024,9 +1024,9 @@ Tk_FreeOptions( break; case TK_CONFIG_CURSOR: case TK_CONFIG_ACTIVE_CURSOR: - if (*((Tk_Cursor *) ptr) != None) { + if (*((Tk_Cursor *) ptr) != NULL) { Tk_FreeCursor(display, *((Tk_Cursor *) ptr)); - *((Tk_Cursor *) ptr) = None; + *((Tk_Cursor *) ptr) = NULL; } } } diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 99ed179..89afb37 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -448,9 +448,9 @@ Tk_PanedWindowObjCmd( pwPtr->optionTable = pwOpts->pwOptions; pwPtr->slaveOpts = pwOpts->slaveOpts; pwPtr->relief = TK_RELIEF_RAISED; - pwPtr->gc = None; - pwPtr->cursor = None; - pwPtr->sashCursor = None; + pwPtr->gc = NULL; + pwPtr->cursor = NULL; + pwPtr->sashCursor = NULL; /* * Keep a hold of the associated tkwin until we destroy the widget, @@ -859,7 +859,7 @@ ConfigureSlaves( index = -1; haveLoc = 0; - if (options.after != None) { + if (options.after != NULL) { tkwin = options.after; haveLoc = 1; for (i = 0; i < pwPtr->numSlaves; i++) { @@ -868,7 +868,7 @@ ConfigureSlaves( break; } } - } else if (options.before != None) { + } else if (options.before != NULL) { tkwin = options.before; haveLoc = 1; for (i = 0; i < pwPtr->numSlaves; i++) { @@ -1299,7 +1299,7 @@ PanedWindowWorldChanged( gcValues.background = Tk_3DBorderColor(pwPtr->background)->pixel; newGC = Tk_GetGC(pwPtr->tkwin, GCBackground, &gcValues); - if (pwPtr->gc != None) { + if (pwPtr->gc != NULL) { Tk_FreeGC(pwPtr->display, pwPtr->gc); } pwPtr->gc = newGC; @@ -2018,10 +2018,10 @@ Unlink( for (i = 0; i < masterPtr->numSlaves; i++) { if (masterPtr->slaves[i]->before == slavePtr->tkwin) { - masterPtr->slaves[i]->before = None; + masterPtr->slaves[i]->before = NULL; } if (masterPtr->slaves[i]->after == slavePtr->tkwin) { - masterPtr->slaves[i]->after = None; + masterPtr->slaves[i]->after = NULL; } } diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 2f527ba..19af02c 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -397,7 +397,7 @@ CreateSlave( slavePtr = (Slave *) ckalloc(sizeof(Slave)); memset(slavePtr, 0, sizeof(Slave)); slavePtr->tkwin = tkwin; - slavePtr->inTkwin = None; + slavePtr->inTkwin = NULL; slavePtr->anchor = TK_ANCHOR_NW; slavePtr->borderMode = BM_INSIDE; slavePtr->optionTable = table; diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index c9cd7cb..4431341 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -262,7 +262,7 @@ CreateRectOval( rectOvalPtr->fillStipple = None; rectOvalPtr->activeFillStipple = None; rectOvalPtr->disabledFillStipple = None; - rectOvalPtr->fillGC = None; + rectOvalPtr->fillGC = NULL; /* * Process the arguments to fill in the item record. @@ -473,9 +473,9 @@ ConfigureRectOval( mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } - if (rectOvalPtr->outline.gc != None) { + if (rectOvalPtr->outline.gc != NULL) { Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->outline.gc); } rectOvalPtr->outline.gc = newGC; @@ -507,7 +507,7 @@ ConfigureRectOval( } if (color == NULL) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = color->pixel; if (stipple != None) { @@ -528,7 +528,7 @@ ConfigureRectOval( #endif newGC = Tk_GetGC(tkwin, mask, &gcValues); } - if (rectOvalPtr->fillGC != None) { + if (rectOvalPtr->fillGC != NULL) { Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->fillGC); } rectOvalPtr->fillGC = newGC; @@ -601,7 +601,7 @@ DeleteRectOval( if (rectOvalPtr->disabledFillStipple != None) { Tk_FreeBitmap(display, rectOvalPtr->disabledFillStipple); } - if (rectOvalPtr->fillGC != None) { + if (rectOvalPtr->fillGC != NULL) { Tk_FreeGC(display, rectOvalPtr->fillGC); } } @@ -670,7 +670,7 @@ ComputeRectOvalBbox( rectOvalPtr->bbox[0] = tmpX; } - if (rectOvalPtr->outline.gc == None) { + if (rectOvalPtr->outline.gc == NULL) { /* * The Win32 switch was added for 8.3 to solve a problem with ovals * leaving traces on bottom and right of 1 pixel. This may not be the @@ -792,7 +792,7 @@ DisplayRectOval( } } - if (rectOvalPtr->fillGC != None) { + if (rectOvalPtr->fillGC != NULL) { if (fillStipple != None) { Tk_TSOffset *tsoffset; int w = 0, h = 0; @@ -836,7 +836,7 @@ DisplayRectOval( } } - if (rectOvalPtr->outline.gc != None) { + if (rectOvalPtr->outline.gc != NULL) { Tk_ChangeOutlineGC(canvas, itemPtr, &(rectOvalPtr->outline)); if (rectOvalPtr->header.typePtr == &tkRectangleType) { XDrawRectangle(display, drawable, rectOvalPtr->outline.gc, @@ -907,7 +907,7 @@ RectToPoint( y1 = rectPtr->bbox[1]; x2 = rectPtr->bbox[2]; y2 = rectPtr->bbox[3]; - if (rectPtr->outline.gc != None) { + if (rectPtr->outline.gc != NULL) { inc = width/2.0; x1 -= inc; y1 -= inc; @@ -923,7 +923,7 @@ RectToPoint( if ((pointPtr[0] >= x1) && (pointPtr[0] < x2) && (pointPtr[1] >= y1) && (pointPtr[1] < y2)) { - if ((rectPtr->fillGC != None) || (rectPtr->outline.gc == None)) { + if ((rectPtr->fillGC != NULL) || (rectPtr->outline.gc == NULL)) { return 0.0; } xDiff = pointPtr[0] - x1; @@ -1019,8 +1019,8 @@ OvalToPoint( } - filled = ovalPtr->fillGC != None; - if (ovalPtr->outline.gc == None) { + filled = ovalPtr->fillGC != NULL; + if (ovalPtr->outline.gc == NULL) { width = 0.0; filled = 1; } @@ -1075,7 +1075,7 @@ RectToArea( } halfWidth = width/2.0; - if (rectPtr->outline.gc == None) { + if (rectPtr->outline.gc == NULL) { halfWidth = 0.0; } @@ -1085,7 +1085,7 @@ RectToArea( || (areaPtr[1] >= (rectPtr->bbox[3] + halfWidth))) { return -1; } - if ((rectPtr->fillGC == None) && (rectPtr->outline.gc != None) + if ((rectPtr->fillGC == NULL) && (rectPtr->outline.gc != NULL) && (areaPtr[0] >= (rectPtr->bbox[0] + halfWidth)) && (areaPtr[1] >= (rectPtr->bbox[1] + halfWidth)) && (areaPtr[2] <= (rectPtr->bbox[2] - halfWidth)) @@ -1154,7 +1154,7 @@ OvalToArea( */ halfWidth = width/2.0; - if (ovalPtr->outline.gc == None) { + if (ovalPtr->outline.gc == NULL) { halfWidth = 0.0; } oval[0] = ovalPtr->bbox[0] - halfWidth; @@ -1171,8 +1171,8 @@ OvalToArea( * return "outside". */ - if ((result == 0) && (ovalPtr->outline.gc != None) - && (ovalPtr->fillGC == None)) { + if ((result == 0) && (ovalPtr->outline.gc != NULL) + && (ovalPtr->fillGC == NULL)) { double centerX, centerY, height; double xDelta1, yDelta1, xDelta2, yDelta2; diff --git a/generic/tkScale.c b/generic/tkScale.c index 69a7d91..6ab574e 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -264,11 +264,11 @@ Tk_ScaleObjCmd( scalePtr->activeBorder = NULL; scalePtr->sliderRelief = TK_RELIEF_RAISED; scalePtr->troughColorPtr = NULL; - scalePtr->troughGC = None; - scalePtr->copyGC = None; + scalePtr->troughGC = NULL; + scalePtr->copyGC = NULL; scalePtr->tkfont = NULL; scalePtr->textColorPtr = NULL; - scalePtr->textGC = None; + scalePtr->textGC = NULL; scalePtr->relief = TK_RELIEF_FLAT; scalePtr->highlightWidth = 0; scalePtr->highlightBorder = NULL; @@ -285,7 +285,7 @@ Tk_ScaleObjCmd( scalePtr->vertTroughX = 0; scalePtr->vertLabelX = 0; scalePtr->fontHeight = 0; - scalePtr->cursor = None; + scalePtr->cursor = NULL; scalePtr->takeFocusPtr = NULL; scalePtr->flags = NEVER_SET; @@ -514,13 +514,13 @@ DestroyScale( TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ScaleVarProc, (ClientData) scalePtr); } - if (scalePtr->troughGC != None) { + if (scalePtr->troughGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->troughGC); } - if (scalePtr->copyGC != None) { + if (scalePtr->copyGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->copyGC); } - if (scalePtr->textGC != None) { + if (scalePtr->textGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->textGC); } Tk_FreeConfigOptions((char *) scalePtr, scalePtr->optionTable, @@ -727,7 +727,7 @@ ScaleWorldChanged( gcValues.foreground = scalePtr->troughColorPtr->pixel; gc = Tk_GetGC(scalePtr->tkwin, GCForeground, &gcValues); - if (scalePtr->troughGC != None) { + if (scalePtr->troughGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->troughGC); } scalePtr->troughGC = gc; @@ -735,12 +735,12 @@ ScaleWorldChanged( gcValues.font = Tk_FontId(scalePtr->tkfont); gcValues.foreground = scalePtr->textColorPtr->pixel; gc = Tk_GetGC(scalePtr->tkwin, GCForeground | GCFont, &gcValues); - if (scalePtr->textGC != None) { + if (scalePtr->textGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->textGC); } scalePtr->textGC = gc; - if (scalePtr->copyGC == None) { + if (scalePtr->copyGC == NULL) { gcValues.graphics_exposures = False; scalePtr->copyGC = Tk_GetGC(scalePtr->tkwin, GCGraphicsExposures, &gcValues); diff --git a/generic/tkScale.h b/generic/tkScale.h index a19695f..079e02c 100644 --- a/generic/tkScale.h +++ b/generic/tkScale.h @@ -156,7 +156,7 @@ typedef struct TkScale { */ int fontHeight; /* Height of scale font. */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ Tcl_Obj *takeFocusPtr; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. May be NULL. */ diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index ba42c20..7e39056 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -188,7 +188,7 @@ Tk_ScrollbarCmd( scrollPtr->lastUnit = 0; scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; - scrollPtr->cursor = None; + scrollPtr->cursor = NULL; scrollPtr->takeFocus = NULL; scrollPtr->flags = 0; diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 126d590..fa0426f 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -119,7 +119,7 @@ typedef struct TkScrollbar { * Miscellaneous information: */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ diff --git a/generic/tkSquare.c b/generic/tkSquare.c index a35832a..355a447 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -166,7 +166,7 @@ SquareObjCmd( squarePtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd, (ClientData) squarePtr, SquareDeletedProc); - squarePtr->gc = None; + squarePtr->gc = NULL; squarePtr->optionTable = optionTable; if (Tk_InitOptions(interp, (char *) squarePtr, optionTable, tkwin) diff --git a/generic/tkText.c b/generic/tkText.c index 8edf82d..c8421c3 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -568,7 +568,7 @@ CreateWidget( textPtr->state = TK_TEXT_STATE_NORMAL; textPtr->relief = TK_RELIEF_FLAT; - textPtr->cursor = None; + textPtr->cursor = NULL; textPtr->charWidth = 1; textPtr->charHeight = 10; textPtr->wrapMode = TEXT_WRAPMODE_CHAR; @@ -2187,7 +2187,7 @@ ConfigureText( textPtr->selTagPtr->affectsDisplay = 0; textPtr->selTagPtr->affectsDisplayGeometry = 0; if ((textPtr->selTagPtr->elideString != NULL) - || (textPtr->selTagPtr->tkfont != None) + || (textPtr->selTagPtr->tkfont != NULL) || (textPtr->selTagPtr->justifyString != NULL) || (textPtr->selTagPtr->lMargin1String != NULL) || (textPtr->selTagPtr->lMargin2String != NULL) diff --git a/generic/tkText.h b/generic/tkText.h index 6f5f153..464bed5 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -654,7 +654,7 @@ typedef struct TkText { /* Color for drawing traversal highlight area * when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ - Tk_Cursor cursor; /* Current cursor for window, or None. */ + Tk_Cursor cursor; /* Current cursor for window, or NULL. */ XColor *fgColor; /* Default foreground color for text. */ Tk_Font tkfont; /* Default font for displaying text. */ int charWidth; /* Width of average character in default diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 1f39112..c3874f1 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -632,7 +632,7 @@ TkTextCreateDInfo( dInfoPtr = (TextDInfo *) ckalloc(sizeof(TextDInfo)); Tcl_InitHashTable(&dInfoPtr->styleTable, sizeof(StyleValues)/sizeof(int)); dInfoPtr->dLinePtr = NULL; - dInfoPtr->copyGC = None; + dInfoPtr->copyGC = NULL; gcValues.graphics_exposures = True; dInfoPtr->scrollGC = Tk_GetGC(textPtr->tkwin, GCGraphicsExposures, &gcValues); @@ -696,7 +696,7 @@ TkTextFreeDInfo( FreeDLines(textPtr, dInfoPtr->dLinePtr, NULL, DLINE_UNLINK); Tcl_DeleteHashTable(&dInfoPtr->styleTable); - if (dInfoPtr->copyGC != None) { + if (dInfoPtr->copyGC != NULL) { Tk_FreeGC(textPtr->display, dInfoPtr->copyGC); } Tk_FreeGC(textPtr->display, dInfoPtr->scrollGC); @@ -832,11 +832,11 @@ GetStyle( styleValues.bgStipple = tagPtr->bgStipple; bgStipplePrio = tagPtr->priority; } - if ((tagPtr->fgColor != None) && (tagPtr->priority > fgPrio)) { + if ((tagPtr->fgColor != NULL) && (tagPtr->priority > fgPrio)) { styleValues.fgColor = tagPtr->fgColor; fgPrio = tagPtr->priority; } - if ((tagPtr->tkfont != None) && (tagPtr->priority > fontPrio)) { + if ((tagPtr->tkfont != NULL) && (tagPtr->priority > fontPrio)) { styleValues.tkfont = tagPtr->tkfont; fontPrio = tagPtr->priority; } @@ -948,7 +948,7 @@ GetStyle( } stylePtr->bgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); } else { - stylePtr->bgGC = None; + stylePtr->bgGC = NULL; } mask = GCFont; gcValues.font = Tk_FontId(styleValues.tkfont); @@ -994,10 +994,10 @@ FreeStyle( { stylePtr->refCount--; if (stylePtr->refCount == 0) { - if (stylePtr->bgGC != None) { + if (stylePtr->bgGC != NULL) { Tk_FreeGC(textPtr->display, stylePtr->bgGC); } - if (stylePtr->fgGC != None) { + if (stylePtr->fgGC != NULL) { Tk_FreeGC(textPtr->display, stylePtr->fgGC); } Tcl_DeleteHashEntry(stylePtr->hPtr); @@ -2578,7 +2578,7 @@ DisplayLineBackground( if ((chunkPtr->nextPtr == NULL) && (rightX < maxX)) { rightX = maxX; } - if (chunkPtr->stylePtr->bgGC != None) { + if (chunkPtr->stylePtr->bgGC != NULL) { /* * Not visible - bail out now. */ @@ -4335,7 +4335,7 @@ DisplayText( dlPtr->spaceAbove, dlPtr->height-dlPtr->spaceAbove-dlPtr->spaceBelow, dlPtr->baseline - dlPtr->spaceAbove, NULL, - (Drawable) None, dlPtr->y + dlPtr->spaceAbove); + None, dlPtr->y + dlPtr->spaceAbove); } } @@ -4970,7 +4970,7 @@ TkTextRelayoutWindow( gcValues.graphics_exposures = False; newGC = Tk_GetGC(textPtr->tkwin, GCGraphicsExposures, &gcValues); - if (dInfoPtr->copyGC != None) { + if (dInfoPtr->copyGC != NULL) { Tk_FreeGC(textPtr->display, dInfoPtr->copyGC); } dInfoPtr->copyGC = newGC; @@ -7708,7 +7708,7 @@ CharDisplayProc( */ if (!sValuePtr->elide && (numBytes > offsetBytes) - && (stylePtr->fgGC != None)) { + && (stylePtr->fgGC != NULL)) { #if TK_DRAW_IN_CONTEXT int start = ciPtr->baseOffset + offsetBytes; int len = ciPtr->numBytes - offsetBytes; diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index a310dd7..d88825c 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -490,7 +490,7 @@ TkTextTagCmd( tagPtr->affectsDisplay = 0; tagPtr->affectsDisplayGeometry = 0; if ((tagPtr->elideString != NULL) - || (tagPtr->tkfont != None) + || (tagPtr->tkfont != NULL) || (tagPtr->justifyString != NULL) || (tagPtr->lMargin1String != NULL) || (tagPtr->lMargin2String != NULL) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 4ac2849..1257e22 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -2110,7 +2110,7 @@ void Tk_UndefineCursor( Tk_Window tkwin) /* Window to manipulate. */ { - Tk_DefineCursor(tkwin, None); + Tk_DefineCursor(tkwin, NULL); } void diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index ae43ae6..82504a1 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -332,7 +332,7 @@ EntryFetchSelection( ClientData clientData, int offset, char *buffer, int maxBytes) { Entry *entryPtr = (Entry *) clientData; - size_t byteCount; + int byteCount; const char *string; const char *selStart, *selEnd; @@ -345,7 +345,7 @@ EntryFetchSelection( selEnd = Tcl_UtfAtIndex(selStart, entryPtr->entry.selectLast - entryPtr->entry.selectFirst); byteCount = selEnd - selStart - offset; - if (byteCount > (size_t)maxBytes) { + if (byteCount > maxBytes) { /* @@@POSSIBLE BUG: Can transfer partial UTF-8 sequences. Is this OK? */ byteCount = maxBytes; } @@ -1151,7 +1151,7 @@ static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj, TkRegion clip) mask |= GCForeground; } gc = Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); - if (clip != None) { + if (clip != NULL) { TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip); } return gc; @@ -1286,7 +1286,7 @@ static void EntryDisplay(void *clientData, Drawable d) * it from the Xft guts (if they're being used). */ #ifdef HAVE_XFT - TkUnixSetXftClipRegion(None); + TkUnixSetXftClipRegion(NULL); #endif TkDestroyRegion(clipRegion); } diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 1037840..e2dd0b1 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -183,7 +183,7 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) if (clipRegion != NULL) { #ifdef HAVE_XFT - TkUnixSetXftClipRegion(None); + TkUnixSetXftClipRegion(NULL); #endif XSetClipMask(Tk_Display(tkwin), gc1, None); XSetClipMask(Tk_Display(tkwin), gc2, None); diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 58c99eb..04dd86f 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -7,7 +7,7 @@ */ #include <string.h> -#include <tk.h> +#include "tkInt.h" #include "ttkThemeInt.h" #define MAX(a,b) (a > b ? a : b) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index f0a3003..473d1e6 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -6,7 +6,7 @@ #include <string.h> #include <stdio.h> -#include <tk.h> +#include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index d5e0484..557ca8f 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -5,7 +5,7 @@ */ #include <string.h> -#include <tk.h> +#include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 60d6cda..b80a3cf 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -37,7 +37,7 @@ #define ACTIVE_BG "systemButtonFacePressed" #define ACTIVE_FG "systemPushButtonPressedText" #define SELECT_BG "systemHighlight" -#define SELECT_FG None +#define SELECT_FG NULL #define INACTIVE_SELECT_BG "systemHighlightSecondary" #define TROUGH "#c3c3c3" #define INDICATOR "#b03060" @@ -281,7 +281,7 @@ #define DEF_MENU_ENTRY_ACTIVE_FG ((char *) NULL) #define DEF_MENU_ENTRY_ACCELERATOR ((char *) NULL) #define DEF_MENU_ENTRY_BG ((char *) NULL) -#define DEF_MENU_ENTRY_BITMAP None +#define DEF_MENU_ENTRY_BITMAP NULL #define DEF_MENU_ENTRY_COLUMN_BREAK "0" #define DEF_MENU_ENTRY_COMMAND ((char *) NULL) #define DEF_MENU_ENTRY_COMPOUND "none" diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index bd7e0a8..03a724d 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -491,7 +491,7 @@ TkMacOSXContainerId( } } Tcl_Panic("TkMacOSXContainerId couldn't find window"); - return None; + return NULL; } /* @@ -527,8 +527,8 @@ TkMacOSXGetHostToplevel( * TODO: Here we should handle out of process embedding. */ - if (contWinPtr == NULL) { - return None; + if (!contWinPtr) { + return NULL; } return TkMacOSXGetHostToplevel(contWinPtr); } diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 8f20447..6b957dc 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -1460,10 +1460,10 @@ TkpMenuInit(void) #undef observe [NSMenuItem setUsesUserKeyEquivalents:NO]; - tkColPtr = TkpGetColor(None, DEF_MENU_BG_COLOR); + tkColPtr = TkpGetColor(NULL, DEF_MENU_BG_COLOR); defaultBg = tkColPtr->color.pixel; ckfree((char *) tkColPtr); - tkColPtr = TkpGetColor(None, DEF_MENU_FG); + tkColPtr = TkpGetColor(NULL, DEF_MENU_FG); defaultFg = tkColPtr->color.pixel; ckfree((char *) tkColPtr); diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 7dde501..ea0fdd0 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -104,8 +104,8 @@ TkpCreateScrollbar( MacScrollbar *scrollPtr = (MacScrollbar *)ckalloc(sizeof(MacScrollbar)); - scrollPtr->troughGC = None; - scrollPtr->copyGC = None; + scrollPtr->troughGC = NULL; + scrollPtr->copyGC = NULL; Tk_CreateEventHandler(tkwin,ExposureMask|StructureNotifyMask|FocusChangeMask|ButtonPressMask|VisibilityChangeMask, ScrollbarEventProc, scrollPtr); diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index a8ecdc1..7663903 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -243,7 +243,7 @@ #define DEF_MENU_ENTRY_ACTIVE_FG (char *) NULL #define DEF_MENU_ENTRY_ACCELERATOR (char *) NULL #define DEF_MENU_ENTRY_BG (char *) NULL -#define DEF_MENU_ENTRY_BITMAP None +#define DEF_MENU_ENTRY_BITMAP NULL #define DEF_MENU_ENTRY_COLUMN_BREAK "0" #define DEF_MENU_ENTRY_COMMAND (char *) NULL #define DEF_MENU_ENTRY_COMPOUND "none" diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index 48d3fb9..3f5b632 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -103,7 +103,7 @@ TkpDisplayMenuButton( border = mbPtr->normalBorder; } - if (mbPtr->image != None) { + if (mbPtr->image != NULL) { Tk_SizeOfImage(mbPtr->image, &width, &height); haveImage = 1; } else if (mbPtr->bitmap != None) { @@ -369,7 +369,7 @@ TkpComputeMenuButtonGeometry( txtHeight = 0; avgWidth = 0; - if (mbPtr->image != None) { + if (mbPtr->image != NULL) { Tk_SizeOfImage(mbPtr->image, &width, &height); haveImage = 1; } else if (mbPtr->bitmap != None) { diff --git a/win/tkWin3d.c b/win/tkWin3d.c index df6aa95..87b4bdb 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 == None) && (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 == None) && (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 != None) { + if (borderPtr->lightGC != NULL) { return; } @@ -540,7 +540,7 @@ TkWinGetBorderPixels( { WinBorder *borderPtr = (WinBorder *) border; - if (borderPtr->info.lightGC == None) { + if (borderPtr->info.lightGC == NULL) { TkpGetShadows(&borderPtr->info, tkwin); } switch (which) { diff --git a/win/tkWinButton.c b/win/tkWinButton.c index c36932d..b0de785 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -434,7 +434,7 @@ TkpDisplayButton( * Display image or bitmap or text for button. */ - if (butPtr->image != None) { + if (butPtr->image != NULL) { Tk_SizeOfImage(butPtr->image, &width, &height); haveImage = 1; } else if (butPtr->bitmap != None) { diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index d0bae8f..cc561ec 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -246,7 +246,7 @@ #define DEF_MENU_ENTRY_ACTIVE_FG (char *) NULL #define DEF_MENU_ENTRY_ACCELERATOR (char *) NULL #define DEF_MENU_ENTRY_BG (char *) NULL -#define DEF_MENU_ENTRY_BITMAP None +#define DEF_MENU_ENTRY_BITMAP NULL #define DEF_MENU_ENTRY_COLUMN_BREAK "0" #define DEF_MENU_ENTRY_COMMAND (char *) NULL #define DEF_MENU_ENTRY_COMPOUND "none" diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 9a35266..e202891 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 != None)) { + && (menuPtr->disabledImageGC != NULL)) { XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC, leftEdge + imageXOffset, (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), diff --git a/win/tkWinPort.h b/win/tkWinPort.h index b94628e..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 diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 2c3b0e4..daadd8e 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2683,7 +2683,7 @@ TkWmDeadWindow( VisibilityChangeMask|StructureNotifyMask, WmWaitVisibilityOrMapProc, (ClientData) wmPtr2->winPtr); wmPtr2->masterPtr = NULL; - if ((wmPtr2->wrapper != None) + if ((wmPtr2->wrapper != NULL) && !(wmPtr2->flags & (WM_NEVER_MAPPED))) { UpdateWrapper(wmPtr2->winPtr); } @@ -8586,7 +8586,7 @@ TkpWinToplevelDetachWindow( SendMessage(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0); winPtr->flags &= ~TK_EMBEDDED; winPtr->privatePtr = NULL; - wmPtr->wrapper = None; + wmPtr->wrapper = NULL; if (state >= 0 && state <= 3) { wmPtr->hints.initial_state = state; } diff --git a/win/tkWinX.c b/win/tkWinX.c index af28e41..2f9565d 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -636,7 +636,7 @@ TkpOpenDisplay( twdPtr = (TkWinDrawable*) ckalloc(sizeof(TkWinDrawable)); if (twdPtr == NULL) { - return None; + return NULL; } twdPtr->type = TWD_WINDOW; twdPtr->window.winPtr = NULL; diff --git a/xlib/X11/X.h b/xlib/X11/X.h index daf2283..b43967e 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -73,7 +73,9 @@ typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs * RESERVED RESOURCE AND CONSTANT DEFINITIONS *****************************************************************/ -#define None 0L /* universal null resource or null atom */ +#ifndef _WIN32 +# define None 0L /* See bug [9e31fd9449] and below */ +#endif #define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ @@ -179,13 +181,20 @@ are reserved in the protocol for errors and replies. */ #define ShiftMask (1<<0) #define LockMask (1<<1) -#define ControlMask (1<<2) +#ifndef _WIN32 +# define ControlMask (1<<2) /* See bug [9e31fd9449] and below */ +#endif #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) #define Mod4Mask (1<<6) #define Mod5Mask (1<<7) +/* See bug [9e31fd9449], this way prevents conflicts with Win32 headers */ +#ifdef _WIN32 +enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) }; +#endif + /* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the masks defined above. */ @@ -50,7 +50,7 @@ static TkpClipMask *AllocClipMask(GC gc) { TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask; - if (clip_mask == None) { + if (clip_mask == NULL) { clip_mask = (TkpClipMask*) ckalloc(sizeof(TkpClipMask)); gc->clip_mask = (Pixmap) clip_mask; #ifdef MAC_OSX_TK @@ -126,7 +126,7 @@ XCreateGC( gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize); if (!gp) { - return None; + return NULL; } #define InitField(name,maskbit,default) \ @@ -269,7 +269,7 @@ int XFreeGC( Display *d, GC gc) { - if (gc != None) { + if (gc != NULL) { FreeClipMask(gc); TkpFreeGCCache(gc); ckfree((char *) gc); @@ -465,8 +465,8 @@ TkSetRegion( GC gc, TkRegion r) { - if (r == None) { - Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead"); + if (r == NULL) { + Tcl_Panic("must not pass NULL to TkSetRegion for compatibility with X11; use XSetClipMask instead"); } else { TkpClipMask *clip_mask = AllocClipMask(gc); |