diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-31 15:56:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-12-31 15:56:41 (GMT) |
commit | 4224e39596e02ca9cf11a2c160d8f8e7b43a45f9 (patch) | |
tree | e78b5e9ecbd064bd24bc43894cd3dd4e9e075480 /generic/tkCanvLine.c | |
parent | ccc7f53ac59980eae109a3314ba3599a8b851fb1 (diff) | |
parent | f2b5a87d6dc6d3468828d48929583d950690a40b (diff) | |
download | tk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.zip tk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.tar.gz tk-4224e39596e02ca9cf11a2c160d8f8e7b43a45f9.tar.bz2 |
As requested by Christian Werner/François Vogel and others: Undo many None -> 0 changes, in order to reduce the probability of merge conflicts with other branches.
Remark: Many usages of "None" in Tk are wrong, "NULL" should be used in many places where pointers are referenced in stead of XID's. Those places are corrected.
Diffstat (limited to 'generic/tkCanvLine.c')
-rw-r--r-- | generic/tkCanvLine.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 7179c85..f862238 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -296,7 +296,7 @@ CreateLine( linePtr->coordPtr = NULL; linePtr->capStyle = CapButt; linePtr->joinStyle = JoinRound; - linePtr->arrowGC = 0; + linePtr->arrowGC = NULL; linePtr->arrow = ARROWS_NONE; linePtr->arrowShapeA = (float)8.0; linePtr->arrowShapeB = (float)10.0; @@ -493,9 +493,9 @@ ConfigureLine( } if (linePtr->outline.activeWidth > linePtr->outline.width || - linePtr->outline.activeDash.number || - linePtr->outline.activeColor || - linePtr->outline.activeStipple) { + linePtr->outline.activeDash.number != 0 || + linePtr->outline.activeColor != NULL || + linePtr->outline.activeStipple != None) { itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT; } else { itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT; @@ -521,7 +521,7 @@ ConfigureLine( #endif arrowGC = Tk_GetGC(tkwin, mask, &gcValues); } else { - newGC = arrowGC = 0; + newGC = arrowGC = NULL; } if (linePtr->outline.gc) { Tk_FreeGC(Tk_Display(tkwin), linePtr->outline.gc); @@ -552,7 +552,7 @@ ConfigureLine( * line's endpoints (they were shortened when the arrowheads were added). */ - if (linePtr->firstArrowPtr && (linePtr->arrow != ARROWS_FIRST) + if ((linePtr->firstArrowPtr != NULL) && (linePtr->arrow != ARROWS_FIRST) && (linePtr->arrow != ARROWS_BOTH)) { linePtr->coordPtr[0] = linePtr->firstArrowPtr[0]; linePtr->coordPtr[1] = linePtr->firstArrowPtr[1]; @@ -608,16 +608,16 @@ DeleteLine( LineItem *linePtr = (LineItem *) itemPtr; Tk_DeleteOutline(display, &linePtr->outline); - if (linePtr->coordPtr) { + if (linePtr->coordPtr != NULL) { ckfree(linePtr->coordPtr); } - if (linePtr->arrowGC) { + if (linePtr->arrowGC != None) { Tk_FreeGC(display, linePtr->arrowGC); } - if (linePtr->firstArrowPtr) { + if (linePtr->firstArrowPtr != NULL) { ckfree(linePtr->firstArrowPtr); } - if (linePtr->lastArrowPtr) { + if (linePtr->lastArrowPtr != NULL) { ckfree(linePtr->lastArrowPtr); } } @@ -654,7 +654,7 @@ ComputeLineBbox( state = Canvas(canvas)->canvas_state; } - if (!(linePtr->numPoints) || (state == TK_STATE_HIDDEN)) { + if (!(linePtr->numPoints) || (state==TK_STATE_HIDDEN)) { linePtr->header.x1 = -1; linePtr->header.x2 = -1; linePtr->header.y1 = -1; @@ -667,7 +667,7 @@ ComputeLineBbox( if (linePtr->outline.activeWidth > width) { width = linePtr->outline.activeWidth; } - } else if (state == TK_STATE_DISABLED) { + } else if (state==TK_STATE_DISABLED) { if (linePtr->outline.disabledWidth > 0) { width = linePtr->outline.disabledWidth; } @@ -2277,7 +2277,7 @@ LineToPostscript( if (linePtr->outline.activeWidth > width) { width = linePtr->outline.activeWidth; } - if (linePtr->outline.activeColor != NULL) { + if (linePtr->outline.activeColor) { color = linePtr->outline.activeColor; } if (linePtr->outline.activeStipple) { @@ -2287,7 +2287,7 @@ LineToPostscript( if (linePtr->outline.disabledWidth > 0) { width = linePtr->outline.disabledWidth; } - if (linePtr->outline.disabledColor != NULL) { + if (linePtr->outline.disabledColor) { color = linePtr->outline.disabledColor; } if (linePtr->outline.disabledStipple) { @@ -2407,8 +2407,8 @@ LineToPostscript( * Output polygons for the arrowheads, if there are any. */ - if (linePtr->firstArrowPtr) { - if (stipple) { + if (linePtr->firstArrowPtr != NULL) { + if (stipple != None) { Tcl_AppendToObj(psObj, "grestore gsave\n", -1); } if (ArrowheadPostscript(interp, canvas, linePtr, @@ -2417,7 +2417,7 @@ LineToPostscript( } } if (linePtr->lastArrowPtr != NULL) { - if (stipple) { + if (stipple != None) { Tcl_AppendToObj(psObj, "grestore gsave\n", -1); } if (ArrowheadPostscript(interp, canvas, linePtr, @@ -2482,11 +2482,11 @@ ArrowheadPostscript( stipple = linePtr->outline.stipple; if (Canvas(canvas)->currentItemPtr == (Tk_Item *) linePtr) { - if (linePtr->outline.activeStipple) { + if (linePtr->outline.activeStipple!=None) { stipple = linePtr->outline.activeStipple; } } else if (state == TK_STATE_DISABLED) { - if (linePtr->outline.activeStipple) { + if (linePtr->outline.activeStipple!=None) { stipple = linePtr->outline.disabledStipple; } } |