"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessary. This returns an instance of a class with the following public methods: getnchannels() -- returns number of audio channels (1 for mono, 2 for stereo) getsampwidth() -- returns sample width in bytes getframerate() -- returns sampling frequency getnframes() -- returns number of audio frames getcomptype() -- returns compression type ('NONE' for linear samples) getcompname() -- returns human-readable version of compression type ('not compressed' linear samples) getparams() -- returns a tuple consisting of all of the above in the above order getmarkers() -- returns None (for compatibility with the aifc module) getmark(id) -- raises an error since the mark does not exist (for compatibility with the aifc module) readframes(n) -- returns at most n frames of audio rewind() -- rewind to the beginning of the audio stream setpos(pos) -- seek to the specified position tell() -- return the current position close() -- close the instance (make it unusable) The position returned by tell() and the position given to setpos() are compatible and have nothing to do with the actual position in the file. The close() method is called automatically when the class instance is destroyed. Writing WAVE files: f = wave.open(file, 'w') where file is either the name of a file or an open file pointer. The open file pointer must have methods write(), tell(), seek(), and close(). This returns an instance of a class with the following public methods: setnchannels(n) -- set the number of channels setsampwidth(n) -- set the sample width setframerate(n) -- set the frame rate setnframes(n) -- set the number of frames setcomptype(type, name) -- set the compression type and the human-readable compression type setparams(tuple) -- set all parameters at once tell() -- return current position in output file writeframesraw(data) -- write audio frames without pathing up the file header writeframes(data) -- write audio frames and patch up the file header close() -- patch up the file header and close the output file You should set the parameters before the first writeframesraw or writeframes. The total number of frames does not need to be set, but when it is set to the correct value, the header does not have to be patched up. It is best to first set all parameters, perhaps possibly the compression type, and then write audio frames using writeframesraw. When all frames have been written, either call writeframes('') or close() to patch up the sizes in the header. The close() method is called automatically when the class instance is destroyed. """ import builtins __all__ = ["open", "openfp", "Error"] class Error(Exception): pass WAVE_FORMAT_PCM = 0x0001 _array_fmts = None, 'b', 'h', None, 'l' # Determine endian-ness import struct if struct.pack("h", 1) == b"\000\001": big_endian = 1 else: big_endian = 0 from chunk import Chunk class Wave_read: """Variables used in this class: These variables are available to the user though appropriate methods of this class: _file -- the open file with methods read(), close(), and seek() set through the __init__() method _nchannels -- the number of audio channels available through the getnchannels() method _nframes -- the number of audio frames available through the getnframes() method _sampwidth -- the number of bytes per audio sample available through the getsampwidth() method _framerate -- the sampling frequency available through the getframerate() method _comptype -- the AIFF-C compression type ('NONE' if AIFF) available through the getcomptype() method _compname -- the human-readable AIFF-C compression type available through the getcomptype() method _soundpos -- the position in the audio stream available through the tell() method, set through the setpos() method These variables are used internally only: _fmt_chunk_read -- 1 iff the FMT chunk has been read _data_seek_needed -- 1 iff positioned correctly in audio file for readframes() _data_chunk -- instantiation of a chunk class for the DATA chunk _framesize -- size of one frame in the file """ def initfp(self, file): self._convert = None self._soundpos = 0 self._file = Chunk(file, bigendian = 0) if self._file.getname() != b'RIFF': raise Error('file does not start with RIFF id') if self._file.read(4) != b'WAVE': raise Error('not a WAVE file') self._fmt_chunk_read = 0 self._data_chunk = None while 1: self._data_seek_needed = 1 try: chunk = Chunk(self._file, bigendian = 0) except EOFError: break chunkname = chunk.getname() if chunkname == b'fmt ': self._read_fmt_chunk(chunk) self._fmt_chunk_read = 1 elif chunkname == b'data': if not self._fmt_chunk_read: raise Error('data chunk before fmt chunk') self._data_chunk = chunk self._nframes = chunk.chunksize // self._framesize self._data_seek_needed = 0 break chunk.skip() if not self._fmt_chunk_read or not self._data_chunk: raise Error('fmt chunk and/or data chunk missing') def __init__(self, f): self._i_opened_the_file = None if isinstance(f, str): f = builtins.open(f, 'rb') self._i_opened_the_file = f # else, assume it is an open file object already try: self.initfp(f) except: if self._i_opened_the_file: f.close() raise def __del__(self): self.close() # # User visible methods. # def getfp(self): return self._file def rewind(self): self._data_seek_needed = 1 self._soundpos = 0 def close(self): if self._i_opened_the_file: self._i_opened_the_file.close() self._i_opened_the_file = None self._file = None def tell(self): return self._soundpos def getnchannels(self): return self._nchannels def getnframes(self): return self._nframes def getsampwidth(self): return self._sampwidth def getframerate(self): return self._framerate def getcomptype(self): return self._comptype def getcompname(self): return self._compname def getparams(self): return self.getnchannels(), self.getsampwidth(), \ self.getframerate(), self.getnframes(), \ self.getcomptype(), self.getcompname() def getmarkers(self): return None def getmark(self, id): raise Error('no marks') def setpos(self, pos): if pos < 0 or pos > self._nframes: raise Error('position not in range') self._soundpos = pos self._data_seek_needed = 1 def readframes(self, nframes): if self._data_seek_needed: self._data_chunk.seek(0, 0) pos = self._soundpos * self._framesize if pos: self._data_chunk.seek(pos, 0) self._data_seek_needed = 0 if nframes == 0: return b'' if self._sampwidth > 1 and big_endian: # unfortunately the fromfile() method does not take # something that only looks like a file object, so # we have to reach into the innards of the chunk object import array chunk = self._data_chunk data = array.array(_array_fmts[self._sampwidth]) nitems = nframes * self._nchannels if nitems * self._sampwidth > chunk.chunksize - chunk.size_read: nitems = (chunk.chunksize - chunk.size_read) // self._sampwidth data.fromfile(chunk.file.file, nitems) # "tell" data chunk how much was read chunk.size_read = chunk.size_read + nitems * self._sampwidth # do the same for the outermost chunk chunk = chunk.file chunk.size_read = chunk.size_read + nitems * self._sampwidth data.byteswap() data = data.tostring() else: data = self._data_chunk.read(nframes * self._framesize) if self._convert and data: data = self._convert(data) self._soundpos = self._soundpos + len(data) // (self._nchannels * self._sampwidth) return data # # Internal methods. # def _read_fmt_chunk(self, chunk): wFormatTag, self._nchannels, self._framerate, dwAvgBytesPerSec, wBlockAlign = struct.unpack_from(' 4: raise Error('bad sample width') self._sampwidth = sampwidth def getsampwidth(self): if not self._sampwidth: raise Error('sample width not set') return self._sampwidth def setframerate(self, framerate): if self._datawritten: raise Error('cannot change parameters after starting to write') if framerate <= 0: raise Error('bad frame rate') self._framerate = framerate def getframerate(self): if not self._framerate: raise Error('frame rate not set') return self._framerate def setnframes(self, nframes): if self._datawritten: raise Error('cannot change parameters after starting to write') self._nframes = nframes def getnframes(self): return self._nframeswritten def setcomptype(self, comptype, compname): if self._datawritten: raise Error('cannot change parameters after starting to write') if comptype not in ('NONE',): raise Error('unsupported compression type') self._comptype = comptype self._compname = compname def getcomptype(self): return self._comptype def getcompname(self): return self._compname def setparams(self, params): nchannels, sampwidth, framerate, nframes, comptype, compname = params if self._datawritten: raise Error('cannot change parameters after starting to write') self.setnchannels(nchannels) self.setsampwidth(sampwidth) self.setframerate(framerate) self.setnframes(nframes) self.setcomptype(comptype, compname) def getparams(self): if not self._nchannels or not self._sampwidth or not self._framerate: raise Error('not all parameters set') return self._nchannels, self._sampwidth, self._framerate, \ self._nframes, self._comptype, self._compname def setmark(self, id, pos, name): raise Error('setmark() not supported') def getmark(self, id): raise Error('no marks') def getmarkers(self): return None def tell(self): return self._nframeswritten def writeframesraw(self, data): self._ensure_header_written(len(data)) nframes = len(data) // (self._sampwidth * self._nchannels) if self._convert: data = self._convert(data) if self._sampwidth > 1 and big_endian: import array data = array.array(_array_fmts[self._sampwidth], data) data.byteswap() data.tofile(self._file) self._datawritten = self._datawritten + len(data) * self._sampwidth else: self._file.write(data) self._datawritten = self._datawritten + len(data) self._nframeswritten = self._nframeswritten + nframes def writeframes(self, data): self.writeframesraw(data) if self._datalength != self._datawritten: self._patchheader() def close(self): if self._file: self._ensure_header_written(0) if self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None if self._i_opened_the_file: self._i_opened_the_file.close() self._i_opened_the_file = None # # Internal methods. # def _ensure_header_written(self, datasize): if not self._headerwritten: if not self._nchannels: raise Error('# channels not specified') if not self._sampwidth: raise Error('sample width not specified') if not self._framerate: raise Error('sampling rate not specified') self._write_header(datasize) def _write_header(self, initlength): assert not self._headerwritten self._file.write(b'RIFF') if not self._nframes: self._nframes = initlength // (self._nchannels * self._sampwidth) self._datalength = self._nframes * self._nchannels * self._sampwidth self._form_length_pos = self._file.tell() self._file.write(struct.pack(' 8 typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t beforeThis, Tcl_Obj *string); + Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Obj *indexString, size_t *indexPtr); -#else -typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int beforeThis, Tcl_Obj *string); -typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr); -#endif + Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr); #endif /* USE_OLD_CANVAS */ typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); @@ -1103,33 +1059,20 @@ typedef void (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double scaleY); typedef void (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr, double deltaX, double deltaY); -#if TCL_MAJOR_VERSION > 8 typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t index); + Tcl_Size index); typedef size_t (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t offset, char *buffer, size_t maxBytes); + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - size_t first, size_t last); -#else -typedef void (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int index); -typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int offset, char *buffer, int maxBytes); -typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, - int first, int last); -#endif + Tcl_Size first, Tcl_Size last); #ifndef __NO_OLD_CONFIG typedef struct Tk_ItemType { const char *name; /* The name of this type of item, such as * "line". */ -#if TCL_MAJOR_VERSION > 8 - size_t itemSize; /* Total amount of space needed for item's + Tcl_Size itemSize; /* Total amount of space needed for item's * record. */ -#else - int itemSize; -#endif Tk_ItemCreateProc *createProc; /* Procedure to create a new item of this * type. */ @@ -1211,25 +1154,17 @@ typedef struct Tk_CanvasTextInfo { Tk_Item *selItemPtr; /* Pointer to selected item. NULL means * selection isn't in this canvas. Writable by * items. */ -#if TCL_MAJOR_VERSION > 8 - size_t selectFirst; /* Character index of first selected + Tcl_Size selectFirst; /* Character index of first selected * character. Writable by items. */ - size_t selectLast; /* Character index of last selected character. + Tcl_Size selectLast; /* Character index of last selected character. * Writable by items. */ -#else - int selectFirst, selectLast; -#endif Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not * necessarily selItemPtr. Read-only to * items. */ -#if TCL_MAJOR_VERSION > 8 - size_t selectAnchor; /* Character index of fixed end of selection + Tcl_Size selectAnchor; /* Character index of fixed end of selection * (i.e. "select to" operation will use this * as one end of the selection). Writable by * items. */ -#else - int selectAnchor; -#endif Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion * cursor. Read-only to items. */ int insertWidth; /* Total width of insertion cursor. Read-only @@ -1689,13 +1624,8 @@ typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp, typedef void (Tk_LostSelProc) (ClientData clientData); typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData, XEvent *eventPtr); -#if TCL_MAJOR_VERSION > 8 -typedef size_t (Tk_SelectionProc) (ClientData clientData, size_t offset, - char *buffer, size_t maxBytes); -#else -typedef int (Tk_SelectionProc) (ClientData clientData, int offset, - char *buffer, int maxBytes); -#endif +typedef size_t (Tk_SelectionProc) (ClientData clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); /* *---------------------------------------------------------------------- diff --git a/generic/tk3d.c b/generic/tk3d.c index 65ae8d0..c8549de 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -748,7 +748,7 @@ Tk_Draw3DPolygon( XPoint *pointPtr, /* Array of points describing polygon. All * points must be absolute * (CoordModeOrigin). */ - int numPoints, /* Number of points at *pointPtr. */ + Tcl_Size numPoints1, /* Number of points at *pointPtr. */ int borderWidth, /* Width of border, measured in pixels to the * left of the polygon's trajectory. May be * negative. */ @@ -763,6 +763,7 @@ Tk_Draw3DPolygon( GC gc; int i, lightOnLeft, dx, dy, parallel, pointsSeen; Display *display = Tk_Display(tkwin); + int numPoints = numPoints1; if (borderPtr->lightGC == NULL) { TkpGetShadows(borderPtr, tkwin); @@ -1017,7 +1018,7 @@ Tk_Fill3DPolygon( XPoint *pointPtr, /* Array of points describing polygon. All * points must be absolute * (CoordModeOrigin). */ - int numPoints, /* Number of points at *pointPtr. */ + Tcl_Size numPoints1, /* Number of points at *pointPtr. */ int borderWidth, /* Width of border, measured in pixels to the * left of the polygon's trajectory. May be * negative. */ @@ -1027,6 +1028,7 @@ Tk_Fill3DPolygon( * TK_RELIEF_SUNKEN. */ { TkBorder *borderPtr = (TkBorder *) border; + int numPoints = numPoints1; XFillPolygon(Tk_Display(tkwin), drawable, borderPtr->bgGC, pointPtr, numPoints, Complex, CoordModeOrigin); diff --git a/generic/tk3d.h b/generic/tk3d.h index 7c22398..6a93199 100644 --- a/generic/tk3d.h +++ b/generic/tk3d.h @@ -28,7 +28,7 @@ typedef struct TkBorder { * the border will be used. */ Colormap colormap; /* Colormap out of which pixels are * allocated. */ - TkSizeT resourceRefCount; /* Number of active uses of this color (each + Tcl_Size resourceRefCount; /* Number of active uses of this color (each * active use corresponds to a call to * Tk_Alloc3DBorderFromObj or Tk_Get3DBorder). * If this count is 0, then this structure is @@ -37,7 +37,7 @@ typedef struct TkBorder { * because there are objects referring to it. * The structure is freed when objRefCount and * resourceRefCount are both 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ XColor *bgColorPtr; /* Background color (intensity between * lightColorPtr and darkColorPtr). */ diff --git a/generic/tkBind.c b/generic/tkBind.c index 9f3016f..58a1c3c 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2175,7 +2175,7 @@ Tk_BindEvent( XEvent *eventPtr, /* What actually happened. */ Tk_Window tkwin, /* Window on display where event occurred (needed in order to * locate display information). */ - int numObjects, /* Number of objects at *objArr. */ + Tcl_Size numObjects1, /* Number of objects at *objArr. */ ClientData *objArr) /* Array of one or more objects to check for a matching binding. */ { Tcl_Interp *interp; @@ -2200,6 +2200,7 @@ Tk_BindEvent( unsigned arraySize; unsigned newArraySize; unsigned i, k; + int numObjects = numObjects1; assert(bindPtr); assert(eventPtr); diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index b9cc335..2c42f0e 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -88,9 +88,9 @@ typedef struct ArcItem { static int StyleParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, - char *widgRec, TkSizeT offset); + char *widgRec, Tcl_Size offset); static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) @@ -99,7 +99,7 @@ static const Tk_CustomOption styleOption = { StyleParseProc, StylePrintProc, NULL }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -2198,7 +2198,7 @@ StyleParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; size_t length; @@ -2259,7 +2259,7 @@ StylePrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Ignored. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 69a37bd..7ef7ba3 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -45,7 +45,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 5cb26e5..6e4626b 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -47,7 +47,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 987040e..57719a6 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -92,14 +92,14 @@ static void DisplayLine(Tk_Canvas canvas, int x, int y, int width, int height); static int GetLineIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static int LineCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void LineDeleteCoords(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void LineInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int LineToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double LineToPoint(Tk_Canvas canvas, @@ -108,15 +108,15 @@ static int LineToPostscript(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass); static int ArrowParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, TkSizeT offset); + const char *value, char *recordPtr, Tcl_Size offset); static const char * ArrowPrintProc(ClientData clientData, - Tk_Window tkwin, char *recordPtr, TkSizeT offset, + Tk_Window tkwin, char *recordPtr, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static int ParseArrowShape(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *recordPtr, TkSizeT offset); + const char *value, char *recordPtr, Tcl_Size offset); static const char * PrintArrowShape(ClientData clientData, - Tk_Window tkwin, char *recordPtr, TkSizeT offset, + Tk_Window tkwin, char *recordPtr, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); static void RotateLine(Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double angleRad); @@ -145,7 +145,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -955,7 +955,7 @@ static void LineInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Line item to be modified. */ - TkSizeT beforeThis, /* Index before which new coordinates are to + Tcl_Size beforeThis, /* Index before which new coordinates are to * be inserted. */ Tcl_Obj *obj) /* New coordinates to be inserted. */ { @@ -979,7 +979,7 @@ LineInsert( if (beforeThis == TCL_INDEX_NONE) { beforeThis = 0; } - if (beforeThis + 1 > (TkSizeT)length + 1) { + if (beforeThis + 1 > (Tcl_Size)length + 1) { beforeThis = length; } @@ -1210,8 +1210,8 @@ static void LineDeleteCoords( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Index of first character to delete. */ - TkSizeT last) /* Index of last character to delete. */ + Tcl_Size first, /* Index of first character to delete. */ + Tcl_Size last) /* Index of last character to delete. */ { LineItem *linePtr = (LineItem *) itemPtr; int count, i, first1, last1, nbDelPoints; @@ -1864,9 +1864,9 @@ GetLineIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular coord in * itemPtr's line. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { - TkSizeT idx, length; + Tcl_Size idx, length; LineItem *linePtr = (LineItem *) itemPtr; const char *string; (void)canvas; @@ -1874,10 +1874,10 @@ GetLineIndex( if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 1, &idx)) { if (idx == TCL_INDEX_NONE) { idx = 0; - } else if (idx > (2*(TkSizeT)linePtr->numPoints)) { + } else if (idx > (2*(Tcl_Size)linePtr->numPoints)) { idx = 2*linePtr->numPoints; } else { - idx &= (TkSizeT)-2; /* If index is odd, make it even. */ + idx &= (Tcl_Size)-2; /* If index is odd, make it even. */ } *indexPtr = idx; return TCL_OK; @@ -2054,12 +2054,12 @@ ParseArrowShape( const char *value, /* Textual specification of arrow shape. */ char *recordPtr, /* Pointer to item record in which to store * arrow information. */ - TkSizeT offset) /* Offset of shape information in widget + Tcl_Size offset) /* Offset of shape information in widget * record. */ { LineItem *linePtr = (LineItem *) recordPtr; double a, b, c; - TkSizeT argc; + Tcl_Size argc; const char **argv = NULL; if ((size_t)offset != offsetof(LineItem, arrowShapeA)) { @@ -2120,7 +2120,7 @@ PrintArrowShape( TCL_UNUSED(Tk_Window), /* Window associated with linePtr's widget. */ char *recordPtr, /* Pointer to item record containing current * shape information. */ - TCL_UNUSED(TkSizeT), /* Offset of arrow information in record. */ + TCL_UNUSED(Tcl_Size), /* Offset of arrow information in record. */ Tcl_FreeProc **freeProcPtr) /* Store address of function to call to free * string here. */ { @@ -2158,7 +2158,7 @@ ArrowParseProc( TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { int c; size_t length; @@ -2223,7 +2223,7 @@ ArrowPrintProc( TCL_UNUSED(void *), /* Ignored. */ TCL_UNUSED(Tk_Window), /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ TCL_UNUSED(Tcl_FreeProc **)) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 86e21f0..a9efc33 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -62,7 +62,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL @@ -163,14 +163,14 @@ static void DisplayPolygon(Tk_Canvas canvas, int x, int y, int width, int height); static int GetPolygonIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static int PolygonCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void PolygonDeleteCoords(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void PolygonInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int PolygonToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double PolygonToPoint(Tk_Canvas canvas, @@ -1016,7 +1016,7 @@ static void PolygonInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Line item to be modified. */ - TkSizeT beforeThis, /* Index before which new coordinates are to + Tcl_Size beforeThis, /* Index before which new coordinates are to * be inserted. */ Tcl_Obj *obj) /* New coordinates to be inserted. */ { @@ -1208,8 +1208,8 @@ static void PolygonDeleteCoords( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Index of first character to delete. */ - TkSizeT last) /* Index of last character to delete. */ + Tcl_Size first, /* Index of first character to delete. */ + Tcl_Size last) /* Index of last character to delete. */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; int count, i; @@ -1711,12 +1711,12 @@ GetPolygonIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular coord in * itemPtr's line. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { - TkSizeT length, idx; + Tcl_Size length, idx; PolygonItem *polyPtr = (PolygonItem *) itemPtr; const char *string; - TkSizeT count = 2*(polyPtr->numPoints - polyPtr->autoClosed); + Tcl_Size count = 2*(polyPtr->numPoints - polyPtr->autoClosed); if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX - 1) - ((INT_MAX) % count), 1, &idx)) { if (idx == TCL_INDEX_NONE) { @@ -1724,7 +1724,7 @@ GetPolygonIndex( } else if (idx >= INT_MAX - ((INT_MAX) % count)) { idx = count; } else { - idx = (idx & (TkSizeT)-2) % count; + idx = (idx & (Tcl_Size)-2) % count; } *indexPtr = idx; return TCL_OK; diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 8831402..6604148 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -1059,7 +1059,7 @@ Tk_PostscriptPath( * generated. */ double *coordPtr, /* Pointer to first in array of 2*numPoints * coordinates giving points for path. */ - int numPoints) /* Number of points at *coordPtr. */ + Tcl_Size numPoints) /* Number of points at *coordPtr. */ { TkPostscriptInfo *psInfoPtr = (TkPostscriptInfo *) psInfo; Tcl_Obj *psObj; diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index ebcbd85..d7219b8 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -32,7 +32,7 @@ typedef struct TextItem { */ double x, y; /* Positioning point for text. */ - TkSizeT insertPos; /* Character index of character just before + Tcl_Size insertPos; /* Character index of character just before * which the insertion cursor is displayed. */ /* @@ -62,8 +62,8 @@ typedef struct TextItem { * configuration settings above. */ - TkSizeT numChars; /* Length of text in characters. */ - TkSizeT numBytes; /* Length of text in bytes. */ + Tcl_Size numChars; /* Length of text in characters. */ + Tcl_Size numBytes; /* Length of text in bytes. */ Tk_TextLayout textLayout; /* Cached text layout information. */ int actualWidth; /* Width of text as computed. Used to make * selections of wrapped text display @@ -87,7 +87,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption offsetOption = { TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) @@ -100,12 +100,12 @@ UnderlineParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item (ignored). */ + Tcl_Size offset) /* Offset into item (ignored). */ { int *underlinePtr = (int *) (widgRec + offset); Tcl_Obj obj; int code; - TkSizeT underline; + Tcl_Size underline; (void)dummy; (void)tkwin; @@ -141,7 +141,7 @@ UnderlinePrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Pointer to record for item. */ + Tcl_Size offset, /* Pointer to record for item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -235,24 +235,24 @@ static void DeleteText(Tk_Canvas canvas, static void DisplayCanvText(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); -static TkSizeT GetSelText(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT offset, char *buffer, - TkSizeT maxBytes); +static Tcl_Size GetSelText(Tk_Canvas canvas, + Tk_Item *itemPtr, Tcl_Size offset, char *buffer, + Tcl_Size maxBytes); static int GetTextIndex(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - Tcl_Obj *obj, TkSizeT *indexPtr); + Tcl_Obj *obj, Tcl_Size *indexPtr); static void ScaleText(Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double scaleX, double scaleY); static void SetTextCursor(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT index); + Tk_Item *itemPtr, Tcl_Size index); static int TextCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void TextDeleteChars(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT first, TkSizeT last); + Tk_Item *itemPtr, Tcl_Size first, Tcl_Size last); static void TextInsert(Tk_Canvas canvas, - Tk_Item *itemPtr, TkSizeT beforeThis, Tcl_Obj *obj); + Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *obj); static int TextToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double TextToPoint(Tk_Canvas canvas, @@ -880,7 +880,7 @@ DisplayCanvText( { TextItem *textPtr; Tk_CanvasTextInfo *textInfoPtr; - TkSizeT selFirstChar, selLastChar; + Tcl_Size selFirstChar, selLastChar; short drawableX, drawableY; Pixmap stipple; Tk_State state = itemPtr->state; @@ -1087,13 +1087,13 @@ static void TextInsert( Tk_Canvas canvas, /* Canvas containing text item. */ Tk_Item *itemPtr, /* Text item to be modified. */ - TkSizeT index, /* Character index before which string is to + Tcl_Size index, /* Character index before which string is to * be inserted. */ Tcl_Obj *obj) /* New characters to be inserted. */ { TextItem *textPtr = (TextItem *) itemPtr; int byteIndex, charsAdded; - TkSizeT byteCount; + Tcl_Size byteCount; char *newStr, *text; const char *string; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; @@ -1169,9 +1169,9 @@ static void TextDeleteChars( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Item in which to delete characters. */ - TkSizeT first, /* Character index of first character to + Tcl_Size first, /* Character index of first character to * delete. */ - TkSizeT last) /* Character index of last character to delete + Tcl_Size last) /* Character index of last character to delete * (inclusive). */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -1458,11 +1458,11 @@ GetTextIndex( * specified. */ Tcl_Obj *obj, /* Specification of a particular character in * itemPtr's text. */ - TkSizeT *indexPtr) /* Where to store converted character + Tcl_Size *indexPtr) /* Where to store converted character * index. */ { TextItem *textPtr = (TextItem *) itemPtr; - TkSizeT length, idx; + Tcl_Size length, idx; int c; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; const char *string; @@ -1558,7 +1558,7 @@ SetTextCursor( TCL_UNUSED(Tk_Canvas), /* Record describing canvas widget. */ Tk_Item *itemPtr, /* Text item in which cursor position is to be * set. */ - TkSizeT index) /* Character index of character just before + Tcl_Size index) /* Character index of character just before * which cursor is to be positioned. */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -1592,19 +1592,19 @@ SetTextCursor( *-------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size GetSelText( TCL_UNUSED(Tk_Canvas), /* Canvas containing selection. */ Tk_Item *itemPtr, /* Text item containing selection. */ - TkSizeT offset, /* Byte offset within selection of first + Tcl_Size offset, /* Byte offset within selection of first * character to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { TextItem *textPtr = (TextItem *) itemPtr; - TkSizeT byteCount; + Tcl_Size byteCount; char *text; const char *selStart, *selEnd; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 99f9072..ea8e2e4 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -402,16 +402,16 @@ Tk_CanvasGetTextInfo( */ int -TkCanvasTagsParseProc( +Tk_CanvasTagsParseProc( ClientData dummy, /* Not used.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option (list of tag names). */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item (ignored). */ + Tcl_Size offset) /* Offset into item (ignored). */ { Tk_Item *itemPtr = (Tk_Item *) widgRec; - TkSizeT argc, i; + Tcl_Size argc, i; const char **argv; Tk_Uid *newPtr; (void)dummy; @@ -472,11 +472,11 @@ TkCanvasTagsParseProc( */ const char * -TkCanvasTagsPrintProc( +Tk_CanvasTagsPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Ignored. */ + Tcl_Size offset, /* Ignored. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -523,7 +523,7 @@ TkCanvasDashParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { (void)dummy; (void)tkwin; @@ -558,7 +558,7 @@ TkCanvasDashPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset in record for item. */ + Tcl_Size offset, /* Offset in record for item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ @@ -747,7 +747,7 @@ TkSmoothParseProc( Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset) /* Offset into item. */ + Tcl_Size offset) /* Offset into item. */ { const Tk_SmoothMethod **smoothPtr = (const Tk_SmoothMethod **) (widgRec + offset); @@ -839,7 +839,7 @@ TkSmoothPrintProc( ClientData dummy, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ char *widgRec, /* Pointer to record for item. */ - TkSizeT offset, /* Offset into item. */ + Tcl_Size offset, /* Offset into item. */ Tcl_FreeProc **freeProcPtr) /* Pointer to variable to fill in with * information about how to reclaim storage * for return string. */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 12bc69d..1ee42c7 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -41,7 +41,7 @@ static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - TkCanvasTagsParseProc, TkCanvasTagsPrintProc, NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 05c77a9..31a3504 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -51,7 +51,7 @@ typedef struct TagSearch { int searchOver; /* Non-zero means NextItem should always * return NULL. */ int type; /* Search type (see #defs below) */ - TkSizeT id; /* Item id for searches by id */ + Tcl_Size id; /* Item id for searches by id */ const char *string; /* Tag expression string */ int stringIndex; /* Current position in string scan */ int stringLength; /* Length of tag expression string */ @@ -222,14 +222,14 @@ static void CanvasCmdDeletedProc(void *clientData); static void CanvasDoEvent(TkCanvas *canvasPtr, XEvent *eventPtr); static void CanvasEventProc(void *clientData, XEvent *eventPtr); -static TkSizeT CanvasFetchSelection(void *clientData, TkSizeT offset, - char *buffer, TkSizeT maxBytes); +static Tcl_Size CanvasFetchSelection(void *clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); static Tk_Item * CanvasFindClosest(TkCanvas *canvasPtr, double coords[2]); static void CanvasFocusProc(TkCanvas *canvasPtr, int gotFocus); static void CanvasLostSelection(void *clientData); static void CanvasSelectTo(TkCanvas *canvasPtr, - Tk_Item *itemPtr, TkSizeT index); + Tk_Item *itemPtr, Tcl_Size index); static void CanvasSetOrigin(TkCanvas *canvasPtr, int xOrigin, int yOrigin); static void CanvasUpdateScrollbars(TkCanvas *canvasPtr); @@ -471,7 +471,7 @@ ItemIndex( TkCanvas *canvasPtr, Tk_Item *itemPtr, Tcl_Obj *objPtr, - TkSizeT *indexPtr) + Tcl_Size *indexPtr) { Tcl_Interp *interp = canvasPtr->interp; @@ -598,7 +598,7 @@ DefaultRotateImplementation( double y, double angleRadians) { - TkSizeT i, objc; + Tcl_Size i, objc; int ok = 1; Tcl_Obj **objv, **newObjv; double *coordv; @@ -1194,7 +1194,7 @@ CanvasWidgetCmd( tmpObj = Tcl_NewListObj(2, objv+4); FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto doneImove) { - TkSizeT index; + Tcl_Size index; int x1, x2, y1, y2; int dontRedraw1, dontRedraw2; @@ -1250,7 +1250,7 @@ CanvasWidgetCmd( int isNew = 0; Tcl_HashEntry *entryPtr; const char *arg; - TkSizeT length; + Tcl_Size length; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg ...?"); @@ -1339,7 +1339,7 @@ CanvasWidgetCmd( break; } case CANV_DCHARS: { - TkSizeT first, last; + Tcl_Size first, last; int x1, x2, y1, y2; if ((objc != 4) && (objc != 5)) { @@ -1442,7 +1442,7 @@ CanvasWidgetCmd( } case CANV_DTAG: { Tk_Uid tag; - TkSizeT i; + Tcl_Size i; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?tagToDelete?"); @@ -1537,7 +1537,7 @@ CanvasWidgetCmd( } break; case CANV_ICURSOR: { - TkSizeT index; + Tcl_Size index; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId index"); @@ -1562,7 +1562,7 @@ CanvasWidgetCmd( break; } case CANV_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "tagOrId string"); @@ -1590,7 +1590,7 @@ CanvasWidgetCmd( break; } case CANV_INSERT: { - TkSizeT beforeThis; + Tcl_Size beforeThis; int x1, x2, y1, y2; if (objc != 5) { @@ -1807,7 +1807,7 @@ CanvasWidgetCmd( break; } case CANV_RCHARS: { - TkSizeT first, last; + Tcl_Size first, last; int x1, x2, y1, y2; int dontRedraw1, dontRedraw2; @@ -1960,7 +1960,7 @@ CanvasWidgetCmd( break; } case CANV_SELECT: { - TkSizeT index; + Tcl_Size index; int optionindex; static const char *const optionStrings[] = { "adjust", "clear", "from", "item", "to", NULL @@ -2383,7 +2383,7 @@ ConfigureCanvas( canvasPtr->scrollX2 = 0; canvasPtr->scrollY2 = 0; if (canvasPtr->regionString != NULL) { - TkSizeT argc2; + Tcl_Size argc2; const char **argv2; if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString, @@ -5314,7 +5314,7 @@ PickCurrentItem( && !(canvasPtr->flags & LEFT_GRABBED_ITEM)) { XEvent event; Tk_Item *itemPtr = canvasPtr->currentItemPtr; - TkSizeT i; + Tcl_Size i; event = canvasPtr->pickEvent; event.type = LeaveNotify; @@ -5472,7 +5472,7 @@ CanvasDoEvent( #define NUM_STATIC 3 void *staticObjects[NUM_STATIC]; void **objectPtr; - TkSizeT numObjects, i; + Tcl_Size numObjects, i; Tk_Item *itemPtr; TagSearchExpr *expr; int numExprs; @@ -5663,10 +5663,10 @@ static void CanvasSelectTo( TkCanvas *canvasPtr, /* Information about widget. */ Tk_Item *itemPtr, /* Item that is to hold selection. */ - TkSizeT index) /* Index of element that is to become the + Tcl_Size index) /* Index of element that is to become the * "other" end of the selection. */ { - TkSizeT oldFirst, oldLast; + Tcl_Size oldFirst, oldLast; Tk_Item *oldSelPtr; oldFirst = canvasPtr->textInfo.selectFirst; @@ -5724,13 +5724,13 @@ CanvasSelectTo( *-------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size CanvasFetchSelection( void *clientData, /* Information about canvas widget. */ - TkSizeT offset, /* Offset within selection of first character + Tcl_Size offset, /* Offset within selection of first character * to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { @@ -6292,7 +6292,7 @@ Tk_CanvasPsPath( * generated. */ double *coordPtr, /* Pointer to first in array of 2*numPoints * coordinates giving points for path. */ - int numPoints) /* Number of points at *coordPtr. */ + Tcl_Size numPoints) /* Number of points at *coordPtr. */ { Tk_PostscriptPath(interp, Canvas(canvas)->psInfo, coordPtr, numPoints); } diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index e4fb8fc..9be431b 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -214,7 +214,7 @@ typedef struct TkCanvas { * when converting coordinates. */ int flags; /* Various flags; see below for * definitions. */ - TkSizeT nextId; /* Number to use as id for next item created + Tcl_Size nextId; /* Number to use as id for next item created * in widget. */ Tk_PostscriptInfo psInfo; /* Pointer to information used for generating * Postscript for the canvas. NULL means no diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 1ae11da..64fcaeb 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -19,12 +19,12 @@ * Prototypes for functions used only in this file: */ -static TkSizeT ClipboardAppHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); -static TkSizeT ClipboardHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); -static TkSizeT ClipboardWindowHandler(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); +static Tcl_Size ClipboardAppHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); +static Tcl_Size ClipboardHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); +static Tcl_Size ClipboardWindowHandler(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); static void ClipboardLostSel(ClientData clientData); static int ClipboardGetProc(ClientData clientData, Tcl_Interp *interp, const char *portion); @@ -48,20 +48,20 @@ static int ClipboardGetProc(ClientData clientData, *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardHandler( ClientData clientData, /* Information about data to fetch. */ - TkSizeT offset, /* Return selection bytes starting at this + Tcl_Size offset, /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */ + Tcl_Size maxBytes) /* Maximum # of bytes to store at buffer. */ { TkClipboardTarget *targetPtr = (TkClipboardTarget *)clientData; TkClipboardBuffer *cbPtr; char *srcPtr, *destPtr; - TkSizeT count = 0; - TkSizeT scanned = 0; - TkSizeT length, freeCount; + Tcl_Size count = 0; + Tcl_Size scanned = 0; + Tcl_Size length, freeCount; /* * Skip to buffer containing offset byte @@ -126,16 +126,16 @@ ClipboardHandler( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardAppHandler( ClientData clientData, /* Pointer to TkDisplay structure. */ - TkSizeT offset, /* Return selection bytes starting at this + Tcl_Size offset, /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */ + Tcl_Size maxBytes) /* Maximum # of bytes to store at buffer. */ { TkDisplay *dispPtr = (TkDisplay *)clientData; - TkSizeT length; + Tcl_Size length; const char *p; p = dispPtr->clipboardAppPtr->winPtr->nameUid; @@ -171,13 +171,13 @@ ClipboardAppHandler( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ClipboardWindowHandler( TCL_UNUSED(void *), /* Not used. */ - TCL_UNUSED(TkSizeT), /* Return selection bytes starting at this + TCL_UNUSED(Tcl_Size), /* Return selection bytes starting at this * offset. */ char *buffer, /* Place to store converted selection. */ - TCL_UNUSED(TkSizeT)) /* Maximum # of bytes to store at buffer. */ + TCL_UNUSED(Tcl_Size)) /* Maximum # of bytes to store at buffer. */ { buffer[0] = '.'; buffer[1] = 0; @@ -451,7 +451,7 @@ Tk_ClipboardObjCmd( }; enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE }; int subIndex; - TkSizeT length; + Tcl_Size length; for (i = 2; i < objc - 1; i++) { string = Tcl_GetStringFromObj(objv[i], &length); diff --git a/generic/tkCmds.c b/generic/tkCmds.c index ec48f91..a50ee8c 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -269,7 +269,7 @@ TkBindEventProc( #define MAX_OBJS 20 void *objects[MAX_OBJS], **objPtr; TkWindow *topLevPtr; - TkSizeT i, count; + Tcl_Size i, count; char *p; Tcl_HashEntry *hPtr; @@ -349,7 +349,7 @@ Tk_BindtagsObjCmd( { Tk_Window tkwin = (Tk_Window)clientData; TkWindow *winPtr, *winPtr2; - TkSizeT i, length; + Tcl_Size i, length; const char *p; Tcl_Obj *listPtr, **tags; @@ -400,7 +400,7 @@ Tk_BindtagsObjCmd( winPtr->numTags = length; winPtr->tagPtr = (void **)ckalloc(length * sizeof(void *)); - for (i = 0; i < (TkSizeT)length; i++) { + for (i = 0; i < (Tcl_Size)length; i++) { p = Tcl_GetString(tags[i]); if (p[0] == '.') { char *copy; @@ -444,7 +444,7 @@ void TkFreeBindingTags( TkWindow *winPtr) /* Window whose tags are to be released. */ { - TkSizeT i; + Tcl_Size i; const char *p; for (i = 0; i < winPtr->numTags; i++) { @@ -1863,7 +1863,7 @@ TkGetDisplayOf( * present. */ { const char *string; - TkSizeT length; + Tcl_Size length; if (objc < 1) { return 0; diff --git a/generic/tkColor.h b/generic/tkColor.h index 59344c1..d4a1fa7 100644 --- a/generic/tkColor.h +++ b/generic/tkColor.h @@ -38,7 +38,7 @@ typedef struct TkColor { Colormap colormap; /* Colormap from which this entry was * allocated. */ Visual *visual; /* Visual associated with colormap. */ - TkSizeT resourceRefCount; /* Number of active uses of this color (each + Tcl_Size resourceRefCount; /* Number of active uses of this color (each * active use corresponds to a call to * Tk_AllocColorFromObj or Tk_GetColor). If * this count is 0, then this TkColor @@ -48,7 +48,7 @@ typedef struct TkColor { * referring to it. The structure is freed * when resourceRefCount and objRefCount are * both 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE. */ Tcl_HashEntry *hashPtr; /* Pointer to hash table entry for this diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 6314bb2..5fe5b18 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -664,7 +664,7 @@ DoObjConfig( break; } case TK_OPTION_INDEX: { - TkSizeT newIndex; + Tcl_Size newIndex; if (TkGetIntForIndex(valuePtr, TCL_INDEX_END, 0, &newIndex) != TCL_OK) { if (interp) { @@ -674,7 +674,7 @@ DoObjConfig( return TCL_ERROR; } if (newIndex == TCL_INDEX_NONE) { - newIndex = (TkSizeT)INT_MIN; + newIndex = (Tcl_Size)INT_MIN; } else if ((size_t)newIndex > (size_t)TCL_INDEX_END>>1) { newIndex++; } @@ -717,7 +717,7 @@ DoObjConfig( case TK_OPTION_STRING: { char *newStr; const char *value; - TkSizeT length; + Tcl_Size length; if (nullOK && ObjectIsEmpty(valuePtr)) { valuePtr = NULL; @@ -1305,7 +1305,7 @@ Tk_SetOptions( * then no error message is returned.*/ void *recordPtr, /* The record to configure. */ Tk_OptionTable optionTable, /* Describes valid options. */ - int objc, /* The number of elements in objv. */ + Tcl_Size objc1, /* The number of elements in objv. */ Tcl_Obj *const objv[], /* Contains one or more name-value pairs. */ Tk_Window tkwin, /* Window associated with the thing being * configured; needed for some options (such @@ -1324,6 +1324,7 @@ Tk_SetOptions( Option *optionPtr; Tk_SavedOptions *lastSavePtr, *newSavePtr; int mask; + int objc = objc1; if (savePtr != NULL) { savePtr->recordPtr = recordPtr; diff --git a/generic/tkDecls.h b/generic/tkDecls.h index dc3563a..72cc243 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -64,7 +64,7 @@ EXTERN void Tk_AddOption(Tk_Window tkwin, const char *name, /* 6 */ EXTERN void Tk_BindEvent(Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, - int numObjects, ClientData *objectPtr); + Tcl_Size numObjects, ClientData *objectPtr); /* 7 */ EXTERN void Tk_CanvasDrawableCoords(Tk_Canvas canvas, double x, double y, short *drawableXPtr, @@ -90,7 +90,7 @@ EXTERN int Tk_CanvasPsFont(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 14 */ EXTERN void Tk_CanvasPsPath(Tcl_Interp *interp, Tk_Canvas canvas, - double *coordPtr, int numPoints); + double *coordPtr, Tcl_Size numPoints); /* 15 */ EXTERN int Tk_CanvasPsStipple(Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); @@ -101,11 +101,12 @@ EXTERN void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc); /* 18 */ EXTERN int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - const char *value, char *widgRec, int offset); + const char *value, char *widgRec, + Tcl_Size offset); /* 19 */ EXTERN const char * Tk_CanvasTagsPrintProc(ClientData clientData, - Tk_Window tkwin, char *widgRec, int offset, - Tcl_FreeProc **freeProcPtr); + Tk_Window tkwin, char *widgRec, + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 20 */ EXTERN Tk_Window Tk_CanvasTkwin(Tk_Canvas canvas); /* 21 */ @@ -149,7 +150,7 @@ EXTERN void Tk_ConfigureWindow(Tk_Window tkwin, XWindowChanges *valuePtr); /* 31 */ EXTERN Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font, const char *str, - int numChars, int wrapLength, + Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 32 */ @@ -230,7 +231,7 @@ EXTERN int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x, /* 57 */ EXTERN void Tk_Draw3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, - int numPoints, int borderWidth, + Tcl_Size numPoints, int borderWidth, int leftRelief); /* 58 */ EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin, @@ -240,7 +241,7 @@ EXTERN void Tk_Draw3DRectangle(Tk_Window tkwin, /* 59 */ EXTERN void Tk_DrawChars(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, - int numBytes, int x, int y); + Tcl_Size numBytes, int x, int y); /* 60 */ EXTERN void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width, Drawable drawable); @@ -252,7 +253,7 @@ EXTERN void Tk_DrawTextLayout(Display *display, /* 62 */ EXTERN void Tk_Fill3DPolygon(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, - int numPoints, int borderWidth, + Tcl_Size numPoints, int borderWidth, int leftRelief); /* 63 */ EXTERN void Tk_Fill3DRectangle(Tk_Window tkwin, @@ -437,7 +438,7 @@ EXTERN void Tk_ManageGeometry(Tk_Window tkwin, EXTERN void Tk_MapWindow(Tk_Window tkwin); /* 126 */ EXTERN int Tk_MeasureChars(Tk_Font tkfont, const char *source, - int numBytes, int maxPixels, int flags, + Tcl_Size numBytes, int maxPixels, int flags, int *lengthPtr); /* 127 */ EXTERN void Tk_MoveResizeWindow(Tk_Window tkwin, int x, int y, @@ -578,14 +579,14 @@ EXTERN void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout); /* 176 */ EXTERN int Tk_TextWidth(Tk_Font font, const char *str, - int numBytes); + Tcl_Size numBytes); /* 177 */ EXTERN void Tk_UndefineCursor(Tk_Window window); /* 178 */ EXTERN void Tk_UnderlineChars(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, - int firstByte, int lastByte); + Tcl_Size firstByte, Tcl_Size lastByte); /* 179 */ EXTERN void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc, @@ -682,14 +683,14 @@ EXTERN int Tk_GetScrollInfoObj(Tcl_Interp *interp, int objc, EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 212 */ -EXTERN void Tk_MainEx(int argc, char **argv, +EXTERN void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 213 */ EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr); /* 214 */ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, - Tk_OptionTable optionTable, int objc, + Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 215 */ @@ -753,7 +754,7 @@ EXTERN int Tk_PostscriptImage(Tk_Image image, /* 235 */ EXTERN void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, - int numPoints); + Tcl_Size numPoints); /* 236 */ EXTERN int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, @@ -944,7 +945,7 @@ typedef struct TkStubs { void (*tk_3DHorizontalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief); /* 3 */ void (*tk_3DVerticalBevel) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief); /* 4 */ void (*tk_AddOption) (Tk_Window tkwin, const char *name, const char *value, int priority); /* 5 */ - void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, int numObjects, ClientData *objectPtr); /* 6 */ + void (*tk_BindEvent) (Tk_BindingTable bindingTable, XEvent *eventPtr, Tk_Window tkwin, Tcl_Size numObjects, ClientData *objectPtr); /* 6 */ void (*tk_CanvasDrawableCoords) (Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr); /* 7 */ void (*tk_CanvasEventuallyRedraw) (Tk_Canvas canvas, int x1, int y1, int x2, int y2); /* 8 */ int (*tk_CanvasGetCoord) (Tcl_Interp *interp, Tk_Canvas canvas, const char *str, double *doublePtr); /* 9 */ @@ -952,12 +953,12 @@ typedef struct TkStubs { int (*tk_CanvasPsBitmap) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height); /* 11 */ int (*tk_CanvasPsColor) (Tcl_Interp *interp, Tk_Canvas canvas, XColor *colorPtr); /* 12 */ int (*tk_CanvasPsFont) (Tcl_Interp *interp, Tk_Canvas canvas, Tk_Font font); /* 13 */ - void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, int numPoints); /* 14 */ + void (*tk_CanvasPsPath) (Tcl_Interp *interp, Tk_Canvas canvas, double *coordPtr, Tcl_Size numPoints); /* 14 */ int (*tk_CanvasPsStipple) (Tcl_Interp *interp, Tk_Canvas canvas, Pixmap bitmap); /* 15 */ double (*tk_CanvasPsY) (Tk_Canvas canvas, double y); /* 16 */ void (*tk_CanvasSetStippleOrigin) (Tk_Canvas canvas, GC gc); /* 17 */ - int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); /* 18 */ - const char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); /* 19 */ + int (*tk_CanvasTagsParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 18 */ + const char * (*tk_CanvasTagsPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 19 */ Tk_Window (*tk_CanvasTkwin) (Tk_Canvas canvas); /* 20 */ void (*tk_CanvasWindowCoords) (Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr); /* 21 */ void (*tk_ChangeWindowAttributes) (Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr); /* 22 */ @@ -969,7 +970,7 @@ typedef struct TkStubs { int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, char *widgRec, const char *argvName, int flags); /* 28 */ int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, int argc, const char **argv, char *widgRec, int flags); /* 29 */ void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */ - Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, int numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ + Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */ unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ @@ -995,12 +996,12 @@ typedef struct TkStubs { void (*tk_DestroyWindow) (Tk_Window tkwin); /* 54 */ const char * (*tk_DisplayName) (Tk_Window tkwin); /* 55 */ int (*tk_DistanceToTextLayout) (Tk_TextLayout layout, int x, int y); /* 56 */ - void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 57 */ + void (*tk_Draw3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief); /* 57 */ void (*tk_Draw3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 58 */ - void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, int x, int y); /* 59 */ + void (*tk_DrawChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, Tcl_Size numBytes, int x, int y); /* 59 */ void (*tk_DrawFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable); /* 60 */ void (*tk_DrawTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar); /* 61 */ - void (*tk_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, int numPoints, int borderWidth, int leftRelief); /* 62 */ + void (*tk_Fill3DPolygon) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint *pointPtr, Tcl_Size numPoints, int borderWidth, int leftRelief); /* 62 */ void (*tk_Fill3DRectangle) (Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief); /* 63 */ Tk_PhotoHandle (*tk_FindPhoto) (Tcl_Interp *interp, const char *imageName); /* 64 */ Font (*tk_FontId) (Tk_Font font); /* 65 */ @@ -1064,7 +1065,7 @@ typedef struct TkStubs { void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */ void (*tk_ManageGeometry) (Tk_Window tkwin, const Tk_GeomMgr *mgrPtr, ClientData clientData); /* 124 */ void (*tk_MapWindow) (Tk_Window tkwin); /* 125 */ - int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, int numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */ + int (*tk_MeasureChars) (Tk_Font tkfont, const char *source, Tcl_Size numBytes, int maxPixels, int flags, int *lengthPtr); /* 126 */ void (*tk_MoveResizeWindow) (Tk_Window tkwin, int x, int y, int width, int height); /* 127 */ void (*tk_MoveWindow) (Tk_Window tkwin, int x, int y); /* 128 */ void (*tk_MoveToplevelWindow) (Tk_Window tkwin, int x, int y); /* 129 */ @@ -1114,9 +1115,9 @@ typedef struct TkStubs { void (*tk_SizeOfImage) (Tk_Image image, int *widthPtr, int *heightPtr); /* 173 */ int (*tk_StrictMotif) (Tk_Window tkwin); /* 174 */ void (*tk_TextLayoutToPostscript) (Tcl_Interp *interp, Tk_TextLayout layout); /* 175 */ - int (*tk_TextWidth) (Tk_Font font, const char *str, int numBytes); /* 176 */ + int (*tk_TextWidth) (Tk_Font font, const char *str, Tcl_Size numBytes); /* 176 */ void (*tk_UndefineCursor) (Tk_Window window); /* 177 */ - void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, int firstByte, int lastByte); /* 178 */ + void (*tk_UnderlineChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte); /* 178 */ void (*tk_UnderlineTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int underline); /* 179 */ void (*tk_Ungrab) (Tk_Window tkwin); /* 180 */ void (*tk_UnmaintainGeometry) (Tk_Window window, Tk_Window container); /* 181 */ @@ -1150,9 +1151,9 @@ typedef struct TkStubs { int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */ int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */ - TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tk_MainEx) (int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ + TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tk_MainEx) (Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */ - int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, int objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ + int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */ int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */ void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */ @@ -1173,7 +1174,7 @@ typedef struct TkStubs { int (*tk_PostscriptColor) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, XColor *colorPtr); /* 232 */ int (*tk_PostscriptFont) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, Tk_Font font); /* 233 */ int (*tk_PostscriptImage) (Tk_Image image, Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, int width, int height, int prepass); /* 234 */ - void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, int numPoints); /* 235 */ + void (*tk_PostscriptPath) (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, double *coordPtr, Tcl_Size numPoints); /* 235 */ int (*tk_PostscriptStipple) (Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap); /* 236 */ double (*tk_PostscriptY) (double y, Tk_PostscriptInfo psInfo); /* 237 */ int (*tk_PostscriptPhoto) (Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, int width, int height); /* 238 */ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index b291acd..a6743d6 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -403,7 +403,7 @@ static const char *const selElementNames[] = { static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, int objc, Tcl_Obj *const objv[]); -static int DeleteChars(Entry *entryPtr, TkSizeT index, TkSizeT count); +static int DeleteChars(Entry *entryPtr, Tcl_Size index, Tcl_Size count); static void DestroyEntry(void *memPtr); static void DisplayEntry(ClientData clientData); static void EntryBlinkProc(ClientData clientData); @@ -412,22 +412,22 @@ static void EntryComputeGeometry(Entry *entryPtr); static void EntryEventProc(ClientData clientData, XEvent *eventPtr); static void EntryFocusProc(Entry *entryPtr, int gotFocus); -static TkSizeT EntryFetchSelection(ClientData clientData, TkSizeT offset, - char *buffer, TkSizeT maxBytes); +static Tcl_Size EntryFetchSelection(ClientData clientData, Tcl_Size offset, + char *buffer, Tcl_Size maxBytes); static void EntryLostSelection(ClientData clientData); static void EventuallyRedraw(Entry *entryPtr); static void EntryScanTo(Entry *entryPtr, int y); static void EntrySetValue(Entry *entryPtr, const char *value); -static void EntrySelectTo(Entry *entryPtr, TkSizeT index); +static void EntrySelectTo(Entry *entryPtr, Tcl_Size index); static char * EntryTextVarProc(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static void EntryUpdateScrollbar(Entry *entryPtr); static int EntryValidate(Entry *entryPtr, char *cmd); static int EntryValidateChange(Entry *entryPtr, const char *change, - const char *newStr, TkSizeT index, int type); + const char *newStr, Tcl_Size index, int type); static void ExpandPercents(Entry *entryPtr, const char *before, - const char *change, const char *newStr, TkSizeT index, + const char *change, const char *newStr, Tcl_Size index, int type, Tcl_DString *dsPtr); static int EntryValueChanged(Entry *entryPtr, const char *newValue); @@ -438,8 +438,8 @@ static int EntryWidgetObjCmd(ClientData clientData, Tcl_Obj *const objv[]); static void EntryWorldChanged(ClientData instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, - Tcl_Obj *indexObj, TkSizeT *indexPtr); -static int InsertChars(Entry *entryPtr, TkSizeT index, const char *string); + Tcl_Obj *indexObj, Tcl_Size *indexPtr); +static int InsertChars(Entry *entryPtr, Tcl_Size index, const char *string); /* * These forward declarations are the spinbox specific ones: @@ -626,7 +626,7 @@ EntryWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum entryCmd) cmdIndex) { case COMMAND_BBOX: { - TkSizeT index; + Tcl_Size index; int x, y, width, height; Tcl_Obj *bbox[4]; @@ -680,7 +680,7 @@ EntryWidgetObjCmd( break; case COMMAND_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; int code; if ((objc < 3) || (objc > 4)) { @@ -727,7 +727,7 @@ EntryWidgetObjCmd( break; case COMMAND_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -742,7 +742,7 @@ EntryWidgetObjCmd( } case COMMAND_INSERT: { - TkSizeT index; + Tcl_Size index; int code; if (objc != 4) { @@ -794,7 +794,7 @@ EntryWidgetObjCmd( } case COMMAND_SELECTION: { - TkSizeT index, index2; + Tcl_Size index, index2; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "option ?index?"); @@ -833,7 +833,7 @@ EntryWidgetObjCmd( goto error; } if (entryPtr->selectFirst != TCL_INDEX_NONE) { - TkSizeT half1, half2; + Tcl_Size half1, half2; half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2; half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2; @@ -948,7 +948,7 @@ EntryWidgetObjCmd( } case COMMAND_XVIEW: { - TkSizeT index; + Tcl_Size index; if (objc == 2) { double first, last; @@ -1261,7 +1261,7 @@ ConfigureEntry( sbPtr->listObj = NULL; if (sbPtr->valueStr != NULL) { Tcl_Obj *newObjPtr; - TkSizeT nelems; + Tcl_Size nelems; newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, -1); if (Tcl_ListObjLength(interp, newObjPtr, &nelems) @@ -1786,7 +1786,7 @@ DisplayEntry( * Draw the selected and unselected portions separately. */ - TkSizeT selFirst; + Tcl_Size selFirst; if (entryPtr->selectFirst + 1 < entryPtr->leftIndex + 1) { selFirst = entryPtr->leftIndex; @@ -1973,7 +1973,7 @@ EntryComputeGeometry( Entry *entryPtr) /* Widget record for entry. */ { int totalLength, overflow, rightX; - TkSizeT maxOffScreen; + Tcl_Size maxOffScreen; int height, width, i; Tk_FontMetrics fm; char *p; @@ -2157,7 +2157,7 @@ EntryComputeGeometry( static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ - TkSizeT index, /* Add the new elements before this character + Tcl_Size index, /* Add the new elements before this character * index. */ const char *value) /* New characters to add (NULL-terminated * string). */ @@ -2256,8 +2256,8 @@ InsertChars( static int DeleteChars( Entry *entryPtr, /* Entry widget to modify. */ - TkSizeT index, /* Index of first character to delete. */ - TkSizeT count) /* How many characters to delete. */ + Tcl_Size index, /* Index of first character to delete. */ + Tcl_Size count) /* How many characters to delete. */ { int byteIndex, byteCount, newByteCount; const char *string; @@ -2675,9 +2675,9 @@ GetEntryIndex( Entry *entryPtr, /* Entry for which the index is being * specified. */ Tcl_Obj *indexObj, /* Specifies character in entryPtr. */ - TkSizeT *indexPtr) /* Where to store converted character index */ + Tcl_Size *indexPtr) /* Where to store converted character index */ { - TkSizeT length, idx; + Tcl_Size length, idx; const char *string; if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->numChars - 1, 1, &idx)) { @@ -2792,7 +2792,7 @@ EntryScanTo( Entry *entryPtr, /* Information about widget. */ int x) /* X-coordinate to use for scan operation. */ { - TkSizeT newLeftIndex; + Tcl_Size newLeftIndex; /* * Compute new leftIndex for entry by amplifying the difference between @@ -2848,10 +2848,10 @@ EntryScanTo( static void EntrySelectTo( Entry *entryPtr, /* Information about widget. */ - TkSizeT index) /* Character index of element that is to + Tcl_Size index) /* Character index of element that is to * become the "other" end of the selection. */ { - TkSizeT newFirst, newLast; + Tcl_Size newFirst, newLast; /* * Grab the selection if we don't own it already. @@ -2911,17 +2911,17 @@ EntrySelectTo( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size EntryFetchSelection( ClientData clientData, /* Information about entry widget. */ - TkSizeT offset, /* Byte offset within selection of first + Tcl_Size offset, /* Byte offset within selection of first * character to be returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NUL character. */ { Entry *entryPtr = (Entry *)clientData; - TkSizeT byteCount; + Tcl_Size byteCount; const char *string; const char *selStart, *selEnd; @@ -3397,7 +3397,7 @@ EntryValidateChange( const char *change, /* Characters to be added/deleted * (NUL-terminated string). */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete, -1 otherwise */ + Tcl_Size index, /* index of insert/delete, -1 otherwise */ int type) /* forced, delete, insert, focusin or * focusout */ { @@ -3543,7 +3543,7 @@ ExpandPercents( const char *change, /* Characters to added/deleted (NUL-terminated * string). */ const char *newValue, /* Potential new value of entry string */ - TkSizeT index, /* index of insert/delete */ + Tcl_Size index, /* index of insert/delete */ int type, /* INSERT or DELETE */ Tcl_DString *dsPtr) /* Dynamic string in which to append new * command. */ @@ -3864,7 +3864,7 @@ SpinboxWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum sbCmd) cmdIndex) { case SB_CMD_BBOX: { - TkSizeT index; + Tcl_Size index; int x, y, width, height; Tcl_Obj *bbox[4]; @@ -3917,7 +3917,7 @@ SpinboxWidgetObjCmd( break; case SB_CMD_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; int code; if ((objc < 3) || (objc > 4)) { @@ -3985,7 +3985,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -4000,7 +4000,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_INSERT: { - TkSizeT index; + Tcl_Size index; int code; if (objc != 4) { @@ -4069,7 +4069,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_SELECTION: { - TkSizeT index, index2; + Tcl_Size index, index2; if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "option ?index?"); @@ -4108,7 +4108,7 @@ SpinboxWidgetObjCmd( goto error; } if (entryPtr->selectFirst != TCL_INDEX_NONE) { - TkSizeT half1, half2; + Tcl_Size half1, half2; half1 = (entryPtr->selectFirst + entryPtr->selectLast)/2; half2 = (entryPtr->selectFirst + entryPtr->selectLast + 1)/2; @@ -4263,7 +4263,7 @@ SpinboxWidgetObjCmd( } case SB_CMD_XVIEW: { - TkSizeT index; + Tcl_Size index; if (objc == 2) { double first, last; @@ -4426,8 +4426,8 @@ SpinboxInvoke( * there. If not, move to the first element of the list. */ - TkSizeT i, listc; - TkSizeT elemLen, length = entryPtr->numChars; + Tcl_Size i, listc; + Tcl_Size elemLen, length = entryPtr->numChars; const char *bytes; Tcl_Obj **listv; diff --git a/generic/tkEntry.h b/generic/tkEntry.h index 939206b..fd71282 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -45,18 +45,18 @@ typedef struct { const char *string; /* Pointer to storage for string; * NULL-terminated; malloc-ed. */ - TkSizeT insertPos; /* Character index before which next typed + Tcl_Size insertPos; /* Character index before which next typed * character will be inserted. */ /* * Information about what's selected, if any. */ - TkSizeT selectFirst; /* Character index of first selected character + Tcl_Size selectFirst; /* Character index of first selected character * (-1 means nothing selected. */ - TkSizeT selectLast; /* Character index just after last selected + Tcl_Size selectLast; /* Character index just after last selected * character (-1 means nothing selected. */ - TkSizeT selectAnchor; /* Fixed end of selection (i.e. "select to" + Tcl_Size selectAnchor; /* Fixed end of selection (i.e. "select to" * operation will use this as one end of the * selection). */ @@ -134,7 +134,7 @@ typedef struct { Tk_TextLayout placeholderLayout;/* Cached placeholder text layout information. */ char *placeholderString; /* String value of placeholder. */ - TkSizeT placeholderChars; /* Number of chars in placeholder. */ + Tcl_Size placeholderChars; /* Number of chars in placeholder. */ XColor *placeholderColorPtr;/* Color value of placeholder foreground. */ GC placeholderGC; /* For drawing placeholder text. */ int placeholderX; /* Origin for layout. */ @@ -151,13 +151,13 @@ typedef struct { * malloced memory with the same character * length as string but whose characters are * all equal to showChar. */ - TkSizeT numBytes; /* Length of string in bytes. */ - TkSizeT numChars; /* Length of string in characters. Both string + Tcl_Size numBytes; /* Length of string in bytes. */ + Tcl_Size numChars; /* Length of string in characters. Both string * and displayString have the same character * length, but may have different byte lengths * due to being made from different UTF-8 * characters. */ - TkSizeT numDisplayBytes; /* Length of displayString in bytes. */ + Tcl_Size numDisplayBytes; /* Length of displayString in bytes. */ int inset; /* Number of pixels on the left and right * sides that are taken up by XPAD, * borderWidth (if any), and highlightWidth @@ -166,7 +166,7 @@ typedef struct { int layoutX, layoutY; /* Origin for layout. */ int leftX; /* X position at which character at leftIndex * is drawn (varies depending on justify). */ - TkSizeT leftIndex; /* Character index of left-most character + Tcl_Size leftIndex; /* Character index of left-most character * visible in window. */ Tcl_TimerToken insertBlinkHandler; /* Timer handler used to blink cursor on and diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 47f8802..809f036 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.c @@ -262,7 +262,7 @@ AddClause( */ for (i=0; i 0 && globList != NULL) { for (i=0; i 4) { @@ -1841,12 +1841,12 @@ int Tk_TextWidth( Tk_Font tkfont, /* Font in which text will be measured. */ const char *string, /* String whose width will be computed. */ - int numBytes) /* Number of bytes to consider from string, or - * < 0 for strlen(). */ + Tcl_Size numBytes) /* Number of bytes to consider from string, or + * TCL_INDEX_NONE for strlen(). */ { int width; - if (numBytes < 0) { + if (numBytes == TCL_INDEX_NONE) { numBytes = strlen(string); } Tk_MeasureChars(tkfont, string, numBytes, -1, 0, &width); @@ -1888,8 +1888,8 @@ Tk_UnderlineChars( * underlined or overstruck. */ int x, int y, /* Coordinates at which first character of * string is drawn. */ - int firstByte, /* Index of first byte of first character. */ - int lastByte) /* Index of first byte after the last + Tcl_Size firstByte, /* Index of first byte of first character. */ + Tcl_Size lastByte) /* Index of first byte after the last * character. */ { TkUnderlineCharsInContext(display, drawable, gc, tkfont, string, @@ -1907,11 +1907,11 @@ TkUnderlineCharsInContext( * dimensions, etc. */ const char *string, /* String containing characters to be * underlined or overstruck. */ - int numBytes, /* Number of bytes in string. */ + Tcl_Size numBytes, /* Number of bytes in string. */ int x, int y, /* Coordinates at which the first character of * the whole string would be drawn. */ - int firstByte, /* Index of first byte of first character. */ - int lastByte) /* Index of first byte after the last + Tcl_Size firstByte, /* Index of first byte of first character. */ + Tcl_Size lastByte) /* Index of first byte after the last * character. */ { TkFont *fontPtr = (TkFont *) tkfont; @@ -1961,8 +1961,8 @@ Tk_ComputeTextLayout( Tk_Font tkfont, /* Font that will be used to display text. */ const char *string, /* String whose dimensions are to be * computed. */ - int numChars, /* Number of characters to consider from - * string, or < 0 for strlen(). */ + Tcl_Size numChars, /* Number of characters to consider from + * string, or TCL_INDEX_NONE for strlen(). */ int wrapLength, /* Longest permissible line length, in pixels. * <= 0 means no automatic wrapping: just let * lines get as long as needed. */ @@ -2000,7 +2000,7 @@ Tk_ComputeTextLayout( height = fmPtr->ascent + fmPtr->descent; - if (numChars < 0) { + if (numChars == TCL_INDEX_NONE) { numChars = Tcl_NumUtfChars(string, -1); } if (wrapLength == 0) { @@ -3299,7 +3299,7 @@ Tk_TextLayoutToPostscript( int baseline = chunkPtr->y; Tcl_Obj *psObj = Tcl_NewObj(); int i, j; - TkSizeT len; + Tcl_Size len; const char *p, *glyphname; char uindex[5], c, *ps; int ch; @@ -3672,7 +3672,7 @@ ParseFontNameObj( { const char *dash; int result, n; - TkSizeT objc, i; + Tcl_Size objc, i; Tcl_Obj **objv; const char *string; diff --git a/generic/tkFont.h b/generic/tkFont.h index 892d8da..3ac34db 100644 --- a/generic/tkFont.h +++ b/generic/tkFont.h @@ -89,7 +89,7 @@ typedef struct TkFont { * Fields used and maintained exclusively by generic code. */ - TkSizeT resourceRefCount; /* Number of active uses of this font (each + Tcl_Size resourceRefCount; /* Number of active uses of this font (each * active use corresponds to a call to * Tk_AllocFontFromTable or Tk_GetFont). If * this count is 0, then this TkFont structure @@ -99,7 +99,7 @@ typedef struct TkFont { * The structure is freed when * resourceRefCount and objRefCount are both * 0. */ - TkSizeT objRefCount; /* The number of Tcl objects that reference + Tcl_Size objRefCount; /* The number of Tcl objects that reference * this structure. */ Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure, * used when deleting it. */ diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 0e44db0..012f474 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -489,7 +489,7 @@ TkListCreateFrame( * Gives the base name to use for the new * application. */ { - TkSizeT objc; + Tcl_Size objc; Tcl_Obj **objv; if (TCL_OK != Tcl_ListObjGetElements(interp, listObj, &objc, &objv)) { @@ -519,7 +519,7 @@ CreateFrame( const char *className, *screenName, *visualName, *colormapName; const char *arg, *useOption; int i, depth; - TkSizeT length; + Tcl_Size length; unsigned int mask; Colormap colormap; Visual *visual; @@ -776,7 +776,7 @@ FrameWidgetObjCmd( Frame *framePtr = (Frame *)clientData; int result = TCL_OK, index; int c, i; - TkSizeT length; + Tcl_Size length; Tcl_Obj *objPtr; if (objc < 2) { diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 24bfd83..24d1f67 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -180,7 +180,7 @@ Tk_GrabObjCmd( TkDisplay *dispPtr; const char *arg; int index; - TkSizeT len; + Tcl_Size len; static const char *const optionStrings[] = { "current", "release", "set", "status", NULL }; diff --git a/generic/tkGrid.c b/generic/tkGrid.c index d796110..59da151 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -983,11 +983,11 @@ GridRowColumnConfigureCommand( int slot; /* the column or row number */ int slotType; /* COLUMN or ROW */ int size; /* the configuration value */ - TkSizeT lObjc; /* Number of items in index list */ + Tcl_Size lObjc; /* Number of items in index list */ Tcl_Obj **lObjv; /* array of indices */ int ok; /* temporary TCL result code */ int i, first, last; - TkSizeT j; + Tcl_Size j; const char *string; static const char *const optionStrings[] = { "-minsize", "-pad", "-uniform", "-weight", NULL @@ -2987,7 +2987,7 @@ ConfigureContent( firstChar = 0; for (numWindows=0, i=0; i < objc; i++) { - TkSizeT length; + Tcl_Size length; char prevChar = firstChar; string = Tcl_GetStringFromObj(objv[i], &length); diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index b9c908b..90510bd 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -858,7 +858,7 @@ StringMatchGIF( TCL_UNUSED(Tcl_Obj *)) /* metadata return dict, may be NULL */ { unsigned char *data, header[10]; - TkSizeT got, length; + Tcl_Size got, length; MFile handle; data = Tcl_GetByteArrayFromObj(dataObj, &length); @@ -929,7 +929,7 @@ StringReadGIF( Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { MFile handle, *hdlPtr = &handle; - TkSizeT length; + Tcl_Size length; const char *xferFormat; unsigned char *data = Tcl_GetByteArrayFromObj(dataObj, &length); diff --git a/generic/tkImgListFormat.c b/generic/tkImgListFormat.c index f5b416a..ae45b04 100644 --- a/generic/tkImgListFormat.c +++ b/generic/tkImgListFormat.c @@ -775,7 +775,7 @@ ParseColor( unsigned char *alphaPtr) { const char *specString; - TkSizeT length; + Tcl_Size length; /* * Find out which color format we have diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index ea9c54a..079bed1 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -126,7 +126,7 @@ typedef struct { Tcl_Channel channel; /* Channel for from-file reads. */ Tcl_Obj *objDataPtr; unsigned char *strDataBuf; /* Raw source data for from-string reads. */ - TkSizeT strDataLen; /* Length of source data. */ + Tcl_Size strDataLen; /* Length of source data. */ unsigned char *base64Data; /* base64 encoded string data. */ unsigned char base64Bits; /* Remaining bits from last base64 read. */ unsigned char base64State; /* Current state of base64 decoder. */ @@ -647,7 +647,7 @@ ReadData( } while (destSz) { - TkSizeT blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ); + Tcl_Size blockSz = PNG_MIN(destSz, PNG_BLOCK_SZ); blockSz = Tcl_Read(pngPtr->channel, (char *)destPtr, blockSz); if (blockSz == TCL_IO_FAILURE) { @@ -2199,7 +2199,7 @@ ReadIDAT( */ while (chunkSz && !Tcl_ZlibStreamEof(pngPtr->stream)) { - TkSizeT len1, len2; + Tcl_Size len1, len2; /* * Read another block of input into the zlib stream if data remains. @@ -2255,7 +2255,7 @@ ReadIDAT( } Tcl_GetByteArrayFromObj(pngPtr->thisLineObj, &len2); - if (len2 == (TkSizeT)pngPtr->phaseSize) { + if (len2 == (Tcl_Size)pngPtr->phaseSize) { if (pngPtr->phase > 7) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "extra data after final scan line of final phase", @@ -3044,7 +3044,7 @@ WriteData( */ if (pngPtr->objDataPtr) { - TkSizeT objSz; + Tcl_Size objSz; unsigned char *destPtr; Tcl_GetByteArrayFromObj(pngPtr->objDataPtr, &objSz); @@ -3339,7 +3339,7 @@ WriteIDAT( int rowNum, flush = TCL_ZLIB_NO_FLUSH, result; Tcl_Obj *outputObj; unsigned char *outputBytes; - TkSizeT outputSize; + Tcl_Size outputSize; /* * Filter and compress each row one at a time. diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index ed21927..db24fa3 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -764,7 +764,7 @@ ReadPPMStringHeader( #define BUFFER_SIZE 1000 char buffer[BUFFER_SIZE], c; int i, numFields, type = 0; - TkSizeT dataSize; + Tcl_Size dataSize; unsigned char *dataBuffer; dataBuffer = Tcl_GetByteArrayFromObj(dataPtr, &dataSize); diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 209de6f..789078e 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -467,7 +467,7 @@ ImgPhotoCmd( Tk_PhotoImageBlock block; Tk_PhotoImageFormat *imageFormat; Tk_PhotoImageFormatVersion3 *imageFormatVersion3; - TkSizeT length; + Tcl_Size length; int imageWidth, imageHeight, matched, oldformat = 0; Tcl_Channel chan; Tk_PhotoHandle srcHandle; @@ -1673,7 +1673,7 @@ ParseSubcommandOptions( * TK_PHOTO_COMPOSITE_* constants. */ NULL }; - TkSizeT length; + Tcl_Size length; int index, c, bit, currentBit; int values[4], numValues, maxValues, argIndex; const char *option, *expandedOption, *needed; @@ -1967,7 +1967,7 @@ ImgPhotoConfigureModel( Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL, *metadataInObj = NULL, *metadataOutObj = NULL; Tcl_Obj *tempdata, *tempformat; - TkSizeT length; + Tcl_Size length; int i, j, result, imageWidth, imageHeight, oldformat; double oldGamma; Tcl_Channel chan; @@ -2069,7 +2069,7 @@ ImgPhotoConfigureModel( * Force into ByteArray format, which most (all) image handlers will * use anyway. Empty length means ignore the -data option. */ - TkSizeT bytesize; + Tcl_Size bytesize; (void) Tcl_GetByteArrayFromObj(data, &bytesize); if (bytesize) { diff --git a/generic/tkImgSVGnano.c b/generic/tkImgSVGnano.c index 427b2c0..338b078 100644 --- a/generic/tkImgSVGnano.c +++ b/generic/tkImgSVGnano.c @@ -68,7 +68,7 @@ static int StringReadSVG(Tcl_Interp *interp, Tcl_Obj *dataObj, int destX, int destY, int width, int height, int srcX, int srcY); static NSVGimage * ParseSVGWithOptions(Tcl_Interp *interp, - const char *input, TkSizeT length, Tcl_Obj *format, + const char *input, Tcl_Size length, Tcl_Obj *format, RastOpts *ropts); static int RasterizeSVG(Tcl_Interp *interp, Tk_PhotoHandle imageHandle, NSVGimage *nsvgImage, @@ -166,7 +166,7 @@ FileMatchSVG( int *widthPtr, int *heightPtr, Tcl_Interp *interp) { - TkSizeT length; + Tcl_Size length; Tcl_Obj *dataObj = Tcl_NewObj(); const char *data; RastOpts ropts; @@ -238,7 +238,7 @@ FileReadSVG( int width, int height, int srcX, int srcY) { - TkSizeT length; + Tcl_Size length; const char *data; RastOpts ropts; NSVGimage *nsvgImage = GetCachedSVG(interp, chan, formatObj, &ropts); @@ -291,7 +291,7 @@ StringMatchSVG( int *widthPtr, int *heightPtr, Tcl_Interp *interp) { - TkSizeT length, testLength; + Tcl_Size length, testLength; const char *data; RastOpts ropts; NSVGimage *nsvgImage; @@ -347,7 +347,7 @@ StringReadSVG( int width, int height, int srcX, int srcY) { - TkSizeT length; + Tcl_Size length; const char *data; RastOpts ropts; NSVGimage *nsvgImage = GetCachedSVG(interp, dataObj, formatObj, &ropts); @@ -383,7 +383,7 @@ static NSVGimage * ParseSVGWithOptions( Tcl_Interp *interp, const char *input, - TkSizeT length, + Tcl_Size length, Tcl_Obj *formatObj, RastOpts *ropts) { @@ -757,7 +757,7 @@ CacheSVG( NSVGimage *nsvgImage, RastOpts *ropts) { - TkSizeT length; + Tcl_Size length; const char *data; NSVGcache *cachePtr = GetCachePtr(interp); @@ -797,7 +797,7 @@ GetCachedSVG( Tcl_Obj *formatObj, RastOpts *ropts) { - TkSizeT length; + Tcl_Size length; const char *data; NSVGcache *cachePtr = GetCachePtr(interp); NSVGimage *nsvgImage = NULL; diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 28cddd2..5af661d 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -538,7 +538,7 @@ declare 162 { int byteIndex, struct TkTextIndex *indexPtr) } declare 163 { - TkSizeT TkTextPrintIndex(const struct TkText *textPtr, + Tcl_Size TkTextPrintIndex(const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string) } declare 164 { @@ -567,51 +567,51 @@ declare 168 { # Next group of functions exposed due to [Bug 2768945]. declare 169 { int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 170 { const char *TkStatePrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 171 { int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 172 { const char *TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 173 { int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 174 { const char *TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 175 { int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 176 { const char *TkPixelPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 177 { int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 178 { const char *TkOrientPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } declare 179 { int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset) + Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset) } declare 180 { const char *TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr) + char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr) } # Angled text API, exposed for Emiliano Gavilán's RBC work. diff --git a/generic/tkInt.h b/generic/tkInt.h index 20db643..cbb6fb8 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -75,14 +75,6 @@ # endif #endif -#ifndef TkSizeT -# if TCL_MAJOR_VERSION > 8 -# define TkSizeT size_t -# else -# define TkSizeT int -# endif -#endif - #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) # define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int len, Tcl_DString *))Tcl_UniCharToUtfDString) # define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int len, Tcl_DString *))Tcl_UtfToUniCharDString) @@ -185,7 +177,7 @@ typedef struct TkCursor { Tk_Cursor cursor; /* System specific identifier for cursor. */ Display *display; /* Display containing cursor. Needed for * disposal and retrieval of cursors. */ - TkSizeT resourceRefCount; /* Number of active uses of this cursor (each + Tcl_Size resourceRefCount; /* Number of active uses of this cursor (each * active use corresponds to a call to * Tk_AllocPreserveFromObj or Tk_Preserve). If * this count is 0, then this structure is no @@ -194,7 +186,7 @@ typedef struct TkCursor { * there are objects referring to it. The * structure is freed when resourceRefCount * and objRefCount are both 0. */ - TkSizeT objRefCount; /* Number of Tcl objects that reference this + Tcl_Size objRefCount; /* Number of Tcl objects that reference this * structure.. */ Tcl_HashTable *otherTable; /* Second table (other than idTable) used to * index this entry. */ @@ -346,7 +338,7 @@ typedef struct TkDisplay { /* First in list of error handlers for this * display. NULL means no handlers exist at * present. */ - TkSizeT deleteCount; /* Counts # of handlers deleted since last + Tcl_Size deleteCount; /* Counts # of handlers deleted since last * time inactive handlers were garbage- * collected. When this number gets big, * handlers get cleaned up. */ @@ -568,7 +560,7 @@ typedef struct TkDisplay { #endif /* TK_USE_INPUT_METHODS */ Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */ - TkSizeT refCount; /* Reference count of how many Tk applications + Tcl_Size refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up * the display when we no longer have any Tk * applications using it. */ @@ -678,7 +670,7 @@ typedef struct TkEventHandler { */ typedef struct TkMainInfo { - TkSizeT refCount; /* Number of windows whose "mainPtr" fields + Tcl_Size refCount; /* Number of windows whose "mainPtr" fields * point here. When this becomes zero, can * free up the structure (the reference count * is zero because windows can get deleted in @@ -846,13 +838,13 @@ typedef struct TkWindow { ClientData *tagPtr; /* Points to array of tags used for bindings * on this window. Each tag is a Tk_Uid. * Malloc'ed. NULL means no tags. */ - TkSizeT numTags; /* Number of tags at *tagPtr. */ + Tcl_Size numTags; /* Number of tags at *tagPtr. */ /* * Information used by tkOption.c to manage options for the window. */ - TkSizeT optionLevel; /* TCL_INDEX_NONE means no option information is currently + Tcl_Size optionLevel; /* TCL_INDEX_NONE means no option information is currently * cached for this window. Otherwise this * gives the level in the option stack at * which info is cached. */ @@ -959,7 +951,7 @@ typedef struct { * adding), or NULL if that has not been * computed yet. If non-NULL, this string was * allocated with ckalloc(). */ - TkSizeT charValueLen; /* Length of string in charValuePtr when that + Tcl_Size charValueLen; /* Length of string in charValuePtr when that * is non-NULL. */ KeySym keysym; /* Key symbol computed after input methods * have been invoked */ @@ -983,7 +975,7 @@ typedef struct { # define TCL_INDEX_NONE (-1) #endif #ifndef TCL_INDEX_END -# define TCL_INDEX_END ((TkSizeT)-2) +# define TCL_INDEX_END ((Tcl_Size)-2) #endif /* @@ -1346,15 +1338,6 @@ MODULE_SCOPE int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin, MODULE_SCOPE int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, XImage *ximage, int x, int y, int width, int height); -#if TCL_MAJOR_VERSION > 8 -MODULE_SCOPE int TkCanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, const char *value, char *widgRec, size_t offset); -MODULE_SCOPE const char *TkCanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin, - char *widgRec, size_t offset, Tcl_FreeProc **freeProcPtr); -#else -#define TkCanvasTagsParseProc Tk_CanvasTagsParseProc -#define TkCanvasTagsPrintProc Tk_CanvasTagsPrintProc -#endif MODULE_SCOPE void TkMapTopFrame(Tk_Window tkwin); MODULE_SCOPE XEvent * TkpGetBindingXEvent(Tcl_Interp *interp); MODULE_SCOPE void TkCreateExitHandler(Tcl_ExitProc *proc, @@ -1380,16 +1363,16 @@ MODULE_SCOPE void TkpDrawCharsInContext(Display * display, int rangeLength, int x, int y); MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display, Drawable drawable, GC gc, Tk_Font tkfont, - const char *source, int numBytes, int rangeStart, - int rangeLength, double x, double y, double angle); + const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, double x, double y, double angle); MODULE_SCOPE int TkpMeasureCharsInContext(Tk_Font tkfont, - const char *source, int numBytes, int rangeStart, - int rangeLength, int maxLength, int flags, + const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, int maxLength, int flags, int *lengthPtr); MODULE_SCOPE void TkUnderlineCharsInContext(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, - const char *string, int numBytes, int x, int y, - int firstByte, int lastByte); + const char *string, Tcl_Size numBytes, int x, int y, + Tcl_Size firstByte, Tcl_Size lastByte); MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, @@ -1421,13 +1404,13 @@ MODULE_SCOPE int TkListCreateFrame(ClientData clientData, MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); -MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, TkSizeT, int lastOK, TkSizeT*); +MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*); #if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) # define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1) # define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL #else -# define TkNewIndexObj(value) (((TkSizeT)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj(value)) +# define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj(value)) # define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL #endif diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index de7e9fc..960d233 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -462,7 +462,7 @@ EXTERN struct TkTextIndex * TkTextMakeByteIndex(TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 163 */ -EXTERN TkSizeT TkTextPrintIndex(const struct TkText *textPtr, +EXTERN Tcl_Size TkTextPrintIndex(const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 164 */ @@ -490,56 +490,56 @@ EXTERN void TkTextInsertDisplayProc(struct TkText *textPtr, EXTERN int TkStateParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 170 */ EXTERN const char * TkStatePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 171 */ EXTERN int TkCanvasDashParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 172 */ EXTERN const char * TkCanvasDashPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 173 */ EXTERN int TkOffsetParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 174 */ EXTERN const char * TkOffsetPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 175 */ EXTERN int TkPixelParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 176 */ EXTERN const char * TkPixelPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 177 */ EXTERN int TkOrientParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 178 */ EXTERN const char * TkOrientPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 179 */ EXTERN int TkSmoothParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, - TkSizeT offset); + Tcl_Size offset); /* 180 */ EXTERN const char * TkSmoothPrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, - TkSizeT offset, Tcl_FreeProc **freeProcPtr); + Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 181 */ EXTERN void TkDrawAngledTextLayout(Display *display, Drawable drawable, GC gc, @@ -766,24 +766,24 @@ typedef struct TkIntStubs { int (*tkTextIndexBackBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 160 */ int (*tkTextIndexForwBytes) (const struct TkText *textPtr, const struct TkTextIndex *srcPtr, int count, struct TkTextIndex *dstPtr); /* 161 */ struct TkTextIndex * (*tkTextMakeByteIndex) (TkTextBTree tree, const struct TkText *textPtr, int lineIndex, int byteIndex, struct TkTextIndex *indexPtr); /* 162 */ - TkSizeT (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */ + Tcl_Size (*tkTextPrintIndex) (const struct TkText *textPtr, const struct TkTextIndex *indexPtr, char *string); /* 163 */ struct TkTextSegment * (*tkTextSetMark) (struct TkText *textPtr, const char *name, struct TkTextIndex *indexPtr); /* 164 */ int (*tkTextXviewCmd) (struct TkText *textPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 165 */ void (*tkTextChanged) (struct TkSharedText *sharedTextPtr, struct TkText *textPtr, const struct TkTextIndex *index1Ptr, const struct TkTextIndex *index2Ptr); /* 166 */ int (*tkBTreeNumLines) (TkTextBTree tree, const struct TkText *textPtr); /* 167 */ void (*tkTextInsertDisplayProc) (struct TkText *textPtr, struct TkTextDispChunk *chunkPtr, int x, int y, int height, int baseline, Display *display, Drawable dst, int screenY); /* 168 */ - int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 169 */ - const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 170 */ - int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 171 */ - const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 172 */ - int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 173 */ - const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 174 */ - int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 175 */ - const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 176 */ - int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 177 */ - const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 178 */ - int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, TkSizeT offset); /* 179 */ - const char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, TkSizeT offset, Tcl_FreeProc **freeProcPtr); /* 180 */ + int (*tkStateParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 169 */ + const char * (*tkStatePrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 170 */ + int (*tkCanvasDashParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 171 */ + const char * (*tkCanvasDashPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 172 */ + int (*tkOffsetParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 173 */ + const char * (*tkOffsetPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 174 */ + int (*tkPixelParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 175 */ + const char * (*tkPixelPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 176 */ + int (*tkOrientParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 177 */ + const char * (*tkOrientPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 178 */ + int (*tkSmoothParseProc) (ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, Tcl_Size offset); /* 179 */ + const char * (*tkSmoothPrintProc) (ClientData clientData, Tk_Window tkwin, char *widgRec, Tcl_Size offset, Tcl_FreeProc **freeProcPtr); /* 180 */ void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */ void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */ int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */ diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 10ab4ee..612e22e 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -405,8 +405,8 @@ static void ListboxComputeGeometry(Listbox *listPtr, int fontChanged, int maxIsStale, int updateGrid); static void ListboxEventProc(ClientData clientData, XEvent *eventPtr); -static TkSizeT ListboxFetchSelection(ClientData clientData, - TkSizeT offset, char *buffer, TkSizeT maxBytes); +static Tcl_Size ListboxFetchSelection(ClientData clientData, + Tcl_Size offset, char *buffer, Tcl_Size maxBytes); static void ListboxLostSelection(ClientData clientData); static void GenerateListboxSelectEvent(Listbox *listPtr); static void EventuallyRedrawRange(Listbox *listPtr, @@ -1100,7 +1100,7 @@ ListboxBboxSubCmd( Tcl_Obj *el, *results[4]; const char *stringRep; int pixelWidth, x, y, result; - TkSizeT stringLen; + Tcl_Size stringLen; Tk_FontMetrics fm; /* @@ -1841,7 +1841,7 @@ DisplayListbox( Tk_Window tkwin = listPtr->tkwin; GC gc; int i, limit, x, y, prevSelected, freeGC; - TkSizeT stringLen; + Tcl_Size stringLen; Tk_FontMetrics fm; Tcl_Obj *curElement; Tcl_HashEntry *entry; @@ -2238,7 +2238,7 @@ ListboxComputeGeometry( * window. */ { int width, height, pixelWidth, pixelHeight, i, result; - TkSizeT textLength; + Tcl_Size textLength; Tk_FontMetrics fm; Tcl_Obj *element; const char *text; @@ -2326,7 +2326,7 @@ ListboxInsertSubCmd( Tcl_Obj *const objv[]) /* New elements (one per entry). */ { int i, oldMaxWidth, pixelWidth, result; - TkSizeT length; + Tcl_Size length; Tcl_Obj *newListObj; const char *stringRep; @@ -2441,7 +2441,7 @@ ListboxDeleteSubCmd( int last) /* Index of last element to delete. */ { int count, i, widthChanged, result, pixelWidth; - TkSizeT length; + Tcl_Size length; Tcl_Obj *newListObj, *element; const char *stringRep; Tcl_HashEntry *entry; @@ -2733,12 +2733,12 @@ GetListboxIndex( int *indexPtr) /* Where to store converted index. */ { int result, index; - TkSizeT idx; + Tcl_Size idx; const char *stringRep; result = TkGetIntForIndex(indexObj, listPtr->nElements - 1, lastOK, &idx); if (result == TCL_OK) { - if ((idx != TCL_INDEX_NONE) && (idx > (TkSizeT)listPtr->nElements)) { + if ((idx != TCL_INDEX_NONE) && (idx > (Tcl_Size)listPtr->nElements)) { idx = listPtr->nElements; } *indexPtr = (int)idx; @@ -3108,20 +3108,20 @@ ListboxSelect( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size ListboxFetchSelection( ClientData clientData, /* Information about listbox widget. */ - TkSizeT offset, /* Offset within selection of first byte to be + Tcl_Size offset, /* Offset within selection of first byte to be * returned. */ char *buffer, /* Location in which to place selection. */ - TkSizeT maxBytes) /* Maximum number of bytes to place at buffer, + Tcl_Size maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NULL * character. */ { Listbox *listPtr = (Listbox *)clientData; Tcl_DString selection; int count, needNewline, i; - TkSizeT length, stringLen; + Tcl_Size length, stringLen; Tcl_Obj *curElement; const char *stringRep; Tcl_HashEntry *entry; diff --git a/generic/tkMain.c b/generic/tkMain.c index c58fc64..e98911f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -160,7 +160,7 @@ static void StdinProc(ClientData clientData, int mask); void Tk_MainEx( - int argc, /* Number of arguments. */ + Tcl_Size argc, /* Number of arguments. */ TCHAR **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 4730575..27a984b 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -335,9 +335,9 @@ static void DestroyMenuHashTable(ClientData clientData, Tcl_Interp *interp); static void DestroyMenuInstance(TkMenu *menuPtr); static void DestroyMenuEntry(void *memPtr); -static TkSizeT GetIndexFromCoords(Tcl_Interp *interp, +static Tcl_Size GetIndexFromCoords(Tcl_Interp *interp, TkMenu *menuPtr, const char *string, - TkSizeT *indexPtr); + Tcl_Size *indexPtr); static int MenuDoYPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuDoXPosition(Tcl_Interp *interp, @@ -346,7 +346,7 @@ static int MenuAddOrInsert(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc, Tcl_Obj *const objv[]); static void MenuCmdDeletedProc(ClientData clientData); -static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, TkSizeT index, int type); +static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, Tcl_Size index, int type); static char * MenuVarProc(ClientData clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); @@ -359,7 +359,7 @@ static void RecursivelyDeleteMenu(TkMenu *menuPtr); static void UnhookCascadeEntry(TkMenuEntry *mePtr); static void MenuCleanup(ClientData unused); static int GetMenuIndex(Tcl_Interp *interp, TkMenu *menuPtr, - Tcl_Obj *objPtr, int lastOK, TkSizeT *indexPtr); + Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr); /* * The structure below is a list of procs that respond to certain window @@ -630,7 +630,7 @@ MenuWidgetObjCmd( switch ((enum options) option) { case MENU_ACTIVATE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -714,7 +714,7 @@ MenuWidgetObjCmd( break; } case MENU_DELETE: { - TkSizeT first, last; + Tcl_Size first, last; Tcl_WideInt w; if ((objc != 3) && (objc != 4)) { @@ -757,7 +757,7 @@ MenuWidgetObjCmd( break; } case MENU_ENTRYCGET: { - TkSizeT index; + Tcl_Size index; Tcl_Obj *resultPtr; if (objc != 4) { @@ -782,7 +782,7 @@ MenuWidgetObjCmd( break; } case MENU_ENTRYCONFIGURE: { - TkSizeT index; + Tcl_Size index; Tcl_Obj *resultPtr; if (objc < 3) { @@ -823,7 +823,7 @@ MenuWidgetObjCmd( break; } case MENU_INDEX: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "string"); @@ -851,7 +851,7 @@ MenuWidgetObjCmd( } break; case MENU_INVOKE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -868,7 +868,7 @@ MenuWidgetObjCmd( } case MENU_POST: { int x, y; - TkSizeT index = TCL_INDEX_NONE; + Tcl_Size index = TCL_INDEX_NONE; if (objc != 4 && objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "x y ?index?"); @@ -903,7 +903,7 @@ MenuWidgetObjCmd( break; } case MENU_POSTCASCADE: { - TkSizeT index; + Tcl_Size index; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -921,7 +921,7 @@ MenuWidgetObjCmd( break; } case MENU_TYPE: { - TkSizeT index; + Tcl_Size index; const char *typeStr; if (objc != 3) { @@ -996,7 +996,7 @@ int TkInvokeMenu( Tcl_Interp *interp, /* The interp that the menu lives in. */ TkMenu *menuPtr, /* The menu we are invoking. */ - TkSizeT index) /* The zero based index of the item we are + Tcl_Size index) /* The zero based index of the item we are * invoking. */ { int result = TCL_OK; @@ -1484,7 +1484,7 @@ MenuWorldChanged( ClientData instanceData) /* Information about widget. */ { TkMenu *menuPtr = (TkMenu *)instanceData; - TkSizeT i; + Tcl_Size i; TkMenuConfigureDrawOptions(menuPtr); for (i = 0; i < menuPtr->numEntries; i++) { @@ -2111,7 +2111,7 @@ GetMenuIndex( * manual entry for valid .*/ int lastOK, /* Non-zero means its OK to return index just * *after* last entry. */ - TkSizeT *indexPtr) /* Where to store converted index. */ + Tcl_Size *indexPtr) /* Where to store converted index. */ { int i; const char *string; @@ -2239,13 +2239,13 @@ MenuCmdDeletedProc( static TkMenuEntry * MenuNewEntry( TkMenu *menuPtr, /* Menu that will hold the new entry. */ - TkSizeT index, /* Where in the menu the new entry is to + Tcl_Size index, /* Where in the menu the new entry is to * go. */ int type) /* The type of the new entry. */ { TkMenuEntry *mePtr; TkMenuEntry **newEntries; - TkSizeT i; + Tcl_Size i; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -2343,7 +2343,7 @@ MenuAddOrInsert( * entry, others are config options. */ { int type; - TkSizeT index; + Tcl_Size index; TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2386,7 +2386,7 @@ MenuAddOrInsert( } if (ConfigureMenuEntry(mePtr, objc - 1, objv + 1) != TCL_OK) { TkMenu *errorMenuPtr; - TkSizeT i; + Tcl_Size i; for (errorMenuPtr = menuPtr->mainMenuPtr; errorMenuPtr != NULL; @@ -2590,7 +2590,7 @@ MenuVarProc( int TkActivateMenuEntry( TkMenu *menuPtr, /* Menu in which to activate. */ - TkSizeT index) /* Index of entry to activate, or + Tcl_Size index) /* Index of entry to activate, or * TCL_INDEX_NONE to deactivate all entries. */ { TkMenuEntry *mePtr; @@ -2691,7 +2691,7 @@ CloneMenu( { int returnResult; int menuType; - TkSizeT i; + Tcl_Size i; TkMenuReferences *menuRefPtr; Tcl_Obj *menuDupCommandArray[4]; @@ -2731,7 +2731,7 @@ CloneMenu( && (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) { TkMenu *newMenuPtr = menuRefPtr->menuPtr; Tcl_Obj *newObjv[3]; - TkSizeT numElements; + Tcl_Size numElements; /* * Now put this newly created menu into the parent menu's instance @@ -2866,7 +2866,7 @@ MenuDoXPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2903,7 +2903,7 @@ MenuDoYPosition( TkMenu *menuPtr, Tcl_Obj *objPtr) { - TkSizeT index; + Tcl_Size index; TkRecomputeMenu(menuPtr); if (GetMenuIndex(interp, menuPtr, objPtr, 0, &index) != TCL_OK) { @@ -2941,12 +2941,12 @@ MenuDoYPosition( *---------------------------------------------------------------------- */ -static TkSizeT +static Tcl_Size GetIndexFromCoords( Tcl_Interp *interp, /* Interpreter of menu. */ TkMenu *menuPtr, /* The menu we are searching. */ const char *string, /* The @string we are parsing. */ - TkSizeT *indexPtr) /* The index of the item that matches. */ + Tcl_Size *indexPtr) /* The index of the item that matches. */ { int x, y, i; const char *p; @@ -3024,7 +3024,7 @@ static void RecursivelyDeleteMenu( TkMenu *menuPtr) /* The menubar instance we are deleting. */ { - TkSizeT i; + Tcl_Size i; TkMenuEntry *mePtr; /* diff --git a/generic/tkMenu.h b/generic/tkMenu.h index d53dc5f..f38bd3e 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -64,7 +64,7 @@ typedef struct TkMenuEntry { Tk_OptionTable optionTable; /* Option table for this menu entry. */ Tcl_Obj *labelPtr; /* Main text label displayed in entry (NULL if * no label). */ - TkSizeT labelLength; /* Number of non-NULL characters in label. */ + Tcl_Size labelLength; /* Number of non-NULL characters in label. */ int state; /* State of button for display purposes: * normal, active, or disabled. */ int underline; /* Value of -underline option: specifies index @@ -85,7 +85,7 @@ typedef struct TkMenuEntry { Tcl_Obj *accelPtr; /* Accelerator string displayed at right of * menu entry. NULL means no such accelerator. * Malloc'ed. */ - TkSizeT accelLength; /* Number of non-NULL characters in + Tcl_Size accelLength; /* Number of non-NULL characters in * accelerator. */ int indicatorOn; /* True means draw indicator, false means * don't draw it. This field is ignored unless @@ -263,8 +263,8 @@ typedef struct TkMenu { Tcl_Command widgetCmd; /* Token for menu's widget command. */ TkMenuEntry **entries; /* Array of pointers to all the entries in the * menu. NULL means no entries. */ - TkSizeT numEntries; /* Number of elements in entries. */ - TkSizeT active; /* Index of active entry. TCL_INDEX_NONE means + Tcl_Size numEntries; /* Number of elements in entries. */ + Tcl_Size active; /* Index of active entry. TCL_INDEX_NONE means * nothing active. */ int menuType; /* MAIN_MENU, TEAROFF_MENU, or MENUBAR. See * below for definitions. */ @@ -478,7 +478,7 @@ typedef struct TkMenuReferences { * the outside world: */ -MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, TkSizeT index); +MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, Tcl_Size index); MODULE_SCOPE void TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr); MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp, const char *name); @@ -494,10 +494,10 @@ MODULE_SCOPE Tcl_HashTable *TkGetMenuHashTable(Tcl_Interp *interp); MODULE_SCOPE void TkMenuInitializeDrawingFields(TkMenu *menuPtr); MODULE_SCOPE void TkMenuInitializeEntryDrawingFields(TkMenuEntry *mePtr); MODULE_SCOPE int TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr, - TkSizeT index); + Tcl_Size index); MODULE_SCOPE void TkMenuConfigureDrawOptions(TkMenu *menuPtr); MODULE_SCOPE int TkMenuConfigureEntryDrawOptions( - TkMenuEntry *mePtr, TkSizeT index); + TkMenuEntry *mePtr, Tcl_Size index); MODULE_SCOPE void TkMenuFreeDrawOptions(TkMenu *menuPtr); MODULE_SCOPE void TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr); MODULE_SCOPE void TkMenuEventProc(ClientData clientData, diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index be82b71..da8ae39 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -298,7 +298,7 @@ TkMenuConfigureDrawOptions( int TkMenuConfigureEntryDrawOptions( TkMenuEntry *mePtr, - TkSizeT index) + Tcl_Size index) { XGCValues gcValues; GC newGC, newActiveGC, newDisabledGC, newIndicatorGC; @@ -487,7 +487,7 @@ TkEventuallyRedrawMenu( TkMenuEntry *mePtr)/* Entry to redraw. NULL means redraw all the * entries in the menu. */ { - TkSizeT i; + Tcl_Size i; if (menuPtr->tkwin == NULL) { return; @@ -624,7 +624,7 @@ DisplayMenu( TkMenu *menuPtr = (TkMenu *)clientData; TkMenuEntry *mePtr; Tk_Window tkwin = menuPtr->tkwin; - TkSizeT index; + Tcl_Size index; int strictMotif; Tk_Font tkfont; Tk_FontMetrics menuMetrics; diff --git a/generic/tkObj.c b/generic/tkObj.c index 1577be9..76719fc 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -223,9 +223,9 @@ GetTypeCache(void) int TkGetIntForIndex( Tcl_Obj *indexObj, - TkSizeT end, + Tcl_Size end, int lastOK, - TkSizeT *indexPtr) + Tcl_Size *indexPtr) { if (indexObj == NULL) { *indexPtr = TCL_INDEX_NONE; @@ -748,7 +748,7 @@ UpdateStringOfMM( { MMRep *mmPtr; char buffer[TCL_DOUBLE_SPACE]; - TkSizeT len; + Tcl_Size len; mmPtr = (MMRep *)objPtr->internalRep.twoPtrValue.ptr1; /* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */ @@ -1116,7 +1116,7 @@ TkParsePadAmount( int *allPtr) /* Write the total padding here */ { int firstInt, secondInt; /* The two components of the padding */ - TkSizeT objc; /* The length of the list (should be 1 or 2) */ + Tcl_Size objc; /* The length of the list (should be 1 or 2) */ Tcl_Obj **objv; /* The objects in the list */ /* diff --git a/generic/tkOption.c b/generic/tkOption.c index 4ba7830..ca940db 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -521,7 +521,7 @@ Tk_GetOption( if (masqName != NULL) { char *masqClass; Tk_Uid nodeId, winClassId, winNameId; - TkSizeT classNameLength; + Tcl_Size classNameLength; Element *nodePtr, *leafPtr; static const int searchOrder[] = { EXACT_NODE_NAME, WILDCARD_NODE_NAME, EXACT_NODE_CLASS, @@ -1085,7 +1085,7 @@ ReadOptionFile( const char *realName; Tcl_Obj *buffer; int result; - TkSizeT bufferSize; + Tcl_Size bufferSize; Tcl_Channel chan; Tcl_DString newName; diff --git a/generic/tkPack.c b/generic/tkPack.c index 8d91f2b..b7ba555 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -1112,7 +1112,7 @@ PackAfter( Tk_Window tkwin, ancestor, parent; Tcl_Obj **options; int c; - TkSizeT index, optionCount; + Tcl_Size index, optionCount; /* * Iterate over all of the window specifiers, each consisting of two @@ -1179,7 +1179,7 @@ PackAfter( packPtr->flags |= OLD_STYLE; for (index = 0 ; index < optionCount; index++) { Tcl_Obj *curOptPtr = options[index]; - TkSizeT length; + Tcl_Size length; const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); c = curOpt[0]; dif