summaryrefslogtreecommitdiffstats
path: root/generic/tkRectOval.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-04-27 22:38:54 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-04-27 22:38:54 (GMT)
commit4513cb9f431ea8c6b151913a016ec6c75bcac559 (patch)
tree681f7c2354a3726da3ab7da646d316c1275f540d /generic/tkRectOval.c
parent1876f5f7ee429456ad89540bcf659c092245bf1b (diff)
downloadtk-4513cb9f431ea8c6b151913a016ec6c75bcac559.zip
tk-4513cb9f431ea8c6b151913a016ec6c75bcac559.tar.gz
tk-4513cb9f431ea8c6b151913a016ec6c75bcac559.tar.bz2
Get rid of pre-C89-isms (esp. CONST vs const).
Diffstat (limited to 'generic/tkRectOval.c')
-rw-r--r--generic/tkRectOval.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 29ee24e..00a8852 100644
--- a/generic/tkRectOval.c
+++ b/generic/tkRectOval.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkRectOval.c,v 1.17 2007/12/13 15:24:16 dgp Exp $
+ * RCS: @(#) $Id: tkRectOval.c,v 1.18 2008/04/27 22:38:57 dkf Exp $
*/
#include <stdio.h>
@@ -135,10 +135,10 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeRectOvalBbox(Tk_Canvas canvas,
RectOvalItem *rectOvalPtr);
static int ConfigureRectOval(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[],
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[],
int flags);
static int CreateRectOval(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
static void DeleteRectOval(Tk_Canvas canvas, Tk_Item *itemPtr,
Display *display);
static void DisplayRectOval(Tk_Canvas canvas, Tk_Item *itemPtr,
@@ -149,7 +149,7 @@ static int OvalToArea(Tk_Canvas canvas, Tk_Item *itemPtr,
static double OvalToPoint(Tk_Canvas canvas, Tk_Item *itemPtr,
double *pointPtr);
static int RectOvalCoords(Tcl_Interp *interp, Tk_Canvas canvas,
- Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]);
+ Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]);
static int RectOvalToPostscript(Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int prepass);
static int RectToArea(Tk_Canvas canvas, Tk_Item *itemPtr,
@@ -240,7 +240,7 @@ CreateRectOval(
Tk_Item *itemPtr, /* Record to hold new item; header has been
* initialized by caller. */
int objc, /* Number of arguments in objv. */
- Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */
+ Tcl_Obj *const objv[]) /* Arguments describing rectangle. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
int i;
@@ -315,7 +315,7 @@ RectOvalCoords(
Tk_Item *itemPtr, /* Item whose coordinates are to be read or
* modified. */
int objc, /* Number of coordinates supplied in objv. */
- Tcl_Obj *CONST objv[]) /* Array of coordinates: x1,y1,x2,y2,... */
+ Tcl_Obj *const objv[]) /* Array of coordinates: x1,y1,x2,y2,... */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
@@ -404,7 +404,7 @@ ConfigureRectOval(
Tk_Canvas canvas, /* Canvas containing itemPtr. */
Tk_Item *itemPtr, /* Rectangle item to reconfigure. */
int objc, /* Number of elements in objv. */
- Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */
+ Tcl_Obj *const objv[], /* Arguments describing things to configure. */
int flags) /* Flags to pass to Tk_ConfigureWidget. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
@@ -420,7 +420,7 @@ ConfigureRectOval(
tkwin = Tk_CanvasTkwin(canvas);
if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
- (CONST char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
+ (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
state = itemPtr->state;
@@ -483,7 +483,7 @@ ConfigureRectOval(
rectOvalPtr->outline.gc = newGC;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
if (state == TK_STATE_HIDDEN) {
ComputeRectOvalBbox(canvas, rectOvalPtr);
@@ -492,7 +492,7 @@ ConfigureRectOval(
color = rectOvalPtr->fillColor;
stipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectOvalPtr->activeFillColor!=NULL) {
color = rectOvalPtr->activeFillColor;
}
@@ -636,7 +636,7 @@ ComputeRectOvalBbox(
Tk_State state = rectOvalPtr->header.state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectOvalPtr->outline.width;
@@ -645,7 +645,7 @@ ComputeRectOvalBbox(
rectOvalPtr->header.x2 = rectOvalPtr->header.y2 = -1;
return;
}
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) {
if (rectOvalPtr->outline.activeWidth>width) {
width = rectOvalPtr->outline.activeWidth;
}
@@ -781,10 +781,10 @@ DisplayRectOval(
*/
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
fillStipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) {
+ if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) {
if (rectOvalPtr->activeFillStipple != None) {
fillStipple = rectOvalPtr->activeFillStipple;
}
@@ -886,11 +886,11 @@ RectToPoint(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectPtr->outline.activeWidth>width) {
width = rectPtr->outline.activeWidth;
}
@@ -1006,11 +1006,11 @@ OvalToPoint(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = (double) ovalPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (ovalPtr->outline.activeWidth>width) {
width = (double) ovalPtr->outline.activeWidth;
}
@@ -1062,16 +1062,16 @@ RectToArea(
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = rectPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (rectPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (rectPtr->outline.activeWidth > width) {
width = rectPtr->outline.activeWidth;
}
} else if (state == TK_STATE_DISABLED) {
- if (rectPtr->outline.disabledWidth>0) {
+ if (rectPtr->outline.disabledWidth > 0) {
width = rectPtr->outline.disabledWidth;
}
}
@@ -1131,22 +1131,21 @@ OvalToArea(
* y1, x2, y2) describing rectangular area. */
{
RectOvalItem *ovalPtr = (RectOvalItem *) itemPtr;
- double oval[4], halfWidth;
+ double oval[4], halfWidth, width;
int result;
- double width;
Tk_State state = itemPtr->state;
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
width = ovalPtr->outline.width;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (ovalPtr->outline.activeWidth>width) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
+ if (ovalPtr->outline.activeWidth > width) {
width = ovalPtr->outline.activeWidth;
}
} else if (state == TK_STATE_DISABLED) {
- if (ovalPtr->outline.disabledWidth>0) {
+ if (ovalPtr->outline.disabledWidth > 0) {
width = ovalPtr->outline.disabledWidth;
}
}
@@ -1328,12 +1327,12 @@ RectOvalToPostscript(
}
if (state == TK_STATE_NULL) {
- state = ((TkCanvas *)canvas)->canvas_state;
+ state = Canvas(canvas)->canvas_state;
}
color = rectOvalPtr->outline.color;
fillColor = rectOvalPtr->fillColor;
fillStipple = rectOvalPtr->fillStipple;
- if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
+ if (Canvas(canvas)->currentItemPtr == itemPtr) {
if (rectOvalPtr->outline.activeColor!=NULL) {
color = rectOvalPtr->outline.activeColor;
}
@@ -1385,7 +1384,7 @@ RectOvalToPostscript(
Tcl_AppendResult(interp, pathCmd, "0 setlinejoin 2 setlinecap\n",
NULL);
if (Tk_CanvasPsOutline(canvas, itemPtr,
- &(rectOvalPtr->outline))!= TCL_OK) {
+ &rectOvalPtr->outline)!= TCL_OK) {
return TCL_ERROR;
}
}