Index: generic/tk3d.c ================================================================== --- generic/tk3d.c +++ generic/tk3d.c @@ -235,13 +235,13 @@ borderPtr->objRefCount = 0; borderPtr->bgColorPtr = bgColorPtr; 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); /* @@ -390,11 +390,11 @@ /* * The code below will never be executed, but it's needed to keep * compilers happy. */ - return (GC) None; + return NULL; } /* *-------------------------------------------------------------- * Index: generic/tk3d.h ================================================================== --- generic/tk3d.h +++ generic/tk3d.h @@ -58,14 +58,14 @@ * areas. Used for displays with <= 64 colors * or where colormap has filled up. */ 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). */ struct TkBorder *nextPtr; /* Points to the next TkBorder structure with * the same color name. Borders with the same Index: generic/tkBind.c ================================================================== --- generic/tkBind.c +++ generic/tkBind.c @@ -3868,11 +3868,11 @@ DoWarp( ClientData clientData) { 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; } Index: generic/tkButton.c ================================================================== --- generic/tkButton.c +++ generic/tkButton.c @@ -708,16 +708,16 @@ butPtr->inset = 0; butPtr->tkfont = NULL; 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; butPtr->height = 0; butPtr->wrapLengthPtr = NULL; @@ -738,11 +738,11 @@ butPtr->defaultState = DEFAULT_DISABLED; butPtr->selVarNamePtr = NULL; butPtr->onValuePtr = NULL; butPtr->offValuePtr = NULL; butPtr->tristateValuePtr = NULL; - butPtr->cursor = None; + butPtr->cursor = NULL; butPtr->takeFocusPtr = NULL; butPtr->commandPtr = NULL; butPtr->flags = 0; Tk_CreateEventHandler(butPtr->tkwin, Index: generic/tkButton.h ================================================================== --- generic/tkButton.h +++ generic/tkButton.h @@ -233,11 +233,11 @@ /* * 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 * scripts. */ Tcl_Obj *commandPtr; /* Value of -command option: specifies script Index: generic/tkCanvArc.c ================================================================== --- generic/tkCanvArc.c +++ generic/tkCanvArc.c @@ -298,11 +298,11 @@ arcPtr->disabledFillColor = NULL; arcPtr->fillStipple = None; 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. */ @@ -491,11 +491,11 @@ if (mask) { gcValues.cap_style = CapButt; mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } if (arcPtr->outline.gc != None) { Tk_FreeGC(Tk_Display(tkwin), arcPtr->outline.gc); } arcPtr->outline.gc = newGC; @@ -525,13 +525,13 @@ stipple = arcPtr->disabledFillStipple; } } 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) { gcValues.arc_mode = ArcChord; } else { @@ -918,17 +918,17 @@ cx, cy, x2, y2); } } 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); } } Tk_ResetOutlineGC(canvas, itemPtr, &(arcPtr->outline)); } Index: generic/tkCanvBmap.c ================================================================== --- generic/tkCanvBmap.c +++ generic/tkCanvBmap.c @@ -189,11 +189,11 @@ bmapPtr->activeFgColor = NULL; bmapPtr->disabledFgColor = NULL; 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 * y) coords are allowed. */ @@ -375,11 +375,11 @@ bitmap = bmapPtr->disabledBitmap; } } if (bitmap == None) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = fgColor->pixel; mask = GCForeground; if (bgColor != NULL) { gcValues.background = bgColor->pixel; Index: generic/tkCanvLine.c ================================================================== --- generic/tkCanvLine.c +++ generic/tkCanvLine.c @@ -301,11 +301,11 @@ linePtr->canvas = canvas; linePtr->numPoints = 0; 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; linePtr->arrowShapeC = (float)3.0; linePtr->firstArrowPtr = NULL; @@ -529,11 +529,11 @@ #else gcValues.line_width = 0; #endif arrowGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = arrowGC = None; + newGC = arrowGC = NULL; } if (linePtr->outline.gc != None) { Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc); } if (linePtr->arrowGC != None) { @@ -2249,11 +2249,11 @@ int prepass) /* 1 means this is a prepass to collect font * information; 0 means final Postscript is * being created. */ { LineItem *linePtr = (LineItem *) itemPtr; - char buffer[64 + TCL_INTEGER_SPACE]; + char buffer[64 + 4*TCL_INTEGER_SPACE]; char *style; double width; XColor *color; Pixmap stipple; Index: generic/tkCanvPoly.c ================================================================== --- generic/tkCanvPoly.c +++ generic/tkCanvPoly.c @@ -277,11 +277,11 @@ polyPtr->activeFillColor = NULL; polyPtr->disabledFillColor = NULL; polyPtr->fillStipple = None; polyPtr->activeFillStipple = None; polyPtr->disabledFillStipple = None; - polyPtr->fillGC = None; + polyPtr->fillGC = NULL; polyPtr->smooth = NULL; polyPtr->splineSteps = 12; polyPtr->autoClosed = 0; /* @@ -482,11 +482,11 @@ gcValues.cap_style = CapRound; gcValues.join_style = polyPtr->joinStyle; mask |= GCCapStyle|GCJoinStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } if (polyPtr->outline.gc != None) { Tk_FreeGC(Tk_Display(tkwin), polyPtr->outline.gc); } polyPtr->outline.gc = newGC; @@ -508,11 +508,11 @@ stipple = polyPtr->disabledFillStipple; } } if (color == NULL) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = color->pixel; mask = GCForeground; if (stipple != None) { gcValues.stipple = stipple; Index: generic/tkCanvText.c ================================================================== --- generic/tkCanvText.c +++ generic/tkCanvText.c @@ -263,13 +263,13 @@ textPtr->numChars = 0; textPtr->numBytes = 0; 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 * y) coords are allowed. */ @@ -440,11 +440,11 @@ if (textPtr->disabledStipple!=None) { stipple = textPtr->disabledStipple; } } - newGC = newSelGC = None; + newGC = newSelGC = NULL; if (textPtr->tkfont != NULL) { gcValues.font = Tk_FontId(textPtr->tkfont); mask = GCFont; if (color != NULL) { gcValues.foreground = color->pixel; @@ -484,11 +484,11 @@ } else { gcValues.foreground = BlackPixelOfScreen(Tk_Screen(tkwin)); } newGC = Tk_GetGC(tkwin, GCForeground, &gcValues); } else { - newGC = None; + newGC = NULL; } if (textPtr->cursorOffGC != None) { Tk_FreeGC(Tk_Display(tkwin), textPtr->cursorOffGC); } textPtr->cursorOffGC = newGC; Index: generic/tkCanvUtil.c ================================================================== --- generic/tkCanvUtil.c +++ generic/tkCanvUtil.c @@ -957,11 +957,11 @@ 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; outline->offset = 0; outline->dash.number = 0; Index: generic/tkCanvas.c ================================================================== --- generic/tkCanvas.c +++ generic/tkCanvas.c @@ -415,11 +415,11 @@ canvasPtr->relief = TK_RELIEF_FLAT; canvasPtr->highlightWidth = 0; canvasPtr->highlightBgColorPtr = NULL; canvasPtr->highlightColorPtr = NULL; canvasPtr->inset = 0; - canvasPtr->pixmapGC = None; + canvasPtr->pixmapGC = NULL; canvasPtr->width = None; canvasPtr->height = None; canvasPtr->confine = 0; canvasPtr->textInfo.selBorder = NULL; canvasPtr->textInfo.selBorderWidth = 0; @@ -461,11 +461,11 @@ canvasPtr->scanXOrigin = 0; canvasPtr->scanY = 0; 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)); canvasPtr->flags = 0; canvasPtr->nextId = 1; Index: generic/tkCanvas.h ================================================================== --- generic/tkCanvas.h +++ generic/tkCanvas.h @@ -204,11 +204,11 @@ /* * 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. */ double pixelsPerMM; /* Scale factor between MM and pixels; used * when converting coordinates. */ Index: generic/tkColor.c ================================================================== --- generic/tkColor.c +++ generic/tkColor.c @@ -240,11 +240,11 @@ * Now create a new TkColor structure and add it to colorNameTable (in * TkDisplay). */ 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); tkColPtr->resourceRefCount = 1; tkColPtr->objRefCount = 0; @@ -321,11 +321,11 @@ * add a new structure to colorValueTable (in TkDisplay). */ 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); tkColPtr->resourceRefCount = 1; tkColPtr->objRefCount = 0; @@ -469,11 +469,11 @@ * longer any objects referencing it. */ if (tkColPtr->gc != None) { XFreeGC(DisplayOfScreen(screen), tkColPtr->gc); - tkColPtr->gc = None; + tkColPtr->gc = NULL; } TkpFreeColor(tkColPtr); prevPtr = Tcl_GetHashValue(tkColPtr->hashPtr); if (prevPtr == tkColPtr) { Index: generic/tkColor.h ================================================================== --- generic/tkColor.h +++ generic/tkColor.h @@ -35,11 +35,11 @@ unsigned int magic; /* Used for quick integrity check on this * structure. Must always have the value * 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 * allocated. */ Visual *visual; /* Visual associated with colormap. */ Index: generic/tkConfig.c ================================================================== --- generic/tkConfig.c +++ generic/tkConfig.c @@ -852,11 +852,11 @@ } case TK_OPTION_CURSOR: { Tk_Cursor newCursor; if (nullOK && ObjectIsEmpty(valuePtr)) { - newCursor = None; + newCursor = NULL; valuePtr = NULL; } else { newCursor = Tk_AllocCursorFromObj(interp, tkwin, valuePtr); if (newCursor == None) { return TCL_ERROR; @@ -914,11 +914,11 @@ case TK_OPTION_WINDOW: { Tk_Window newWin; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; - newWin = None; + newWin = NULL; } else { if (TkGetWindowFromObj(interp, tkwin, valuePtr, &newWin) != TCL_OK) { return TCL_ERROR; } @@ -1700,11 +1700,11 @@ break; case TK_OPTION_CURSOR: if (internalFormExists) { if (*((Tk_Cursor *) internalPtr) != None) { Tk_FreeCursor(Tk_Display(tkwin), *((Tk_Cursor *) internalPtr)); - *((Tk_Cursor *) internalPtr) = None; + *((Tk_Cursor *) internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_FreeCursorFromObj(tkwin, objPtr); } break; Index: generic/tkCursor.c ================================================================== --- generic/tkCursor.c +++ generic/tkCursor.c @@ -147,11 +147,11 @@ */ 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; } @@ -186,11 +186,11 @@ Tk_Uid string) /* Description of cursor. See manual entry for * details on legal syntax. */ { TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string); if (cursorPtr == NULL) { - return None; + return NULL; } return cursorPtr->cursor; } /* @@ -380,11 +380,11 @@ Tcl_SetHashValue(cursorPtr->idHashPtr, cursorPtr); return cursorPtr->cursor; error: Tcl_DeleteHashEntry(dataHashPtr); - return None; + return NULL; } /* *-------------------------------------------------------------- * Index: generic/tkEntry.c ================================================================== --- generic/tkEntry.c +++ generic/tkEntry.c @@ -521,20 +521,20 @@ tmp[0] = '\0'; entryPtr->string = tmp; 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; /* * Keep a hold of the associated tkwin until we destroy the entry, @@ -1421,11 +1421,11 @@ static void EntryWorldChanged( ClientData instanceData) /* Information about widget. */ { XGCValues gcValues; - GC gc = None; + GC gc = NULL; unsigned long mask; Tk_3DBorder border; XColor *colorPtr; Entry *entryPtr = (Entry *) instanceData; @@ -2449,11 +2449,11 @@ if (elem == SEL_ENTRY) { cursor = entryPtr->cursor; } else if ((elem == SEL_BUTTONDOWN) || (elem == SEL_BUTTONUP)) { cursor = sbPtr->bCursor; } else { - cursor = None; + cursor = NULL; } if (cursor != None) { Tk_DefineCursor(entryPtr->tkwin, cursor); } else { Tk_UndefineCursor(entryPtr->tkwin); @@ -3589,26 +3589,26 @@ tmp[0] = '\0'; entryPtr->string = tmp; 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; sbPtr->toValue = 100.0; sbPtr->increment = 1.0; Index: generic/tkEntry.h ================================================================== --- generic/tkEntry.h +++ generic/tkEntry.h @@ -85,11 +85,11 @@ * background. */ Tk_3DBorder readonlyBorder; /* Used for drawing border around whole window * 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. */ XColor *fgColorPtr; /* Text color in normal mode. */ XColor *dfgColorPtr; /* Text color in disabled mode. */ @@ -195,11 +195,11 @@ */ 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 * means no command to issue. */ @@ -224,11 +224,11 @@ * Malloc'ed. */ char *reqFormat; /* Sprintf conversion specifier used for the * value that the users requests. Malloc'ed */ char *valueFormat; /* Sprintf conversion specifier used for the * value. */ - char digitFormat[10]; /* Sprintf conversion specifier computed from + char digitFormat[16]; /* Sprintf conversion specifier computed from * digits and other information; used for the * value. */ char *valueStr; /* Values List. Malloc'ed. */ Tcl_Obj *listObj; /* Pointer to the list object being used */ Index: generic/tkEvent.c ================================================================== --- generic/tkEvent.c +++ generic/tkEvent.c @@ -1434,11 +1434,11 @@ ipPtr = ipPtr->nextPtr) { if (ipPtr->nextHandler == handlerPtr) { ipPtr->nextHandler = NULL; } if (ipPtr->winPtr == winPtr) { - ipPtr->winPtr = None; + ipPtr->winPtr = NULL; } } ckfree((char *) handlerPtr); } } Index: generic/tkFrame.c ================================================================== --- generic/tkFrame.c +++ generic/tkFrame.c @@ -635,16 +635,16 @@ (ClientData) framePtr, FrameCmdDeletedProc); framePtr->optionTable = optionTable; 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; } /* * Store backreference to frame widget in window structure. */ Index: generic/tkImgBmap.c ================================================================== --- generic/tkImgBmap.c +++ generic/tkImgBmap.c @@ -422,11 +422,11 @@ gcValues.clip_mask = instancePtr->bitmap; mask |= GCClipMask; } gc = Tk_GetGC(instancePtr->tkwin, mask, &gcValues); } else { - gc = None; + gc = NULL; } if (instancePtr->gc != None) { Tk_FreeGC(Tk_Display(instancePtr->tkwin), instancePtr->gc); } instancePtr->gc = gc; @@ -439,11 +439,11 @@ */ if (instancePtr->gc != None) { 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, "\")"); Tcl_BackgroundError(masterPtr->interp); } @@ -834,11 +834,11 @@ instancePtr->tkwin = tkwin; instancePtr->fg = NULL; instancePtr->bg = NULL; instancePtr->bitmap = None; instancePtr->mask = None; - instancePtr->gc = None; + instancePtr->gc = NULL; instancePtr->nextPtr = masterPtr->instancePtr; masterPtr->instancePtr = instancePtr; ImgBmapConfigureInstance(instancePtr); /* Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -532,17 +532,17 @@ Tcl_InitHashTable(listPtr->selection, TCL_ONE_WORD_KEYS); listPtr->itemAttrTable = (Tcl_HashTable *) 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; /* * Keep a hold of the associated tkwin until we destroy the listbox, Index: generic/tkMenu.c ================================================================== --- generic/tkMenu.c +++ generic/tkMenu.c @@ -504,11 +504,11 @@ menuPtr->interp = interp; menuPtr->widgetCmd = Tcl_CreateObjCommand(interp, 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; TkMenuInitializeDrawingFields(menuPtr); Index: generic/tkMenu.h ================================================================== --- generic/tkMenu.h +++ generic/tkMenu.h @@ -78,12 +78,12 @@ * normal, active, or disabled. */ int underline; /* Value of -underline option: specifies index * 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. */ Tk_Image image; /* Image to display in menu entry, or NULL if * none. */ @@ -178,11 +178,11 @@ * menu. */ GC disabledGC; /* Used to produce disabled effect for entry. * 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. */ /* * Miscellaneous fields. */ @@ -345,11 +345,11 @@ Tcl_Obj *tearoffCommandPtr; /* If non-NULL, points to a command to run * whenever the menu is torn-off. */ 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 * details. */ int postCommandGeneration; /* Need to do pre-invocation post command Index: generic/tkMenuDraw.c ================================================================== --- generic/tkMenuDraw.c +++ generic/tkMenuDraw.c @@ -41,16 +41,16 @@ 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; } /* *---------------------------------------------------------------------- @@ -77,14 +77,14 @@ mePtr->height = 0; mePtr->x = 0; 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; } /* *---------------------------------------------------------------------- * @@ -383,14 +383,14 @@ gcValues.background = Tk_3DBorderColor(activeBorder)->pixel; newActiveGC = Tk_GetGC(menuPtr->tkwin, 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) { Tk_FreeGC(menuPtr->display, mePtr->textGC); } mePtr->textGC = newGC; Index: generic/tkMenubutton.c ================================================================== --- generic/tkMenubutton.c +++ generic/tkMenubutton.c @@ -265,15 +265,15 @@ mbPtr->inset = 0; mbPtr->tkfont = NULL; 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; mbPtr->heightString = NULL; mbPtr->width = 0; @@ -286,11 +286,11 @@ mbPtr->textLayout = NULL; mbPtr->indicatorOn = 0; mbPtr->indicatorWidth = 0; mbPtr->indicatorHeight = 0; mbPtr->direction = DIRECTION_FLUSH; - mbPtr->cursor = None; + mbPtr->cursor = NULL; mbPtr->takeFocus = NULL; mbPtr->flags = 0; Tk_CreateEventHandler(mbPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, Index: generic/tkMenubutton.h ================================================================== --- generic/tkMenubutton.h +++ generic/tkMenubutton.h @@ -173,11 +173,11 @@ * will attempt to pop the menu compleletly * above or below the menu respectively. * "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. */ int flags; /* Various flags; see below for * definitions. */ Index: generic/tkMessage.c ================================================================== --- generic/tkMessage.c +++ generic/tkMessage.c @@ -252,15 +252,15 @@ msgPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd, (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); Tk_CreateEventHandler(msgPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, @@ -521,11 +521,11 @@ static void MessageWorldChanged( ClientData instanceData) /* Information about widget. */ { XGCValues gcValues; - GC gc = None; + GC gc = NULL; Tk_FontMetrics fm; Message *msgPtr; msgPtr = (Message *) instanceData; Index: generic/tkOldConfig.c ================================================================== --- generic/tkOldConfig.c +++ generic/tkOldConfig.c @@ -474,11 +474,11 @@ case TK_CONFIG_CURSOR: case TK_CONFIG_ACTIVE_CURSOR: { 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) { return TCL_ERROR; @@ -1024,11 +1024,11 @@ break; case TK_CONFIG_CURSOR: case TK_CONFIG_ACTIVE_CURSOR: if (*((Tk_Cursor *) ptr) != None) { Tk_FreeCursor(display, *((Tk_Cursor *) ptr)); - *((Tk_Cursor *) ptr) = None; + *((Tk_Cursor *) ptr) = NULL; } } } } Index: generic/tkPanedWindow.c ================================================================== --- generic/tkPanedWindow.c +++ generic/tkPanedWindow.c @@ -446,13 +446,13 @@ Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd, (ClientData) pwPtr, PanedWindowCmdDeletedProc); 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, * otherwise Tk might free it while we still need it. */ @@ -2016,14 +2016,14 @@ * Clean out any -after or -before references to this slave */ 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; } } masterPtr->flags |= REQUESTED_RELAYOUT; if (!(masterPtr->flags & REDRAW_PENDING)) { Index: generic/tkPlace.c ================================================================== --- generic/tkPlace.c +++ generic/tkPlace.c @@ -395,11 +395,11 @@ */ 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; Tcl_SetHashValue(hPtr, slavePtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc, Index: generic/tkRectOval.c ================================================================== --- generic/tkRectOval.c +++ generic/tkRectOval.c @@ -260,11 +260,11 @@ rectOvalPtr->activeFillColor = NULL; rectOvalPtr->disabledFillColor = NULL; rectOvalPtr->fillStipple = None; rectOvalPtr->activeFillStipple = None; rectOvalPtr->disabledFillStipple = None; - rectOvalPtr->fillGC = None; + rectOvalPtr->fillGC = NULL; /* * Process the arguments to fill in the item record. */ @@ -471,11 +471,11 @@ rectOvalPtr->outline.color != NULL) { gcValues.cap_style = CapProjecting; mask |= GCCapStyle; newGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = None; + newGC = NULL; } if (rectOvalPtr->outline.gc != None) { Tk_FreeGC(Tk_Display(tkwin), rectOvalPtr->outline.gc); } rectOvalPtr->outline.gc = newGC; @@ -505,11 +505,11 @@ stipple = rectOvalPtr->disabledFillStipple; } } if (color == NULL) { - newGC = None; + newGC = NULL; } else { gcValues.foreground = color->pixel; if (stipple != None) { gcValues.stipple = stipple; gcValues.fill_style = FillStippled; Index: generic/tkScale.c ================================================================== --- generic/tkScale.c +++ generic/tkScale.c @@ -262,15 +262,15 @@ scalePtr->borderWidth = 0; scalePtr->bgBorder = NULL; 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; scalePtr->highlightColorPtr = NULL; scalePtr->inset = 0; @@ -283,11 +283,11 @@ scalePtr->vertTickRightX = 0; scalePtr->vertValueRightX = 0; scalePtr->vertTroughX = 0; scalePtr->vertLabelX = 0; scalePtr->fontHeight = 0; - scalePtr->cursor = None; + scalePtr->cursor = NULL; scalePtr->takeFocusPtr = NULL; scalePtr->flags = NEVER_SET; Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr); Tk_CreateEventHandler(scalePtr->tkwin, Index: generic/tkScale.h ================================================================== --- generic/tkScale.h +++ generic/tkScale.h @@ -76,11 +76,11 @@ * multiple of this value. */ int digits; /* Number of significant digits to print in * values. 0 means we get to choose the number * based on resolution and/or the range of the * scale. */ - char format[10]; /* Sprintf conversion specifier computed from + char format[16]; /* Sprintf conversion specifier computed from * digits and other information. */ double bigIncrement; /* Amount to use for large increments to scale * value. (0 means we pick a value). */ char *command; /* Command prefix to use when invoking Tcl * commands because the scale value changed. @@ -154,11 +154,11 @@ /* * Miscellaneous information: */ 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. */ int flags; /* Various flags; see below for * definitions. */ Index: generic/tkScrollbar.c ================================================================== --- generic/tkScrollbar.c +++ generic/tkScrollbar.c @@ -186,11 +186,11 @@ scrollPtr->windowUnits = 0; scrollPtr->firstUnit = 0; scrollPtr->lastUnit = 0; scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; - scrollPtr->cursor = None; + scrollPtr->cursor = NULL; scrollPtr->takeFocus = NULL; scrollPtr->flags = 0; if (ConfigureScrollbar(interp, scrollPtr, argc-2, argv+2, 0) != TCL_OK) { Tk_DestroyWindow(scrollPtr->tkwin); Index: generic/tkScrollbar.h ================================================================== --- generic/tkScrollbar.h +++ generic/tkScrollbar.h @@ -117,11 +117,11 @@ /* * 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. */ int flags; /* Various flags; see below for * definitions. */ Index: generic/tkSquare.c ================================================================== --- generic/tkSquare.c +++ generic/tkSquare.c @@ -164,11 +164,11 @@ squarePtr->display = Tk_Display(tkwin); squarePtr->interp = interp; 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) != TCL_OK) { Tk_DestroyWindow(squarePtr->tkwin); Index: generic/tkText.c ================================================================== --- generic/tkText.c +++ generic/tkText.c @@ -566,11 +566,11 @@ textPtr->end = NULL; } 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; textPtr->prevWidth = Tk_Width(newWin); textPtr->prevHeight = Tk_Height(newWin); Index: generic/tkText.h ================================================================== --- generic/tkText.h +++ generic/tkText.h @@ -652,11 +652,11 @@ * don't draw a highlight. */ XColor *highlightBgColorPtr; /* 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 * font. */ int charHeight; /* Height of average character in default Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -630,11 +630,11 @@ XGCValues gcValues; 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); dInfoPtr->topOfEof = 0; dInfoPtr->newXPixelOffset = 0; @@ -946,11 +946,11 @@ gcValues.fill_style = FillStippled; mask |= GCStipple|GCFillStyle; } stylePtr->bgGC = Tk_GetGC(textPtr->tkwin, mask, &gcValues); } else { - stylePtr->bgGC = None; + stylePtr->bgGC = NULL; } mask = GCFont; gcValues.font = Tk_FontId(styleValues.tkfont); mask |= GCForeground; gcValues.foreground = styleValues.fgColor->pixel; @@ -4333,11 +4333,11 @@ } TkTextEmbWinDisplayProc(textPtr, chunkPtr, x, dlPtr->spaceAbove, dlPtr->height-dlPtr->spaceAbove-dlPtr->spaceBelow, dlPtr->baseline - dlPtr->spaceAbove, NULL, - (Drawable) None, dlPtr->y + dlPtr->spaceAbove); + None, dlPtr->y + dlPtr->spaceAbove); } } } #ifndef TK_NO_DOUBLE_BUFFERING Index: generic/tkWindow.c ================================================================== --- generic/tkWindow.c +++ generic/tkWindow.c @@ -2108,11 +2108,11 @@ void Tk_UndefineCursor( Tk_Window tkwin) /* Window to manipulate. */ { - Tk_DefineCursor(tkwin, None); + Tk_DefineCursor(tkwin, NULL); } void Tk_SetWindowColormap( Tk_Window tkwin, /* Window to manipulate. */ Index: generic/ttk/ttkEntry.c ================================================================== --- generic/ttk/ttkEntry.c +++ generic/ttk/ttkEntry.c @@ -330,11 +330,11 @@ static int 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; if (entryPtr->entry.selectFirst < 0 || !entryPtr->entry.exportSelection) { return -1; @@ -343,11 +343,11 @@ selStart = Tcl_UtfAtIndex(string, entryPtr->entry.selectFirst); 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; } if (byteCount <= 0) { return 0; Index: generic/ttk/ttkLayout.c ================================================================== --- generic/ttk/ttkLayout.c +++ generic/ttk/ttkLayout.c @@ -5,11 +5,11 @@ * * Copyright (c) 2003 Joe English. Freely redistributable. */ #include -#include +#include "tkInt.h" #include "ttkThemeInt.h" #define MAX(a,b) (a > b ? a : b) #define MIN(a,b) (a < b ? a : b) Index: generic/ttk/ttkTreeview.c ================================================================== --- generic/ttk/ttkTreeview.c +++ generic/ttk/ttkTreeview.c @@ -4,11 +4,11 @@ * ttk::treeview widget implementation. */ #include #include -#include +#include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" #define DEF_TREE_ROWS "10" #define DEF_COLWIDTH "200" Index: generic/ttk/ttkWidget.c ================================================================== --- generic/ttk/ttkWidget.c +++ generic/ttk/ttkWidget.c @@ -3,11 +3,11 @@ * * Core widget utilities. */ #include -#include +#include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" #ifdef MAC_OSX_TK #define TK_NO_DOUBLE_BUFFERING 1 Index: macosx/tkMacOSXDefault.h ================================================================== --- macosx/tkMacOSXDefault.h +++ macosx/tkMacOSXDefault.h @@ -35,11 +35,11 @@ #define WHITE "White" #define NORMAL_BG "systemWindowBody" #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" #define DISABLED "#a3a3a3" @@ -279,11 +279,11 @@ #define DEF_MENU_ENTRY_ACTIVE_BG ((char *) NULL) #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" #define DEF_MENU_ENTRY_FG ((char *) NULL) #define DEF_MENU_ENTRY_FONT ((char *) NULL) Index: macosx/tkMacOSXEmbed.c ================================================================== --- macosx/tkMacOSXEmbed.c +++ macosx/tkMacOSXEmbed.c @@ -489,11 +489,11 @@ if (containerPtr->embeddedPtr == winPtr) { return (MacDrawable *) containerPtr->parent; } } Tcl_Panic("TkMacOSXContainerId couldn't find window"); - return None; + return NULL; } /* *---------------------------------------------------------------------- * @@ -525,12 +525,12 @@ /* * TODO: Here we should handle out of process embedding. */ - if (contWinPtr == NULL) { - return None; + if (!contWinPtr) { + return NULL; } return TkMacOSXGetHostToplevel(contWinPtr); } /* Index: macosx/tkMacOSXMenu.c ================================================================== --- macosx/tkMacOSXMenu.c +++ macosx/tkMacOSXMenu.c @@ -1458,14 +1458,14 @@ observe(NSMenuDidBeginTrackingNotification, menuBeginTracking:); observe(NSMenuDidEndTrackingNotification, menuEndTracking:); #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); ChkErr(GetThemeMetric, kThemeMetricMenuMarkColumnWidth, &menuMarkColumnWidth); Index: macosx/tkMacOSXScrlbr.c ================================================================== --- macosx/tkMacOSXScrlbr.c +++ macosx/tkMacOSXScrlbr.c @@ -102,12 +102,12 @@ Tk_Window tkwin) { 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); return (TkScrollbar *) scrollPtr; } Index: macosx/tkMacOSXXStubs.c ================================================================== --- macosx/tkMacOSXXStubs.c +++ macosx/tkMacOSXXStubs.c @@ -1369,11 +1369,11 @@ void Tk_ResetUserInactiveTime( Display *dpy) { - IOGPoint loc; + IOGPoint loc = {0}; kern_return_t kr; NXEvent nullEvent = {NX_NULLEVENT, {0, 0}, 0, -1, 0}; enum { kNULLEventPostThrottle = 10 }; static io_connect_t io_connection = MACH_PORT_NULL; Index: unix/tkUnixDefault.h ================================================================== --- unix/tkUnixDefault.h +++ unix/tkUnixDefault.h @@ -241,11 +241,11 @@ #define DEF_MENU_ENTRY_ACTIVE_BG (char *) NULL #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" #define DEF_MENU_ENTRY_FG (char *) NULL #define DEF_MENU_ENTRY_FONT (char *) NULL Index: win/tkWinButton.c ================================================================== --- win/tkWinButton.c +++ win/tkWinButton.c @@ -125,11 +125,11 @@ HMODULE module = (HINSTANCE) Tk_GetHINSTANCE(); HRSRC hrsrc; HGLOBAL hblk; LPBITMAPINFOHEADER newBitmap; - DWORD size; + size_t size; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); hrsrc = FindResource(module, "buttons", RT_BITMAP); if (hrsrc == NULL) { @@ -144,21 +144,22 @@ * Copy the DIBitmap into writable memory. */ if (tsdPtr->boxesPtr != NULL && !(tsdPtr->boxesPtr->biWidth % 4) && !(tsdPtr->boxesPtr->biHeight % 2)) { - size = tsdPtr->boxesPtr->biSize + (1 << tsdPtr->boxesPtr->biBitCount) - * sizeof(RGBQUAD) + tsdPtr->boxesPtr->biSizeImage; + size = tsdPtr->boxesPtr->biSize + + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount) + + tsdPtr->boxesPtr->biSizeImage; newBitmap = (LPBITMAPINFOHEADER) ckalloc(size); memcpy(newBitmap, tsdPtr->boxesPtr, size); tsdPtr->boxesPtr = newBitmap; tsdPtr->boxWidth = tsdPtr->boxesPtr->biWidth / 4; tsdPtr->boxHeight = tsdPtr->boxesPtr->biHeight / 2; 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; } } Index: win/tkWinDefault.h ================================================================== --- win/tkWinDefault.h +++ win/tkWinDefault.h @@ -244,11 +244,11 @@ #define DEF_MENU_ENTRY_ACTIVE_BG (char *) NULL #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" #define DEF_MENU_ENTRY_FG (char *) NULL #define DEF_MENU_ENTRY_FONT (char *) NULL Index: win/tkWinEmbed.c ================================================================== --- win/tkWinEmbed.c +++ win/tkWinEmbed.c @@ -298,11 +298,11 @@ * order to avoid bug 1096074 in future. */ char msg[256]; - sprintf(msg, "Unable to get information of window \"%.80s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string); + sprintf(msg, "Unable to get information of window \"%.79s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string); if (IDCANCEL == MessageBox(hwnd, msg, "Tk Warning", MB_OKCANCEL | MB_ICONWARNING)) { Tcl_SetResult(interp, "Operation has been canceled", TCL_STATIC); return TCL_ERROR; } Index: win/tkWinImage.c ================================================================== --- win/tkWinImage.c +++ win/tkWinImage.c @@ -346,11 +346,11 @@ depth = twdPtr->bitmap.depth; } size = sizeof(BITMAPINFO); if (depth <= 8) { - size += sizeof(unsigned short) * (1 << depth); + size += sizeof(unsigned short) << depth; } bmInfo = (BITMAPINFO *) ckalloc((unsigned)size); bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo->bmiHeader.biWidth = width; Index: win/tkWinPort.h ================================================================== --- win/tkWinPort.h +++ win/tkWinPort.h @@ -81,10 +81,15 @@ /* * 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 /* * The following macro checks to see whether there is buffered Index: win/tkWinWm.c ================================================================== --- win/tkWinWm.c +++ win/tkWinWm.c @@ -8584,11 +8584,11 @@ SendMessage(wmPtr->wrapper, TK_SETMENU, 0, 0); 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; } } if (winPtr->flags & TK_TOP_LEVEL) { Index: win/tkWinX.c ================================================================== --- win/tkWinX.c +++ win/tkWinX.c @@ -634,11 +634,11 @@ * Set up the root window. */ twdPtr = (TkWinDrawable*) ckalloc(sizeof(TkWinDrawable)); if (twdPtr == NULL) { - return None; + return NULL; } twdPtr->type = TWD_WINDOW; twdPtr->window.winPtr = NULL; twdPtr->window.handle = NULL; screen->root = (Window)twdPtr; Index: xlib/X11/X.h ================================================================== --- xlib/X11/X.h +++ xlib/X11/X.h @@ -71,11 +71,13 @@ /***************************************************************** * 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 */ #define CopyFromParent 0L /* border pixmap in CreateWindow @@ -177,16 +179,23 @@ /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, state in various key-, mouse-, and button-related events. */ #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. */ #define ShiftMapIndex 0 Index: xlib/xgc.c ================================================================== --- xlib/xgc.c +++ xlib/xgc.c @@ -124,11 +124,11 @@ #define MAX_DASH_LIST_SIZE 10 gp = (XGCValues *) ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize); if (!gp) { - return None; + return NULL; } #define InitField(name,maskbit,default) \ (gp->name = (mask & (maskbit)) ? values->name : (default))