From 0b1f6ed09a118b4d974ca8048adec672061662d1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 6 Oct 2021 19:33:03 +0000 Subject: Change "IntRep" to "InternalRep", as discussed in the Tcl Core mailing list --- generic/tcl.decls | 8 +-- generic/tcl.h | 12 ++-- generic/tclAssembly.c | 10 ++-- generic/tclBasic.c | 18 +++--- generic/tclBinary.c | 74 ++++++++++++------------- generic/tclClock.c | 2 +- generic/tclCmdMZ.c | 20 +++---- generic/tclCompExpr.c | 10 ++-- generic/tclCompile.c | 14 ++--- generic/tclCompile.h | 36 ++++++------ generic/tclDecls.h | 26 ++++----- generic/tclDictObj.c | 58 ++++++++++---------- generic/tclDisassemble.c | 32 +++++------ generic/tclEncoding.c | 36 ++++++------ generic/tclEnsemble.c | 24 ++++---- generic/tclExecute.c | 52 +++++++++--------- generic/tclGet.c | 4 +- generic/tclIO.c | 40 +++++++------- generic/tclIndexObj.c | 32 +++++------ generic/tclInt.h | 24 ++++---- generic/tclLink.c | 6 +- generic/tclListObj.c | 140 +++++++++++++++++++++++------------------------ generic/tclLiteral.c | 6 +- generic/tclNamesp.c | 30 +++++----- generic/tclOOCall.c | 14 ++--- generic/tclOOMethod.c | 4 +- generic/tclObj.c | 56 +++++++++---------- generic/tclPathObj.c | 38 ++++++------- generic/tclProc.c | 72 ++++++++++++------------ generic/tclRegexp.c | 22 ++++---- generic/tclResult.c | 4 +- generic/tclScan.c | 4 +- generic/tclStrToD.c | 10 ++-- generic/tclStringObj.c | 28 +++++----- generic/tclStubInit.c | 6 +- generic/tclTest.c | 4 +- generic/tclUtil.c | 22 ++++---- generic/tclVar.c | 58 ++++++++++---------- macosx/tclMacOSXFCmd.c | 4 +- 39 files changed, 532 insertions(+), 528 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 5d2fc62..6bf669e 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2348,18 +2348,18 @@ declare 635 { # TIP #445 declare 636 { - void Tcl_FreeIntRep(Tcl_Obj *objPtr) + void Tcl_FreeInternalRep(Tcl_Obj *objPtr) } declare 637 { char *Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes) } declare 638 { - Tcl_ObjIntRep *Tcl_FetchIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr) + Tcl_ObjInternalRep *Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr) } declare 639 { - void Tcl_StoreIntRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, - const Tcl_ObjIntRep *irPtr) + void Tcl_StoreInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, + const Tcl_ObjInternalRep *irPtr) } declare 640 { int Tcl_HasStringRep(Tcl_Obj *objPtr) diff --git a/generic/tcl.h b/generic/tcl.h index 2d529b7..fa61efc 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -749,13 +749,13 @@ 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 + * The following structure stores an internal representation (internalrep) for + * a Tcl value. An internalrep 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. + * the handling of the internalrep. */ -typedef union Tcl_ObjIntRep { /* The internal representation: */ +typedef union Tcl_ObjInternalRep { /* The internal representation: */ long longValue; /* - an long integer value. */ double doubleValue; /* - a double-precision floating value. */ void *otherValuePtr; /* - another, type-specific value, */ @@ -769,7 +769,7 @@ typedef union Tcl_ObjIntRep { /* The internal representation: */ void *ptr; /* not used internally any more. */ unsigned long value; } ptrAndLongRep; -} Tcl_ObjIntRep; +} Tcl_ObjInternalRep; /* * One of the following structures exists for each object in the Tcl system. @@ -796,7 +796,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). */ - Tcl_ObjIntRep internalRep; /* The internal representation: */ + Tcl_ObjInternalRep internalRep; /* The internal representation: */ } Tcl_Obj; diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index a20cd1a..b429113 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -865,7 +865,7 @@ CompileAssembleObj( * is valid in the current context. */ - ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr); if (codePtr) { namespacePtr = iPtr->varFramePtr->nsPtr; @@ -882,7 +882,7 @@ CompileAssembleObj( * Not valid, so free it and regenerate. */ - Tcl_StoreIntRep(objPtr, &assembleCodeType, NULL); + Tcl_StoreInternalRep(objPtr, &assembleCodeType, NULL); } /* @@ -4289,7 +4289,7 @@ AddBasicBlockRangeToErrorInfo( * DupAssembleCodeInternalRep -- * * Part of the Tcl object type implementation for Tcl assembly language - * bytecode. We do not copy the bytecode intrep. Instead, we return + * bytecode. We do not copy the bytecode internalrep. Instead, we return * without setting copyPtr->typePtr, so the copy is a plain string copy * of the assembly source, and if it is to be used as a compiled * expression, it will need to be reprocessed. @@ -4298,7 +4298,7 @@ AddBasicBlockRangeToErrorInfo( * usual (only?) time Tcl_DuplicateObj() will be called is when the copy * is about to be modified, which would invalidate any copied bytecode * anyway. The only reason it might make sense to copy the bytecode is if - * we had some modifying routines that operated directly on the intrep, + * we had some modifying routines that operated directly on the internalrep, * as we do for lists and dicts. * * Results: @@ -4342,7 +4342,7 @@ FreeAssembleCodeInternalRep( { ByteCode *codePtr; - ByteCodeGetIntRep(objPtr, &assembleCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &assembleCodeType, codePtr); assert(codePtr != NULL); TclReleaseByteCode(codePtr); diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 69194f8..599366b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -3959,8 +3959,8 @@ OldMathFuncProc( result = Tcl_GetDoubleFromObj(NULL, valuePtr, &d); #ifdef ACCEPT_NAN if (result != TCL_OK) { - const Tcl_ObjIntRep *irPtr - = TclFetchIntRep(valuePtr, &tclDoubleType); + const Tcl_ObjInternalRep *irPtr + = TclFetchInternalRep(valuePtr, &tclDoubleType); if (irPtr) { d = irPtr->doubleValue; @@ -7537,7 +7537,7 @@ ExprCeilFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7577,7 +7577,7 @@ ExprFloorFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7723,7 +7723,7 @@ ExprSqrtFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { Tcl_SetObjResult(interp, objv[1]); @@ -7777,7 +7777,7 @@ ExprUnaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { d = irPtr->doubleValue; @@ -7841,7 +7841,7 @@ ExprBinaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[1], &d1); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { d1 = irPtr->doubleValue; @@ -7856,7 +7856,7 @@ ExprBinaryFunc( code = Tcl_GetDoubleFromObj(interp, objv[2], &d2); #ifdef ACCEPT_NAN if (code != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objv[1], &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objv[1], &tclDoubleType); if (irPtr) { d2 = irPtr->doubleValue; @@ -8017,7 +8017,7 @@ ExprDoubleFunc( } if (Tcl_GetDoubleFromObj(interp, objv[1], &dResult) != TCL_OK) { #ifdef ACCEPT_NAN - if (TclHasIntRep(objv[1], &tclDoubleType)) { + if (TclHasInternalRep(objv[1], &tclDoubleType)) { Tcl_SetObjResult(interp, objv[1]); return TCL_OK; } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 396beec..633bc1e 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -226,7 +226,7 @@ static const EnsembleImplMap decodeMap[] = { * implies a side testing burden -- past mistakes will not let us avoid that * immediately, but it is at least a conventional test of type, and can be * implemented entirely by examining the objPtr fields, with no need to query - * the intrep, as a canonical flag would require. + * the internalrep, as a canonical flag would require. * * Until Tcl_GetByteArrayFromObj() and Tcl_SetByteArrayLength() can be revised * to admit the possibility of returning NULL when the true value is not a @@ -289,7 +289,7 @@ int TclIsPureByteArray( Tcl_Obj * objPtr) { - return TclHasIntRep(objPtr, &properByteArrayType); + return TclHasInternalRep(objPtr, &properByteArrayType); } /* @@ -414,7 +414,7 @@ Tcl_SetByteArrayObj( * be >= 0. */ { ByteArray *byteArrayPtr; - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; if (Tcl_IsShared(objPtr)) { Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj"); @@ -434,7 +434,7 @@ Tcl_SetByteArrayObj( } SET_BYTEARRAY(&ir, byteArrayPtr); - Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir); + Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir); } /* @@ -462,17 +462,17 @@ TclGetBytesFromObj( * array of bytes in the ByteArray object. */ { ByteArray *baPtr; - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { SetByteArrayFromAny(NULL, objPtr); - irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { if (interp) { const char *nonbyte; int ucs4; - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); baPtr = GET_BYTEARRAY(irPtr); nonbyte = Tcl_UtfAtIndex(Tcl_GetString(objPtr), baPtr->bad); TclUtfToUCS4(nonbyte, &ucs4); @@ -519,14 +519,14 @@ Tcl_GetByteArrayFromObj( * array of bytes in the ByteArray object. */ { ByteArray *baPtr; - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; unsigned char *result = TclGetBytesFromObj(NULL, objPtr, lengthPtr); if (result) { return result; } - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); assert(irPtr != NULL); baPtr = GET_BYTEARRAY(irPtr); @@ -544,14 +544,14 @@ TclGetByteArrayFromObj( * array of bytes in the ByteArray object. */ { ByteArray *baPtr; - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; unsigned char *result = TclGetBytesFromObj(NULL, objPtr, (int *)NULL); if (result) { return result; } - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); assert(irPtr != NULL); baPtr = GET_BYTEARRAY(irPtr); @@ -595,7 +595,7 @@ Tcl_SetByteArrayLength( { ByteArray *byteArrayPtr; unsigned newLength; - Tcl_ObjIntRep *irPtr; + Tcl_ObjInternalRep *irPtr; assert(length >= 0); newLength = (unsigned int)length; @@ -604,14 +604,14 @@ Tcl_SetByteArrayLength( Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength"); } - irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); if (irPtr == NULL) { SetByteArrayFromAny(NULL, objPtr); - irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); } } } @@ -655,12 +655,12 @@ SetByteArrayFromAny( unsigned char *dst; Tcl_UniChar ch = 0; ByteArray *byteArrayPtr; - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; - if (TclHasIntRep(objPtr, &properByteArrayType)) { + if (TclHasInternalRep(objPtr, &properByteArrayType)) { return TCL_OK; } - if (TclHasIntRep(objPtr, &tclByteArrayType)) { + if (TclHasInternalRep(objPtr, &tclByteArrayType)) { return TCL_OK; } @@ -683,10 +683,10 @@ SetByteArrayFromAny( if (bad == length) { byteArrayPtr->bad = byteArrayPtr->used; - Tcl_StoreIntRep(objPtr, &properByteArrayType, &ir); + Tcl_StoreInternalRep(objPtr, &properByteArrayType, &ir); } else { byteArrayPtr->bad = bad; - Tcl_StoreIntRep(objPtr, &tclByteArrayType, &ir); + Tcl_StoreInternalRep(objPtr, &tclByteArrayType, &ir); } return TCL_OK; @@ -713,14 +713,14 @@ static void FreeByteArrayInternalRep( Tcl_Obj *objPtr) /* Object with internal rep to free. */ { - ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &tclByteArrayType))); + ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &tclByteArrayType))); } static void FreeProperByteArrayInternalRep( Tcl_Obj *objPtr) /* Object with internal rep to free. */ { - ckfree(GET_BYTEARRAY(TclFetchIntRep(objPtr, &properByteArrayType))); + ckfree(GET_BYTEARRAY(TclFetchInternalRep(objPtr, &properByteArrayType))); } /* @@ -747,9 +747,9 @@ DupByteArrayInternalRep( { unsigned int length; ByteArray *srcArrayPtr, *copyArrayPtr; - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; - srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &tclByteArrayType)); + srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &tclByteArrayType)); length = srcArrayPtr->used; copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length)); @@ -759,7 +759,7 @@ DupByteArrayInternalRep( memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length); SET_BYTEARRAY(&ir, copyArrayPtr); - Tcl_StoreIntRep(copyPtr, &tclByteArrayType, &ir); + Tcl_StoreInternalRep(copyPtr, &tclByteArrayType, &ir); } static void @@ -769,9 +769,9 @@ DupProperByteArrayInternalRep( { unsigned int length; ByteArray *srcArrayPtr, *copyArrayPtr; - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; - srcArrayPtr = GET_BYTEARRAY(TclFetchIntRep(srcPtr, &properByteArrayType)); + srcArrayPtr = GET_BYTEARRAY(TclFetchInternalRep(srcPtr, &properByteArrayType)); length = srcArrayPtr->used; copyArrayPtr = (ByteArray *)ckalloc(BYTEARRAY_SIZE(length)); @@ -781,7 +781,7 @@ DupProperByteArrayInternalRep( memcpy(copyArrayPtr->bytes, srcArrayPtr->bytes, length); SET_BYTEARRAY(&ir, copyArrayPtr); - Tcl_StoreIntRep(copyPtr, &properByteArrayType, &ir); + Tcl_StoreInternalRep(copyPtr, &properByteArrayType, &ir); } /* @@ -806,7 +806,7 @@ UpdateStringOfByteArray( Tcl_Obj *objPtr) /* ByteArray object whose string rep to * update. */ { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); ByteArray *byteArrayPtr = GET_BYTEARRAY(irPtr); unsigned char *src = byteArrayPtr->bytes; unsigned int i, length = byteArrayPtr->used; @@ -867,7 +867,7 @@ TclAppendBytesToByteArray( { ByteArray *byteArrayPtr; unsigned int length, needed; - Tcl_ObjIntRep *irPtr; + Tcl_ObjInternalRep *irPtr; if (Tcl_IsShared(objPtr)) { Tcl_Panic("%s called with shared object","TclAppendBytesToByteArray"); @@ -886,14 +886,14 @@ TclAppendBytesToByteArray( length = (unsigned int) len; - irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); if (irPtr == NULL) { SetByteArrayFromAny(NULL, objPtr); - irPtr = TclFetchIntRep(objPtr, &properByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &properByteArrayType); if (irPtr == NULL) { - irPtr = TclFetchIntRep(objPtr, &tclByteArrayType); + irPtr = TclFetchInternalRep(objPtr, &tclByteArrayType); } } } @@ -2158,7 +2158,7 @@ FormatNumber( */ if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType); if (irPtr == NULL) { return TCL_ERROR; } @@ -2178,7 +2178,7 @@ FormatNumber( */ if (Tcl_GetDoubleFromObj(interp, src, &dvalue) != TCL_OK) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(src, &tclDoubleType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(src, &tclDoubleType); if (irPtr == NULL) { return TCL_ERROR; diff --git a/generic/tclClock.c b/generic/tclClock.c index 90a998d..4473f74 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -452,7 +452,7 @@ ClockGetdatefieldsObjCmd( * that it isn't. */ - if (TclHasIntRep(objv[1], &tclBignumType)) { + if (TclHasInternalRep(objv[1], &tclBignumType)) { Tcl_SetObjResult(interp, lit[LIT_INTEGER_VALUE_TOO_LARGE]); return TCL_ERROR; } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index d37f5bf..f8f0004 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1611,7 +1611,7 @@ StringIsCmd( case STR_IS_BOOL: case STR_IS_TRUE: case STR_IS_FALSE: - if (!TclHasIntRep(objPtr, &tclBooleanType) + if (!TclHasInternalRep(objPtr, &tclBooleanType) && (TCL_OK != TclSetBooleanFromAny(NULL, objPtr))) { if (strict) { result = 0; @@ -1681,9 +1681,9 @@ StringIsCmd( chcomp = Tcl_UniCharIsDigit; break; case STR_IS_DOUBLE: { - if (TclHasIntRep(objPtr, &tclDoubleType) || - TclHasIntRep(objPtr, &tclIntType) || - TclHasIntRep(objPtr, &tclBignumType)) { + if (TclHasInternalRep(objPtr, &tclDoubleType) || + TclHasInternalRep(objPtr, &tclIntType) || + TclHasInternalRep(objPtr, &tclBignumType)) { break; } string1 = TclGetStringFromObj(objPtr, &length1); @@ -1702,7 +1702,7 @@ StringIsCmd( failat = stop - string1; if (stop < end) { result = 0; - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); } } break; @@ -1712,8 +1712,8 @@ StringIsCmd( break; case STR_IS_INT: case STR_IS_ENTIER: - if (TclHasIntRep(objPtr, &tclIntType) || - TclHasIntRep(objPtr, &tclBignumType)) { + if (TclHasInternalRep(objPtr, &tclIntType) || + TclHasInternalRep(objPtr, &tclBignumType)) { break; } string1 = TclGetStringFromObj(objPtr, &length1); @@ -1742,7 +1742,7 @@ StringIsCmd( result = 0; failat = stop - string1; - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); } } else { /* @@ -1795,7 +1795,7 @@ StringIsCmd( */ failat = stop - string1; - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); } } else { /* @@ -1990,7 +1990,7 @@ StringMapCmd( */ if (!TclHasStringRep(objv[objc-2]) - && TclHasIntRep(objv[objc-2], &tclDictType)) { + && TclHasInternalRep(objv[objc-2], &tclDictType)) { int i, done; Tcl_DictSearch search; diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 03aebe3..23d8711 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2109,7 +2109,7 @@ ParseLexeme( * Example: Inf + luence + () becomes a valid function call. * [Bug 3401704] */ - if (TclHasIntRep(literal, &tclDoubleType)) { + if (TclHasInternalRep(literal, &tclDoubleType)) { const char *p = start; while (p < end) { @@ -2520,7 +2520,7 @@ CompileExprTree( * However, the design of the "global" and "local" * LiteralTable does not permit the value of lePtr->objPtr * to change. So rather than replace lePtr->objPtr, we do - * surgery to transfer our desired intrep into it. + * surgery to transfer our desired internalrep into it. */ objPtr->typePtr = literal->typePtr; @@ -2533,9 +2533,9 @@ CompileExprTree( * When optimize==0, we know the expression is a one-off and * there's nothing to be gained from sharing literals when * they won't live long, and the copies we have already have - * an appropriate intrep. In this case, skip literal + * an appropriate internalrep. In this case, skip literal * registration that would enable sharing, and use the routine - * that preserves intreps. + * that preserves internalreps. */ TclEmitPush(TclAddLiteralObj(envPtr, literal, NULL), envPtr); @@ -2572,7 +2572,7 @@ CompileExprTree( if ((tableValue->typePtr == NULL) && (objPtr->typePtr != NULL)) { /* - * Same intrep surgery as for OT_LITERAL. + * Same internalrep surgery as for OT_LITERAL. */ tableValue->typePtr = objPtr->typePtr; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index f966979..5b047b3 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -990,7 +990,7 @@ FreeByteCodeInternalRep( { ByteCode *codePtr; - ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr); assert(codePtr != NULL); TclReleaseByteCode(codePtr); @@ -1320,7 +1320,7 @@ CompileSubstObj( Interp *iPtr = (Interp *) interp; ByteCode *codePtr = NULL; - ByteCodeGetIntRep(objPtr, &substCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr); if (codePtr != NULL) { Namespace *nsPtr = iPtr->varFramePtr->nsPtr; @@ -1332,7 +1332,7 @@ CompileSubstObj( || (codePtr->nsEpoch != nsPtr->resolverEpoch) || (codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr)) { - Tcl_StoreIntRep(objPtr, &substCodeType, NULL); + Tcl_StoreInternalRep(objPtr, &substCodeType, NULL); codePtr = NULL; } } @@ -1391,7 +1391,7 @@ FreeSubstCodeInternalRep( { ByteCode *codePtr; - ByteCodeGetIntRep(objPtr, &substCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &substCodeType, codePtr); assert(codePtr != NULL); TclReleaseByteCode(codePtr); @@ -2784,7 +2784,7 @@ PreventCycle( for (i = 0; i < envPtr->literalArrayNext; i++) { if (objPtr == TclFetchLiteral(envPtr, i)) { /* - * Prevent circular reference where the bytecode intrep of + * Prevent circular reference where the bytecode internalrep of * a value contains a literal which is that same value. * If this is allowed to happen, refcount decrements may not * reach zero, and memory may leak. Bugs 467523, 3357771 @@ -2792,7 +2792,7 @@ PreventCycle( * NOTE: [Bugs 3392070, 3389764] We make a copy based completely * on the string value, and do not call Tcl_DuplicateObj() so we * can be sure we do not have any lingering cycles hiding in - * the intrep. + * the internalrep. */ int numBytes; const char *bytes = TclGetStringFromObj(objPtr, &numBytes); @@ -2963,7 +2963,7 @@ TclInitByteCodeObj( * by making its internal rep point to the just compiled ByteCode. */ - ByteCodeSetIntRep(objPtr, typePtr, codePtr); + ByteCodeSetInternalRep(objPtr, typePtr, codePtr); return codePtr; } diff --git a/generic/tclCompile.h b/generic/tclCompile.h index 6a5faaf..96a3541 100644 --- a/generic/tclCompile.h +++ b/generic/tclCompile.h @@ -217,9 +217,9 @@ typedef struct ExtCmdLoc { * the AuxData structure. */ -typedef ClientData (AuxDataDupProc) (ClientData clientData); -typedef void (AuxDataFreeProc) (ClientData clientData); -typedef void (AuxDataPrintProc)(ClientData clientData, +typedef void *(AuxDataDupProc) (void *clientData); +typedef void (AuxDataFreeProc) (void *clientData); +typedef void (AuxDataPrintProc)(void *clientData, Tcl_Obj *appendObj, struct ByteCode *codePtr, unsigned int pcOffset); @@ -515,20 +515,20 @@ typedef struct ByteCode { #endif /* TCL_COMPILE_STATS */ } ByteCode; -#define ByteCodeSetIntRep(objPtr, typePtr, codePtr) \ +#define ByteCodeSetInternalRep(objPtr, typePtr, codePtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (codePtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), (typePtr), &ir); \ + Tcl_StoreInternalRep((objPtr), (typePtr), &ir); \ } while (0) -#define ByteCodeGetIntRep(objPtr, typePtr, codePtr) \ +#define ByteCodeGetInternalRep(objPtr, typePtr, codePtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), (typePtr)); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), (typePtr)); \ (codePtr) = irPtr ? (ByteCode*)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -1118,7 +1118,7 @@ MODULE_SCOPE void TclCompileTokens(Tcl_Interp *interp, CompileEnv *envPtr); MODULE_SCOPE void TclCompileVarSubst(Tcl_Interp *interp, Tcl_Token *tokenPtr, CompileEnv *envPtr); -MODULE_SCOPE int TclCreateAuxData(ClientData clientData, +MODULE_SCOPE int TclCreateAuxData(void *clientData, const AuxDataType *typePtr, CompileEnv *envPtr); MODULE_SCOPE int TclCreateExceptRange(ExceptionRangeType type, CompileEnv *envPtr); @@ -1192,16 +1192,16 @@ MODULE_SCOPE void TclReleaseByteCode(ByteCode *codePtr); MODULE_SCOPE void TclReleaseLiteral(Tcl_Interp *interp, Tcl_Obj *objPtr); MODULE_SCOPE void TclInvalidateCmdLiteral(Tcl_Interp *interp, const char *name, Namespace *nsPtr); -MODULE_SCOPE int TclSingleOpCmd(ClientData clientData, +MODULE_SCOPE int TclSingleOpCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int TclSortingOpCmd(ClientData clientData, +MODULE_SCOPE int TclSortingOpCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int TclVariadicOpCmd(ClientData clientData, +MODULE_SCOPE int TclVariadicOpCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int TclNoIdentOpCmd(ClientData clientData, +MODULE_SCOPE int TclNoIdentOpCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); #ifdef TCL_COMPILE_DEBUG @@ -1217,7 +1217,7 @@ MODULE_SCOPE void TclLogCommandInfo(Tcl_Interp *interp, MODULE_SCOPE Tcl_Obj *TclGetInnerContext(Tcl_Interp *interp, const unsigned char *pc, Tcl_Obj **tosPtr); MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst); -MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, +MODULE_SCOPE int TclPushProcCallFrame(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], int isLambda); @@ -1232,7 +1232,7 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, /* * Simplified form to access AuxData. * - * ClientData TclFetchAuxData(CompileEng *envPtr, int index); + * void *TclFetchAuxData(CompileEng *envPtr, int index); */ #define TclFetchAuxData(envPtr, index) \ @@ -1557,9 +1557,9 @@ MODULE_SCOPE int TclPushProcCallFrame(ClientData clientData, */ #define PushLiteral(envPtr, string, length) \ - TclEmitPush(TclRegisterLiteral(envPtr, string, length, 0), (envPtr)) + TclEmitPush(TclRegisterLiteral((envPtr), (string), (length), 0), (envPtr)) #define PushStringLiteral(envPtr, string) \ - PushLiteral(envPtr, string, (int) (sizeof(string "") - 1)) + PushLiteral((envPtr), (string), (int) (sizeof(string "") - 1)) /* * Macro to advance to the next token; it is more mnemonic than the address diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 7d2e202..f833206 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1886,17 +1886,17 @@ EXTERN int TclZipfs_MountBuffer(Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 636 */ -EXTERN void Tcl_FreeIntRep(Tcl_Obj *objPtr); +EXTERN void Tcl_FreeInternalRep(Tcl_Obj *objPtr); /* 637 */ EXTERN char * Tcl_InitStringRep(Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes); /* 638 */ -EXTERN Tcl_ObjIntRep * Tcl_FetchIntRep(Tcl_Obj *objPtr, +EXTERN Tcl_ObjInternalRep * Tcl_FetchInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 639 */ -EXTERN void Tcl_StoreIntRep(Tcl_Obj *objPtr, +EXTERN void Tcl_StoreInternalRep(Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, - const Tcl_ObjIntRep *irPtr); + const Tcl_ObjInternalRep *irPtr); /* 640 */ EXTERN int Tcl_HasStringRep(Tcl_Obj *objPtr); /* 641 */ @@ -2615,10 +2615,10 @@ typedef struct TclStubs { int (*tclZipfs_Unmount) (Tcl_Interp *interp, const char *mountPoint); /* 633 */ Tcl_Obj * (*tclZipfs_TclLibrary) (void); /* 634 */ int (*tclZipfs_MountBuffer) (Tcl_Interp *interp, const char *mountPoint, unsigned char *data, size_t datalen, int copy); /* 635 */ - void (*tcl_FreeIntRep) (Tcl_Obj *objPtr); /* 636 */ + void (*tcl_FreeInternalRep) (Tcl_Obj *objPtr); /* 636 */ char * (*tcl_InitStringRep) (Tcl_Obj *objPtr, const char *bytes, unsigned int numBytes); /* 637 */ - Tcl_ObjIntRep * (*tcl_FetchIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */ - void (*tcl_StoreIntRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjIntRep *irPtr); /* 639 */ + Tcl_ObjInternalRep * (*tcl_FetchInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr); /* 638 */ + void (*tcl_StoreInternalRep) (Tcl_Obj *objPtr, const Tcl_ObjType *typePtr, const Tcl_ObjInternalRep *irPtr); /* 639 */ int (*tcl_HasStringRep) (Tcl_Obj *objPtr); /* 640 */ void (*tcl_IncrRefCount) (Tcl_Obj *objPtr); /* 641 */ void (*tcl_DecrRefCount) (Tcl_Obj *objPtr); /* 642 */ @@ -3942,14 +3942,14 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tclZipfs_TclLibrary) /* 634 */ #define TclZipfs_MountBuffer \ (tclStubsPtr->tclZipfs_MountBuffer) /* 635 */ -#define Tcl_FreeIntRep \ - (tclStubsPtr->tcl_FreeIntRep) /* 636 */ +#define Tcl_FreeInternalRep \ + (tclStubsPtr->tcl_FreeInternalRep) /* 636 */ #define Tcl_InitStringRep \ (tclStubsPtr->tcl_InitStringRep) /* 637 */ -#define Tcl_FetchIntRep \ - (tclStubsPtr->tcl_FetchIntRep) /* 638 */ -#define Tcl_StoreIntRep \ - (tclStubsPtr->tcl_StoreIntRep) /* 639 */ +#define Tcl_FetchInternalRep \ + (tclStubsPtr->tcl_FetchInternalRep) /* 638 */ +#define Tcl_StoreInternalRep \ + (tclStubsPtr->tcl_StoreInternalRep) /* 639 */ #define Tcl_HasStringRep \ (tclStubsPtr->tcl_HasStringRep) /* 640 */ #define Tcl_IncrRefCount \ diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index a0ce8a4..900974f 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -149,18 +149,18 @@ const Tcl_ObjType tclDictType = { SetDictFromAny /* setFromAnyProc */ }; -#define DictSetIntRep(objPtr, dictRepPtr) \ +#define DictSetInternalRep(objPtr, dictRepPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (dictRepPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &tclDictType, &ir); \ + Tcl_StoreInternalRep((objPtr), &tclDictType, &ir); \ } while (0) -#define DictGetIntRep(objPtr, dictRepPtr) \ +#define DictGetInternalRep(objPtr, dictRepPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &tclDictType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &tclDictType); \ (dictRepPtr) = irPtr ? (Dict *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -362,7 +362,7 @@ DupDictInternalRep( Dict *oldDict, *newDict = (Dict *)ckalloc(sizeof(Dict)); ChainEntry *cPtr; - DictGetIntRep(srcPtr, oldDict); + DictGetInternalRep(srcPtr, oldDict); /* * Copy values across from the old hash table. @@ -395,7 +395,7 @@ DupDictInternalRep( * Store in the object. */ - DictSetIntRep(copyPtr, newDict); + DictSetInternalRep(copyPtr, newDict); } /* @@ -422,7 +422,7 @@ FreeDictInternalRep( { Dict *dict; - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); if (dict->refCount-- <= 1) { DeleteDict(dict); @@ -499,7 +499,7 @@ UpdateStringOfDict( int numElems; - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); assert (dict != NULL); @@ -610,7 +610,7 @@ SetDictFromAny( * the conversion from lists to dictionaries. */ - if (TclHasIntRep(objPtr, &tclListType)) { + if (TclHasInternalRep(objPtr, &tclListType)) { int objc, i; Tcl_Obj **objv; @@ -717,7 +717,7 @@ SetDictFromAny( dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; - DictSetIntRep(objPtr, dict); + DictSetInternalRep(objPtr, dict); return TCL_OK; missingValue: @@ -739,12 +739,12 @@ GetDictFromObj( { Dict *dict; - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); if (dict == NULL) { if (SetDictFromAny(interp, dictPtr) != TCL_OK) { return NULL; } - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); } return dict; } @@ -792,12 +792,12 @@ TclTraceDictPath( Dict *dict, *newDict; int i; - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); if (dict == NULL) { if (SetDictFromAny(interp, dictPtr) != TCL_OK) { return NULL; } - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); } if (flags & DICT_PATH_UPDATE) { dict->chain = NULL; @@ -835,7 +835,7 @@ TclTraceDictPath( } else { tmpObj = (Tcl_Obj *)Tcl_GetHashValue(hPtr); - DictGetIntRep(tmpObj, newDict); + DictGetInternalRep(tmpObj, newDict); if (newDict == NULL) { if (SetDictFromAny(interp, tmpObj) != TCL_OK) { @@ -844,7 +844,7 @@ TclTraceDictPath( } } - DictGetIntRep(tmpObj, newDict); + DictGetInternalRep(tmpObj, newDict); if (flags & DICT_PATH_UPDATE) { if (Tcl_IsShared(tmpObj)) { TclDecrRefCount(tmpObj); @@ -852,7 +852,7 @@ TclTraceDictPath( Tcl_IncrRefCount(tmpObj); Tcl_SetHashValue(hPtr, tmpObj); dict->epoch++; - DictGetIntRep(tmpObj, newDict); + DictGetInternalRep(tmpObj, newDict); } newDict->chain = dictPtr; @@ -889,14 +889,14 @@ InvalidateDictChain( { Dict *dict; - DictGetIntRep(dictObj, dict); + DictGetInternalRep(dictObj, dict); assert( dict != NULL); do { dict->refCount++; TclInvalidateStringRep(dictObj); - TclFreeIntRep(dictObj); - DictSetIntRep(dictObj, dict); + TclFreeInternalRep(dictObj); + DictSetInternalRep(dictObj, dict); dict->epoch++; dictObj = dict->chain; @@ -904,7 +904,7 @@ InvalidateDictChain( break; } dict->chain = NULL; - DictGetIntRep(dictObj, dict); + DictGetInternalRep(dictObj, dict); } while (dict != NULL); } @@ -950,8 +950,8 @@ Tcl_DictObjPut( TclInvalidateStringRep(dictPtr); hPtr = CreateChainEntry(dict, keyPtr, &isNew); dict->refCount++; - TclFreeIntRep(dictPtr) - DictSetIntRep(dictPtr, dict); + TclFreeInternalRep(dictPtr) + DictSetInternalRep(dictPtr, dict); Tcl_IncrRefCount(valuePtr); if (!isNew) { Tcl_Obj *oldValuePtr = (Tcl_Obj *)Tcl_GetHashValue(hPtr); @@ -1306,7 +1306,7 @@ Tcl_DictObjPutKeyList( return TCL_ERROR; } - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); assert(dict != NULL); hPtr = CreateChainEntry(dict, keyv[keyc-1], &isNew); Tcl_IncrRefCount(valuePtr); @@ -1364,7 +1364,7 @@ Tcl_DictObjRemoveKeyList( return TCL_ERROR; } - DictGetIntRep(dictPtr, dict); + DictGetInternalRep(dictPtr, dict); assert(dict != NULL); DeleteChainEntry(dict, keyv[keyc-1]); InvalidateDictChain(dictPtr); @@ -1411,7 +1411,7 @@ Tcl_NewDictObj(void) dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; - DictSetIntRep(dictPtr, dict); + DictSetInternalRep(dictPtr, dict); return dictPtr; #endif } @@ -1459,7 +1459,7 @@ Tcl_DbNewDictObj( dict->epoch = 1; dict->chain = NULL; dict->refCount = 1; - DictSetIntRep(dictPtr, dict); + DictSetInternalRep(dictPtr, dict); return dictPtr; } #else /* !TCL_MEM_DEBUG */ diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index f5cc8b7..7bc1c97 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -44,17 +44,17 @@ static const Tcl_ObjType instNameType = { NULL, /* setFromAnyProc */ }; -#define InstNameSetIntRep(objPtr, inst) \ +#define InstNameSetInternalRep(objPtr, inst) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.wideValue = (inst); \ - Tcl_StoreIntRep((objPtr), &instNameType, &ir); \ + Tcl_StoreInternalRep((objPtr), &instNameType, &ir); \ } while (0) -#define InstNameGetIntRep(objPtr, inst) \ +#define InstNameGetInternalRep(objPtr, inst) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &instNameType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &instNameType); \ assert(irPtr != NULL); \ (inst) = (size_t)irPtr->wideValue; \ } while (0) @@ -259,7 +259,7 @@ DisassembleByteCodeObj( Interp *iPtr; Tcl_Obj *bufferObj, *fileObj; - ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr); iPtr = (Interp *) *codePtr->interpHandle; @@ -761,7 +761,7 @@ TclGetInnerContext( int len; /* - * Reset while keeping the list intrep as much as possible. + * Reset while keeping the list internalrep as much as possible. */ Tcl_ListObjLength(interp, result, &len); @@ -808,7 +808,7 @@ TclNewInstNameObj( TclNewObj(objPtr); TclInvalidateStringRep(objPtr); - InstNameSetIntRep(objPtr, (long) inst); + InstNameSetInternalRep(objPtr, (long) inst); return objPtr; } @@ -830,7 +830,7 @@ UpdateStringOfInstName( size_t inst; /* NOTE: We know this is really an unsigned char */ char *dst; - InstNameGetIntRep(objPtr, inst); + InstNameGetInternalRep(objPtr, inst); if (inst > LAST_INST_OPCODE) { dst = Tcl_InitStringRep(objPtr, NULL, TCL_INTEGER_SPACE + 5); @@ -945,7 +945,7 @@ DisassembleByteCodeAsDicts( int codeOffset, codeLength, sourceOffset, sourceLength; int i, val, line; - ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr); /* * Get the literals from the bytecode. @@ -1368,7 +1368,7 @@ Tcl_DisassembleObjCmd( return TCL_ERROR; } - if (!TclHasIntRep(objv[2], &tclByteCodeType) && (TCL_OK + if (!TclHasInternalRep(objv[2], &tclByteCodeType) && (TCL_OK != TclSetByteCodeFromAny(interp, objv[2], NULL, NULL))) { return TCL_ERROR; } @@ -1419,7 +1419,7 @@ Tcl_DisassembleObjCmd( * Compile if necessary. */ - if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) { + if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) { Command cmd; /* @@ -1484,7 +1484,7 @@ Tcl_DisassembleObjCmd( * Compile if necessary. */ - if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) { + if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) { Command cmd; /* @@ -1569,7 +1569,7 @@ Tcl_DisassembleObjCmd( "METHODTYPE", NULL); return TCL_ERROR; } - if (!TclHasIntRep(procPtr->bodyPtr, &tclByteCodeType)) { + if (!TclHasInternalRep(procPtr->bodyPtr, &tclByteCodeType)) { Command cmd; /* @@ -1597,7 +1597,7 @@ Tcl_DisassembleObjCmd( * Do the actual disassembly. */ - ByteCodeGetIntRep(codeObjPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(codeObjPtr, &tclByteCodeType, codePtr); if (codePtr->flags & TCL_BYTECODE_PRECOMPILED) { Tcl_SetObjResult(interp, Tcl_NewStringObj( diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 9367863..61a931d 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -196,13 +196,13 @@ static unsigned short emptyPage[256]; */ static Tcl_EncodingConvertProc BinaryProc; -static Tcl_DupInternalRepProc DupEncodingIntRep; +static Tcl_DupInternalRepProc DupEncodingInternalRep; static Tcl_EncodingFreeProc EscapeFreeProc; static Tcl_EncodingConvertProc EscapeFromUtfProc; static Tcl_EncodingConvertProc EscapeToUtfProc; static void FillEncodingFileMap(void); static void FreeEncoding(Tcl_Encoding encoding); -static Tcl_FreeInternalRepProc FreeEncodingIntRep; +static Tcl_FreeInternalRepProc FreeEncodingInternalRep; static Encoding * GetTableEncoding(EscapeEncodingData *dataPtr, int state); static Tcl_Encoding LoadEncodingFile(Tcl_Interp *interp, @@ -226,25 +226,25 @@ static Tcl_EncodingConvertProc Iso88591ToUtfProc; /* * A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field - * of the intrep. This should help the lifetime of encodings be more useful. + * of the internalrep. This should help the lifetime of encodings be more useful. * See concerns raised in [Bug 1077262]. */ static const Tcl_ObjType encodingType = { - "encoding", FreeEncodingIntRep, DupEncodingIntRep, NULL, NULL + "encoding", FreeEncodingInternalRep, DupEncodingInternalRep, NULL, NULL }; -#define EncodingSetIntRep(objPtr, encoding) \ +#define EncodingSetInternalRep(objPtr, encoding) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (encoding); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &encodingType, &ir); \ + Tcl_StoreInternalRep((objPtr), &encodingType, &ir); \ } while (0) -#define EncodingGetIntRep(objPtr, encoding) \ +#define EncodingGetInternalRep(objPtr, encoding) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep ((objPtr), &encodingType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep ((objPtr), &encodingType); \ (encoding) = irPtr ? (Tcl_Encoding)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -277,13 +277,13 @@ Tcl_GetEncodingFromObj( Tcl_Encoding encoding; const char *name = TclGetString(objPtr); - EncodingGetIntRep(objPtr, encoding); + EncodingGetInternalRep(objPtr, encoding); if (encoding == NULL) { encoding = Tcl_GetEncoding(interp, name); if (encoding == NULL) { return TCL_ERROR; } - EncodingSetIntRep(objPtr, encoding); + EncodingSetInternalRep(objPtr, encoding); } *encodingPtr = Tcl_GetEncoding(NULL, name); return TCL_OK; @@ -292,7 +292,7 @@ Tcl_GetEncodingFromObj( /* *---------------------------------------------------------------------- * - * FreeEncodingIntRep -- + * FreeEncodingInternalRep -- * * The Tcl_FreeInternalRepProc for the "encoding" Tcl_ObjType. * @@ -300,19 +300,19 @@ Tcl_GetEncodingFromObj( */ static void -FreeEncodingIntRep( +FreeEncodingInternalRep( Tcl_Obj *objPtr) { Tcl_Encoding encoding; - EncodingGetIntRep(objPtr, encoding); + EncodingGetInternalRep(objPtr, encoding); Tcl_FreeEncoding(encoding); } /* *---------------------------------------------------------------------- * - * DupEncodingIntRep -- + * DupEncodingInternalRep -- * * The Tcl_DupInternalRepProc for the "encoding" Tcl_ObjType. * @@ -320,12 +320,12 @@ FreeEncodingIntRep( */ static void -DupEncodingIntRep( +DupEncodingInternalRep( Tcl_Obj *srcPtr, Tcl_Obj *dupPtr) { Tcl_Encoding encoding = Tcl_GetEncoding(NULL, TclGetString(srcPtr)); - EncodingSetIntRep(dupPtr, encoding); + EncodingSetInternalRep(dupPtr, encoding); } /* diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 7d060b0..850d5d0 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -84,18 +84,18 @@ static const Tcl_ObjType ensembleCmdType = { NULL /* setFromAnyProc */ }; -#define ECRSetIntRep(objPtr, ecRepPtr) \ +#define ECRSetInternalRep(objPtr, ecRepPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (ecRepPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &ensembleCmdType, &ir); \ + Tcl_StoreInternalRep((objPtr), &ensembleCmdType, &ir); \ } while (0) -#define ECRGetIntRep(objPtr, ecRepPtr) \ +#define ECRGetInternalRep(objPtr, ecRepPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &ensembleCmdType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &ensembleCmdType); \ (ecRepPtr) = irPtr ? (EnsembleCmdRep *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -1759,7 +1759,7 @@ NsEnsembleImplementationCmdNR( */ EnsembleCmdRep *ensembleCmd; - ECRGetIntRep(subObj, ensembleCmd); + ECRGetInternalRep(subObj, ensembleCmd); if (ensembleCmd) { if (ensembleCmd->epoch == ensemblePtr->epoch && ensembleCmd->token == (Command *)ensemblePtr->token) { @@ -2424,7 +2424,7 @@ MakeCachedEnsembleCommand( { EnsembleCmdRep *ensembleCmd; - ECRGetIntRep(objPtr, ensembleCmd); + ECRGetInternalRep(objPtr, ensembleCmd); if (ensembleCmd) { TclCleanupCommandMacro(ensembleCmd->token); if (ensembleCmd->fix) { @@ -2437,7 +2437,7 @@ MakeCachedEnsembleCommand( */ ensembleCmd = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep)); - ECRSetIntRep(objPtr, ensembleCmd); + ECRSetInternalRep(objPtr, ensembleCmd); } /* @@ -2847,7 +2847,7 @@ FreeEnsembleCmdRep( { EnsembleCmdRep *ensembleCmd; - ECRGetIntRep(objPtr, ensembleCmd); + ECRGetInternalRep(objPtr, ensembleCmd); TclCleanupCommandMacro(ensembleCmd->token); if (ensembleCmd->fix) { Tcl_DecrRefCount(ensembleCmd->fix); @@ -2881,8 +2881,8 @@ DupEnsembleCmdRep( EnsembleCmdRep *ensembleCmd; EnsembleCmdRep *ensembleCopy = (EnsembleCmdRep *)ckalloc(sizeof(EnsembleCmdRep)); - ECRGetIntRep(objPtr, ensembleCmd); - ECRSetIntRep(copyPtr, ensembleCopy); + ECRGetInternalRep(objPtr, ensembleCmd); + ECRSetInternalRep(copyPtr, ensembleCopy); ensembleCopy->epoch = ensembleCmd->epoch; ensembleCopy->token = ensembleCmd->token; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 7e51c0d..73bd0e9 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -509,11 +509,11 @@ VarHashCreateVar( */ #define GetNumberFromObj(interp, objPtr, ptrPtr, tPtr) \ - ((TclHasIntRep((objPtr), &tclIntType)) \ + ((TclHasInternalRep((objPtr), &tclIntType)) \ ? (*(tPtr) = TCL_NUMBER_INT, \ *(ptrPtr) = (ClientData) \ (&((objPtr)->internalRep.wideValue)), TCL_OK) : \ - TclHasIntRep((objPtr), &tclDoubleType) \ + TclHasInternalRep((objPtr), &tclDoubleType) \ ? (((TclIsNaN((objPtr)->internalRep.doubleValue)) \ ? (*(tPtr) = TCL_NUMBER_NAN) \ : (*(tPtr) = TCL_NUMBER_DOUBLE)), \ @@ -759,9 +759,9 @@ ReleaseDictIterator( { Tcl_DictSearch *searchPtr; Tcl_Obj *dictPtr; - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; - irPtr = TclFetchIntRep(objPtr, &dictIteratorType); + irPtr = TclFetchInternalRep(objPtr, &dictIteratorType); assert(irPtr != NULL); /* @@ -1474,7 +1474,7 @@ CompileExprObj( * is valid in the current context. */ - ByteCodeGetIntRep(objPtr, &exprCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &exprCodeType, codePtr); if (codePtr != NULL) { Namespace *namespacePtr = iPtr->varFramePtr->nsPtr; @@ -1484,7 +1484,7 @@ CompileExprObj( || (codePtr->nsPtr != namespacePtr) || (codePtr->nsEpoch != namespacePtr->resolverEpoch) || (codePtr->localCachePtr != iPtr->varFramePtr->localCachePtr)) { - Tcl_StoreIntRep(objPtr, &exprCodeType, NULL); + Tcl_StoreInternalRep(objPtr, &exprCodeType, NULL); codePtr = NULL; } } @@ -1538,7 +1538,7 @@ CompileExprObj( * DupExprCodeInternalRep -- * * Part of the Tcl object type implementation for Tcl expression - * bytecode. We do not copy the bytecode intrep. Instead, we return + * bytecode. We do not copy the bytecode internalrep. Instead, we return * without setting copyPtr->typePtr, so the copy is a plain string copy * of the expression value, and if it is to be used as a compiled * expression, it will just need a recompile. @@ -1547,7 +1547,7 @@ CompileExprObj( * usual (only?) time Tcl_DuplicateObj() will be called is when the copy * is about to be modified, which would invalidate any copied bytecode * anyway. The only reason it might make sense to copy the bytecode is if - * we had some modifying routines that operated directly on the intrep, + * we had some modifying routines that operated directly on the internalrep, * like we do for lists and dicts. * * Results: @@ -1590,7 +1590,7 @@ FreeExprCodeInternalRep( Tcl_Obj *objPtr) { ByteCode *codePtr; - ByteCodeGetIntRep(objPtr, &exprCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &exprCodeType, codePtr); assert(codePtr != NULL); TclReleaseByteCode(codePtr); @@ -1629,7 +1629,7 @@ TclCompileObj( * compilation). Otherwise, check that it is "fresh" enough. */ - ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr); if (codePtr != NULL) { /* * Make sure the Bytecode hasn't been invalidated by, e.g., someone @@ -1775,7 +1775,7 @@ TclCompileObj( iPtr->invokeWord = word; TclSetByteCodeFromAny(interp, objPtr, NULL, NULL); iPtr->invokeCmdFramePtr = NULL; - ByteCodeGetIntRep(objPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(objPtr, &tclByteCodeType, codePtr); if (iPtr->varFramePtr->localCachePtr) { codePtr->localCachePtr = iPtr->varFramePtr->localCachePtr; codePtr->localCachePtr->refCount++; @@ -4864,7 +4864,7 @@ TEBCresume( */ if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK) - && !TclHasIntRep(value2Ptr, &tclListType)) { + && !TclHasInternalRep(value2Ptr, &tclListType)) { int code; DECACHE_STACK_INFO(); @@ -5262,7 +5262,7 @@ TEBCresume( } else { length = Tcl_UtfToUpper(TclGetString(valuePtr)); Tcl_SetObjLength(valuePtr, length); - TclFreeIntRep(valuePtr); + TclFreeInternalRep(valuePtr); TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr))); NEXT_INST_F(1, 0, 0); } @@ -5279,7 +5279,7 @@ TEBCresume( } else { length = Tcl_UtfToLower(TclGetString(valuePtr)); Tcl_SetObjLength(valuePtr, length); - TclFreeIntRep(valuePtr); + TclFreeInternalRep(valuePtr); TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr))); NEXT_INST_F(1, 0, 0); } @@ -5296,7 +5296,7 @@ TEBCresume( } else { length = Tcl_UtfToTitle(TclGetString(valuePtr)); Tcl_SetObjLength(valuePtr, length); - TclFreeIntRep(valuePtr); + TclFreeInternalRep(valuePtr); TRACE_APPEND(("\"%.20s\"\n", O2S(valuePtr))); NEXT_INST_F(1, 0, 0); } @@ -5610,8 +5610,8 @@ TEBCresume( * both. */ - if (TclHasIntRep(valuePtr, &tclStringType) - || TclHasIntRep(value2Ptr, &tclStringType)) { + if (TclHasInternalRep(valuePtr, &tclStringType) + || TclHasInternalRep(value2Ptr, &tclStringType)) { Tcl_UniChar *ustring1, *ustring2; ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length); @@ -6400,7 +6400,7 @@ TEBCresume( if (Tcl_IsShared(valuePtr)) { /* * Here we do some surgery within the Tcl_Obj internals. We want - * to copy the intrep, but not the string, so we temporarily hide + * to copy the internalrep, but not the string, so we temporarily hide * the string so we do not copy it. */ @@ -6425,7 +6425,7 @@ TEBCresume( case INST_TRY_CVT_TO_BOOLEAN: valuePtr = OBJ_AT_TOS; - if (TclHasIntRep(valuePtr, &tclBooleanType)) { + if (TclHasInternalRep(valuePtr, &tclBooleanType)) { objResultPtr = TCONST(1); } else { int res = (TclSetBooleanFromAny(NULL, valuePtr) == TCL_OK); @@ -7260,7 +7260,7 @@ TEBCresume( /* * dictPtr is no longer on the stack, and we're not - * moving it into the intrep of an iterator. We need + * moving it into the internalrep of an iterator. We need * to drop the refcount [Tcl Bug 9b352768e6]. */ @@ -7270,15 +7270,15 @@ TEBCresume( goto gotError; } { - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; TclNewObj(statePtr); ir.twoPtrValue.ptr1 = searchPtr; ir.twoPtrValue.ptr2 = dictPtr; - Tcl_StoreIntRep(statePtr, &dictIteratorType, &ir); + Tcl_StoreInternalRep(statePtr, &dictIteratorType, &ir); } varPtr = LOCAL(opnd); if (varPtr->value.objPtr) { - if (TclHasIntRep(varPtr->value.objPtr, &dictIteratorType)) { + if (TclHasInternalRep(varPtr->value.objPtr, &dictIteratorType)) { Tcl_Panic("mis-issued dictFirst!"); } TclDecrRefCount(varPtr->value.objPtr); @@ -7292,10 +7292,10 @@ TEBCresume( TRACE(("%u => ", opnd)); statePtr = (*LOCAL(opnd)).value.objPtr; { - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; if (statePtr && - (irPtr = TclFetchIntRep(statePtr, &dictIteratorType))) { + (irPtr = TclFetchInternalRep(statePtr, &dictIteratorType))) { searchPtr = (Tcl_DictSearch *)irPtr->twoPtrValue.ptr1; Tcl_DictObjNext(searchPtr, &keyPtr, &valuePtr, &done); } else { @@ -9852,7 +9852,7 @@ EvalStatsCmd( for (i = 0; i < globalTablePtr->numBuckets; i++) { for (entryPtr = globalTablePtr->buckets[i]; entryPtr != NULL; entryPtr = entryPtr->nextPtr) { - if (TclHasIntRep(entryPtr->objPtr, &tclByteCodeType)) { + if (TclHasInternalRep(entryPtr->objPtr, &tclByteCodeType)) { numByteCodeLits++; } (void) TclGetStringFromObj(entryPtr->objPtr, &length); diff --git a/generic/tclGet.c b/generic/tclGet.c index 3dbc545..970e093 100644 --- a/generic/tclGet.c +++ b/generic/tclGet.c @@ -53,7 +53,7 @@ Tcl_GetInt( if (obj.refCount > 1) { Tcl_Panic("invalid sharing of Tcl_Obj on C stack"); } - TclFreeIntRep(&obj); + TclFreeInternalRep(&obj); return code; } @@ -97,7 +97,7 @@ Tcl_GetDouble( if (obj.refCount > 1) { Tcl_Panic("invalid sharing of Tcl_Obj on C stack"); } - TclFreeIntRep(&obj); + TclFreeInternalRep(&obj); return code; } diff --git a/generic/tclIO.c b/generic/tclIO.c index d704d29..44568e4 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -324,30 +324,30 @@ typedef struct ResolvedChanName { size_t refCount; /* Share this struct among many Tcl_Obj. */ } ResolvedChanName; -static void DupChannelIntRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); -static void FreeChannelIntRep(Tcl_Obj *objPtr); +static void DupChannelInternalRep(Tcl_Obj *objPtr, Tcl_Obj *copyPtr); +static void FreeChannelInternalRep(Tcl_Obj *objPtr); static const Tcl_ObjType chanObjType = { "channel", /* name for this type */ - FreeChannelIntRep, /* freeIntRepProc */ - DupChannelIntRep, /* dupIntRepProc */ + FreeChannelInternalRep, /* freeIntRepProc */ + DupChannelInternalRep, /* dupIntRepProc */ NULL, /* updateStringProc */ NULL /* setFromAnyProc */ }; -#define ChanSetIntRep(objPtr, resPtr) \ +#define ChanSetInternalRep(objPtr, resPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ (resPtr)->refCount++; \ ir.twoPtrValue.ptr1 = (resPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &chanObjType, &ir); \ + Tcl_StoreInternalRep((objPtr), &chanObjType, &ir); \ } while (0) -#define ChanGetIntRep(objPtr, resPtr) \ +#define ChanGetInternalRep(objPtr, resPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &chanObjType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &chanObjType); \ (resPtr) = irPtr ? (ResolvedChanName *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -1524,7 +1524,7 @@ TclGetChannelFromObj( return TCL_ERROR; } - ChanGetIntRep(objPtr, resPtr); + ChanGetInternalRep(objPtr, resPtr); if (resPtr) { /* * Confirm validity of saved lookup results. @@ -1546,7 +1546,7 @@ TclGetChannelFromObj( if (chan == NULL) { if (resPtr) { - Tcl_StoreIntRep(objPtr, &chanObjType, NULL); + Tcl_StoreInternalRep(objPtr, &chanObjType, NULL); } return TCL_ERROR; } @@ -1560,7 +1560,7 @@ TclGetChannelFromObj( } else { resPtr = (ResolvedChanName *) ckalloc(sizeof(ResolvedChanName)); resPtr->refCount = 0; - ChanSetIntRep(objPtr, resPtr); /* Overwrites, if needed */ + ChanSetInternalRep(objPtr, resPtr); /* Overwrites, if needed */ } statePtr = ((Channel *)chan)->state; resPtr->statePtr = statePtr; @@ -11274,7 +11274,7 @@ Tcl_ChannelTruncateProc( /* *---------------------------------------------------------------------- * - * DupChannelIntRep -- + * DupChannelInternalRep -- * * Initialize the internal representation of a new Tcl_Obj to a copy of * the internal representation of an existing string object. @@ -11290,7 +11290,7 @@ Tcl_ChannelTruncateProc( */ static void -DupChannelIntRep( +DupChannelInternalRep( Tcl_Obj *srcPtr, /* Object with internal rep to copy. Must have * an internal rep of type "Channel". */ Tcl_Obj *copyPtr) /* Object with internal rep to set. Must not @@ -11298,15 +11298,15 @@ DupChannelIntRep( { ResolvedChanName *resPtr; - ChanGetIntRep(srcPtr, resPtr); + ChanGetInternalRep(srcPtr, resPtr); assert(resPtr); - ChanSetIntRep(copyPtr, resPtr); + ChanSetInternalRep(copyPtr, resPtr); } /* *---------------------------------------------------------------------- * - * FreeChannelIntRep -- + * FreeChannelInternalRep -- * * Release statePtr storage. * @@ -11320,12 +11320,12 @@ DupChannelIntRep( */ static void -FreeChannelIntRep( +FreeChannelInternalRep( Tcl_Obj *objPtr) /* Object with internal rep to free. */ { ResolvedChanName *resPtr; - ChanGetIntRep(objPtr, resPtr); + ChanGetInternalRep(objPtr, resPtr); assert(resPtr); if (resPtr->refCount-- > 1) { return; diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index c33caf8..c2812ea 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -122,7 +122,7 @@ Tcl_GetIndexFromObj( * the common case where the result is cached). */ - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &indexType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &indexType); if (irPtr) { IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; @@ -270,7 +270,7 @@ Tcl_GetIndexFromObjStruct( const char *const *entryPtr; Tcl_Obj *resultPtr; IndexRep *indexRep; - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; /* Protect against invalid values, like -1 or 0. */ if (offset < (int)sizeof(char *)) { @@ -281,7 +281,7 @@ Tcl_GetIndexFromObjStruct( */ if (!(flags & TCL_INDEX_TEMP_TABLE)) { - irPtr = TclFetchIntRep(objPtr, &indexType); + irPtr = TclFetchInternalRep(objPtr, &indexType); if (irPtr) { indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; if (indexRep->tablePtr==tablePtr && indexRep->offset==offset) { @@ -345,15 +345,15 @@ Tcl_GetIndexFromObjStruct( */ if (!(flags & TCL_INDEX_TEMP_TABLE)) { - irPtr = TclFetchIntRep(objPtr, &indexType); + irPtr = TclFetchInternalRep(objPtr, &indexType); if (irPtr) { indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; } else { - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; indexRep = (IndexRep*)ckalloc(sizeof(IndexRep)); ir.twoPtrValue.ptr1 = indexRep; - Tcl_StoreIntRep(objPtr, &indexType, &ir); + Tcl_StoreInternalRep(objPtr, &indexType, &ir); } indexRep->tablePtr = (void *) tablePtr; indexRep->offset = offset; @@ -423,7 +423,7 @@ static void UpdateStringOfIndex( Tcl_Obj *objPtr) { - IndexRep *indexRep = (IndexRep *)TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1; + IndexRep *indexRep = (IndexRep *)TclFetchInternalRep(objPtr, &indexType)->twoPtrValue.ptr1; const char *indexStr = EXPAND_OF(indexRep); Tcl_InitStringRep(objPtr, indexStr, strlen(indexStr)); @@ -452,14 +452,14 @@ DupIndex( Tcl_Obj *srcPtr, Tcl_Obj *dupPtr) { - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; IndexRep *dupIndexRep = (IndexRep *)ckalloc(sizeof(IndexRep)); - memcpy(dupIndexRep, TclFetchIntRep(srcPtr, &indexType)->twoPtrValue.ptr1, + memcpy(dupIndexRep, TclFetchInternalRep(srcPtr, &indexType)->twoPtrValue.ptr1, sizeof(IndexRep)); ir.twoPtrValue.ptr1 = dupIndexRep; - Tcl_StoreIntRep(dupPtr, &indexType, &ir); + Tcl_StoreInternalRep(dupPtr, &indexType, &ir); } /* @@ -483,7 +483,7 @@ static void FreeIndex( Tcl_Obj *objPtr) { - ckfree(TclFetchIntRep(objPtr, &indexType)->twoPtrValue.ptr1); + ckfree(TclFetchInternalRep(objPtr, &indexType)->twoPtrValue.ptr1); objPtr->typePtr = NULL; } @@ -922,9 +922,9 @@ Tcl_WrongNumArgs( /* * Add the element, quoting it if necessary. */ - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; - if ((irPtr = TclFetchIntRep(origObjv[i], &indexType))) { + if ((irPtr = TclFetchInternalRep(origObjv[i], &indexType))) { IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; elementStr = EXPAND_OF(indexRep); @@ -971,9 +971,9 @@ Tcl_WrongNumArgs( * the correct error message even if the subcommand was abbreviated. * Otherwise, just use the string rep. */ - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; - if ((irPtr = TclFetchIntRep(objv[i], &indexType))) { + if ((irPtr = TclFetchInternalRep(objv[i], &indexType))) { IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1; Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), NULL); @@ -1418,7 +1418,7 @@ TclGetCompletionCodeFromObj( "ok", "error", "return", "break", "continue", NULL }; - if (!TclHasIntRep(value, &indexType) + if (!TclHasInternalRep(value, &indexType) && TclGetIntFromObj(NULL, value, codePtr) == TCL_OK) { return TCL_OK; } diff --git a/generic/tclInt.h b/generic/tclInt.h index 6c3a05d..08445a5 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3219,7 +3219,7 @@ MODULE_SCOPE int TclScanElement(const char *string, int length, char *flagPtr); MODULE_SCOPE void TclSetBgErrorHandler(Tcl_Interp *interp, Tcl_Obj *cmdPrefix); -MODULE_SCOPE void TclSetBignumIntRep(Tcl_Obj *objPtr, +MODULE_SCOPE void TclSetBignumInternalRep(Tcl_Obj *objPtr, void *bignumValue); MODULE_SCOPE int TclSetBooleanFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); @@ -4536,11 +4536,11 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, * representation. Does not actually reset the rep's bytes. The ANSI C * "prototype" for this macro is: * - * MODULE_SCOPE void TclFreeIntRep(Tcl_Obj *objPtr); + * MODULE_SCOPE void TclFreeInternalRep(Tcl_Obj *objPtr); *---------------------------------------------------------------- */ -#define TclFreeIntRep(objPtr) \ +#define TclFreeInternalRep(objPtr) \ if ((objPtr)->typePtr != NULL) { \ if ((objPtr)->typePtr->freeIntRepProc != NULL) { \ (objPtr)->typePtr->freeIntRepProc(objPtr); \ @@ -4548,6 +4548,10 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, (objPtr)->typePtr = NULL; \ } +#if !defined(TCL_NO_DEPRECATED) && TCL_MAJOR_VERSION < 8 +# define TclFreeIntRep(objPtr) TclFreeInternalRep(objPtr) +#endif + /* *---------------------------------------------------------------- * Macro used by the Tcl core to clean out an object's string representation. @@ -4758,10 +4762,10 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[]; MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr); #define TclIsPureDict(objPtr) \ (((objPtr)->bytes==NULL) && ((objPtr)->typePtr==&tclDictType)) -#define TclHasIntRep(objPtr, type) \ +#define TclHasInternalRep(objPtr, type) \ ((objPtr)->typePtr == (type)) -#define TclFetchIntRep(objPtr, type) \ - (TclHasIntRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL) +#define TclFetchInternalRep(objPtr, type) \ + (TclHasInternalRep((objPtr), (type)) ? &((objPtr)->internalRep) : NULL) /* @@ -4851,18 +4855,18 @@ MODULE_SCOPE Tcl_LibraryInitProc Procbodytest_SafeInit; #define TclSetIntObj(objPtr, i) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.wideValue = (Tcl_WideInt) i; \ TclInvalidateStringRep(objPtr); \ - Tcl_StoreIntRep(objPtr, &tclIntType, &ir); \ + Tcl_StoreInternalRep(objPtr, &tclIntType, &ir); \ } while (0) #define TclSetDoubleObj(objPtr, d) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.doubleValue = (double) d; \ TclInvalidateStringRep(objPtr); \ - Tcl_StoreIntRep(objPtr, &tclDoubleType, &ir); \ + Tcl_StoreInternalRep(objPtr, &tclDoubleType, &ir); \ } while (0) /* diff --git a/generic/tclLink.c b/generic/tclLink.c index 02b19aa..34ad67b 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -588,7 +588,7 @@ GetDouble( return 0; } else { #ifdef ACCEPT_NAN - Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &tclDoubleType); + Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &tclDoubleType); if (irPtr != NULL) { *dblPtr = irPtr->doubleValue; @@ -656,7 +656,7 @@ SetInvalidRealFromAny( double doubleValue = 0.0; Tcl_GetDoubleFromObj(NULL, objPtr, &doubleValue); - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->typePtr = &invalidRealType; objPtr->internalRep.doubleValue = doubleValue; return TCL_OK; @@ -705,7 +705,7 @@ GetInvalidDoubleFromObj( { int intValue; - if (TclHasIntRep(objPtr, &invalidRealType)) { + if (TclHasInternalRep(objPtr, &invalidRealType)) { goto gotdouble; } if (GetInvalidIntFromObj(objPtr, &intValue) == TCL_OK) { diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 0cc1c11..c66fd1e 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -20,7 +20,7 @@ static List * AttemptNewList(Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static List * NewListIntRep(int objc, Tcl_Obj *const objv[], int p); +static List * NewListInternalRep(int objc, Tcl_Obj *const objv[], int p); static void DupListInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr); static void FreeListInternalRep(Tcl_Obj *listPtr); static int SetListFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); @@ -49,24 +49,24 @@ const Tcl_ObjType tclListType = { /* Macros to manipulate the List internal rep */ -#define ListSetIntRep(objPtr, listRepPtr) \ +#define ListSetInternalRep(objPtr, listRepPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (listRepPtr); \ ir.twoPtrValue.ptr2 = NULL; \ (listRepPtr)->refCount++; \ - Tcl_StoreIntRep((objPtr), &tclListType, &ir); \ + Tcl_StoreInternalRep((objPtr), &tclListType, &ir); \ } while (0) -#define ListGetIntRep(objPtr, listRepPtr) \ +#define ListGetInternalRep(objPtr, listRepPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &tclListType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &tclListType); \ (listRepPtr) = irPtr ? (List *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) -#define ListResetIntRep(objPtr, listRepPtr) \ - TclFetchIntRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr) +#define ListResetInternalRep(objPtr, listRepPtr) \ + TclFetchInternalRep((objPtr), &tclListType)->twoPtrValue.ptr1 = (listRepPtr) #ifndef TCL_MIN_ELEMENT_GROWTH #define TCL_MIN_ELEMENT_GROWTH TCL_MIN_GROWTH/sizeof(Tcl_Obj *) @@ -75,7 +75,7 @@ const Tcl_ObjType tclListType = { /* *---------------------------------------------------------------------- * - * NewListIntRep -- + * NewListInternalRep -- * * Creates a list internal rep with space for objc elements. objc * must be > 0. If objv!=NULL, initializes with the first objc values @@ -96,7 +96,7 @@ const Tcl_ObjType tclListType = { */ static List * -NewListIntRep( +NewListInternalRep( int objc, Tcl_Obj *const objv[], int p) @@ -104,7 +104,7 @@ NewListIntRep( List *listRepPtr; if (objc <= 0) { - Tcl_Panic("NewListIntRep: expects postive element count"); + Tcl_Panic("NewListInternalRep: expects postive element count"); } /* @@ -179,7 +179,7 @@ AttemptNewList( int objc, Tcl_Obj *const objv[]) { - List *listRepPtr = NewListIntRep(objc, objv, 0); + List *listRepPtr = NewListInternalRep(objc, objv, 0); if (interp != NULL && listRepPtr == NULL) { if (objc > LIST_MAX) { @@ -253,14 +253,14 @@ Tcl_NewListObj( * Create the internal rep. */ - listRepPtr = NewListIntRep(objc, objv, 1); + listRepPtr = NewListInternalRep(objc, objv, 1); /* * Now create the object. */ TclInvalidateStringRep(listPtr); - ListSetIntRep(listPtr, listRepPtr); + ListSetInternalRep(listPtr, listRepPtr); return listPtr; } #endif /* if TCL_MEM_DEBUG */ @@ -318,14 +318,14 @@ Tcl_DbNewListObj( * Create the internal rep. */ - listRepPtr = NewListIntRep(objc, objv, 1); + listRepPtr = NewListInternalRep(objc, objv, 1); /* * Now create the object. */ TclInvalidateStringRep(listPtr); - ListSetIntRep(listPtr, listRepPtr); + ListSetInternalRep(listPtr, listRepPtr); return listPtr; } @@ -381,7 +381,7 @@ Tcl_SetListObj( * Free any old string rep and any internal rep for the old type. */ - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); TclInvalidateStringRep(objPtr); /* @@ -391,8 +391,8 @@ Tcl_SetListObj( */ if (objc > 0) { - listRepPtr = NewListIntRep(objc, objv, 1); - ListSetIntRep(objPtr, listRepPtr); + listRepPtr = NewListInternalRep(objc, objv, 1); + ListSetInternalRep(objPtr, listRepPtr); } else { Tcl_InitStringRep(objPtr, NULL, 0); } @@ -428,7 +428,7 @@ TclListObjCopy( Tcl_Obj *copyPtr; List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (NULL == listRepPtr) { if (SetListFromAny(interp, listPtr) != TCL_OK) { return NULL; @@ -566,7 +566,7 @@ Tcl_ListObjGetElements( { List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int result, length; @@ -581,7 +581,7 @@ Tcl_ListObjGetElements( if (result != TCL_OK) { return result; } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } *objcPtr = listRepPtr->elemCount; *objvPtr = &listRepPtr->elements; @@ -680,7 +680,7 @@ Tcl_ListObjAppendElement( Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendElement"); } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int result, length; @@ -693,7 +693,7 @@ Tcl_ListObjAppendElement( if (result != TCL_OK) { return result; } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } numElems = listRepPtr->elemCount; @@ -713,7 +713,7 @@ Tcl_ListObjAppendElement( if (needGrow && !isShared) { /* - * Need to grow + unshared intrep => try to realloc + * Need to grow + unshared internalrep => try to realloc */ attempt = 2 * numRequired; @@ -741,8 +741,8 @@ Tcl_ListObjAppendElement( Tcl_Obj **dst, **src = &listRepPtr->elements; /* - * Either we have a shared intrep and we must copy to write, or we - * need to grow and realloc attempts failed. Attempt intrep copy. + * Either we have a shared internalrep and we must copy to write, or we + * need to grow and realloc attempts failed. Attempt internalrep copy. */ attempt = 2 * numRequired; @@ -773,7 +773,7 @@ Tcl_ListObjAppendElement( if (isShared) { /* - * The original intrep must remain undisturbed. Copy into the new + * The original internalrep must remain undisturbed. Copy into the new * one and bump refcounts */ while (numElems--) { @@ -783,7 +783,7 @@ Tcl_ListObjAppendElement( listRepPtr->refCount--; } else { /* - * Old intrep to be freed, re-use refCounts. + * Old internalrep to be freed, re-use refCounts. */ memcpy(dst, src, numElems * sizeof(Tcl_Obj *)); @@ -791,10 +791,10 @@ Tcl_ListObjAppendElement( } listRepPtr = newPtr; } - ListResetIntRep(listPtr, listRepPtr); + ListResetInternalRep(listPtr, listRepPtr); listRepPtr->refCount++; - TclFreeIntRep(listPtr); - ListSetIntRep(listPtr, listRepPtr); + TclFreeInternalRep(listPtr); + ListSetInternalRep(listPtr, listRepPtr); listRepPtr->refCount--; /* @@ -850,7 +850,7 @@ Tcl_ListObjIndex( { List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int result, length; @@ -863,7 +863,7 @@ Tcl_ListObjIndex( if (result != TCL_OK) { return result; } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } if ((index < 0) || (index >= listRepPtr->elemCount)) { @@ -905,7 +905,7 @@ Tcl_ListObjLength( { List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int result, length; @@ -918,7 +918,7 @@ Tcl_ListObjLength( if (result != TCL_OK) { return result; } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } *intPtr = listRepPtr->elemCount; @@ -981,7 +981,7 @@ Tcl_ListObjReplace( Tcl_Panic("%s called with shared object", "Tcl_ListObjReplace"); } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int length; @@ -998,7 +998,7 @@ Tcl_ListObjReplace( return result; } } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } /* @@ -1062,7 +1062,7 @@ Tcl_ListObjReplace( } if (newPtr) { listRepPtr = newPtr; - ListResetIntRep(listPtr, listRepPtr); + ListResetInternalRep(listPtr, listRepPtr); elemPtrs = &listRepPtr->elements; listRepPtr->maxElemCount = attempt; needGrow = numRequired > listRepPtr->maxElemCount; @@ -1135,7 +1135,7 @@ Tcl_ListObjReplace( } } - ListResetIntRep(listPtr, listRepPtr); + ListResetInternalRep(listPtr, listRepPtr); listRepPtr->refCount++; elemPtrs = &listRepPtr->elements; @@ -1213,8 +1213,8 @@ Tcl_ListObjReplace( */ listRepPtr->refCount++; - TclFreeIntRep(listPtr); - ListSetIntRep(listPtr, listRepPtr); + TclFreeInternalRep(listPtr); + ListSetInternalRep(listPtr, listRepPtr); listRepPtr->refCount--; TclInvalidateStringRep(listPtr); @@ -1240,7 +1240,7 @@ Tcl_ListObjReplace( * This procedure is implemented entirely as a wrapper around * TclLindexFlat. All it does is reconfigure the argument format into the * form required by TclLindexFlat, while taking care to manage shimmering - * in such a way that we tend to keep the most useful intreps and/or + * in such a way that we tend to keep the most useful internalreps and/or * avoid the most expensive conversions. * *---------------------------------------------------------------------- @@ -1263,7 +1263,7 @@ TclLindexList( * shimmering; see TIP#22 and TIP#33 for the details. */ - ListGetIntRep(argPtr, listRepPtr); + ListGetInternalRep(argPtr, listRepPtr); if ((listRepPtr == NULL) && TclGetIntForIndexM(NULL , argPtr, INT_MAX - 1, &index) == TCL_OK) { /* @@ -1295,7 +1295,7 @@ TclLindexList( return TclLindexFlat(interp, listPtr, 1, &argPtr); } - ListGetIntRep(indexListCopy, listRepPtr); + ListGetInternalRep(indexListCopy, listRepPtr); assert(listRepPtr != NULL); @@ -1418,7 +1418,7 @@ TclLindexFlat( * This procedure is implemented entirely as a wrapper around * TclLsetFlat. All it does is reconfigure the argument format into the * form required by TclLsetFlat, while taking care to manage shimmering - * in such a way that we tend to keep the most useful intreps and/or + * in such a way that we tend to keep the most useful internalreps and/or * avoid the most expensive conversions. * *---------------------------------------------------------------------- @@ -1444,7 +1444,7 @@ TclLsetList( * shimmering; see TIP #22 and #23 for details. */ - ListGetIntRep(indexArgPtr, listRepPtr); + ListGetInternalRep(indexArgPtr, listRepPtr); if (listRepPtr == NULL && TclGetIntForIndexM(NULL, indexArgPtr, INT_MAX - 1, &index) == TCL_OK) { /* @@ -1531,7 +1531,7 @@ TclLsetFlat( { int index, result, len; Tcl_Obj *subListPtr, *retValuePtr, *chainPtr; - Tcl_ObjIntRep *irPtr; + Tcl_ObjInternalRep *irPtr; /* * If there are no indices, simply return the new value. (Without @@ -1636,8 +1636,8 @@ TclLsetFlat( /* * Replace the original elemPtr[index] in parentList with a copy * we know to be unshared. This call will also deal with the - * situation where parentList shares its intrep with other - * Tcl_Obj's. Dealing with the shared intrep case can cause + * situation where parentList shares its internalrep with other + * Tcl_Obj's. Dealing with the shared internalrep case can cause * subListPtr to become shared again, so detect that case and make * and store another copy. */ @@ -1662,11 +1662,11 @@ TclLsetFlat( * variable. Later on, when we set valuePtr in its proper place, * then all containing lists will have their values changed, and * will need their string reps spoiled. We maintain a list of all - * those Tcl_Obj's (via a little intrep surgery) so we can spoil + * those Tcl_Obj's (via a little internalrep surgery) so we can spoil * them at that time. */ - irPtr = TclFetchIntRep(parentList, &tclListType); + irPtr = TclFetchInternalRep(parentList, &tclListType); irPtr->twoPtrValue.ptr2 = chainPtr; chainPtr = parentList; } @@ -1684,10 +1684,10 @@ TclLsetFlat( List *listRepPtr; /* - * Clear away our intrep surgery mess. + * Clear away our internalrep surgery mess. */ - irPtr = TclFetchIntRep(objPtr, &tclListType); + irPtr = TclFetchInternalRep(objPtr, &tclListType); listRepPtr = (List *)irPtr->twoPtrValue.ptr1; chainPtr = (Tcl_Obj *)irPtr->twoPtrValue.ptr2; @@ -1699,8 +1699,8 @@ TclLsetFlat( */ listRepPtr->refCount++; - TclFreeIntRep(objPtr); - ListSetIntRep(objPtr, listRepPtr); + TclFreeInternalRep(objPtr); + ListSetInternalRep(objPtr, listRepPtr); listRepPtr->refCount--; TclInvalidateStringRep(objPtr); @@ -1793,7 +1793,7 @@ TclListObjSetElement( Tcl_Panic("%s called with shared object", "TclListObjSetElement"); } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); if (listRepPtr == NULL) { int result, length; @@ -1811,7 +1811,7 @@ TclListObjSetElement( if (result != TCL_OK) { return result; } - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); } elemCount = listRepPtr->elemCount; @@ -1857,7 +1857,7 @@ TclListObjSetElement( listRepPtr->refCount--; listRepPtr = newPtr; - ListResetIntRep(listPtr, listRepPtr); + ListResetInternalRep(listPtr, listRepPtr); } elemPtrs = &listRepPtr->elements; @@ -1880,13 +1880,13 @@ TclListObjSetElement( elemPtrs[index] = valuePtr; /* - * Invalidate outdated intreps. + * Invalidate outdated internalreps. */ - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); listRepPtr->refCount++; - TclFreeIntRep(listPtr); - ListSetIntRep(listPtr, listRepPtr); + TclFreeInternalRep(listPtr); + ListSetInternalRep(listPtr, listRepPtr); listRepPtr->refCount--; TclInvalidateStringRep(listPtr); @@ -1918,7 +1918,7 @@ FreeListInternalRep( { List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); assert(listRepPtr != NULL); if (listRepPtr->refCount-- <= 1) { @@ -1956,9 +1956,9 @@ DupListInternalRep( { List *listRepPtr; - ListGetIntRep(srcPtr, listRepPtr); + ListGetInternalRep(srcPtr, listRepPtr); assert(listRepPtr != NULL); - ListSetIntRep(copyPtr, listRepPtr); + ListSetInternalRep(copyPtr, listRepPtr); } /* @@ -1996,7 +1996,7 @@ SetListFromAny( * describe duplicate keys). */ - if (!TclHasStringRep(objPtr) && TclHasIntRep(objPtr, &tclDictType)) { + if (!TclHasStringRep(objPtr) && TclHasInternalRep(objPtr, &tclDictType)) { Tcl_Obj *keyPtr, *valuePtr; Tcl_DictSearch search; int done, size; @@ -2099,7 +2099,7 @@ SetListFromAny( * Tcl_GetStringFromObj, to use the old internalRep. */ - ListSetIntRep(objPtr, listRepPtr); + ListSetInternalRep(objPtr, listRepPtr); return TCL_OK; } @@ -2136,7 +2136,7 @@ UpdateStringOfList( Tcl_Obj **elemPtrs; List *listRepPtr; - ListGetIntRep(listPtr, listRepPtr); + ListGetInternalRep(listPtr, listRepPtr); assert(listRepPtr != NULL); diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index fe1b00d..e1943a1 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -1045,7 +1045,7 @@ RebuildLiteralTable( * * Side effects: * Resets the internal representation of the CmdName Tcl_Obj - * using TclFreeIntRep(). + * using TclFreeInternalRep(). * *---------------------------------------------------------------------- */ @@ -1064,8 +1064,8 @@ TclInvalidateCmdLiteral( strlen(name), -1, NULL, nsPtr, 0, NULL); if (literalObjPtr != NULL) { - if (TclHasIntRep(literalObjPtr, &tclCmdNameType)) { - TclFreeIntRep(literalObjPtr); + if (TclHasInternalRep(literalObjPtr, &tclCmdNameType)) { + TclFreeInternalRep(literalObjPtr); } /* Balance the refcount effects of TclCreateLiteral() above */ Tcl_IncrRefCount(literalObjPtr); diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 2aed628..639dff2 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -133,19 +133,19 @@ static const Tcl_ObjType nsNameType = { SetNsNameFromAny /* setFromAnyProc */ }; -#define NsNameSetIntRep(objPtr, nnPtr) \ +#define NsNameSetInternalRep(objPtr, nnPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ (nnPtr)->refCount++; \ ir.twoPtrValue.ptr1 = (nnPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &nsNameType, &ir); \ + Tcl_StoreInternalRep((objPtr), &nsNameType, &ir); \ } while (0) -#define NsNameGetIntRep(objPtr, nnPtr) \ +#define NsNameGetInternalRep(objPtr, nnPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &nsNameType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &nsNameType); \ (nnPtr) = irPtr ? (ResolvedNsName *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -2928,7 +2928,7 @@ GetNamespaceFromObj( { ResolvedNsName *resNamePtr; - NsNameGetIntRep(objPtr, resNamePtr); + NsNameGetInternalRep(objPtr, resNamePtr); if (resNamePtr) { Namespace *nsPtr, *refNsPtr; @@ -2945,10 +2945,10 @@ GetNamespaceFromObj( *nsPtrPtr = (Tcl_Namespace *) nsPtr; return TCL_OK; } - Tcl_StoreIntRep(objPtr, &nsNameType, NULL); + Tcl_StoreInternalRep(objPtr, &nsNameType, NULL); } if (SetNsNameFromAny(interp, objPtr) == TCL_OK) { - NsNameGetIntRep(objPtr, resNamePtr); + NsNameGetInternalRep(objPtr, resNamePtr); assert(resNamePtr != NULL); *nsPtrPtr = (Tcl_Namespace *) resNamePtr->nsPtr; return TCL_OK; @@ -4722,7 +4722,7 @@ FreeNsNameInternalRep( { ResolvedNsName *resNamePtr; - NsNameGetIntRep(objPtr, resNamePtr); + NsNameGetInternalRep(objPtr, resNamePtr); assert(resNamePtr != NULL); /* @@ -4768,9 +4768,9 @@ DupNsNameInternalRep( { ResolvedNsName *resNamePtr; - NsNameGetIntRep(srcPtr, resNamePtr); + NsNameGetInternalRep(srcPtr, resNamePtr); assert(resNamePtr != NULL); - NsNameSetIntRep(copyPtr, resNamePtr); + NsNameSetInternalRep(copyPtr, resNamePtr); } /* @@ -4833,7 +4833,7 @@ SetNsNameFromAny( resNamePtr->refNsPtr = (Namespace *) TclGetCurrentNamespace(interp); } resNamePtr->refCount = 0; - NsNameSetIntRep(objPtr, resNamePtr); + NsNameSetInternalRep(objPtr, resNamePtr); return TCL_OK; } @@ -5013,7 +5013,7 @@ TclLogCommandInfo( Tcl_ListObjLength(interp, iPtr->errorStack, &len); /* - * Reset while keeping the list intrep as much as possible. + * Reset while keeping the list internalrep as much as possible. */ Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, 0, NULL); @@ -5098,7 +5098,7 @@ TclErrorStackResetIf( Tcl_ListObjLength(interp, iPtr->errorStack, &len); /* - * Reset while keeping the list intrep as much as possible. + * Reset while keeping the list internalrep as much as possible. */ Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, 0, NULL); diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index b7df93e..71db6c1 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -247,12 +247,12 @@ StashCallChain( Tcl_Obj *objPtr, CallChain *callPtr) { - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; callPtr->refCount++; TclGetString(objPtr); ir.twoPtrValue.ptr1 = callPtr; - Tcl_StoreIntRep(objPtr, &methodNameType, &ir); + Tcl_StoreInternalRep(objPtr, &methodNameType, &ir); } void @@ -280,7 +280,7 @@ DupMethodNameRep( Tcl_Obj *dstPtr) { StashCallChain(dstPtr, - (CallChain *)TclFetchIntRep(srcPtr, &methodNameType)->twoPtrValue.ptr1); + (CallChain *)TclFetchInternalRep(srcPtr, &methodNameType)->twoPtrValue.ptr1); } static void @@ -288,7 +288,7 @@ FreeMethodNameRep( Tcl_Obj *objPtr) { TclOODeleteChain( - (CallChain *)TclFetchIntRep(objPtr, &methodNameType)->twoPtrValue.ptr1); + (CallChain *)TclFetchInternalRep(objPtr, &methodNameType)->twoPtrValue.ptr1); } /* @@ -1189,16 +1189,16 @@ TclOOGetCallContext( * the object, and in the class). */ - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; const int reuseMask = (WANT_PUBLIC(flags) ? ~0 : ~PUBLIC_METHOD); - if ((irPtr = TclFetchIntRep(cacheInThisObj, &methodNameType))) { + if ((irPtr = TclFetchInternalRep(cacheInThisObj, &methodNameType))) { callPtr = (CallChain *)irPtr->twoPtrValue.ptr1; if (IsStillValid(callPtr, oPtr, flags, reuseMask)) { callPtr->refCount++; goto returnContext; } - Tcl_StoreIntRep(cacheInThisObj, &methodNameType, NULL); + Tcl_StoreInternalRep(cacheInThisObj, &methodNameType, NULL); } if (oPtr->flags & USE_CLASS_CACHE) { diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index f111461..1903bb9 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -859,7 +859,7 @@ PushMethodCallFrame( * alternative is *so* slow... */ - ByteCodeGetIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, codePtr); if (codePtr) { codePtr->nsPtr = nsPtr; } @@ -1338,7 +1338,7 @@ CloneProcedureMethod( bodyObj = Tcl_DuplicateObj(pmPtr->procPtr->bodyPtr); Tcl_GetString(bodyObj); - Tcl_StoreIntRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL); + Tcl_StoreInternalRep(pmPtr->procPtr->bodyPtr, &tclByteCodeType, NULL); /* * Create the actual copy of the method record, manufacturing a new proc diff --git a/generic/tclObj.c b/generic/tclObj.c index 421c1da..e5ec838 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1373,7 +1373,7 @@ TclFreeObj( PopObjToDelete(context, objToFree); TCL_DTRACE_OBJ_FREE(objToFree); - TclFreeIntRep(objToFree); + TclFreeInternalRep(objToFree); Tcl_MutexLock(&tclObjMutex); ckfree(objToFree); @@ -1592,7 +1592,7 @@ TclSetDuplicateObj( Tcl_Panic("%s called with shared object", "TclSetDuplicateObj"); } TclInvalidateStringRep(dupPtr); - TclFreeIntRep(dupPtr); + TclFreeInternalRep(dupPtr); SetDuplicateObj(dupPtr, objPtr); } @@ -1892,13 +1892,13 @@ Tcl_HasStringRep( /* *---------------------------------------------------------------------- * - * Tcl_StoreIntRep -- + * Tcl_StoreInternalRep -- * * This function is called to set the object's internal * representation to match a particular type. * * It is the caller's responsibility to guarantee that - * the value of the submitted IntRep is in agreement with + * the value of the submitted internalrep is in agreement with * the value of any existing string rep. * * Results: @@ -1912,17 +1912,17 @@ Tcl_HasStringRep( */ void -Tcl_StoreIntRep( +Tcl_StoreInternalRep( Tcl_Obj *objPtr, /* Object whose internal rep should be set. */ const Tcl_ObjType *typePtr, /* New type for the object */ - const Tcl_ObjIntRep *irPtr) /* New IntRep for the object */ + const Tcl_ObjInternalRep *irPtr) /* New internalrep for the object */ { - /* Clear out any existing IntRep ( "shimmer" ) */ - TclFreeIntRep(objPtr); + /* Clear out any existing internalrep ( "shimmer" ) */ + TclFreeInternalRep(objPtr); - /* When irPtr == NULL, just leave objPtr with no IntRep for typePtr */ + /* When irPtr == NULL, just leave objPtr with no internalrep for typePtr */ if (irPtr) { - /* Copy the new IntRep into place */ + /* Copy the new internalrep into place */ objPtr->internalRep = *irPtr; /* Set the type to match */ @@ -1933,13 +1933,13 @@ Tcl_StoreIntRep( /* *---------------------------------------------------------------------- * - * Tcl_FetchIntRep -- + * Tcl_FetchInternalRep -- * * This function is called to retrieve the object's internal * representation matching a requested type, if any. * * Results: - * A read-only pointer to the associated Tcl_ObjIntRep, or + * A read-only pointer to the associated Tcl_ObjInternalRep, or * NULL if no such internal representation exists. * * Side effects: @@ -1949,18 +1949,18 @@ Tcl_StoreIntRep( *---------------------------------------------------------------------- */ -Tcl_ObjIntRep * -Tcl_FetchIntRep( +Tcl_ObjInternalRep * +Tcl_FetchInternalRep( Tcl_Obj *objPtr, /* Object to fetch from. */ const Tcl_ObjType *typePtr) /* Requested type */ { - return TclFetchIntRep(objPtr, typePtr); + return TclFetchInternalRep(objPtr, typePtr); } /* *---------------------------------------------------------------------- * - * Tcl_FreeIntRep -- + * Tcl_FreeInternalRep -- * * This function is called to free an object's internal representation. * @@ -1975,10 +1975,10 @@ Tcl_FetchIntRep( */ void -Tcl_FreeIntRep( +Tcl_FreeInternalRep( Tcl_Obj *objPtr) /* Object whose internal rep should be freed. */ { - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); } /* @@ -2134,7 +2134,7 @@ Tcl_SetBooleanObj( * result unless "interp" is NULL. * * Side effects: - * The intrep of *objPtr may be changed. + * The internalrep of *objPtr may be changed. * *---------------------------------------------------------------------- */ @@ -2157,7 +2157,7 @@ Tcl_GetBooleanFromObj( if (objPtr->typePtr == &tclDoubleType) { /* * Caution: Don't be tempted to check directly for the "double" - * Tcl_ObjType and then compare the intrep to 0.0. This isn't + * Tcl_ObjType and then compare the internalrep to 0.0. This isn't * reliable because a "double" Tcl_ObjType can hold the NaN value. * Use the API Tcl_GetDoubleFromObj, which does the checking and * sets the proper error message for us. @@ -2357,13 +2357,13 @@ ParseBoolean( */ goodBoolean: - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.longValue = newBool; objPtr->typePtr = &tclBooleanType; return TCL_OK; numericBoolean: - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.wideValue = newBool; objPtr->typePtr = &tclIntType; return TCL_OK; @@ -3639,7 +3639,7 @@ GetBignumFromObj( } } else { TclUnpackBignum(objPtr, *bignumValue); - /* Optimized TclFreeIntRep */ + /* Optimized TclFreeInternalRep */ objPtr->internalRep.twoPtrValue.ptr1 = NULL; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = NULL; @@ -3793,14 +3793,14 @@ Tcl_SetBignumObj( return; tooLargeForWide: TclInvalidateStringRep(objPtr); - TclFreeIntRep(objPtr); - TclSetBignumIntRep(objPtr, bignumValue); + TclFreeInternalRep(objPtr); + TclSetBignumInternalRep(objPtr, bignumValue); } /* *---------------------------------------------------------------------- * - * TclSetBignumIntRep -- + * TclSetBignumInternalRep -- * * Install a bignum into the internal representation of an object. * @@ -3816,7 +3816,7 @@ Tcl_SetBignumObj( */ void -TclSetBignumIntRep( +TclSetBignumInternalRep( Tcl_Obj *objPtr, void *big) { @@ -4554,7 +4554,7 @@ SetCmdNameObj( } if (resPtr == NULL) { - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.twoPtrValue.ptr1 = fillPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index e4826ad..b5207a1 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -85,13 +85,13 @@ typedef struct FsPath { * fields. */ -#define PATHOBJ(pathPtr) ((FsPath *) (TclFetchIntRep((pathPtr), &fsPathType)->twoPtrValue.ptr1)) +#define PATHOBJ(pathPtr) ((FsPath *) (TclFetchInternalRep((pathPtr), &fsPathType)->twoPtrValue.ptr1)) #define SETPATHOBJ(pathPtr,fsPathPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (void *) (fsPathPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((pathPtr), &fsPathType, &ir); \ + Tcl_StoreInternalRep((pathPtr), &fsPathType, &ir); \ } while (0) #define PATHFLAGS(pathPtr) (PATHOBJ(pathPtr)->flags) @@ -544,7 +544,7 @@ TclPathPart( Tcl_Obj *pathPtr, /* Path to take dirname of */ Tcl_PathPart portion) /* Requested portion of name */ { - if (TclHasIntRep(pathPtr, &fsPathType)) { + if (TclHasInternalRep(pathPtr, &fsPathType)) { FsPath *fsPathPtr = PATHOBJ(pathPtr); if (PATHFLAGS(pathPtr) != 0) { @@ -843,7 +843,7 @@ TclJoinPath( if (elements == 2) { Tcl_Obj *elt = objv[0]; - Tcl_ObjIntRep *eltIr = TclFetchIntRep(elt, &fsPathType); + Tcl_ObjInternalRep *eltIr = TclFetchInternalRep(elt, &fsPathType); /* * This is a special case where we can be much more efficient, where @@ -1149,13 +1149,13 @@ Tcl_FSConvertToPathType( * path. */ - if (TclHasIntRep(pathPtr, &fsPathType)) { + if (TclHasInternalRep(pathPtr, &fsPathType)) { if (TclFSEpochOk(PATHOBJ(pathPtr)->filesystemEpoch)) { return TCL_OK; } TclGetString(pathPtr); - Tcl_StoreIntRep(pathPtr, &fsPathType, NULL); + Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL); } return SetFsPathFromAny(interp, pathPtr); @@ -1349,7 +1349,7 @@ AppendPath( * that use some character other than "/" as a path separator. I know * of no evidence that such a foolish thing exists. This solution was * chosen so that "JoinPath" operations that pass through either path - * intrep produce the same results; that is, bugward compatibility. If + * internalrep produce the same results; that is, bugward compatibility. If * we need to fix that bug here, it needs fixing in TclJoinPath() too. */ bytes = TclGetStringFromObj(tail, &numBytes); @@ -1391,7 +1391,7 @@ TclFSMakePathRelative( { int cwdLen, len; const char *tempStr; - Tcl_ObjIntRep *irPtr = TclFetchIntRep(pathPtr, &fsPathType); + Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(pathPtr, &fsPathType); if (irPtr) { FsPath *fsPathPtr = PATHOBJ(pathPtr); @@ -1461,7 +1461,7 @@ MakePathFromNormalized( { FsPath *fsPathPtr; - if (TclHasIntRep(pathPtr, &fsPathType)) { + if (TclHasInternalRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -1532,7 +1532,7 @@ Tcl_FSNewNativePath( * safe. */ - Tcl_StoreIntRep(pathPtr, &fsPathType, NULL); + Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL); fsPathPtr = (FsPath *)ckalloc(sizeof(FsPath)); fsPathPtr->translatedPathPtr = NULL; @@ -1598,7 +1598,7 @@ Tcl_FSGetTranslatedPath( Tcl_Obj *translatedCwdPtr = Tcl_FSGetTranslatedPath(interp, srcFsPathPtr->cwdPtr); - Tcl_ObjIntRep *translatedCwdIrPtr; + Tcl_ObjInternalRep *translatedCwdIrPtr; if (translatedCwdPtr == NULL) { return NULL; @@ -1607,7 +1607,7 @@ Tcl_FSGetTranslatedPath( retObj = Tcl_FSJoinToPath(translatedCwdPtr, 1, &srcFsPathPtr->normPathPtr); Tcl_IncrRefCount(srcFsPathPtr->translatedPathPtr = retObj); - translatedCwdIrPtr = TclFetchIntRep(translatedCwdPtr, &fsPathType); + translatedCwdIrPtr = TclFetchInternalRep(translatedCwdPtr, &fsPathType); if (translatedCwdIrPtr) { srcFsPathPtr->filesystemEpoch = PATHOBJ(translatedCwdPtr)->filesystemEpoch; @@ -1802,7 +1802,7 @@ Tcl_FSGetNormalizedPath( if (fsPathPtr->cwdPtr != NULL) { if (!TclFSCwdPointerEquals(&fsPathPtr->cwdPtr)) { TclGetString(pathPtr); - Tcl_StoreIntRep(pathPtr, &fsPathType, NULL); + Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL); if (SetFsPathFromAny(interp, pathPtr) != TCL_OK) { return NULL; } @@ -2048,7 +2048,7 @@ TclFSEnsureEpochOk( { FsPath *srcFsPathPtr; - if (!TclHasIntRep(pathPtr, &fsPathType)) { + if (!TclHasInternalRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -2062,7 +2062,7 @@ TclFSEnsureEpochOk( */ TclGetString(pathPtr); - Tcl_StoreIntRep(pathPtr, &fsPathType, NULL); + Tcl_StoreInternalRep(pathPtr, &fsPathType, NULL); if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) { return TCL_ERROR; } @@ -2106,7 +2106,7 @@ TclFSSetPathDetails( * Make sure pathPtr is of the correct type. */ - if (!TclHasIntRep(pathPtr, &fsPathType)) { + if (!TclHasInternalRep(pathPtr, &fsPathType)) { if (SetFsPathFromAny(NULL, pathPtr) != TCL_OK) { return; } @@ -2206,7 +2206,7 @@ SetFsPathFromAny( Tcl_Obj *transPtr; const char *name; - if (TclHasIntRep(pathPtr, &fsPathType)) { + if (TclHasInternalRep(pathPtr, &fsPathType)) { return TCL_OK; } @@ -2519,7 +2519,7 @@ TclNativePathInFilesystem( * semantics of Tcl (at present anyway), so we have to abide by them here. */ - if (TclHasIntRep(pathPtr, &fsPathType)) { + if (TclHasInternalRep(pathPtr, &fsPathType)) { if (pathPtr->bytes != NULL && pathPtr->bytes[0] == '\0') { /* * We reject the empty path "". diff --git a/generic/tclProc.c b/generic/tclProc.c index b3de29a..402b752 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -67,19 +67,19 @@ const Tcl_ObjType tclProcBodyType = { * should panic instead. */ }; -#define ProcSetIntRep(objPtr, procPtr) \ +#define ProcSetInternalRep(objPtr, procPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ (procPtr)->refCount++; \ ir.twoPtrValue.ptr1 = (procPtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &tclProcBodyType, &ir); \ + Tcl_StoreInternalRep((objPtr), &tclProcBodyType, &ir); \ } while (0) -#define ProcGetIntRep(objPtr, procPtr) \ +#define ProcGetInternalRep(objPtr, procPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &tclProcBodyType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &tclProcBodyType); \ (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -113,19 +113,19 @@ static const Tcl_ObjType lambdaType = { SetLambdaFromAny /* setFromAnyProc */ }; -#define LambdaSetIntRep(objPtr, procPtr, nsObjPtr) \ +#define LambdaSetInternalRep(objPtr, procPtr, nsObjPtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ ir.twoPtrValue.ptr1 = (procPtr); \ ir.twoPtrValue.ptr2 = (nsObjPtr); \ Tcl_IncrRefCount((nsObjPtr)); \ - Tcl_StoreIntRep((objPtr), &lambdaType, &ir); \ + Tcl_StoreInternalRep((objPtr), &lambdaType, &ir); \ } while (0) -#define LambdaGetIntRep(objPtr, procPtr, nsObjPtr) \ +#define LambdaGetInternalRep(objPtr, procPtr, nsObjPtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &lambdaType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &lambdaType); \ (procPtr) = irPtr ? (Proc *)irPtr->twoPtrValue.ptr1 : NULL; \ (nsObjPtr) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \ } while (0) @@ -327,7 +327,7 @@ Tcl_ProcObjCmd( * of all procs whose argument list is just _args_ */ - if (TclHasIntRep(objv[3], &tclProcBodyType)) { + if (TclHasInternalRep(objv[3], &tclProcBodyType)) { goto done; } @@ -409,7 +409,7 @@ TclCreateProc( Tcl_Obj **argArray; int precompiled = 0; - ProcGetIntRep(bodyPtr, procPtr); + ProcGetInternalRep(bodyPtr, procPtr); if (procPtr != NULL) { /* * Because the body is a TclProProcBody, the actual body is already @@ -724,7 +724,7 @@ TclGetFrame( obj.length = strlen(name); obj.typePtr = NULL; result = TclObjGetFrame(interp, &obj, framePtrPtr); - TclFreeIntRep(&obj); + TclFreeInternalRep(&obj); return result; } @@ -762,7 +762,7 @@ TclObjGetFrame( { Interp *iPtr = (Interp *) interp; int curLevel, level, result; - const Tcl_ObjIntRep *irPtr; + const Tcl_ObjInternalRep *irPtr; const char *name = NULL; Tcl_WideInt w; @@ -788,7 +788,7 @@ TclObjGetFrame( level = curLevel - level; result = 1; } - } else if ((irPtr = TclFetchIntRep(objPtr, &levelReferenceType))) { + } else if ((irPtr = TclFetchInternalRep(objPtr, &levelReferenceType))) { level = irPtr->wideValue; result = 1; } else { @@ -798,10 +798,10 @@ TclObjGetFrame( if (level < 0 || (level > 0 && name[1] == '-')) { result = -1; } else { - Tcl_ObjIntRep ir; + Tcl_ObjInternalRep ir; ir.wideValue = level; - Tcl_StoreIntRep(objPtr, &levelReferenceType, &ir); + Tcl_StoreInternalRep(objPtr, &levelReferenceType, &ir); result = 1; } } else { @@ -1151,7 +1151,7 @@ TclInitCompiledLocals( ByteCode *codePtr; bodyPtr = framePtr->procPtr->bodyPtr; - ByteCodeGetIntRep(bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(bodyPtr, &tclByteCodeType, codePtr); if (codePtr == NULL) { Tcl_Panic("body object for proc attached to frame is not a byte code type"); } @@ -1327,7 +1327,7 @@ InitLocalCache( CompiledLocal *localPtr; int isNew; - ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); /* * Cache the names and initial values of local variables; store the @@ -1400,7 +1400,7 @@ InitArgsAndLocals( int localCt = procPtr->numCompiledLocals, numArgs, argCt, i, imax; Tcl_Obj *const *argObjs; - ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); /* * Make sure that the local cache of variable names and initial values has @@ -1576,7 +1576,7 @@ TclPushProcCallFrame( * local variables are found while compiling. */ - ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); if (codePtr != NULL) { Interp *iPtr = (Interp *) interp; @@ -1786,7 +1786,7 @@ TclNRInterpProcCore( */ procPtr->refCount++; - ByteCodeGetIntRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(procPtr->bodyPtr, &tclByteCodeType, codePtr); TclNRAddCallback(interp, InterpProcNR2, procNameObj, errorProc, NULL, NULL); @@ -1920,7 +1920,7 @@ TclProcCompileProc( Tcl_CallFrame *framePtr; ByteCode *codePtr; - ByteCodeGetIntRep(bodyPtr, &tclByteCodeType, codePtr); + ByteCodeGetInternalRep(bodyPtr, &tclByteCodeType, codePtr); /* * If necessary, compile the procedure's body. The compiler will allocate @@ -1955,7 +1955,7 @@ TclProcCompileProc( codePtr->compileEpoch = iPtr->compileEpoch; codePtr->nsPtr = nsPtr; } else { - Tcl_StoreIntRep(bodyPtr, &tclByteCodeType, NULL); + Tcl_StoreInternalRep(bodyPtr, &tclByteCodeType, NULL); codePtr = NULL; } } @@ -2312,7 +2312,7 @@ TclNewProcBodyObj( TclNewObj(objPtr); if (objPtr) { - ProcSetIntRep(objPtr, procPtr); + ProcSetInternalRep(objPtr, procPtr); } return objPtr; @@ -2341,9 +2341,9 @@ ProcBodyDup( Tcl_Obj *dupPtr) /* Target object for the duplication. */ { Proc *procPtr; - ProcGetIntRep(srcPtr, procPtr); + ProcGetInternalRep(srcPtr, procPtr); - ProcSetIntRep(dupPtr, procPtr); + ProcSetInternalRep(dupPtr, procPtr); } /* @@ -2371,7 +2371,7 @@ ProcBodyFree( { Proc *procPtr; - ProcGetIntRep(objPtr, procPtr); + ProcGetInternalRep(objPtr, procPtr); if (procPtr->refCount-- <= 1) { TclProcCleanupProc(procPtr); @@ -2400,12 +2400,12 @@ DupLambdaInternalRep( Proc *procPtr; Tcl_Obj *nsObjPtr; - LambdaGetIntRep(srcPtr, procPtr, nsObjPtr); + LambdaGetInternalRep(srcPtr, procPtr, nsObjPtr); assert(procPtr != NULL); procPtr->refCount++; - LambdaSetIntRep(copyPtr, procPtr, nsObjPtr); + LambdaSetInternalRep(copyPtr, procPtr, nsObjPtr); } static void @@ -2416,7 +2416,7 @@ FreeLambdaInternalRep( Proc *procPtr; Tcl_Obj *nsObjPtr; - LambdaGetIntRep(objPtr, procPtr, nsObjPtr); + LambdaGetInternalRep(objPtr, procPtr, nsObjPtr); assert(procPtr != NULL); if (procPtr->refCount-- <= 1) { @@ -2590,7 +2590,7 @@ SetLambdaFromAny( * conversion to lambdaType. */ - LambdaSetIntRep(objPtr, procPtr, nsObjPtr); + LambdaSetInternalRep(objPtr, procPtr, nsObjPtr); return TCL_OK; } @@ -2603,13 +2603,13 @@ TclGetLambdaFromObj( Proc *procPtr; Tcl_Obj *nsObjPtr; - LambdaGetIntRep(objPtr, procPtr, nsObjPtr); + LambdaGetInternalRep(objPtr, procPtr, nsObjPtr); if (procPtr == NULL) { if (SetLambdaFromAny(interp, objPtr) != TCL_OK) { return NULL; } - LambdaGetIntRep(objPtr, procPtr, nsObjPtr); + LambdaGetInternalRep(objPtr, procPtr, nsObjPtr); } assert(procPtr != NULL); diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index f161782..b7fbb81 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -109,19 +109,19 @@ const Tcl_ObjType tclRegexpType = { SetRegexpFromAny /* setFromAnyProc */ }; -#define RegexpSetIntRep(objPtr, rePtr) \ +#define RegexpSetInternalRep(objPtr, rePtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ (rePtr)->refCount++; \ ir.twoPtrValue.ptr1 = (rePtr); \ ir.twoPtrValue.ptr2 = NULL; \ - Tcl_StoreIntRep((objPtr), &tclRegexpType, &ir); \ + Tcl_StoreInternalRep((objPtr), &tclRegexpType, &ir); \ } while (0) -#define RegexpGetIntRep(objPtr, rePtr) \ +#define RegexpGetInternalRep(objPtr, rePtr) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &tclRegexpType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &tclRegexpType); \ (rePtr) = irPtr ? (TclRegexp *)irPtr->twoPtrValue.ptr1 : NULL; \ } while (0) @@ -598,7 +598,7 @@ Tcl_GetRegExpFromObj( TclRegexp *regexpPtr; const char *pattern; - RegexpGetIntRep(objPtr, regexpPtr); + RegexpGetInternalRep(objPtr, regexpPtr); if ((regexpPtr == NULL) || (regexpPtr->flags != flags)) { pattern = TclGetStringFromObj(objPtr, &length); @@ -608,7 +608,7 @@ Tcl_GetRegExpFromObj( return NULL; } - RegexpSetIntRep(objPtr, regexpPtr); + RegexpSetInternalRep(objPtr, regexpPtr); } return (Tcl_RegExp) regexpPtr; } @@ -757,7 +757,7 @@ FreeRegexpInternalRep( { TclRegexp *regexpRepPtr; - RegexpGetIntRep(objPtr, regexpRepPtr); + RegexpGetInternalRep(objPtr, regexpRepPtr); assert(regexpRepPtr != NULL); @@ -794,11 +794,11 @@ DupRegexpInternalRep( { TclRegexp *regexpPtr; - RegexpGetIntRep(srcPtr, regexpPtr); + RegexpGetInternalRep(srcPtr, regexpPtr); assert(regexpPtr != NULL); - RegexpSetIntRep(copyPtr, regexpPtr); + RegexpSetInternalRep(copyPtr, regexpPtr); } /* diff --git a/generic/tclResult.c b/generic/tclResult.c index 5b7a8e5..dba57c1 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -1013,7 +1013,7 @@ ResetObjResult( objResultPtr->bytes = &tclEmptyString; objResultPtr->length = 0; } - TclFreeIntRep(objResultPtr); + TclFreeInternalRep(objResultPtr); } } @@ -1336,7 +1336,7 @@ TclProcessReturn( Tcl_ListObjLength(interp, iPtr->errorStack, &len); /* - * Reset while keeping the list intrep as much as possible. + * Reset while keeping the list internalrep as much as possible. */ Tcl_ListObjReplace(interp, iPtr->errorStack, 0, len, valueObjc, diff --git a/generic/tclScan.c b/generic/tclScan.c index f35b376..5568529 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -1017,8 +1017,8 @@ Tcl_ScanObjCmd( double dvalue; if (Tcl_GetDoubleFromObj(NULL, objPtr, &dvalue) != TCL_OK) { #ifdef ACCEPT_NAN - const Tcl_ObjIntRep *irPtr - = TclFetchIntRep(objPtr, &tclDoubleType); + const Tcl_ObjInternalRep *irPtr + = TclFetchInternalRep(objPtr, &tclDoubleType); if (irPtr) { dvalue = irPtr->doubleValue; } else diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index b213bed..3cee154 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -553,11 +553,11 @@ TclParseNumber( if (bytes == NULL) { if (interp == NULL && endPtrPtr == NULL) { - if (TclHasIntRep(objPtr, &tclDictType)) { + if (TclHasInternalRep(objPtr, &tclDictType)) { /* A dict can never be a (single) number */ return TCL_ERROR; } - if (TclHasIntRep(objPtr, &tclListType)) { + if (TclHasInternalRep(objPtr, &tclListType)) { int length; /* A list can only be a (single) number if its length == 1 */ TclListObjLength(NULL, objPtr, &length); @@ -1295,7 +1295,7 @@ TclParseNumber( */ if (status == TCL_OK && objPtr != NULL) { - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); switch (acceptState) { case SIGNUM: case BAD_OCTAL: @@ -1405,7 +1405,7 @@ TclParseNumber( if (signum) { err = mp_neg(&octalSignificandBig, &octalSignificandBig); } - TclSetBignumIntRep(objPtr, &octalSignificandBig); + TclSetBignumInternalRep(objPtr, &octalSignificandBig); } if (err != MP_OKAY) { return TCL_ERROR; @@ -1441,7 +1441,7 @@ TclParseNumber( if (signum) { err = mp_neg(&significandBig, &significandBig); } - TclSetBignumIntRep(objPtr, &significandBig); + TclSetBignumInternalRep(objPtr, &significandBig); } if (err != MP_OKAY) { return TCL_ERROR; diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 508b280..91b632a 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -836,7 +836,7 @@ Tcl_SetStringObj( * Set the type to NULL and free any internal rep for the old type. */ - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); /* * Free any old string rep, then set the string rep to a copy of the @@ -1098,7 +1098,7 @@ Tcl_SetUnicodeObj( if (Tcl_IsShared(objPtr)) { Tcl_Panic("%s called with shared object", "Tcl_SetUnicodeObj"); } - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); SetUnicodeObj(objPtr, unicode, numChars); } @@ -1443,7 +1443,7 @@ Tcl_AppendObjToObj( * If appendObjPtr is not of the "String" type, don't convert it. */ - if (TclHasIntRep(appendObjPtr, &tclStringType)) { + if (TclHasInternalRep(appendObjPtr, &tclStringType)) { Tcl_UniChar *unicode = Tcl_GetUnicodeFromObj(appendObjPtr, &numChars); @@ -1464,7 +1464,7 @@ Tcl_AppendObjToObj( bytes = TclGetStringFromObj(appendObjPtr, &length); numChars = stringPtr->numChars; - if ((numChars >= 0) && TclHasIntRep(appendObjPtr, &tclStringType)) { + if ((numChars >= 0) && TclHasInternalRep(appendObjPtr, &tclStringType)) { String *appendStringPtr = GET_STRING(appendObjPtr); appendNumChars = appendStringPtr->numChars; @@ -2869,7 +2869,7 @@ TclGetStringStorage( { String *stringPtr; - if (!TclHasIntRep(objPtr, &tclStringType) || objPtr->bytes == NULL) { + if (!TclHasInternalRep(objPtr, &tclStringType) || objPtr->bytes == NULL) { return TclGetStringFromObj(objPtr, (int *)sizePtr); } @@ -2917,7 +2917,7 @@ TclStringRepeat( */ if (!binary) { - if (TclHasIntRep(objPtr, &tclStringType)) { + if (TclHasInternalRep(objPtr, &tclStringType)) { String *stringPtr = GET_STRING(objPtr); if (stringPtr->hasUnicode) { unichar = 1; @@ -3001,7 +3001,7 @@ TclStringRepeat( if (!inPlace || Tcl_IsShared(objPtr)) { objResultPtr = Tcl_NewStringObj(Tcl_GetString(objPtr), length); } else { - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objResultPtr = objPtr; } if (0 == Tcl_AttemptSetObjLength(objResultPtr, count*length)) { @@ -3096,7 +3096,7 @@ TclStringCat( } else { /* assert (objPtr->typePtr != NULL) -- stork! */ binary = 0; - if (TclHasIntRep(objPtr, &tclStringType)) { + if (TclHasInternalRep(objPtr, &tclStringType)) { /* Have a pure Unicode value; ask to preserve it */ requestUniChar = 1; } else { @@ -3363,7 +3363,7 @@ TclStringCat( dst = Tcl_GetString(objResultPtr) + start; /* assert ( length > start ) */ - TclFreeIntRep(objResultPtr); + TclFreeInternalRep(objResultPtr); } else { TclNewObj(objResultPtr); /* PANIC? */ if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) { @@ -3449,8 +3449,8 @@ TclStringCmp( s1 = (char *) Tcl_GetByteArrayFromObj(value1Ptr, &s1len); s2 = (char *) Tcl_GetByteArrayFromObj(value2Ptr, &s2len); memCmpFn = memcmp; - } else if (TclHasIntRep(value1Ptr, &tclStringType) - && TclHasIntRep(value2Ptr, &tclStringType)) { + } else if (TclHasInternalRep(value1Ptr, &tclStringType) + && TclHasInternalRep(value2Ptr, &tclStringType)) { /* * Do a unicode-specific comparison if both of the args are of * String type. If the char length == byte length, we can do a @@ -4284,7 +4284,7 @@ SetStringFromAny( TCL_UNUSED(Tcl_Interp *), Tcl_Obj *objPtr) /* The object to convert. */ { - if (!TclHasIntRep(objPtr, &tclStringType)) { + if (!TclHasInternalRep(objPtr, &tclStringType)) { String *stringPtr = stringAlloc(0); /* @@ -4292,10 +4292,10 @@ SetStringFromAny( */ (void) TclGetString(objPtr); - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); /* - * Create a basic String intrep that just points to the UTF-8 string + * Create a basic String internalrep that just points to the UTF-8 string * already in place at objPtr->bytes. */ diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 137aea0..533e2c7 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -1920,10 +1920,10 @@ const TclStubs tclStubs = { TclZipfs_Unmount, /* 633 */ TclZipfs_TclLibrary, /* 634 */ TclZipfs_MountBuffer, /* 635 */ - Tcl_FreeIntRep, /* 636 */ + Tcl_FreeInternalRep, /* 636 */ Tcl_InitStringRep, /* 637 */ - Tcl_FetchIntRep, /* 638 */ - Tcl_StoreIntRep, /* 639 */ + Tcl_FetchInternalRep, /* 638 */ + Tcl_StoreInternalRep, /* 639 */ Tcl_HasStringRep, /* 640 */ Tcl_IncrRefCount, /* 641 */ Tcl_DecrRefCount, /* 642 */ diff --git a/generic/tclTest.c b/generic/tclTest.c index 5c08aa0..1ce11eb 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -1654,7 +1654,7 @@ TestdoubledigitsObjCmd( status = Tcl_GetDoubleFromObj(interp, objv[1], &d); if (status != TCL_OK) { doubleType = Tcl_GetObjType("double"); - if (Tcl_FetchIntRep(objv[1], doubleType) + if (Tcl_FetchInternalRep(objv[1], doubleType) && TclIsNaN(objv[1]->internalRep.doubleValue)) { status = TCL_OK; memcpy(&d, &(objv[1]->internalRep.doubleValue), sizeof(double)); @@ -1891,7 +1891,7 @@ TestencodingObjCmd( } Tcl_FreeEncoding(encoding); /* Free returned reference */ Tcl_FreeEncoding(encoding); /* Free to match CREATE */ - TclFreeIntRep(objv[2]); /* Free the cached ref */ + TclFreeInternalRep(objv[2]); /* Free the cached ref */ break; } return TCL_OK; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index bbacbe2..32721f6 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -123,7 +123,7 @@ static int FindElement(Tcl_Interp *interp, const char *string, * represents a list index in the form, "end-offset". It is used as a * performance optimization in Tcl_GetIntForIndex. The internal rep is * stored directly in the wideValue, so no memory management is required - * for it. This is a caching intrep, keeping the result of a parse + * for it. This is a caching internalrep, keeping the result of a parse * around. This type is only created from a pre-existing string, so an * updateStringProc will never be called and need not exist. The type * is unregistered, so has no need of a setFromAnyProc either. @@ -2589,7 +2589,7 @@ TclStringMatchObj( trivial = nocase ? 0 : TclMatchIsTrivial(TclGetString(ptnObj)); */ - if (TclHasIntRep(strObj, &tclStringType) || (strObj->typePtr == NULL)) { + if (TclHasInternalRep(strObj, &tclStringType) || (strObj->typePtr == NULL)) { Tcl_UniChar *udata, *uptn; udata = Tcl_GetUnicodeFromObj(strObj, &length); @@ -3035,7 +3035,7 @@ Tcl_DStringGetResult( dsPtr->string = TclGetString(iPtr->objResultPtr); dsPtr->length = iPtr->objResultPtr->length; dsPtr->spaceAvl = dsPtr->length + 1; - TclFreeIntRep(iPtr->objResultPtr); + TclFreeInternalRep(iPtr->objResultPtr); iPtr->objResultPtr->bytes = &tclEmptyString; iPtr->objResultPtr->length = 0; } @@ -3752,12 +3752,12 @@ GetEndOffsetFromObj( Tcl_WideInt *widePtr) /* Location filled in with an integer * representing an index. */ { - Tcl_ObjIntRep *irPtr; + Tcl_ObjInternalRep *irPtr; Tcl_WideInt offset = -1; /* Offset in the "end-offset" expression - 1 */ ClientData cd; - while ((irPtr = TclFetchIntRep(objPtr, &endOffsetType)) == NULL) { - Tcl_ObjIntRep ir; + while ((irPtr = TclFetchInternalRep(objPtr, &endOffsetType)) == NULL) { + Tcl_ObjInternalRep ir; int length; const char *bytes = TclGetStringFromObj(objPtr, &length); @@ -3816,8 +3816,8 @@ GetEndOffsetFromObj( } } } - /* Clear invalid intreps left by TclParseNumber */ - TclFreeIntRep(objPtr); + /* Clear invalid internalreps left by TclParseNumber */ + TclFreeInternalRep(objPtr); if (t1 && t2) { /* We have both integer values */ @@ -3942,7 +3942,7 @@ GetEndOffsetFromObj( parseOK: /* Success. Store the new internal rep. */ ir.wideValue = offset; - Tcl_StoreIntRep(objPtr, &endOffsetType, &ir); + Tcl_StoreInternalRep(objPtr, &endOffsetType, &ir); } offset = irPtr->wideValue; @@ -4047,7 +4047,7 @@ TclIndexEncode( int idx; if (TCL_OK == GetWideForIndex(interp, objPtr, (unsigned)TCL_INDEX_END , &wide)) { - const Tcl_ObjIntRep *irPtr = TclFetchIntRep(objPtr, &endOffsetType); + const Tcl_ObjInternalRep *irPtr = TclFetchInternalRep(objPtr, &endOffsetType); if (irPtr && irPtr->wideValue >= 0) { /* "int[+-]int" syntax, works the same here as "int" */ irPtr = NULL; @@ -4330,7 +4330,7 @@ TclSetProcessGlobalValue( /* * Fill the local thread copy directly with the Tcl_Obj value to avoid - * loss of the intrep. Increment newValue refCount early to handle case + * loss of the internalrep. Increment newValue refCount early to handle case * where we set a PGV to itself. */ diff --git a/generic/tclVar.c b/generic/tclVar.c index 51c51f8..d2b8227 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -253,20 +253,20 @@ static const Tcl_ObjType localVarNameType = { FreeLocalVarName, DupLocalVarName, NULL, NULL }; -#define LocalSetIntRep(objPtr, index, namePtr) \ +#define LocalSetInternalRep(objPtr, index, namePtr) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ Tcl_Obj *ptr = (namePtr); \ if (ptr) {Tcl_IncrRefCount(ptr);} \ ir.twoPtrValue.ptr1 = ptr; \ ir.twoPtrValue.ptr2 = INT2PTR(index); \ - Tcl_StoreIntRep((objPtr), &localVarNameType, &ir); \ + Tcl_StoreInternalRep((objPtr), &localVarNameType, &ir); \ } while (0) -#define LocalGetIntRep(objPtr, index, name) \ +#define LocalGetInternalRep(objPtr, index, name) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &localVarNameType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &localVarNameType); \ (name) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \ (index) = irPtr ? PTR2INT(irPtr->twoPtrValue.ptr2) : -1; \ } while (0) @@ -276,22 +276,22 @@ static const Tcl_ObjType parsedVarNameType = { FreeParsedVarName, DupParsedVarName, NULL, NULL }; -#define ParsedSetIntRep(objPtr, arrayPtr, elem) \ +#define ParsedSetInternalRep(objPtr, arrayPtr, elem) \ do { \ - Tcl_ObjIntRep ir; \ + Tcl_ObjInternalRep ir; \ Tcl_Obj *ptr1 = (arrayPtr); \ Tcl_Obj *ptr2 = (elem); \ if (ptr1) {Tcl_IncrRefCount(ptr1);} \ if (ptr2) {Tcl_IncrRefCount(ptr2);} \ ir.twoPtrValue.ptr1 = ptr1; \ ir.twoPtrValue.ptr2 = ptr2; \ - Tcl_StoreIntRep((objPtr), &parsedVarNameType, &ir); \ + Tcl_StoreInternalRep((objPtr), &parsedVarNameType, &ir); \ } while (0) -#define ParsedGetIntRep(objPtr, parsed, array, elem) \ +#define ParsedGetInternalRep(objPtr, parsed, array, elem) \ do { \ - const Tcl_ObjIntRep *irPtr; \ - irPtr = TclFetchIntRep((objPtr), &parsedVarNameType); \ + const Tcl_ObjInternalRep *irPtr; \ + irPtr = TclFetchInternalRep((objPtr), &parsedVarNameType); \ (parsed) = (irPtr != NULL); \ (array) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr1 : NULL; \ (elem) = irPtr ? (Tcl_Obj *)irPtr->twoPtrValue.ptr2 : NULL; \ @@ -615,7 +615,7 @@ TclObjLookupVarEx( *arrayPtrPtr = NULL; restart: - LocalGetIntRep(part1Ptr, localIndex, namePtr); + LocalGetInternalRep(part1Ptr, localIndex, namePtr); if (localIndex >= 0) { if (HasLocalVars(varFramePtr) && !(flags & (TCL_GLOBAL_ONLY | TCL_NAMESPACE_ONLY)) @@ -639,7 +639,7 @@ TclObjLookupVarEx( * If part1Ptr is a parsedVarNameType, retrieve the pre-parsed parts. */ - ParsedGetIntRep(part1Ptr, parsed, arrayPtr, elem); + ParsedGetInternalRep(part1Ptr, parsed, arrayPtr, elem); if (parsed && arrayPtr) { if (part2Ptr != NULL) { /* @@ -685,7 +685,7 @@ TclObjLookupVarEx( part2Ptr = Tcl_NewStringObj(part2 + 1, len - (part2 - part1) - 2); - ParsedSetIntRep(part1Ptr, arrayPtr, part2Ptr); + ParsedSetInternalRep(part1Ptr, arrayPtr, part2Ptr); part1Ptr = arrayPtr; } @@ -721,16 +721,16 @@ TclObjLookupVarEx( Tcl_Obj *cachedNamePtr = localName(varFramePtr, index); if (part1Ptr == cachedNamePtr) { - LocalSetIntRep(part1Ptr, index, NULL); + LocalSetInternalRep(part1Ptr, index, NULL); } else { /* * [80304238ac] Trickiness here. We will store and incr the * refcount on cachedNamePtr. Trouble is that it's possible - * (see test var-22.1) for cachedNamePtr to have an intrep + * (see test var-22.1) for cachedNamePtr to have an internalrep * that contains a stored and refcounted part1Ptr. This * would be a reference cycle which leads to a memory leak. * - * The solution here is to wipe away all intrep(s) in + * The solution here is to wipe away all internalrep(s) in * cachedNamePtr and leave it as string only. This is * radical and destructive, so a better idea would be welcome. */ @@ -739,24 +739,24 @@ TclObjLookupVarEx( * Firstly set cached local var reference (avoid free before set, * see [45b9faf103f2]) */ - LocalSetIntRep(part1Ptr, index, cachedNamePtr); + LocalSetInternalRep(part1Ptr, index, cachedNamePtr); /* Then wipe it */ - TclFreeIntRep(cachedNamePtr); + TclFreeInternalRep(cachedNamePtr); /* * Now go ahead and convert it the the "localVarName" type, * since we suspect at least some use of the value as a * varname and we want to resolve it quickly. */ - LocalSetIntRep(cachedNamePtr, index, NULL); + LocalSetInternalRep(cachedNamePtr, index, NULL); } } else { /* * At least mark part1Ptr as already parsed. */ - ParsedSetIntRep(part1Ptr, NULL, NULL); + ParsedSetInternalRep(part1Ptr, NULL, NULL); } donePart1: @@ -4115,7 +4115,7 @@ ArraySetCmd( */ arrayElemObj = objv[2]; - if (TclHasIntRep(arrayElemObj, &tclDictType) && arrayElemObj->bytes == NULL) { + if (TclHasInternalRep(arrayElemObj, &tclDictType) && arrayElemObj->bytes == NULL) { Tcl_Obj *keyPtr, *valuePtr; Tcl_DictSearch search; int done; @@ -5788,7 +5788,7 @@ FreeLocalVarName( int index; Tcl_Obj *namePtr; - LocalGetIntRep(objPtr, index, namePtr); + LocalGetInternalRep(objPtr, index, namePtr); index++; /* Compiler warning bait. */ if (namePtr) { @@ -5804,11 +5804,11 @@ DupLocalVarName( int index; Tcl_Obj *namePtr; - LocalGetIntRep(srcPtr, index, namePtr); + LocalGetInternalRep(srcPtr, index, namePtr); if (!namePtr) { namePtr = srcPtr; } - LocalSetIntRep(dupPtr, index, namePtr); + LocalSetInternalRep(dupPtr, index, namePtr); } /* @@ -5827,7 +5827,7 @@ FreeParsedVarName( Tcl_Obj *arrayPtr, *elem; int parsed; - ParsedGetIntRep(objPtr, parsed, arrayPtr, elem); + ParsedGetInternalRep(objPtr, parsed, arrayPtr, elem); parsed++; /* Silence compiler. */ if (arrayPtr != NULL) { @@ -5844,10 +5844,10 @@ DupParsedVarName( Tcl_Obj *arrayPtr, *elem; int parsed; - ParsedGetIntRep(srcPtr, parsed, arrayPtr, elem); + ParsedGetInternalRep(srcPtr, parsed, arrayPtr, elem); parsed++; /* Silence compiler. */ - ParsedSetIntRep(dupPtr, arrayPtr, elem); + ParsedSetInternalRep(dupPtr, arrayPtr, elem); } /* diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c index a70a789..1717c3c 100644 --- a/macosx/tclMacOSXFCmd.c +++ b/macosx/tclMacOSXFCmd.c @@ -577,7 +577,7 @@ GetOSTypeFromObj( { int result = TCL_OK; - if (!TclHasIntRep(objPtr, &tclOSTypeType)) { + if (!TclHasInternalRep(objPtr, &tclOSTypeType)) { result = SetOSTypeFromAny(interp, objPtr); } *osTypePtr = (OSType) objPtr->internalRep.wideValue; @@ -659,7 +659,7 @@ SetOSTypeFromAny( (OSType) bytes[1] << 16 | (OSType) bytes[2] << 8 | (OSType) bytes[3]; - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.wideValue = (Tcl_WideInt) osType; objPtr->typePtr = &tclOSTypeType; } -- cgit v0.12