summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-09 20:57:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-10-09 20:57:30 (GMT)
commita2b119cac88f2853439b6781404687c40acae4d2 (patch)
treeb05b022d925e2de8066a531d89ac1841a29af259
parentbff6ed619c256ef90256f67fc53f7b566b58c368 (diff)
downloadtcl-a2b119cac88f2853439b6781404687c40acae4d2.zip
tcl-a2b119cac88f2853439b6781404687c40acae4d2.tar.gz
tcl-a2b119cac88f2853439b6781404687c40acae4d2.tar.bz2
Tcl_NewWideIntObj -> Tcl_NewBooleanObj where appropriate
-rw-r--r--generic/tclTest.c28
-rw-r--r--generic/tclTestObj.c12
-rw-r--r--generic/tclTestProcBodyObj.c2
3 files changed, 21 insertions, 21 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 95f4d2f..539c90f 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -2941,7 +2941,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[2], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "int", &intVar,
TCL_LINK_INT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2949,7 +2949,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[3], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "real", &realVar,
TCL_LINK_DOUBLE | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2957,7 +2957,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[4], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "bool", &boolVar,
TCL_LINK_BOOLEAN | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2965,7 +2965,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[5], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "string", &stringVar,
TCL_LINK_STRING | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2973,7 +2973,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[6], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "wide", &wideVar,
TCL_LINK_WIDE_INT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2981,7 +2981,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[7], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "char", &charVar,
TCL_LINK_CHAR | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2989,7 +2989,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[8], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "uchar", &ucharVar,
TCL_LINK_UCHAR | flag) != TCL_OK) {
return TCL_ERROR;
@@ -2997,7 +2997,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[9], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "short", &shortVar,
TCL_LINK_SHORT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3005,7 +3005,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[10], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "ushort", &ushortVar,
TCL_LINK_USHORT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3013,7 +3013,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[11], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "uint", &uintVar,
TCL_LINK_UINT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3021,7 +3021,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[12], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "long", &longVar,
TCL_LINK_LONG | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3029,7 +3029,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[13], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "ulong", &ulongVar,
TCL_LINK_ULONG | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3037,7 +3037,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[14], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "float", &floatVar,
TCL_LINK_FLOAT | flag) != TCL_OK) {
return TCL_ERROR;
@@ -3045,7 +3045,7 @@ TestlinkCmd(
if (Tcl_GetBoolean(interp, argv[15], &writable) != TCL_OK) {
return TCL_ERROR;
}
- flag = (writable != 0) ? 0 : TCL_LINK_READ_ONLY;
+ flag = writable ? 0 : TCL_LINK_READ_ONLY;
if (Tcl_LinkVar(interp, "uwide", &uwideVar,
TCL_LINK_WIDE_UINT | flag) != TCL_OK) {
return TCL_ERROR;
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c
index 721237b..c9a910a 100644
--- a/generic/tclTestObj.c
+++ b/generic/tclTestObj.c
@@ -292,9 +292,9 @@ TestbignumobjCmd(
return TCL_ERROR;
}
if (!Tcl_IsShared(varPtr[varIndex])) {
- Tcl_SetWideIntObj(varPtr[varIndex], mp_iszero(&bignumValue));
+ Tcl_SetBooleanObj(varPtr[varIndex], mp_iszero(&bignumValue));
} else {
- SetVarToObj(varPtr, varIndex, Tcl_NewWideIntObj(mp_iszero(&bignumValue)));
+ SetVarToObj(varPtr, varIndex, Tcl_NewBooleanObj(mp_iszero(&bignumValue)));
}
mp_clear(&bignumValue);
break;
@@ -387,9 +387,9 @@ TestbooleanobjCmd(
*/
if ((varPtr[varIndex] != NULL) && !Tcl_IsShared(varPtr[varIndex])) {
- Tcl_SetWideIntObj(varPtr[varIndex], boolValue != 0);
+ Tcl_SetBooleanObj(varPtr[varIndex], boolValue);
} else {
- SetVarToObj(varPtr, varIndex, Tcl_NewWideIntObj(boolValue != 0));
+ SetVarToObj(varPtr, varIndex, Tcl_NewBooleanObj(boolValue));
}
Tcl_SetObjResult(interp, varPtr[varIndex]);
} else if (strcmp(subCmd, "get") == 0) {
@@ -412,9 +412,9 @@ TestbooleanobjCmd(
return TCL_ERROR;
}
if (!Tcl_IsShared(varPtr[varIndex])) {
- Tcl_SetWideIntObj(varPtr[varIndex], boolValue == 0);
+ Tcl_SetBooleanObj(varPtr[varIndex], !boolValue);
} else {
- SetVarToObj(varPtr, varIndex, Tcl_NewWideIntObj(boolValue == 0));
+ SetVarToObj(varPtr, varIndex, Tcl_NewBooleanObj(!boolValue));
}
Tcl_SetObjResult(interp, varPtr[varIndex]);
} else {
diff --git a/generic/tclTestProcBodyObj.c b/generic/tclTestProcBodyObj.c
index 38cfaaa..844ff1b 100644
--- a/generic/tclTestProcBodyObj.c
+++ b/generic/tclTestProcBodyObj.c
@@ -340,7 +340,7 @@ ProcBodyTestCheckObjCmd(
}
version = Tcl_PkgPresent(interp, packageName, packageVersion, 1);
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
strcmp(version, packageVersion) == 0));
return TCL_OK;
}