summaryrefslogtreecommitdiffstats
path: root/xlib/xgc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 09:44:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 09:44:05 (GMT)
commite26cd8eb2b04a4bd764e382cbcbfe4b1030796c6 (patch)
tree6bca925436edc8dce431cfd10502d50117b62d46 /xlib/xgc.c
parent0c4227b6cc6e9716ddd086a75e45c4e9373fa51b (diff)
parent81b0bd7641a9d2f63154c97d41c27bbb696ef674 (diff)
downloadtk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.zip
tk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.tar.gz
tk-e26cd8eb2b04a4bd764e382cbcbfe4b1030796c6.tar.bz2
Fix [9e31fd9449]: X11/X.h and Windows.h have conflicting symbols
*** POTENTIAL INCOMPATIBILITY *** for Win32 only: On X11 and Mac, "None" can still be used as before
Diffstat (limited to 'xlib/xgc.c')
-rw-r--r--xlib/xgc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/xlib/xgc.c b/xlib/xgc.c
index 984c949..be66b21 100644
--- a/xlib/xgc.c
+++ b/xlib/xgc.c
@@ -50,7 +50,7 @@
static TkpClipMask *AllocClipMask(GC gc) {
TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask;
- if (clip_mask == None) {
+ if (!clip_mask) {
clip_mask = ckalloc(sizeof(TkpClipMask));
gc->clip_mask = (Pixmap) clip_mask;
#ifdef MAC_OSX_TK
@@ -78,14 +78,14 @@ static TkpClipMask *AllocClipMask(GC gc) {
*/
static void FreeClipMask(GC gc) {
- if (gc->clip_mask != None) {
+ if (gc->clip_mask) {
#ifdef MAC_OSX_TK
if (((TkpClipMask*) gc->clip_mask)->type == TKP_CLIP_REGION) {
TkpReleaseRegion(((TkpClipMask*) gc->clip_mask)->value.region);
}
#endif
ckfree(gc->clip_mask);
- gc->clip_mask = None;
+ gc->clip_mask = 0;
}
}
@@ -125,7 +125,7 @@ XCreateGC(
gp = ckalloc(sizeof(XGCValues) + MAX_DASH_LIST_SIZE + gcCacheSize);
if (!gp) {
- return None;
+ return 0;
}
#define InitField(name,maskbit,default) \
@@ -144,11 +144,11 @@ XCreateGC(
InitField(fill_style, GCFillStyle, FillSolid);
InitField(fill_rule, GCFillRule, WindingRule);
InitField(arc_mode, GCArcMode, ArcPieSlice);
- InitField(tile, GCTile, None);
- InitField(stipple, GCStipple, None);
+ InitField(tile, GCTile, 0);
+ InitField(stipple, GCStipple, 0);
InitField(ts_x_origin, GCTileStipXOrigin, 0);
InitField(ts_y_origin, GCTileStipYOrigin, 0);
- InitField(font, GCFont, None);
+ InitField(font, GCFont, 0);
InitField(subwindow_mode, GCSubwindowMode, ClipByChildren);
InitField(graphics_exposures, GCGraphicsExposures, True);
InitField(clip_x_origin, GCClipXOrigin, 0);
@@ -157,7 +157,7 @@ XCreateGC(
InitField(dashes, GCDashList, 4);
(&(gp->dashes))[1] = 0;
- gp->clip_mask = None;
+ gp->clip_mask = 0;
if (mask & GCClipMask) {
TkpClipMask *clip_mask = AllocClipMask(gp);
@@ -268,7 +268,7 @@ int XFreeGC(
Display *d,
GC gc)
{
- if (gc != None) {
+ if (gc) {
FreeClipMask(gc);
TkpFreeGCCache(gc);
ckfree(gc);
@@ -464,7 +464,7 @@ TkSetRegion(
GC gc,
TkRegion r)
{
- if (r == None) {
+ if (!r) {
Tcl_Panic("must not pass None to TkSetRegion for compatibility with X11; use XSetClipMask instead");
} else {
TkpClipMask *clip_mask = AllocClipMask(gc);
@@ -483,7 +483,7 @@ XSetClipMask(
GC gc,
Pixmap pixmap)
{
- if (pixmap == None) {
+ if (!pixmap) {
FreeClipMask(gc);
} else {
TkpClipMask *clip_mask = AllocClipMask(gc);