summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-10 08:10:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-10 08:10:29 (GMT)
commit7b3b30d439640b2474a81ff1b97c8ae264811165 (patch)
tree05e00c4d3ff33c3693eecf185af839c020854fc1 /generic/tkTextDisp.c
parent3d9f5433b611ddba5d4c1f219d61bfcde319034f (diff)
parent44cdf94725d440ad4b97077853722891d2d9cd7d (diff)
downloadtk-7b3b30d439640b2474a81ff1b97c8ae264811165.zip
tk-7b3b30d439640b2474a81ff1b97c8ae264811165.tar.gz
tk-7b3b30d439640b2474a81ff1b97c8ae264811165.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.
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 356e8b7..fcefb9a 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -666,7 +666,7 @@ TkTextCreateDInfo(
dInfoPtr = 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);
@@ -730,7 +730,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);
@@ -862,7 +862,7 @@ GetStyle(
border = tagPtr->selBorder;
}
- if ((tagPtr->selFgColor != None) && (isSelected)) {
+ if ((tagPtr->selFgColor != NULL) && isSelected) {
fgColor = tagPtr->selFgColor;
}
@@ -889,11 +889,11 @@ GetStyle(
styleValues.bgStipple = tagPtr->bgStipple;
bgStipplePrio = tagPtr->priority;
}
- if ((fgColor != None) && (tagPtr->priority > fgPrio)) {
+ if ((fgColor != NULL) && (tagPtr->priority > fgPrio)) {
styleValues.fgColor = 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;
}
@@ -931,9 +931,9 @@ GetStyle(
&& (tagPtr->priority > overstrikePrio)) {
styleValues.overstrike = tagPtr->overstrike;
overstrikePrio = tagPtr->priority;
- if (tagPtr->overstrikeColor != None) {
+ if (tagPtr->overstrikeColor != NULL) {
styleValues.overstrikeColor = tagPtr->overstrikeColor;
- } else if (fgColor != None) {
+ } else if (fgColor != NULL) {
styleValues.overstrikeColor = fgColor;
}
}
@@ -976,9 +976,9 @@ GetStyle(
&& (tagPtr->priority > underlinePrio)) {
styleValues.underline = tagPtr->underline;
underlinePrio = tagPtr->priority;
- if (tagPtr->underlineColor != None) {
+ if (tagPtr->underlineColor != NULL) {
styleValues.underlineColor = tagPtr->underlineColor;
- } else if (fgColor != None) {
+ } else if (fgColor != NULL) {
styleValues.underlineColor = fgColor;
}
}
@@ -1025,7 +1025,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);
@@ -1076,16 +1076,16 @@ 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);
}
- if (stylePtr->ulGC != None) {
+ if (stylePtr->ulGC != NULL) {
Tk_FreeGC(textPtr->display, stylePtr->ulGC);
}
- if (stylePtr->ovGC != None) {
+ if (stylePtr->ovGC != NULL) {
Tk_FreeGC(textPtr->display, stylePtr->ovGC);
}
Tcl_DeleteHashEntry(stylePtr->hPtr);
@@ -2690,7 +2690,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.
*/
@@ -3147,7 +3147,7 @@ GenerateWidgetViewSyncEvent(
{
Bool NewSyncState = (InSync != 0); /* ensure 0 or 1 value */
Bool OldSyncState = !(textPtr->dInfoPtr->flags & OUT_OF_SYNC);
-
+
/*
* OSX 10.14 needs to be told to display the window when the Text Widget
* is in sync. (That is, to run DisplayText inside of the drawRect
@@ -4583,7 +4583,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);
}
}
}
@@ -5219,7 +5219,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;
@@ -8027,7 +8027,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;