summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvUtil.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 08:02:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-20 08:02:30 (GMT)
commit81b0bd7641a9d2f63154c97d41c27bbb696ef674 (patch)
treea17119411589e8c1291df53e2546243d84e78583 /generic/tkCanvUtil.c
parent93d974c265533cf2445446954346be8192e850a0 (diff)
downloadtk-81b0bd7641a9d2f63154c97d41c27bbb696ef674.zip
tk-81b0bd7641a9d2f63154c97d41c27bbb696ef674.tar.gz
tk-81b0bd7641a9d2f63154c97d41c27bbb696ef674.tar.bz2
Fix [9e31fd944934e269121fa78ff56b7b86f33e6db6|9e31fd9449]: X11/X.h and Windows.h have conflicting symbols.
Also fix a few newer (harmless) gcc warnings.
Diffstat (limited to 'generic/tkCanvUtil.c')
-rw-r--r--generic/tkCanvUtil.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index 08aeab7..cacceda 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 = 0;
outline->width = 1.0;
outline->activeWidth = 0.0;
outline->disabledWidth = 0.0;
@@ -973,9 +973,9 @@ Tk_CreateOutline(
outline->color = NULL;
outline->activeColor = NULL;
outline->disabledColor = NULL;
- outline->stipple = None;
- outline->activeStipple = None;
- outline->disabledStipple = None;
+ outline->stipple = 0;
+ outline->activeStipple = 0;
+ outline->disabledStipple = 0;
}
/*
@@ -1000,7 +1000,7 @@ Tk_DeleteOutline(
Display *display, /* Display containing window. */
Tk_Outline *outline)
{
- if (outline->gc != None) {
+ if (outline->gc) {
Tk_FreeGC(display, outline->gc);
}
if ((unsigned int)ABS(outline->dash.number) > sizeof(char *)) {
@@ -1012,22 +1012,22 @@ Tk_DeleteOutline(
if ((unsigned int)ABS(outline->disabledDash.number) > sizeof(char *)) {
ckfree((char *) outline->disabledDash.pattern.pt);
}
- if (outline->color != NULL) {
+ if (outline->color) {
Tk_FreeColor(outline->color);
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
Tk_FreeColor(outline->activeColor);
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
Tk_FreeColor(outline->disabledColor);
}
- if (outline->stipple != None) {
+ if (outline->stipple) {
Tk_FreeBitmap(display, outline->stipple);
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
Tk_FreeBitmap(display, outline->activeStipple);
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
Tk_FreeBitmap(display, outline->disabledStipple);
}
}
@@ -1093,26 +1093,26 @@ Tk_ConfigOutlineGC(
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor!=NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple!=None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>0) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor!=NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple!=None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1125,18 +1125,18 @@ Tk_ConfigOutlineGC(
if (color != NULL) {
gcValues->foreground = color->pixel;
mask = GCForeground|GCLineWidth;
- if (stipple != None) {
+ if (stipple) {
gcValues->stipple = stipple;
gcValues->fill_style = FillStippled;
mask |= GCStipple|GCFillStyle;
}
}
- if (mask && (dash->number != 0)) {
+ if (mask && dash->number) {
gcValues->line_style = LineOnOffDash;
gcValues->dash_offset = outline->offset;
if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
gcValues->dashes = dash->pattern.pt[0];
- } else if (dash->number != 0) {
+ } else if (dash->number) {
gcValues->dashes = dash->pattern.array[0];
} else {
gcValues->dashes = (char) (4 * width + 0.5);
@@ -1191,30 +1191,30 @@ Tk_ChangeOutlineGC(
if (outline->activeWidth > width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth > width) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
- if (color==NULL) {
+ if (!color) {
return 0;
}
@@ -1236,7 +1236,7 @@ Tk_ChangeOutlineGC(
XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
outline->offset, p, dash->number);
}
- if (stipple!=None) {
+ if (stipple) {
int w=0; int h=0;
Tk_TSOffset *tsoffset = &outline->tsoffset;
int flags = tsoffset->flags;
@@ -1310,26 +1310,26 @@ Tk_ResetOutlineGC(
if (outline->activeWidth>width) {
width = outline->activeWidth;
}
- if (outline->activeDash.number != 0) {
+ if (outline->activeDash.number) {
dash = &(outline->activeDash);
}
- if (outline->activeColor!=NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple!=None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
if (outline->disabledWidth>width) {
width = outline->disabledWidth;
}
- if (outline->disabledDash.number != 0) {
+ if (outline->disabledDash.number) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor!=NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple!=None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1342,7 +1342,7 @@ Tk_ResetOutlineGC(
((dash->number == -1) && (dash->pattern.array[0] != ','))) {
if ((unsigned int)ABS(dash->number) > sizeof(char *)) {
dashList = dash->pattern.pt[0];
- } else if (dash->number != 0) {
+ } else if (dash->number) {
dashList = dash->pattern.array[0];
} else {
dashList = (char) (4 * width + 0.5);
@@ -1350,7 +1350,7 @@ Tk_ResetOutlineGC(
XSetDashes(((TkCanvas *)canvas)->display, outline->gc,
outline->offset, &dashList , 1);
}
- if (stipple != None) {
+ if (stipple) {
XSetTSOrigin(((TkCanvas *)canvas)->display, outline->gc, 0, 0);
return 1;
}
@@ -1409,10 +1409,10 @@ Tk_CanvasPsOutline(
if (outline->activeDash.number > 0) {
dash = &(outline->activeDash);
}
- if (outline->activeColor != NULL) {
+ if (outline->activeColor) {
color = outline->activeColor;
}
- if (outline->activeStipple != None) {
+ if (outline->activeStipple) {
stipple = outline->activeStipple;
}
} else if (state == TK_STATE_DISABLED) {
@@ -1422,10 +1422,10 @@ Tk_CanvasPsOutline(
if (outline->disabledDash.number > 0) {
dash = &(outline->disabledDash);
}
- if (outline->disabledColor != NULL) {
+ if (outline->disabledColor) {
color = outline->disabledColor;
}
- if (outline->disabledStipple != None) {
+ if (outline->disabledStipple) {
stipple = outline->disabledStipple;
}
}
@@ -1482,7 +1482,7 @@ Tk_CanvasPsOutline(
if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) {
return TCL_ERROR;
}
- if (stipple != None) {
+ if (stipple) {
Tcl_AppendResult(interp, "StrokeClip ", NULL);
if (Tk_CanvasPsStipple(interp, canvas, stipple) != TCL_OK) {
return TCL_ERROR;