summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index c94228a..12ea2b8 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.132 2007/08/12 14:40:01 msofer Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.133 2007/09/03 01:36:54 das Exp $
*/
#include "tclInt.h"
@@ -175,6 +175,7 @@ static void UpdateStringOfDouble(Tcl_Obj *objPtr);
static void UpdateStringOfInt(Tcl_Obj *objPtr);
#ifndef NO_WIDE_TYPE
static void UpdateStringOfWideInt(Tcl_Obj *objPtr);
+static int SetWideIntFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
#endif
static void FreeBignum(Tcl_Obj *objPtr);
static void DupBignum(Tcl_Obj *objPtr, Tcl_Obj *copyPtr);
@@ -241,7 +242,7 @@ Tcl_ObjType tclWideIntType = {
NULL, /* freeIntRepProc */
NULL, /* dupIntRepProc */
UpdateStringOfWideInt, /* updateStringProc */
- NULL /* setFromAnyProc */
+ SetWideIntFromAny /* setFromAnyProc */
};
#endif
Tcl_ObjType tclBignumType = {
@@ -366,6 +367,9 @@ TclInitObjSubsystem(void)
/* For backward compatibility only ... */
Tcl_RegisterObjType(&oldBooleanType);
+#ifndef NO_WIDE_TYPE
+ Tcl_RegisterObjType(&tclWideIntType);
+#endif
#ifdef TCL_COMPILE_STATS
Tcl_MutexLock(&tclObjMutex);
@@ -2532,6 +2536,33 @@ Tcl_GetWideIntFromObj(
TCL_PARSE_INTEGER_ONLY)==TCL_OK);
return TCL_ERROR;
}
+#ifndef NO_WIDE_TYPE
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetWideIntFromAny --
+ *
+ * Attempts to force the internal representation for a Tcl object to
+ * tclWideIntType, specifically.
+ *
+ * Results:
+ * The return value is a standard object Tcl result. If an error occurs
+ * during conversion, an error message is left in the interpreter's
+ * result unless "interp" is NULL.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+SetWideIntFromAny(
+ Tcl_Interp *interp, /* Tcl interpreter */
+ Tcl_Obj *objPtr) /* Pointer to the object to convert */
+{
+ Tcl_WideInt w;
+ return Tcl_GetWideIntFromObj(interp, objPtr, &w);
+}
+#endif /* !NO_WIDE_TYPE */
/*
*----------------------------------------------------------------------
@@ -2607,6 +2638,8 @@ DupBignum(
*
* The object's existing string representation is NOT freed; memory will leak
* if the string rep is still valid at the time this function is called.
+ *
+ *----------------------------------------------------------------------
*/
static void