diff options
author | dgp <dgp@users.sourceforge.net> | 2018-11-13 21:04:19 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-11-13 21:04:19 (GMT) |
commit | ad8c23540cd977b9e923053d0e86a56207761680 (patch) | |
tree | 141d7a82c5cb9b47ac8b675fef1c021a520d40ed /generic/tcl.h | |
parent | 4e39644e1e0b2c89d06189ae0d14527235499bd1 (diff) | |
parent | f7dfeb706fb75bccd0aae6cd6119fccdfb6bd8d0 (diff) | |
download | tcl-ad8c23540cd977b9e923053d0e86a56207761680.zip tcl-ad8c23540cd977b9e923053d0e86a56207761680.tar.gz tcl-ad8c23540cd977b9e923053d0e86a56207761680.tar.bz2 |
Implement TIP 445
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index a77211b..3b6d818 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -618,6 +618,29 @@ typedef struct Tcl_ObjType { } Tcl_ObjType; /* + * The following structure stores an internal representation (intrep) for + * a Tcl value. An intrep is associated with an Tcl_ObjType when both + * are stored in the same Tcl_Obj. The routines of the Tcl_ObjType govern + * the handling of the intrep. + */ + +typedef union Tcl_ObjIntRep { /* The internal representation: */ + long longValue; /* - an long integer value. */ + double doubleValue; /* - a double-precision floating value. */ + void *otherValuePtr; /* - another, type-specific value, */ + /* not used internally any more. */ + Tcl_WideInt wideValue; /* - an integer value >= 64bits */ + struct { /* - internal rep as two pointers. */ + void *ptr1; + void *ptr2; + } twoPtrValue; + struct { /* - internal rep as a pointer and a long, */ + void *ptr; /* not used internally any more. */ + unsigned long value; + } ptrAndLongRep; +} Tcl_ObjIntRep; + +/* * One of the following structures exists for each object in the Tcl system. * An object stores a value as either a string, some internal representation, * or both. @@ -642,27 +665,7 @@ typedef struct Tcl_Obj { * corresponds to the type of the object's * internal rep. NULL indicates the object has * no internal rep (has no type). */ - union { /* The internal representation: */ - long longValue; /* - an long integer value. */ - double doubleValue; /* - a double-precision floating value. */ - void *otherValuePtr; /* - another, type-specific value, not used - * internally any more. */ - Tcl_WideInt wideValue; /* - a long long value. */ - struct { /* - internal rep as two pointers. - * Many uses in Tcl, including a bignum's - * tightly packed fields, where the alloc, - * used and signum flags are packed into - * ptr2 with everything else hung off - * ptr1. */ - void *ptr1; - void *ptr2; - } twoPtrValue; - struct { /* - internal rep as a pointer and a long, - * not used internally any more. */ - void *ptr; - unsigned long value; - } ptrAndLongRep; - } internalRep; + Tcl_ObjIntRep internalRep; /* The internal representation: */ } Tcl_Obj; |