summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-09-17 10:40:08 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-09-17 10:40:08 (GMT)
commit700619fa04b8a0e355f2716eb6fe90d71303b4f9 (patch)
tree62dca16d6fae0e061564c7f6c7e46d9a45f80ecd
parentf9b52790b4a1ec44032e5c28b8f387916214b8e5 (diff)
downloadtcl-700619fa04b8a0e355f2716eb6fe90d71303b4f9.zip
tcl-700619fa04b8a0e355f2716eb6fe90d71303b4f9.tar.gz
tcl-700619fa04b8a0e355f2716eb6fe90d71303b4f9.tar.bz2
Minor cleanup of NULL usage
-rw-r--r--generic/tclExecute.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 584c747..48f5e4b 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.336 2007/09/13 15:27:07 das Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.337 2007/09/17 10:40:08 dkf Exp $
*/
#include "tclInt.h"
@@ -169,14 +169,18 @@ static BuiltinFunc tclBuiltinFuncTable[] = {
((Var *) ((char *)hPtr - TclOffset(VarInHash, entry)))
static inline Var *
-VarHashCreateVar(TclVarHashTable *tablePtr, Tcl_Obj *key, int *newPtr)
+VarHashCreateVar(
+ TclVarHashTable *tablePtr,
+ Tcl_Obj *key,
+ int *newPtr)
{
- Tcl_HashEntry *hPtr = Tcl_CreateHashEntry((Tcl_HashTable *) tablePtr, (char *) key, newPtr);
- if (hPtr) {
- return VarHashGetValue(hPtr);
- } else {
+ Tcl_HashEntry *hPtr = Tcl_CreateHashEntry((Tcl_HashTable *) tablePtr,
+ (char *) key, newPtr);
+
+ if (!hPtr) {
return NULL;
}
+ return VarHashGetValue(hPtr);
}
#define VarHashFindVar(tablePtr, key) \
@@ -6814,8 +6818,7 @@ TclExecuteByteCode(
divideByZero:
Tcl_SetObjResult(interp, Tcl_NewStringObj("divide by zero", -1));
- Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero",
- (char *) NULL);
+ Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", NULL);
result = TCL_ERROR;
goto checkForCatch;
@@ -6829,7 +6832,7 @@ TclExecuteByteCode(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"exponentiation of zero by negative power", -1));
Tcl_SetErrorCode(interp, "ARITH", "DOMAIN",
- "exponentiation of zero by negative power", (char *) NULL);
+ "exponentiation of zero by negative power", NULL);
result = TCL_ERROR;
goto checkForCatch;
@@ -7588,23 +7591,23 @@ TclExprFloatError(
if ((errno == EDOM) || TclIsNaN(value)) {
s = "domain error: argument not in valid range";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
- Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, (char *) NULL);
+ Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, NULL);
} else if ((errno == ERANGE) || TclIsInfinite(value)) {
if (value == 0.0) {
s = "floating-point value too small to represent";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
- Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, (char *) NULL);
+ Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, NULL);
} else {
s = "floating-point value too large to represent";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
- Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, (char *) NULL);
+ Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, NULL);
}
} else {
Tcl_Obj *objPtr = Tcl_ObjPrintf(
"unknown floating-point error, errno = %d", errno);
Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN",
- Tcl_GetString(objPtr), (char *) NULL);
+ Tcl_GetString(objPtr), NULL);
Tcl_SetObjResult(interp, objPtr);
}
}