From 90913ce1f8b0d59e50df2ce83b0ae1d6dbba2c20 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 23 Mar 2024 17:57:53 +0000 Subject: Another round of int -> Tcl_Size. Use more (char *)NULL in stead of simply NULL. Re-generate stub table, only creating dummy stub entries for TCL_MAJOR_VERSION < 9 --- generic/tkCanvArc.c | 6 +- generic/tkCanvBmap.c | 6 +- generic/tkCanvImg.c | 4 +- generic/tkCanvLine.c | 32 +++++----- generic/tkCanvPoly.c | 4 +- generic/tkCanvPs.c | 16 ++--- generic/tkCanvText.c | 12 ++-- generic/tkCanvUtil.c | 6 +- generic/tkCanvWind.c | 6 +- generic/tkCanvas.c | 159 +++++++++++++++++++++++++------------------------- generic/tkFrame.c | 5 +- generic/tkInt.decls | 6 +- generic/tkIntDecls.h | 22 ++++--- generic/tkStubInit.c | 6 ++ generic/tkTest.c | 4 +- generic/tkText.c | 55 +++++++++-------- generic/tkTextDisp.c | 8 +-- generic/tkTextImage.c | 6 +- generic/tkTextIndex.c | 8 +-- generic/tkTextMark.c | 4 +- generic/tkTextTag.c | 4 +- 21 files changed, 201 insertions(+), 178 deletions(-) diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 5238be2..c197ff8 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -376,7 +376,7 @@ ArcCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 4, got %" TCL_SIZE_MODIFIER "d", objc)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "ARC", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -405,7 +405,7 @@ ArcCoords( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 4, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "ARC", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "ARC", (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -2228,7 +2228,7 @@ StyleParseProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad -style option \"%s\": must be arc, chord, or pieslice", value)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARC_STYLE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARC_STYLE", (char *)NULL); *stylePtr = PIESLICE_STYLE; return TCL_ERROR; } diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 9de234d..1bbf566 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -265,7 +265,7 @@ BitmapCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "d", objc)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "BITMAP", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -279,7 +279,7 @@ BitmapCoords( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "BITMAP", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "BITMAP", (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -984,7 +984,7 @@ BitmapToPostscript( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't generate Postscript for bitmaps more than 60000" " pixels wide", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", (char *)NULL); goto error; } diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index e6128bb..46fc288 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -249,7 +249,7 @@ ImageCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "d", objc)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -263,7 +263,7 @@ ImageCoords( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "IMAGE", (char *)NULL); return TCL_ERROR; } return TCL_OK; diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 6200c87..7897705 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -33,7 +33,7 @@ typedef struct LineItem { Tk_Outline outline; /* Outline structure */ Tk_Canvas canvas; /* Canvas containing item. Needed for parsing * arrow shapes. */ - int numPoints; /* Number of points in line (always >= 0). */ + Tcl_Size numPoints; /* Number of points in line (always >= 0). */ double *coordPtr; /* Pointer to malloc-ed array containing x- * and y-coords of all points in line. * X-coords are even-valued indices, y-coords @@ -366,8 +366,7 @@ LineCoords( Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { LineItem *linePtr = (LineItem *) itemPtr; - Tcl_Size i; - int numPoints; + Tcl_Size i, numPoints; double *coordPtr; if (objc == 0) { @@ -403,12 +402,12 @@ LineCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected an even number, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", (char *)NULL); return TCL_ERROR; } else if (objc < 4) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected at least 4, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "LINE", (char *)NULL); return TCL_ERROR; } @@ -654,7 +653,8 @@ ComputeLineBbox( LineItem *linePtr) /* Item whose bbos is to be recomputed. */ { double *coordPtr; - int i, intWidth; + Tcl_Size i; + int intWidth; double width; Tk_State state = linePtr->header.state; Tk_TSOffset *tsoffset; @@ -1002,7 +1002,7 @@ LineInsert( linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1]; } newCoordPtr = (double *)ckalloc(sizeof(double) * (length + objc)); - for (i=0; i<(int)beforeThis; i++) { + for (i=0; icoordPtr[i]; } for (i=0; icoordPtr; i < linePtr->numPoints; i++, coordPtr += 2) { @@ -2010,7 +2010,7 @@ RotateLine( { LineItem *linePtr = (LineItem *) itemPtr; double *coordPtr; - int i; + Tcl_Size i; double s = sin(angleRad), c = cos(angleRad); for (i = 0, coordPtr = linePtr->coordPtr; i < linePtr->numPoints; @@ -2095,7 +2095,7 @@ ParseArrowShape( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad arrow shape \"%s\": must be list with three numbers", value)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROW_SHAPE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROW_SHAPE", (char *)NULL); if (argv != NULL) { ckfree(argv); } @@ -2197,7 +2197,7 @@ ArrowParseProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad arrow spec \"%s\": must be none, first, last, or both", value)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROW", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "ARROW", (char *)NULL); *arrowPtr = ARROWS_NONE; return TCL_ERROR; } diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 97ac202..400e4c5 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -364,7 +364,7 @@ PolygonCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected an even number, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "POLYGON", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "POLYGON", (char *)NULL); return TCL_ERROR; } @@ -1766,7 +1766,7 @@ GetPolygonIndex( } else { badIndex: Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "POLY", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "POLY", (char *)NULL); return TCL_ERROR; } return TCL_OK; diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index d9759d7..af2718b 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -324,7 +324,7 @@ TkCanvPostscriptObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad color mode \"%s\": must be monochrome, gray, or color", psInfo.colorMode)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "COLORMODE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "COLORMODE", (char *)NULL); result = TCL_ERROR; goto cleanup; } @@ -338,7 +338,7 @@ TkCanvPostscriptObjCmd( if (psInfo.channelName != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't specify both -file and -channel", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "USAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "USAGE", (char *)NULL); result = TCL_ERROR; goto cleanup; } @@ -351,7 +351,7 @@ TkCanvPostscriptObjCmd( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't specify -file in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "PS_FILE", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "PS_FILE", (char *)NULL); result = TCL_ERROR; goto cleanup; } @@ -384,7 +384,7 @@ TkCanvPostscriptObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "channel \"%s\" wasn't opened for writing", psInfo.channelName)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "UNWRITABLE",NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "UNWRITABLE", (char *)NULL); result = TCL_ERROR; goto cleanup; } @@ -798,7 +798,7 @@ Tk_PostscriptFont( "bad font map entry for \"%s\": \"%s\"", name, Tcl_GetString(list))); Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "FONTMAP", - NULL); + (char *)NULL); return TCL_ERROR; } @@ -1124,7 +1124,7 @@ GetPostscriptPoints( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad distance \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "POINTS", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "POINTS", (char *)NULL); } return TCL_ERROR; } @@ -1363,7 +1363,7 @@ TkPostscriptImage( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't generate Postscript for images more than %d pixels wide", maxWidth)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", (char *)NULL); ckfree(cdata.colors); return TCL_ERROR; } @@ -1549,7 +1549,7 @@ Tk_PostscriptPhoto( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't generate Postscript for images more than %d pixels wide", maxWidth)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "PS", "MEMLIMIT", (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 3f02158..6ab7911 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -131,7 +131,7 @@ UnderlineParseProc( } else { Tcl_AppendResult(interp, "bad index \"", value, - "\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", NULL); + "\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", (char *)NULL); } return code; } @@ -432,7 +432,7 @@ TextCoords( } else if (objc > 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", (char *)NULL); return TCL_ERROR; } @@ -443,7 +443,7 @@ TextCoords( } else if (objc != 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "TEXT", (char *)NULL); return TCL_ERROR; } } @@ -1486,7 +1486,7 @@ GetTextIndex( if (textInfoPtr->selItemPtr != itemPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "selection isn't in item", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "UNSELECTED", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "UNSELECTED", (char *)NULL); return TCL_ERROR; } *indexPtr = textInfoPtr->selectFirst; @@ -1495,7 +1495,7 @@ GetTextIndex( if (textInfoPtr->selItemPtr != itemPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "selection isn't in item", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "UNSELECTED", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "UNSELECTED", (char *)NULL); return TCL_ERROR; } *indexPtr = textInfoPtr->selectLast; @@ -1529,7 +1529,7 @@ GetTextIndex( } else { badIndex: Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "TEXT", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "TEXT", (char *)NULL); return TCL_ERROR; } return TCL_OK; diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 16bff09..252bfb8 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -777,7 +777,7 @@ TkSmoothParseProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "ambiguous smooth method \"%s\"", value)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "SMOOTH", value, - NULL); + (char *)NULL); return TCL_ERROR; } smooth = &methods->smooth; @@ -912,7 +912,7 @@ Tk_GetDash( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer in the range 1..255 but got \"%s\"", *largv)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "DASH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "DASH", (char *)NULL); goto syntaxError; } *pt++ = i; @@ -933,7 +933,7 @@ Tk_GetDash( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad dash list \"%s\": must be a list of integers or a format like \"-..\"", value)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "DASH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "DASH", (char *)NULL); syntaxError: if (argv != NULL) { ckfree(argv); diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index e54032f..38754d8 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -263,7 +263,7 @@ WinItemCoords( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 2, got %" TCL_SIZE_MODIFIER "d", objc)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "WINDOW", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -276,7 +276,7 @@ WinItemCoords( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # coordinates: expected 0 or 2, got %" TCL_SIZE_MODIFIER "d", objc)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "COORDS", "WINDOW", (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -378,7 +378,7 @@ ConfigureWinItem( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use %s in a window item of this canvas", Tk_PathName(winItemPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); winItemPtr->tkwin = NULL; return TCL_ERROR; } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 3a0b1b0..3367859 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -241,7 +241,7 @@ static int CanvasWidgetCmd(void *clientData, Tcl_Obj *const *objv); static void CanvasWorldChanged(void *instanceData); static int ConfigureCanvas(Tcl_Interp *interp, - TkCanvas *canvasPtr, int objc, + TkCanvas *canvasPtr, Tcl_Size objc, Tcl_Obj *const *objv, int flags); static void DefaultRotateImplementation(TkCanvas *canvasPtr, Tk_Item *itemPtr, double x, double y, @@ -254,8 +254,8 @@ static void DoItem(Tcl_Obj *accumObj, static void EventuallyRedrawItem(TkCanvas *canvasPtr, Tk_Item *itemPtr); static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, - int objc, Tcl_Obj *const *objv, - Tcl_Obj *newTagObj, int first, + Tcl_Size objc, Tcl_Obj *const *objv, + Tcl_Obj *newTagObj, Tcl_Size first, TagSearch **searchPtrPtr); static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Obj *const *objv, Tk_Uid uid, int enclosed); @@ -335,7 +335,7 @@ static inline int ItemConfigure( TkCanvas *canvasPtr, Tk_Item *itemPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; @@ -386,7 +386,7 @@ static inline int ItemCoords( TkCanvas *canvasPtr, Tk_Item *itemPtr, - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; @@ -418,7 +418,7 @@ ItemCreate( TkCanvas *canvasPtr, Tk_Item *itemPtr, /* Warning: incomplete! typePtr field must be * set by this point. */ - int objc, + Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; @@ -499,7 +499,7 @@ ItemIndex( itemPtr, objPtr, indexPtr); } else { #if defined(TK_NO_DEPRECATED) - Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (void *)NULL); + Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (char *)NULL); return TCL_ERROR; #else return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, @@ -674,9 +674,9 @@ DefaultRotateImplementation( for (i=0 ; iregionString)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "SCROLL_REGION", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "SCROLL_REGION", (char *)NULL); badRegion: ckfree(canvasPtr->regionString); ckfree(argv2); @@ -2619,7 +2620,7 @@ DrawCanvas( #endif if ((tkwin = canvasPtr->tkwin) == NULL) { - Tcl_AppendResult(interp, "canvas tkwin is NULL!", NULL); + Tcl_AppendResult(interp, "canvas tkwin is NULL!", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2633,7 +2634,7 @@ DrawCanvas( do { if ((displayPtr = Tk_Display(tkwin)) == NULL) { - Tcl_AppendResult(interp, "canvas (or parent) display is NULL!", NULL); + Tcl_AppendResult(interp, "canvas (or parent) display is NULL!", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2643,7 +2644,7 @@ DrawCanvas( } if ((tkwin = Tk_Parent(tkwin)) == NULL) { - Tcl_AppendResult(interp, "canvas has no parent with a valid window id! Is the toplevel window mapped?", NULL); + Tcl_AppendResult(interp, "canvas has no parent with a valid window id! Is the toplevel window mapped?", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2654,7 +2655,7 @@ DrawCanvas( visualPtr = Tk_Visual(tkwin); if (subsample == 0) { - Tcl_AppendResult(interp, "subsample cannot be zero", NULL); + Tcl_AppendResult(interp, "subsample cannot be zero", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2715,7 +2716,7 @@ DrawCanvas( pmHeight = pixmapY2 - pixmapY1 + 1; if ((pixmap = Tk_GetPixmap(displayPtr, Tk_WindowId(tkwin), pmWidth, pmHeight, bitsPerPixel)) == 0) { - Tcl_AppendResult(interp, "failed to create drawing Pixmap", NULL); + Tcl_AppendResult(interp, "failed to create drawing Pixmap", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2762,56 +2763,56 @@ DrawCanvas( if ((ximagePtr = XGetImage(displayPtr, pixmap, -pixmapX1, -pixmapY1, cWidth, cHeight, AllPlanes, ZPixmap)) == NULL) { - Tcl_AppendResult(interp, "failed to copy Pixmap to XImage", NULL); + Tcl_AppendResult(interp, "failed to copy Pixmap to XImage", (char *)NULL); result = TCL_ERROR; goto done; } #ifdef DEBUG_DRAWCANVAS - Tcl_AppendResult(interp, "ximagePtr {", NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->width); Tcl_AppendResult(interp, " width ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->height); Tcl_AppendResult(interp, " height ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->xoffset); Tcl_AppendResult(interp, " xoffset ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->format); Tcl_AppendResult(interp, " format ", buffer, NULL); - Tcl_AppendResult(interp, " ximagePtr->data", NULL); + Tcl_AppendResult(interp, "ximagePtr {", (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->width); Tcl_AppendResult(interp, " width ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->height); Tcl_AppendResult(interp, " height ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->xoffset); Tcl_AppendResult(interp, " xoffset ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->format); Tcl_AppendResult(interp, " format ", buffer, (char *)NULL); + Tcl_AppendResult(interp, " ximagePtr->data", (char *)NULL); if (ximagePtr->data != NULL) { int ix, iy; - Tcl_AppendResult(interp, " {", NULL); + Tcl_AppendResult(interp, " {", (char *)NULL); for (iy = 0; iy < ximagePtr->height; ++ iy) { - Tcl_AppendResult(interp, " {", NULL); + Tcl_AppendResult(interp, " {", (char *)NULL); for (ix = 0; ix < ximagePtr->bytes_per_line; ++ ix) { if (ix > 0) { if (ix % 4 == 0) - Tcl_AppendResult(interp, "-", NULL); + Tcl_AppendResult(interp, "-", (char *)NULL); else - Tcl_AppendResult(interp, " ", NULL); + Tcl_AppendResult(interp, " ", (char *)NULL); } snprintf(buffer,sizeof(buffer),"%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF); - Tcl_AppendResult(interp, buffer, NULL); + Tcl_AppendResult(interp, buffer, (char *)NULL); } - Tcl_AppendResult(interp, " }", NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); } - Tcl_AppendResult(interp, " }", NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); } else snprintf(buffer,sizeof(buffer)," NULL"); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->byte_order); Tcl_AppendResult(interp, " byte_order ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_unit); Tcl_AppendResult(interp, " bitmap_unit ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_bit_order); Tcl_AppendResult(interp, " bitmap_bit_order ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_pad); Tcl_AppendResult(interp, " bitmap_pad ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->depth); Tcl_AppendResult(interp, " depth ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bytes_per_line); Tcl_AppendResult(interp, " bytes_per_line ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bits_per_pixel); Tcl_AppendResult(interp, " bits_per_pixel ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, NULL); - Tcl_AppendResult(interp, " }", NULL); - - Tcl_AppendResult(interp, "\nvisualPtr {", NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, NULL); - Tcl_AppendResult(interp, " }", NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->byte_order); Tcl_AppendResult(interp, " byte_order ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_unit); Tcl_AppendResult(interp, " bitmap_unit ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_bit_order); Tcl_AppendResult(interp, " bitmap_bit_order ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bitmap_pad); Tcl_AppendResult(interp, " bitmap_pad ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->depth); Tcl_AppendResult(interp, " depth ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bytes_per_line); Tcl_AppendResult(interp, " bytes_per_line ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",ximagePtr->bits_per_pixel); Tcl_AppendResult(interp, " bits_per_pixel ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",ximagePtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, (char *)NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); + + Tcl_AppendResult(interp, "\nvisualPtr {", (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"0x%8.8lx",visualPtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, (char *)NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); #endif @@ -2851,13 +2852,13 @@ DrawCanvas( DecomposeMaskToShiftAndBits(visualPtr->blue_mask,&bshift,&bbits); #ifdef DEBUG_DRAWCANVAS - snprintf(buffer,sizeof(buffer),"%d",rshift); Tcl_AppendResult(interp, "\nbits { rshift ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",gshift); Tcl_AppendResult(interp, " gshift ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",bshift); Tcl_AppendResult(interp, " bshift ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",rbits); Tcl_AppendResult(interp, " rbits ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",gbits); Tcl_AppendResult(interp, " gbits ", buffer, NULL); - snprintf(buffer,sizeof(buffer),"%d",bbits); Tcl_AppendResult(interp, " bbits ", buffer, " }", NULL); - Tcl_AppendResult(interp, "\nConverted_image {", NULL); + snprintf(buffer,sizeof(buffer),"%d",rshift); Tcl_AppendResult(interp, "\nbits { rshift ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",gshift); Tcl_AppendResult(interp, " gshift ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",bshift); Tcl_AppendResult(interp, " bshift ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",rbits); Tcl_AppendResult(interp, " rbits ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",gbits); Tcl_AppendResult(interp, " gbits ", buffer, (char *)NULL); + snprintf(buffer,sizeof(buffer),"%d",bbits); Tcl_AppendResult(interp, " bbits ", buffer, " }", (char *)NULL); + Tcl_AppendResult(interp, "\nConverted_image {", (char *)NULL); #endif /* Ok, had to use ximagePtr->bits_per_pixel here and in the switch (...) @@ -2870,7 +2871,7 @@ DrawCanvas( for (y = 0; y < blockPtr.height; ++y) { #ifdef DEBUG_DRAWCANVAS - Tcl_AppendResult(interp, " {", NULL); + Tcl_AppendResult(interp, " {", (char *)NULL); #endif for(x = 0; x < blockPtr.width; ++x) { @@ -2970,14 +2971,14 @@ DrawCanvas( { int ix; if (x > 0) - Tcl_AppendResult(interp, "-", NULL); + Tcl_AppendResult(interp, "-", (char *)NULL); for (ix = 0; ix < 4; ++ix) { if (ix > 0) - Tcl_AppendResult(interp, " ", NULL); + Tcl_AppendResult(interp, " ", (char *)NULL); snprintf(buffer,sizeof(buffer),"%2.2x", blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); - Tcl_AppendResult(interp, buffer, NULL); + Tcl_AppendResult(interp, buffer, (char *)NULL); } } #endif @@ -2985,13 +2986,13 @@ DrawCanvas( } #ifdef DEBUG_DRAWCANVAS - Tcl_AppendResult(interp, " }", NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); #endif } #ifdef DEBUG_DRAWCANVAS - Tcl_AppendResult(interp, " }", NULL); + Tcl_AppendResult(interp, " }", (char *)NULL); #endif /* @@ -4037,7 +4038,7 @@ TagSearchScanExpr( Tcl_SetObjResult(interp, Tcl_NewStringObj( "too many '!' in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "COMPLEXITY", NULL); + "COMPLEXITY", (char *)NULL); return TCL_ERROR; } looking_for_tag++; @@ -4087,7 +4088,7 @@ TagSearchScanExpr( Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing endquote in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "ENDQUOTE", NULL); + "ENDQUOTE", (char *)NULL); return TCL_ERROR; } if (!(tag - searchPtr->rewritebuffer)) { @@ -4095,7 +4096,7 @@ TagSearchScanExpr( "null quoted tag string in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "EMPTY", NULL); + "EMPTY", (char *)NULL); return TCL_ERROR; } *tag++ = '\0'; @@ -4112,7 +4113,7 @@ TagSearchScanExpr( Tcl_SetObjResult(interp, Tcl_NewStringObj( "unexpected operator in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "UNEXPECTED", NULL); + "UNEXPECTED", (char *)NULL); return TCL_ERROR; default: /* Unquoted tag string */ @@ -4176,7 +4177,7 @@ TagSearchScanExpr( Tcl_SetObjResult(interp, Tcl_NewStringObj( "singleton '&' in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "INCOMPLETE_OP", NULL); + "INCOMPLETE_OP", (char *)NULL); return TCL_ERROR; } expr->uids[expr->index++] = searchUids->andUid; @@ -4189,7 +4190,7 @@ TagSearchScanExpr( Tcl_SetObjResult(interp, Tcl_NewStringObj( "singleton '|' in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", - "INCOMPLETE_OP", NULL); + "INCOMPLETE_OP", (char *)NULL); return TCL_ERROR; } expr->uids[expr->index++] = searchUids->orUid; @@ -4210,7 +4211,7 @@ TagSearchScanExpr( "invalid boolean operator in tag search expression", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", "BAD_OP", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -4222,7 +4223,7 @@ TagSearchScanExpr( } Tcl_SetObjResult(interp, Tcl_NewStringObj( "missing tag in tag search expression", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", "NO_TAG", NULL); + Tcl_SetErrorCode(interp, "TK", "CANVAS", "SEARCH", "NO_TAG", (char *)NULL); return TCL_ERROR; } @@ -4695,7 +4696,7 @@ static int FindItems( Tcl_Interp *interp, /* Interpreter for error reporting. */ TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */ - int objc, /* Number of entries in argv. Must be greater + Tcl_Size objc, /* Number of entries in argv. Must be greater * than zero. */ Tcl_Obj *const *objv, /* Arguments that describe what items to * search for (see user doc on "find" and @@ -4704,7 +4705,7 @@ FindItems( * found items; if NULL, then ids of found * items are returned in the interp's * result. */ - int first /* For error messages: gives number of + Tcl_Size first /* For error messages: gives number of * elements of objv which are already * handled. */ ,TagSearch **searchPtrPtr /* From CanvasWidgetCmd local vars*/ @@ -5502,7 +5503,7 @@ CanvasDoEvent( Tcl_Size numObjects, i; Tk_Item *itemPtr; TagSearchExpr *expr; - int numExprs; + Tcl_Size numExprs; SearchUids *searchUids = GetStaticUids(); if (canvasPtr->bindingTable == NULL) { diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 103b2ac..39ac164 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -449,7 +449,7 @@ int TkCreateFrame( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ - int argc, /* Number of arguments. */ + Tcl_Size argc, /* Number of arguments. */ const char *const *argv, /* Argument strings. */ int toplevel, /* Non-zero means create a toplevel window, * zero means create a frame. */ @@ -458,7 +458,8 @@ TkCreateFrame( * Gives the base name to use for the new * application. */ { - int result, i; + int result; + Tcl_Size i; Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **)); for (i=0; i=, >, or !=", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "COMPARISON", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "COMPARISON", (char *)NULL); result = TCL_ERROR; goto done; } @@ -1046,7 +1046,7 @@ TextWidgetObjCmd( "bad option \"%s\": must be -chars, -displaychars, " "-displayindices, -displaylines, -indices, -lines, -update, " "-xpixels, or -ypixels", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_OPTION", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_OPTION", (char *)NULL); result = TCL_ERROR; goto done; } @@ -1421,7 +1421,7 @@ TextWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "index \"%s\" before \"%s\" in the text", Tcl_GetString(objv[3]), Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", (char *)NULL); result = TCL_ERROR; goto done; } @@ -1526,7 +1526,7 @@ TextWidgetObjCmd( Tcl_Obj *cmd = objv[3]; const char *option = Tcl_GetString(objv[2]); if (strncmp(option, "-command", objv[2]->length)) { - Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", NULL); + Tcl_AppendResult(interp, "wrong option \"", option, "\": should be \"-command\"", (char *)NULL); result = TCL_ERROR; goto done; } @@ -2126,7 +2126,7 @@ ConfigureText( if (start > end) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "-startline must be less than or equal to -endline", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", (char *)NULL); Tk_RestoreSavedOptions(&savedOptions); return TCL_ERROR; } @@ -3415,8 +3415,7 @@ TextFetchSelection( { TkText *textPtr = (TkText *)clientData; TkTextIndex eof; - int count, chunkSize; - Tcl_Size offsetInSeg; + Tcl_Size count, offsetInSeg, chunkSize; TkTextSearch search; TkTextSegment *segPtr; @@ -3484,7 +3483,7 @@ TextFetchSelection( chunkSize = (int)maxBytes; } if (textPtr->selIndex.linePtr == search.curIndex.linePtr) { - int leftInRange; + Tcl_Size leftInRange; leftInRange = search.curIndex.byteIndex - textPtr->selIndex.byteIndex; @@ -3727,7 +3726,7 @@ TextInsertCmd( * insertions will fail. */ - int length = InsertChars(sharedTextPtr, textPtr, &index1, objv[j], + Tcl_Size length = InsertChars(sharedTextPtr, textPtr, &index1, objv[j], viewUpdate); if (objc > (j+1)) { @@ -3864,7 +3863,7 @@ TextSearchCmd( if (i + 1 >= objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no value given for \"-count\" option", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "VALUE", (char *)NULL); return TCL_ERROR; } i++; @@ -3918,7 +3917,7 @@ TextSearchCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "the \"-nolinestop\" option requires the \"-regexp\" option" " to be present", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", (char *)NULL); return TCL_ERROR; } @@ -3926,7 +3925,7 @@ TextSearchCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "the \"-overlap\" option requires the \"-all\" option" " to be present", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "SEARCH_USAGE", (char *)NULL); return TCL_ERROR; } @@ -4552,7 +4551,7 @@ TkTextGetTabs( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tab stop \"%s\" is not at a positive distance", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; } @@ -4586,7 +4585,7 @@ TkTextGetTabs( "tabs must be monotonically increasing, but \"%s\" is " "smaller than or equal to the previous tab", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; #endif /* _TK_ALLOW_DECREASING_TABS */ } @@ -4730,7 +4729,7 @@ TextDumpCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Usage: %s dump ?-all -image -text -mark -tag -window? " "?-command script? index ?index2?", Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); return TCL_ERROR; } if (what == 0) { @@ -5331,7 +5330,7 @@ TextEditCmd( canUndo = TkUndoCanUndo(textPtr->sharedTextPtr->undoStack); if (TextEditRedo(textPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj("nothing to redo", -1)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_REDO", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_REDO", (char *)NULL); return TCL_ERROR; } canRedo = TkUndoCanRedo(textPtr->sharedTextPtr->undoStack); @@ -5366,7 +5365,7 @@ TextEditCmd( canRedo = TkUndoCanRedo(textPtr->sharedTextPtr->undoStack); if (TextEditUndo(textPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj("nothing to undo", -1)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_UNDO", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_UNDO", (char *)NULL); return TCL_ERROR; } canUndo = TkUndoCanUndo(textPtr->sharedTextPtr->undoStack); @@ -6926,8 +6925,9 @@ TkpTesttextCmd( Tcl_Obj *const objv[]) /* Argument strings. */ { TkText *textPtr; - size_t len; - int lineIndex, byteIndex, byteOffset; + Tcl_Size len; + Tcl_WideInt lineIndex, byteIndex; + Tcl_WideInt byteOffset; TkTextIndex index; char buf[TK_POS_CHARS]; Tcl_CmdInfo info; @@ -6945,8 +6945,13 @@ TkpTesttextCmd( if (objc != 5) { return TCL_ERROR; } - lineIndex = atoi(Tcl_GetString(objv[3])) - 1; - byteIndex = atoi(Tcl_GetString(objv[4])); + if (Tcl_GetWideIntFromObj(interp, objv[3], &lineIndex)) { + return TCL_ERROR; + } + lineIndex--; + if (Tcl_GetWideIntFromObj(interp, objv[4], &byteIndex)) { + return TCL_ERROR; + } TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, lineIndex, byteIndex, &index); @@ -6957,7 +6962,9 @@ TkpTesttextCmd( if (TkTextGetIndex(interp, textPtr, Tcl_GetString(objv[3]), &index) != TCL_OK) { return TCL_ERROR; } - byteOffset = atoi(Tcl_GetString(objv[4])); + if (Tcl_GetWideIntFromObj(interp, objv[4], &byteOffset)) { + return TCL_ERROR; + } TkTextIndexForwBytes(textPtr, &index, byteOffset, &index); } else if (strncmp(Tcl_GetString(objv[2]), "backbytes", len) == 0) { if (objc != 5) { @@ -6966,7 +6973,9 @@ TkpTesttextCmd( if (TkTextGetIndex(interp, textPtr, Tcl_GetString(objv[3]), &index) != TCL_OK) { return TCL_ERROR; } - byteOffset = atoi(Tcl_GetString(objv[4])); + if (Tcl_GetWideIntFromObj(interp, objv[4], &byteOffset)) { + return TCL_ERROR; + } TkTextIndexBackBytes(textPtr, &index, byteOffset, &index); } else { return TCL_ERROR; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 44fbbd5..cc4a12c 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3671,7 +3671,7 @@ TkTextFindDisplayLineEnd( while (1) { DLine *dlPtr; - int byteCount; + Tcl_Size byteCount; TkTextIndex nextLineStart; dlPtr = LayoutDLine(textPtr, &index); @@ -6390,7 +6390,7 @@ TkTextScanCmd( if ((objc != 5) && (objc != 6)) { Tcl_WrongNumArgs(interp, 2, objv, "mark x y"); Tcl_AppendResult(interp, " or \"", Tcl_GetString(objv[0]), - " scan dragto x y ?gain?\"", NULL); + " scan dragto x y ?gain?\"", (char *)NULL); /* * Ought to be: * Tcl_WrongNumArgs(interp, 2, objc, "dragto x y ?gain?"); @@ -6460,7 +6460,7 @@ TkTextScanCmd( "bad scan option \"%s\": must be dragto or mark", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "scan option", - Tcl_GetString(objv[2]), NULL); + Tcl_GetString(objv[2]), (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -7366,7 +7366,7 @@ TkTextIndexBbox( TextDInfo *dInfoPtr = textPtr->dInfoPtr; DLine *dlPtr; TkTextDispChunk *chunkPtr; - int byteCount; + Tcl_Size byteCount; /* * Make sure that all of the screen layout information is up to date. diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 3544f92..7f292e8 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -158,7 +158,7 @@ TkTextImageCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded image at index \"%s\"", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_IMAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_IMAGE", (char *)NULL); return TCL_ERROR; } objPtr = Tk_GetOptionValue(interp, &eiPtr->body.ei, @@ -183,7 +183,7 @@ TkTextImageCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded image at index \"%s\"", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_IMAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_IMAGE", (char *)NULL); return TCL_ERROR; } if (objc <= 5) { @@ -383,7 +383,7 @@ EmbImageConfigure( "Either a \"-name\" or a \"-image\" argument must be" " provided to the \"image create\" subcommand", TCL_INDEX_NONE)); Tcl_SetErrorCode(textPtr->interp, "TK", "TEXT", "IMAGE_CREATE_USAGE", - NULL); + (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index c62a198..d566d5c 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -852,7 +852,7 @@ GetIndex( "text doesn't contain any characters tagged with \"%s\"", tagName)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_INDEX", tagName, - NULL); + (char *)NULL); Tcl_DStringFree(©); return TCL_ERROR; } @@ -1017,7 +1017,7 @@ GetIndex( error: Tcl_DStringFree(©); Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad text index \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "BAD_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "BAD_INDEX", (char *)NULL); return TCL_ERROR; } @@ -1484,7 +1484,7 @@ int TkTextIndexForwBytes( const TkText *textPtr, const TkTextIndex *srcPtr, /* Source index. */ - int byteCount, /* How many bytes forward to move. May be + Tcl_Size byteCount, /* How many bytes forward to move. May be * negative. */ TkTextIndex *dstPtr) /* Destination index: gets modified. */ { @@ -2015,7 +2015,7 @@ int TkTextIndexBackBytes( const TkText *textPtr, const TkTextIndex *srcPtr, /* Source index. */ - int byteCount, /* How many bytes backward to move. May be + Tcl_Size byteCount, /* How many bytes backward to move. May be * negative. */ TkTextIndex *dstPtr) /* Destination index: gets modified. */ { diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index b25e4dd..db1dec1 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -144,7 +144,7 @@ TkTextMarkCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "there is no mark named \"%s\"", str)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_MARK", str, - NULL); + (char *)NULL); return TCL_ERROR; } markPtr = (TkTextSegment *)Tcl_GetHashValue(hPtr); @@ -170,7 +170,7 @@ TkTextMarkCmd( } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad mark gravity \"%s\": must be left or right", str)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "MARK_GRAVITY", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "MARK_GRAVITY", (char *)NULL); return TCL_ERROR; } TkTextMarkSegToIndex(textPtr, markPtr, &index); diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index ef318b7..26b9f0c 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -129,7 +129,7 @@ SetRelief( if (Tk_GetReliefFromObj(nullOK ? NULL : interp, *value, &relief.value) != TCL_OK) { if (nullOK) { Tcl_AppendResult(interp, "bad relief \"", - Tcl_GetString(*value), "\": must be flat, groove, raised, ridge, solid, sunken, or \"\"", NULL); + Tcl_GetString(*value), "\": must be flat, groove, raised, ridge, solid, sunken, or \"\"", (char *)NULL); } return TCL_ERROR; } @@ -161,7 +161,7 @@ SetJustify( if (Tk_GetJustifyFromObj(nullOK ? NULL : interp, *value, &justify.value) != TCL_OK) { if (nullOK) { Tcl_AppendResult(interp, "bad justification \"", - Tcl_GetString(*value), "\": must be left, right, center, or \"\"", NULL); + Tcl_GetString(*value), "\": must be left, right, center, or \"\"", (char *)NULL); } return TCL_ERROR; } -- cgit v0.12