summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-01 14:30:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-01 14:30:07 (GMT)
commit36cc0029458ead72be711c8c402f55a4fd26edd3 (patch)
tree9d78414244a27069e5362313cf542baba8dfefb1
parentc122ab6dc1e84c1b07be22f6b1b3983df7268a68 (diff)
parent5f84e8bb5604b44e2682c85e6bf8724deb5c3257 (diff)
downloadtk-36cc0029458ead72be711c8c402f55a4fd26edd3.zip
tk-36cc0029458ead72be711c8c402f55a4fd26edd3.tar.gz
tk-36cc0029458ead72be711c8c402f55a4fd26edd3.tar.bz2
Use internalRep.twoPtrValue.ptr1 in stead of internalRep.otherValuePtr everywhere.
Change some internal "length" variables from type int to type size_t, so it could handle bigger string sizes (for "novem")
-rw-r--r--generic/tkConfig.c2
-rw-r--r--generic/tkEntry.c14
-rw-r--r--generic/tkImgPhoto.c2
-rw-r--r--generic/tkMenu.c4
-rw-r--r--generic/tkObj.c32
-rw-r--r--generic/tkOldConfig.c2
-rw-r--r--generic/tkPanedWindow.c2
-rw-r--r--generic/tkStyle.c16
-rw-r--r--generic/tkTest.c10
-rw-r--r--generic/tkText.c2
-rw-r--r--generic/ttk/ttkEntry.c4
-rw-r--r--win/tkWinDialog.c15
-rw-r--r--win/tkWinWm.c62
13 files changed, 89 insertions, 78 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c
index 2503f31..3be882f 100644
--- a/generic/tkConfig.c
+++ b/generic/tkConfig.c
@@ -1004,7 +1004,7 @@ ObjectIsEmpty(
if (objPtr->bytes != NULL) {
return (objPtr->length == 0);
}
- Tcl_GetStringFromObj(objPtr, &length);
+ (void)Tcl_GetStringFromObj(objPtr, &length);
return (length == 0);
}
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 9d1595c..551da30 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1019,7 +1019,7 @@ DestroyEntry(
* Tk_FreeOptions handle all the standard option-related stuff.
*/
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar(entryPtr->interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
@@ -1034,7 +1034,7 @@ DestroyEntry(
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
- ckfree(entryPtr->displayString);
+ ckfree((char *)entryPtr->displayString);
}
if (entryPtr->type == TK_SPINBOX) {
Spinbox *sbPtr = (Spinbox *) entryPtr;
@@ -1881,7 +1881,7 @@ EntryComputeGeometry(
char *p;
if (entryPtr->displayString != entryPtr->string) {
- ckfree(entryPtr->displayString);
+ ckfree((char *)entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
@@ -2037,7 +2037,7 @@ InsertChars(
return;
}
- ckfree(string);
+ ckfree((char *)string);
entryPtr->string = newStr;
/*
@@ -2142,7 +2142,7 @@ DeleteChars(
}
ckfree(toDelete);
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
entryPtr->string = newStr;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
@@ -2318,13 +2318,13 @@ EntrySetValue(
if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
- ckfree(value);
+ ckfree((char *)value);
return;
}
}
oldSource = entryPtr->string;
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
if (malloced) {
entryPtr->string = value;
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index ce160a4..4fcc3db 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -230,7 +230,7 @@ PhotoFormatThreadExitProc(
while (tsdPtr->formatList != NULL) {
freePtr = tsdPtr->formatList;
tsdPtr->formatList = tsdPtr->formatList->nextPtr;
- ckfree(freePtr->name);
+ ckfree((char *)freePtr->name);
ckfree(freePtr);
}
}
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index c303c2f..70e8335 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -1742,12 +1742,12 @@ PostProcessEntry(
if (mePtr->labelPtr == NULL) {
mePtr->labelLength = 0;
} else {
- Tcl_GetStringFromObj(mePtr->labelPtr, &mePtr->labelLength);
+ (void)Tcl_GetStringFromObj(mePtr->labelPtr, &mePtr->labelLength);
}
if (mePtr->accelPtr == NULL) {
mePtr->accelLength = 0;
} else {
- Tcl_GetStringFromObj(mePtr->accelPtr, &mePtr->accelLength);
+ (void)Tcl_GetStringFromObj(mePtr->accelPtr, &mePtr->accelLength);
}
/*
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 1ccf3c5..b027b0f 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -33,7 +33,7 @@ typedef struct PixelRep {
(PTR2INT((objPtr)->internalRep.twoPtrValue.ptr1))
#define SET_COMPLEXPIXEL(objPtr, repPtr) \
- (objPtr)->internalRep.twoPtrValue.ptr1 = 0; \
+ (objPtr)->internalRep.twoPtrValue.ptr1 = NULL; \
(objPtr)->internalRep.twoPtrValue.ptr2 = repPtr
#define GET_COMPLEXPIXEL(objPtr) \
@@ -553,7 +553,7 @@ Tk_GetMMFromObj(
}
}
- mmPtr = objPtr->internalRep.otherValuePtr;
+ mmPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (mmPtr->tkwin != tkwin) {
d = mmPtr->value;
if (mmPtr->units == -1) {
@@ -592,8 +592,8 @@ static void
FreeMMInternalRep(
Tcl_Obj *objPtr) /* MM object with internal rep to free. */
{
- ckfree(objPtr->internalRep.otherValuePtr);
- objPtr->internalRep.otherValuePtr = NULL;
+ ckfree(objPtr->internalRep.twoPtrValue.ptr1);
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
objPtr->typePtr = NULL;
}
@@ -623,13 +623,13 @@ DupMMInternalRep(
MMRep *oldPtr, *newPtr;
copyPtr->typePtr = srcPtr->typePtr;
- oldPtr = srcPtr->internalRep.otherValuePtr;
+ oldPtr = srcPtr->internalRep.twoPtrValue.ptr1;
newPtr = ckalloc(sizeof(MMRep));
newPtr->value = oldPtr->value;
newPtr->units = oldPtr->units;
newPtr->tkwin = oldPtr->tkwin;
newPtr->returnValue = oldPtr->returnValue;
- copyPtr->internalRep.otherValuePtr = newPtr;
+ copyPtr->internalRep.twoPtrValue.ptr1 = newPtr;
}
/*
@@ -659,7 +659,7 @@ UpdateStringOfMM(
char buffer[TCL_DOUBLE_SPACE];
register int len;
- mmPtr = objPtr->internalRep.otherValuePtr;
+ mmPtr = objPtr->internalRep.twoPtrValue.ptr1;
/* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */
if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) {
Tcl_Panic("UpdateStringOfMM: false precondition");
@@ -782,7 +782,7 @@ SetMMFromAny(
mmPtr->tkwin = NULL;
mmPtr->returnValue = d;
- objPtr->internalRep.otherValuePtr = mmPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = mmPtr;
return TCL_OK;
}
@@ -824,7 +824,7 @@ TkGetWindowFromObj(
return result;
}
- winPtr = objPtr->internalRep.otherValuePtr;
+ winPtr = objPtr->internalRep.twoPtrValue.ptr1;
if (winPtr->tkwin == NULL
|| winPtr->mainPtr == NULL
|| winPtr->mainPtr != mainPtr
@@ -880,7 +880,7 @@ SetWindowFromAny(
* Free the old internalRep before setting the new one.
*/
- Tcl_GetString(objPtr);
+ (void)Tcl_GetString(objPtr);
typePtr = objPtr->typePtr;
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
typePtr->freeIntRepProc(objPtr);
@@ -891,7 +891,7 @@ SetWindowFromAny(
winPtr->mainPtr = NULL;
winPtr->epoch = 0;
- objPtr->internalRep.otherValuePtr = winPtr;
+ objPtr->internalRep.twoPtrValue.ptr1 = winPtr;
objPtr->typePtr = &windowObjType;
return TCL_OK;
@@ -922,12 +922,12 @@ DupWindowInternalRep(
{
register WindowRep *oldPtr, *newPtr;
- oldPtr = srcPtr->internalRep.otherValuePtr;
+ oldPtr = srcPtr->internalRep.twoPtrValue.ptr1;
newPtr = ckalloc(sizeof(WindowRep));
newPtr->tkwin = oldPtr->tkwin;
newPtr->mainPtr = oldPtr->mainPtr;
newPtr->epoch = oldPtr->epoch;
- copyPtr->internalRep.otherValuePtr = newPtr;
+ copyPtr->internalRep.twoPtrValue.ptr1 = newPtr;
copyPtr->typePtr = srcPtr->typePtr;
}
@@ -953,8 +953,8 @@ static void
FreeWindowInternalRep(
Tcl_Obj *objPtr) /* Window object with internal rep to free. */
{
- ckfree(objPtr->internalRep.otherValuePtr);
- objPtr->internalRep.otherValuePtr = NULL;
+ ckfree(objPtr->internalRep.twoPtrValue.ptr1);
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
objPtr->typePtr = NULL;
}
@@ -985,7 +985,7 @@ TkNewWindowObj(
SetWindowFromAny(NULL, objPtr);
- winPtr = objPtr->internalRep.otherValuePtr;
+ winPtr = objPtr->internalRep.twoPtrValue.ptr1;
winPtr->tkwin = tkwin;
winPtr->mainPtr = mainPtr;
winPtr->epoch = mainPtr->deletionEpoch;
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c
index f9a69de..a77edce 100644
--- a/generic/tkOldConfig.c
+++ b/generic/tkOldConfig.c
@@ -939,7 +939,7 @@ Tk_ConfigureValue(
Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1));
if (freeProc != NULL) {
if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
- ckfree(result);
+ ckfree((char *) result);
} else {
freeProc((char *) result);
}
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index eb92aae..733610e 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -2905,7 +2905,7 @@ ObjectIsEmpty(
if (objPtr->bytes != NULL) {
return (objPtr->length == 0);
}
- Tcl_GetStringFromObj(objPtr, &length);
+ (void)Tcl_GetStringFromObj(objPtr, &length);
return (length == 0);
}
diff --git a/generic/tkStyle.c b/generic/tkStyle.c
index d5e1407..e7401df 100644
--- a/generic/tkStyle.c
+++ b/generic/tkStyle.c
@@ -146,8 +146,8 @@ static int SetStyleFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
/*
* The following structure defines the implementation of the "style" Tcl
- * object, used for drawing. The internalRep.otherValuePtr field of each style
- * object points to the Style structure for the stylefont, or NULL.
+ * object, used for drawing. The internalRep.twoPtrValue.ptr1 field of each
+ * style object points to the Style structure for the stylefont, or NULL.
*/
static const Tcl_ObjType styleObjType = {
@@ -1410,7 +1410,7 @@ Tk_AllocStyleFromObj(
if (objPtr->typePtr != &styleObjType) {
SetStyleFromAny(interp, objPtr);
}
- stylePtr = objPtr->internalRep.otherValuePtr;
+ stylePtr = objPtr->internalRep.twoPtrValue.ptr1;
return (Tk_Style) stylePtr;
}
@@ -1442,7 +1442,7 @@ Tk_GetStyleFromObj(
SetStyleFromAny(NULL, objPtr);
}
- return objPtr->internalRep.otherValuePtr;
+ return objPtr->internalRep.twoPtrValue.ptr1;
}
/*
@@ -1497,7 +1497,7 @@ SetStyleFromAny(
}
objPtr->typePtr = &styleObjType;
- objPtr->internalRep.otherValuePtr = Tk_GetStyle(interp, name);
+ objPtr->internalRep.twoPtrValue.ptr1 = Tk_GetStyle(interp, name);
return TCL_OK;
}
@@ -1520,7 +1520,7 @@ static void
FreeStyleObjProc(
Tcl_Obj *objPtr) /* The object we are releasing. */
{
- objPtr->internalRep.otherValuePtr = NULL;
+ objPtr->internalRep.twoPtrValue.ptr1 = NULL;
objPtr->typePtr = NULL;
}
@@ -1541,8 +1541,8 @@ DupStyleObjProc(
Tcl_Obj *dupObjPtr) /* The object we are copying to. */
{
dupObjPtr->typePtr = srcObjPtr->typePtr;
- dupObjPtr->internalRep.otherValuePtr =
- srcObjPtr->internalRep.otherValuePtr;
+ dupObjPtr->internalRep.twoPtrValue.ptr1 =
+ srcObjPtr->internalRep.twoPtrValue.ptr1;
}
/*
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 13415c4..88c50fa 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -223,7 +223,7 @@ Tktest_Init(
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
return TCL_ERROR;
}
- if (Tk_InitStubs(interp, "8.1", 0) == NULL) {
+ if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
return TCL_ERROR;
}
@@ -2002,14 +2002,14 @@ CustomOptionSet(
} else if ((*value)->bytes != NULL) {
objEmpty = ((*value)->length == 0);
} else {
- Tcl_GetStringFromObj((*value), &length);
+ (void)Tcl_GetStringFromObj(*value, &length);
objEmpty = (length == 0);
}
if ((flags & TK_OPTION_NULL_OK) && objEmpty) {
*value = NULL;
} else {
- string = Tcl_GetStringFromObj((*value), &length);
+ string = Tcl_GetStringFromObj(*value, &length);
Tcl_UtfToUpper(string);
if (strcmp(string, "BAD") == 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("expected good value, got \"BAD\"", -1));
@@ -2017,8 +2017,8 @@ CustomOptionSet(
}
}
if (internalPtr != NULL) {
- if ((*value) != NULL) {
- string = Tcl_GetStringFromObj((*value), &length);
+ if (*valu) != NULL) {
+ string = Tcl_GetStringFromObj(*value, &length);
newStr = ckalloc(length + 1);
strcpy(newStr, string);
} else {
diff --git a/generic/tkText.c b/generic/tkText.c
index b3fbaa1..07de6ee 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -6617,7 +6617,7 @@ ObjectIsEmpty(
if (objPtr->bytes != NULL) {
return (objPtr->length == 0);
}
- Tcl_GetStringFromObj(objPtr, &length);
+ (void)Tcl_GetStringFromObj(objPtr, &length);
return (length == 0);
}
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 9e99a5d..62a2720 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1314,8 +1314,8 @@ EntryIndex(
int *indexPtr) /* Return value */
{
# define EntryWidth(e) (Tk_Width(entryPtr->core.tkwin)) /* Not Right */
- int length;
- const char *string = Tcl_GetStringFromObj(indexObj, &length);
+ const char *string = Tcl_GetString(indexObj);
+ size_t length = indexObj->length;
if (strncmp(string, "end", length) == 0) {
*indexPtr = entryPtr->entry.numChars;
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 3b1351e..35d07d1 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1161,12 +1161,13 @@ MakeFilter(
*p = '\0';
} else {
- int len;
+ size_t len;
if (valuePtr == NULL) {
len = 0;
} else {
- (void) Tcl_GetStringFromObj(valuePtr, &len);
+ (void) Tcl_GetString(valuePtr);
+ len = valuePtr->length;
}
/*
@@ -2258,7 +2259,7 @@ FontchooserConfigureCmd(
}
for (i = 1; i < objc; i += 2) {
- int optionIndex, len;
+ int optionIndex;
if (Tcl_GetIndexFromObjStruct(interp, objv[i], optionStrings,
sizeof(char *), "option", 0, &optionIndex) != TCL_OK) {
@@ -2318,8 +2319,8 @@ FontchooserConfigureCmd(
if (hdPtr->fontObj) {
Tcl_DecrRefCount(hdPtr->fontObj);
}
- Tcl_GetStringFromObj(objv[i+1], &len);
- if (len) {
+ (void)Tcl_GetString(objv[i+1]);
+ if (objv[i+1]->length) {
hdPtr->fontObj = objv[i+1];
if (Tcl_IsShared(hdPtr->fontObj)) {
hdPtr->fontObj = Tcl_DuplicateObj(hdPtr->fontObj);
@@ -2333,8 +2334,8 @@ FontchooserConfigureCmd(
if (hdPtr->cmdObj) {
Tcl_DecrRefCount(hdPtr->cmdObj);
}
- Tcl_GetStringFromObj(objv[i+1], &len);
- if (len) {
+ (void)Tcl_GetString(objv[i+1]);
+ if (objv[i+1]->length) {
hdPtr->cmdObj = objv[i+1];
if (Tcl_IsShared(hdPtr->cmdObj)) {
hdPtr->cmdObj = Tcl_DuplicateObj(hdPtr->cmdObj);
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 28850d5..1099375 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2802,7 +2802,8 @@ Tk_WmObjCmd(
WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT,
WMOPT_WITHDRAW
};
- int index, length;
+ int index;
+ size_t length;
const char *argv1;
TkWindow *winPtr, **winPtrPtr = &winPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -2813,8 +2814,9 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
- argv1 = Tcl_GetStringFromObj(objv[1], &length);
- if ((argv1[0] == 't') && !strncmp(argv1, "tracing", (unsigned) length)
+ argv1 = Tcl_GetString(objv[1]);
+ length = objv[1]->length;
+ if ((argv1[0] == 't') && !strncmp(argv1, "tracing", objv[1]->length)
&& (length >= 3)) {
int wmTracing;
@@ -3029,7 +3031,8 @@ WmAttributesCmd(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
LONG style, exStyle, styleBit, *stylePtr = NULL;
const char *string;
- int i, boolean, length;
+ int i, boolean;
+ size_t length;
int config_fullscreen = 0, updatewrapper = 0;
int fullscreen_attr_changed = 0, fullscreen_attr = 0;
@@ -3076,23 +3079,24 @@ WmAttributesCmd(
return TCL_OK;
}
for (i = 3; i < objc; i += 2) {
- string = Tcl_GetStringFromObj(objv[i], &length);
+ string = Tcl_GetString(objv[i]);
+ length = objv[i]->length;
if ((length < 2) || (string[0] != '-')) {
goto configArgs;
}
- if (strncmp(string, "-disabled", (unsigned) length) == 0) {
+ if (strncmp(string, "-disabled", length) == 0) {
stylePtr = &style;
styleBit = WS_DISABLED;
- } else if ((strncmp(string, "-alpha", (unsigned) length) == 0)
+ } else if ((strncmp(string, "-alpha", length) == 0)
|| ((length > 2) && (strncmp(string, "-transparentcolor",
- (unsigned) length) == 0))) {
+ length) == 0))) {
stylePtr = &exStyle;
styleBit = WS_EX_LAYERED;
- } else if (strncmp(string, "-fullscreen", (unsigned) length) == 0) {
+ } else if (strncmp(string, "-fullscreen", length) == 0) {
config_fullscreen = 1;
styleBit = 0;
} else if ((length > 3)
- && (strncmp(string, "-toolwindow", (unsigned) length) == 0)) {
+ && (strncmp(string, "-toolwindow", length) == 0)) {
stylePtr = &exStyle;
styleBit = WS_EX_TOOLWINDOW;
if (objc != 4) {
@@ -3102,7 +3106,7 @@ WmAttributesCmd(
updatewrapper = 1;
}
} else if ((length > 3)
- && (strncmp(string, "-topmost", (unsigned) length) == 0)) {
+ && (strncmp(string, "-topmost", length) == 0)) {
stylePtr = &exStyle;
styleBit = WS_EX_TOPMOST;
if ((i < objc-1) && (winPtr->flags & TK_EMBEDDED)) {
@@ -3144,8 +3148,9 @@ WmAttributesCmd(
}
wmPtr->alpha = dval;
} else { /* -transparentcolor */
- const char *crefstr = Tcl_GetStringFromObj(objv[i+1], &length);
+ const char *crefstr = Tcl_GetString(objv[i+1]);
+ length = objv[i+1]->length;
if (length == 0) {
/* reset to no transparent color */
if (wmPtr->crefObj) {
@@ -3323,7 +3328,7 @@ WmClientCmd(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ size_t length;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
@@ -3336,7 +3341,8 @@ WmClientCmd(
}
return TCL_OK;
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = Tcl_GetString(objv[3]);
+ length = objv[3]->length;
if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
ckfree(wmPtr->clientMachine);
@@ -3352,7 +3358,7 @@ WmClientCmd(
ckfree(wmPtr->clientMachine);
}
wmPtr->clientMachine = ckalloc(length + 1);
- memcpy(wmPtr->clientMachine, argv3, (unsigned) length + 1);
+ memcpy(wmPtr->clientMachine, argv3, length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XTextProperty textProp;
@@ -3916,7 +3922,7 @@ WmGroupCmd(
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Tk_Window tkwin2;
const char *argv3;
- int length;
+ size_t length;
if ((objc != 3) && (objc != 4)) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
@@ -3928,7 +3934,8 @@ WmGroupCmd(
}
return TCL_OK;
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = Tcl_GetString(objv[3]);
+ length = objv[3]->length;
if (*argv3 == '\0') {
wmPtr->hints.flags &= ~WindowGroupHint;
if (wmPtr->leaderName != NULL) {
@@ -3946,7 +3953,7 @@ WmGroupCmd(
wmPtr->hints.window_group = Tk_WindowId(tkwin2);
wmPtr->hints.flags |= WindowGroupHint;
wmPtr->leaderName = ckalloc(length + 1);
- memcpy(wmPtr->leaderName, argv3, (unsigned) length + 1);
+ memcpy(wmPtr->leaderName, argv3, length + 1);
}
return TCL_OK;
}
@@ -4237,7 +4244,7 @@ WmIconnameCmd(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ size_t length;
if (objc > 4) {
Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
@@ -4251,9 +4258,10 @@ WmIconnameCmd(
if (wmPtr->iconName != NULL) {
ckfree(wmPtr->iconName);
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = Tcl_GetString(objv[3]);
+ length = objv[3]->length;
wmPtr->iconName = ckalloc(length + 1);
- memcpy(wmPtr->iconName, argv3, (unsigned) length + 1);
+ memcpy(wmPtr->iconName, argv3, length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
@@ -4945,7 +4953,7 @@ WmProtocolCmd(
register ProtocolHandler *protPtr, *prevPtr;
Atom protocol;
const char *cmd;
- int cmdLength;
+ size_t cmdLength;
Tcl_Obj *resultObj;
if ((objc < 3) || (objc > 5)) {
@@ -5000,7 +5008,8 @@ WmProtocolCmd(
break;
}
}
- cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ cmd = Tcl_GetString(objv[4]);
+ cmdLength = objv[4]->length;
if (cmdLength > 0) {
protPtr = ckalloc(HANDLER_SIZE(cmdLength));
protPtr->protocol = protocol;
@@ -5438,7 +5447,7 @@ WmTitleCmd(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
const char *argv3;
- int length;
+ size_t length;
HWND wrapper;
if (objc > 4) {
@@ -5471,9 +5480,10 @@ WmTitleCmd(
if (wmPtr->title != NULL) {
ckfree(wmPtr->title);
}
- argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ argv3 = Tcl_GetString(objv[3]);
+ length = objv[3]->length;
wmPtr->title = ckalloc(length + 1);
- memcpy(wmPtr->title, argv3, (unsigned) length + 1);
+ memcpy(wmPtr->title, argv3, length + 1);
if (!(wmPtr->flags & WM_NEVER_MAPPED) && wmPtr->wrapper != NULL) {
Tcl_DString titleString;