diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:05:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-02-28 12:05:02 (GMT) |
commit | 1d2fbf0b67d3ebfca3632d712654d9bc01af76dd (patch) | |
tree | 2ec07b8daf001f18e7432b25d0c9167aaa3838ec /generic/tkObj.c | |
parent | 8ef8de11eed562a7015b9e8ff11a6a77124b1d19 (diff) | |
parent | 4d4bf9a051a30dad87a2b518e2641851b702dd3c (diff) | |
download | tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.zip tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.tar.gz tk-1d2fbf0b67d3ebfca3632d712654d9bc01af76dd.tar.bz2 |
Implement TIP #557: C++ support for Tcl
Diffstat (limited to 'generic/tkObj.c')
-rw-r--r-- | generic/tkObj.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/generic/tkObj.c b/generic/tkObj.c index cfcb770..e3b1107 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -177,7 +177,7 @@ static const Tcl_ObjType windowObjType = { static ThreadSpecificData * GetTypeCache(void) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->doubleTypePtr == NULL) { @@ -486,8 +486,8 @@ FreePixelInternalRep( static void DupPixelInternalRep( - register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - register Tcl_Obj *copyPtr) /* Object with internal rep to set. */ + Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ + Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { copyPtr->typePtr = srcPtr->typePtr; @@ -497,7 +497,7 @@ DupPixelInternalRep( PixelRep *oldPtr, *newPtr; oldPtr = GET_COMPLEXPIXEL(srcPtr); - newPtr = ckalloc(sizeof(PixelRep)); + newPtr = (PixelRep *)ckalloc(sizeof(PixelRep)); newPtr->value = oldPtr->value; newPtr->units = oldPtr->units; newPtr->tkwin = oldPtr->tkwin; @@ -581,7 +581,7 @@ SetPixelFromAny( if ((units < 0) && (i == d)) { SET_SIMPLEPIXEL(objPtr, i); } else { - PixelRep *pixelPtr = ckalloc(sizeof(PixelRep)); + PixelRep *pixelPtr = (PixelRep *)ckalloc(sizeof(PixelRep)); pixelPtr->value = d; pixelPtr->units = units; @@ -642,7 +642,7 @@ Tk_GetMMFromObj( } } - mmPtr = objPtr->internalRep.twoPtrValue.ptr1; + mmPtr = (MMRep *)objPtr->internalRep.twoPtrValue.ptr1; if (mmPtr->tkwin != tkwin) { d = mmPtr->value; if (mmPtr->units == -1) { @@ -706,14 +706,14 @@ FreeMMInternalRep( static void DupMMInternalRep( - register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ - register Tcl_Obj *copyPtr) /* Object with internal rep to set. */ + Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ + Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { MMRep *oldPtr, *newPtr; copyPtr->typePtr = srcPtr->typePtr; - oldPtr = srcPtr->internalRep.twoPtrValue.ptr1; - newPtr = ckalloc(sizeof(MMRep)); + oldPtr = (MMRep *)srcPtr->internalRep.twoPtrValue.ptr1; + newPtr = (MMRep *)ckalloc(sizeof(MMRep)); newPtr->value = oldPtr->value; newPtr->units = oldPtr->units; newPtr->tkwin = oldPtr->tkwin; @@ -742,13 +742,13 @@ DupMMInternalRep( static void UpdateStringOfMM( - register Tcl_Obj *objPtr) /* pixel obj with string rep to update. */ + Tcl_Obj *objPtr) /* pixel obj with string rep to update. */ { MMRep *mmPtr; char buffer[TCL_DOUBLE_SPACE]; TkSizeT len; - mmPtr = objPtr->internalRep.twoPtrValue.ptr1; + mmPtr = (MMRep *)objPtr->internalRep.twoPtrValue.ptr1; /* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */ if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) { Tcl_Panic("UpdateStringOfMM: false precondition"); @@ -757,7 +757,7 @@ UpdateStringOfMM( Tcl_PrintDouble(NULL, mmPtr->value, buffer); len = strlen(buffer); - objPtr->bytes = ckalloc(len + 1); + objPtr->bytes = (char *)ckalloc(len + 1); strcpy(objPtr->bytes, buffer); objPtr->length = len; } @@ -865,7 +865,7 @@ SetMMFromAny( objPtr->typePtr = &mmObjType; - mmPtr = ckalloc(sizeof(MMRep)); + mmPtr = (MMRep *)ckalloc(sizeof(MMRep)); mmPtr->value = d; mmPtr->units = units; mmPtr->tkwin = NULL; @@ -905,7 +905,7 @@ TkGetWindowFromObj( Tk_Window *windowPtr) /* Place to store resulting window. */ { TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr; - register WindowRep *winPtr; + WindowRep *winPtr; if (objPtr->typePtr != &windowObjType) { int result = SetWindowFromAny(interp, objPtr); @@ -914,7 +914,7 @@ TkGetWindowFromObj( } } - winPtr = objPtr->internalRep.twoPtrValue.ptr1; + winPtr = (WindowRep *)objPtr->internalRep.twoPtrValue.ptr1; if (winPtr->tkwin == NULL || winPtr->mainPtr == NULL || winPtr->mainPtr != mainPtr @@ -960,11 +960,12 @@ TkGetWindowFromObj( static int SetWindowFromAny( - Tcl_Interp *interp, /* Used for error reporting if not NULL. */ - register Tcl_Obj *objPtr) /* The object to convert. */ + Tcl_Interp *dummy, /* Used for error reporting if not NULL. */ + Tcl_Obj *objPtr) /* The object to convert. */ { const Tcl_ObjType *typePtr; WindowRep *winPtr; + (void)dummy; /* * Free the old internalRep before setting the new one. @@ -976,7 +977,7 @@ SetWindowFromAny( typePtr->freeIntRepProc(objPtr); } - winPtr = ckalloc(sizeof(WindowRep)); + winPtr = (WindowRep *)ckalloc(sizeof(WindowRep)); winPtr->tkwin = NULL; winPtr->mainPtr = NULL; winPtr->epoch = 0; @@ -1007,13 +1008,13 @@ SetWindowFromAny( static void DupWindowInternalRep( - register Tcl_Obj *srcPtr, - register Tcl_Obj *copyPtr) + Tcl_Obj *srcPtr, + Tcl_Obj *copyPtr) { - register WindowRep *oldPtr, *newPtr; + WindowRep *oldPtr, *newPtr; - oldPtr = srcPtr->internalRep.twoPtrValue.ptr1; - newPtr = ckalloc(sizeof(WindowRep)); + oldPtr = (WindowRep *)srcPtr->internalRep.twoPtrValue.ptr1; + newPtr = (WindowRep *)ckalloc(sizeof(WindowRep)); newPtr->tkwin = oldPtr->tkwin; newPtr->mainPtr = oldPtr->mainPtr; newPtr->epoch = oldPtr->epoch; @@ -1071,11 +1072,11 @@ TkNewWindowObj( { Tcl_Obj *objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1); TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr; - register WindowRep *winPtr; + WindowRep *winPtr; SetWindowFromAny(NULL, objPtr); - winPtr = objPtr->internalRep.twoPtrValue.ptr1; + winPtr = (WindowRep *)objPtr->internalRep.twoPtrValue.ptr1; winPtr->tkwin = tkwin; winPtr->mainPtr = mainPtr; winPtr->epoch = mainPtr->deletionEpoch; |