summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-01 21:10:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-01 21:10:02 (GMT)
commit0045adce01c53ec2e867265e7ece58744f67f68a (patch)
tree9411c4eca2874e76b0312b5a872bdda33073ded8
parent657fe549c6c15721a179d3bcd6e504f70b56a47e (diff)
parentd52dd6d1f39463186ea3f591128b7335f73e9615 (diff)
downloadtk-0045adce01c53ec2e867265e7ece58744f67f68a.zip
tk-0045adce01c53ec2e867265e7ece58744f67f68a.tar.gz
tk-0045adce01c53ec2e867265e7ece58744f67f68a.tar.bz2
Use Tcl_NewBooleanObj() where appropriate
-rw-r--r--generic/tk3d.c4
-rw-r--r--generic/tkCursor.c4
-rw-r--r--generic/tkEntry.c2
-rw-r--r--generic/tkWindow.c2
-rw-r--r--generic/ttk/ttkEntry.c2
-rw-r--r--generic/ttk/ttkTreeview.c4
-rw-r--r--generic/ttk/ttkWidget.c2
-rw-r--r--unix/tkUnixWm.c8
-rw-r--r--win/tkWinDialog.c2
-rw-r--r--win/tkWinWm.c20
10 files changed, 25 insertions, 25 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 0920dc1..33e2e56 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -1389,9 +1389,9 @@ TkDebugBorder(
Tcl_Obj *objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((Tcl_WideInt)borderPtr->resourceRefCount));
+ Tcl_NewWideIntObj(borderPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((Tcl_WideInt)borderPtr->objRefCount));
+ Tcl_NewWideIntObj(borderPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
diff --git a/generic/tkCursor.c b/generic/tkCursor.c
index ea0a35f..9785470 100644
--- a/generic/tkCursor.c
+++ b/generic/tkCursor.c
@@ -868,9 +868,9 @@ TkDebugCursor(
for ( ; (cursorPtr != NULL); cursorPtr = cursorPtr->nextPtr) {
objPtr = Tcl_NewObj();
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((Tcl_WideInt)cursorPtr->resourceRefCount));
+ Tcl_NewWideIntObj(cursorPtr->resourceRefCount));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((Tcl_WideInt)cursorPtr->objRefCount));
+ Tcl_NewWideIntObj(cursorPtr->objRefCount));
Tcl_ListObjAppendElement(NULL, resultPtr, objPtr);
}
}
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index a07a533..d1514d1 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -880,7 +880,7 @@ EntryWidgetObjCmd(
goto error;
}
Tcl_SetObjResult(interp,
- Tcl_NewWideIntObj(entryPtr->selectFirst != TCL_INDEX_NONE));
+ Tcl_NewBooleanObj(entryPtr->selectFirst != TCL_INDEX_NONE));
goto done;
case SELECTION_RANGE:
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 6b1e154..20eca1b 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3293,7 +3293,7 @@ Initialize(
Tcl_SetVar2Ex(interp, "argv", NULL,
Tcl_NewListObj(objc-1, rest+1), TCL_GLOBAL_ONLY);
Tcl_SetVar2Ex(interp, "argc", NULL,
- Tcl_NewWideIntObj((Tcl_WideInt)objc-1), TCL_GLOBAL_ONLY);
+ Tcl_NewWideIntObj(objc-1), TCL_GLOBAL_ONLY);
ckfree(rest);
}
Tcl_DecrRefCount(parseList);
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index fee2bc2..d59eef8 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1645,7 +1645,7 @@ static int EntrySelectionPresentCommand(
return TCL_ERROR;
}
Tcl_SetObjResult(interp,
- Tcl_NewWideIntObj(entryPtr->entry.selectFirst >= 0));
+ Tcl_NewBooleanObj(entryPtr->entry.selectFirst >= 0));
return TCL_OK;
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 3af1094..5880a49 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2716,7 +2716,7 @@ static int TreeviewExistsCommand(
}
entryPtr = Tcl_FindHashEntry(&tv->tree.items, Tcl_GetString(objv[2]));
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(entryPtr != 0));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(entryPtr != 0));
return TCL_OK;
}
@@ -4080,7 +4080,7 @@ static int TreeviewTagHasCommand(
return TCL_ERROR;
}
Tcl_SetObjResult(interp,
- Tcl_NewWideIntObj(Ttk_TagSetContains(item->tagset, tag)));
+ Tcl_NewBooleanObj(Ttk_TagSetContains(item->tagset, tag)));
return TCL_OK;
} else {
Tcl_WrongNumArgs(interp, 3, objv, "tagName ?item?");
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index 5790cc3..b5d9a21 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -734,7 +734,7 @@ int TtkWidgetInstateCommand(
if (objc == 3) {
Tcl_SetObjResult(interp,
- Tcl_NewWideIntObj(Ttk_StateMatches(state,&spec)));
+ Tcl_NewBooleanObj(Ttk_StateMatches(state,&spec)));
} else if (objc == 4) {
if (Ttk_StateMatches(state,&spec)) {
status = Tcl_EvalObjEx(interp, objv[3], 0);
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index 0424218..51a308b 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -1349,11 +1349,11 @@ WmGetAttribute(
case WMATT_ALPHA:
return Tcl_NewDoubleObj(wmPtr->attributes.alpha);
case WMATT_TOPMOST:
- return Tcl_NewWideIntObj(wmPtr->attributes.topmost != 0);
+ return Tcl_NewBooleanObj(wmPtr->attributes.topmost);
case WMATT_ZOOMED:
- return Tcl_NewWideIntObj(wmPtr->attributes.zoomed != 0);
+ return Tcl_NewBooleanObj(wmPtr->attributes.zoomed);
case WMATT_FULLSCREEN:
- return Tcl_NewWideIntObj(wmPtr->attributes.fullscreen != 0);
+ return Tcl_NewBooleanObj(wmPtr->attributes.fullscreen);
case WMATT_TYPE:
return GetNetWmType(winPtr);
case _WMATT_LAST_ATTRIBUTE:
@@ -2938,7 +2938,7 @@ WmOverrideredirectCmd(
}
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) {
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index c414c47..77f8e98 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -3203,7 +3203,7 @@ FontchooserCget(
}
break;
case FontchooserVisible:
- resObj = Tcl_NewWideIntObj((hdPtr->hwnd != NULL) && IsWindow(hdPtr->hwnd));
+ resObj = Tcl_NewBooleanObj((hdPtr->hwnd != NULL) && IsWindow(hdPtr->hwnd));
break;
default:
resObj = Tcl_NewStringObj("", 0);
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index eb35e5a..f6d3216 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2706,8 +2706,8 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
- (dispPtr->flags & TK_DISPLAY_WM_TRACING) != 0));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
+ dispPtr->flags & TK_DISPLAY_WM_TRACING));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
@@ -2945,19 +2945,19 @@ WmAttributesCmd(
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-disabled", TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((style & WS_DISABLED) != 0));
+ Tcl_NewBooleanObj(style & WS_DISABLED));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-fullscreen", TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((wmPtr->flags & WM_FULLSCREEN) != 0));
+ Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-toolwindow", TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((exStyle & WS_EX_TOOLWINDOW) != 0));
+ Tcl_NewBooleanObj(exStyle & WS_EX_TOOLWINDOW));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-topmost", TCL_INDEX_NONE));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewWideIntObj((exStyle & WS_EX_TOPMOST) != 0));
+ Tcl_NewBooleanObj(exStyle & WS_EX_TOPMOST));
Tcl_SetObjResult(interp, objPtr);
return TCL_OK;
}
@@ -3105,7 +3105,7 @@ WmAttributesCmd(
config_fullscreen = 0;
} else if (objc == 4) {
Tcl_SetObjResult(interp,
- Tcl_NewWideIntObj((*stylePtr & styleBit) != 0));
+ Tcl_NewBooleanObj(*stylePtr & styleBit));
} else if (boolValue) {
*stylePtr |= styleBit;
} else {
@@ -4752,7 +4752,7 @@ WmOverrideredirectCmd(
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
}
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolValue) != TCL_OK) {
@@ -4978,8 +4978,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
+ results[1] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}