diff options
author | das <das> | 2007-09-03 01:36:54 (GMT) |
---|---|---|
committer | das <das> | 2007-09-03 01:36:54 (GMT) |
commit | fcb552a060dd886a2bc705c9817fa3f211ee8865 (patch) | |
tree | 1058e7cb0512fb90e2c3fc87cb481ffe0fcc2f40 /generic | |
parent | 5b7651bcebf601b398730591d1e15d0a513aab91 (diff) | |
download | tcl-fcb552a060dd886a2bc705c9817fa3f211ee8865.zip tcl-fcb552a060dd886a2bc705c9817fa3f211ee8865.tar.gz tcl-fcb552a060dd886a2bc705c9817fa3f211ee8865.tar.bz2 |
* generic/tclObj.c (TclInitObjSubsystem): restore registration of the
"wideInt" Tcl_ObjType for compatibility with 8.4 extensions that access
the tclWideIntType Tcl_ObjType; add setFromAnyProc for tclWideIntType.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclObj.c | 37 |
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 |