Index: Makefile.in =================================================================== diff -u -r379ac9a34ada00777afd0d8e0fe199ff825e982b -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- Makefile.in (.../Makefile.in) (revision 379ac9a34ada00777afd0d8e0fe199ff825e982b) +++ Makefile.in (.../Makefile.in) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -708,10 +708,10 @@ #======================================================================== pkgIndex.tcl: $(PKG_LIB_FILE) - @echo package ifneeded nsf $(PACKAGE_VERSION) \"load [list [file join \$$dir . $(PKG_LIB_FILE)] nsf]\; package provide nsf $(PACKAGE_VERSION)\" > pkgIndex.tcl + @echo package ifneeded nsf $(PACKAGE_VERSION) \"load [list [file join \$$dir . $(PKG_LIB_FILE)] Nsf]\; package provide nsf $(PACKAGE_VERSION)\" > pkgIndex.tcl install-pkgIndex: -# @echo package ifneeded nsf $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] nsf] > "$(pkglibdir)/pkgIndex.tcl" +# @echo package ifneeded nsf $(PACKAGE_VERSION) [list load [file join \$$dir .. "$(PKG_LIB_FILE)"] Nsf] > "$(pkglibdir)/pkgIndex.tcl" #nxsh: tclAppInit.o $(PKG_OBJECTS) $(CONDITIONAL_STUB_OBJECTS) # $(CC) -rdynamic -o $@ tclAppInit.o \ Index: generic/nsf.c =================================================================== diff -u -re3f1c112441a1f66703d7d33659830ca7059aaea -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsf.c (.../nsf.c) (revision e3f1c112441a1f66703d7d33659830ca7059aaea) +++ generic/nsf.c (.../nsf.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -117,7 +117,7 @@ ClientData oldDeleteData; Tcl_CmdDeleteProc *oldDeleteProc; NsfParamDefs *paramDefs; - int *colonLocalVarCache; + long *colonLocalVarCache; unsigned int checkAlwaysFlag; Tcl_Namespace *execNsPtr; Tcl_Obj *returnsObj; @@ -240,8 +240,8 @@ /* * Prototypes for interpreter life-cyle */ -EXTERN Tcl_PackageInitProc Nsf_SafeInit; -EXTERN Tcl_PackageInitProc Nsf_Init; +EXTERN Tcl_LibraryInitProc Nsf_SafeInit; +EXTERN Tcl_LibraryInitProc Nsf_Init; static Tcl_ExitProc Nsf_ExitProc; static Tcl_ExitProc ExitHandler; @@ -740,9 +740,9 @@ nonnull_assert(context != NULL); Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, "puts stderr \"Error in ", -1); - Tcl_DStringAppend(dsPtr, context, -1); - Tcl_DStringAppend(dsPtr, ":\n$::errorCode $::errorInfo\"", -1); + Tcl_DStringAppend(dsPtr, "puts stderr \"Error in ", TCL_INDEX_NONE); + Tcl_DStringAppend(dsPtr, context, TCL_INDEX_NONE); + Tcl_DStringAppend(dsPtr, ":\n$::errorCode $::errorInfo\"", TCL_INDEX_NONE); Tcl_EvalEx(interp, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), 0); Tcl_DStringFree(dsPtr); } @@ -1074,7 +1074,7 @@ memcpy(pcPtr->objv + from, source, sizeof(Tcl_Obj *) * (size_t)elts); memset(pcPtr->flags + from, 0, sizeof(int) * (size_t)elts); - pcPtr->objc += (int)elts; + pcPtr->objc += (TCL_SIZE_T)elts; /*NsfPrintObjv("AFTER: ", pcPtr->objc, pcPtr->full_objv);*/ } @@ -1165,6 +1165,7 @@ if (unlikely(status != 0u)) { if ((status & NSF_PC_STATUS_MUST_DECR) != 0u) { int i; + /*fprintf(stderr, "ParseContextRelease %p loop from 0 to %d\n", pcPtr, pcPtr->objc-1);*/ for (i = 0; i < pcPtr->objc; i++) { /*fprintf(stderr, "ParseContextRelease %p check [%d] obj %p flags %.6x & %p\n", @@ -1285,8 +1286,8 @@ int NsfCallMethodWithArgs(Tcl_Interp *interp, Nsf_Object *object, Tcl_Obj *methodObj, Tcl_Obj *arg1, int givenObjc, Tcl_Obj *const objv[], unsigned int flags) { - int objc = givenObjc + 2; - int result; + int objc = givenObjc + 2; + int result; ALLOC_ON_STACK(Tcl_Obj*, objc, tov); nonnull_assert(interp != NULL); @@ -1374,11 +1375,11 @@ * *---------------------------------------------------------------------- */ -static Tcl_HashEntry * Nsf_NextHashEntry(Tcl_HashTable *tablePtr, int expected, Tcl_HashSearch *hSrchPtr) +static Tcl_HashEntry * Nsf_NextHashEntry(Tcl_HashTable *tablePtr, size_t expected, Tcl_HashSearch *hSrchPtr) nonnull(1) nonnull(3); static Tcl_HashEntry * -Nsf_NextHashEntry(Tcl_HashTable *tablePtr, int expected, Tcl_HashSearch *hSrchPtr) { +Nsf_NextHashEntry(Tcl_HashTable *tablePtr, size_t expected, Tcl_HashSearch *hSrchPtr) { Tcl_HashEntry *result; nonnull_assert(tablePtr != NULL); @@ -1874,19 +1875,19 @@ static char * DStringAppendQualName(Tcl_DString *dsPtr, const Tcl_Namespace *nsPtr, const char *name) { - int oldLength; + size_t oldLength; nonnull_assert(dsPtr != NULL); nonnull_assert(nsPtr != NULL); nonnull_assert(name != NULL); oldLength = Tcl_DStringLength(dsPtr); - Tcl_DStringAppend(dsPtr, nsPtr->fullName, -1); + Tcl_DStringAppend(dsPtr, nsPtr->fullName, TCL_INDEX_NONE); if (Tcl_DStringLength(dsPtr) > (oldLength + 2)) { Tcl_DStringAppend(dsPtr, "::", 2); } - Tcl_DStringAppend(dsPtr, name, -1); + Tcl_DStringAppend(dsPtr, name, TCL_INDEX_NONE); return Tcl_DStringValue(dsPtr); } @@ -2026,7 +2027,7 @@ cmd = Tcl_GetCommandFromObj(interp, objPtr); /*fprintf(stderr, "GetObjectFromObj obj %p %s (type %p) => cmd=%p (refCount %d)\n", - objPtr, ObjStr(objPtr), objPtr->typePtr, cmd, (cmd != NULL) ? Tcl_Command_refCount(cmd) : -1);*/ + objPtr, ObjStr(objPtr), objPtr->typePtr, cmd, (cmd != NULL) ? Tcl_Command_refCount(cmd) : TCL_INDEX_NONE);*/ if (cmd != NULL) { NsfObject *cmdObject; @@ -2351,10 +2352,10 @@ Tcl_DString ds, *dsPtr = &ds; DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, what, -1); + Tcl_DStringAppend(dsPtr, what, TCL_INDEX_NONE); if (pPtr->converterArg != NULL) { - Tcl_DStringAppend(dsPtr, " of type ", -1); - Tcl_DStringAppend(dsPtr, ObjStr(pPtr->converterArg), -1); + Tcl_DStringAppend(dsPtr, " of type ", 9); + Tcl_DStringAppend(dsPtr, ObjStr(pPtr->converterArg), TCL_INDEX_NONE); } NsfObjErrType(interp, NULL, objPtr, Tcl_DStringValue(dsPtr), (Nsf_Param *)pPtr); DSTRING_FREE(dsPtr); @@ -2418,7 +2419,7 @@ void NewTclCommand(Tcl_Interp *interp, Tcl_DString *dsPtr) { - int prefixLength; + size_t prefixLength; NsfStringIncrStruct *iss; nonnull_assert(interp != NULL); @@ -2430,7 +2431,7 @@ while (1) { (void)NsfStringIncr(iss); - Tcl_DStringAppend(dsPtr, iss->start, (int)iss->length); + Tcl_DStringAppend(dsPtr, iss->start, (unsigned long)iss->length); if (!Tcl_FindCommand(interp, Tcl_DStringValue(dsPtr), NULL, TCL_GLOBAL_ONLY)) { break; } @@ -3747,7 +3748,7 @@ * Obtain parent name. */ Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, methodName, (int)objNameLength); + Tcl_DStringAppend(dsPtr, methodName, (TCL_SIZE_T)objNameLength); regObject = GetObjectFromNsName(interp, Tcl_DStringValue(dsPtr), fromClassNS); if (regObject != NULL && methodName1 != NULL) { *methodName1 = procName; @@ -3903,7 +3904,7 @@ INCR_REF_COUNT(methodHandleObj); if (methodNameDs != NULL) { - Tcl_DStringAppend(methodNameDs, Tcl_GetCommandName(interp, cmd), -1); + Tcl_DStringAppend(methodNameDs, Tcl_GetCommandName(interp, cmd), TCL_INDEX_NONE); } parentNsPtr = NULL; @@ -3940,7 +3941,7 @@ parentNsPtr = ensembleObject->nsPtr; Tcl_AppendLimitedToObj(methodHandleObj, "::", 2, INT_MAX, NULL); - Tcl_AppendLimitedToObj(methodHandleObj, ObjStr(ov[i]), -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(methodHandleObj, ObjStr(ov[i]), TCL_INDEX_NONE, INT_MAX, NULL); if (methodNameDs != NULL) { Tcl_DStringAppendElement(methodNameDs, ObjStr(ov[i])); } @@ -4919,37 +4920,37 @@ static Tcl_Var CompiledLocalsLookup(CallFrame *varFramePtr, const char *varName) { - int localCt; + TCL_SIZE_T localCt; nonnull_assert(varFramePtr != NULL); nonnull_assert(varName != NULL); localCt = varFramePtr->numCompiledLocals; if (localCt > 0) { Tcl_Obj **varNameObjPtr; - int i, nameLength; + size_t i, nameLength; varNameObjPtr = &varFramePtr->localCachePtr->varName0; - nameLength = (int)strlen(varName); + nameLength = strlen(varName); /* fprintf(stderr, "=== compiled local search #local vars %d for <%s> flags %.8x\n", localCt, varName, varFramePtr->isProcCallFrame); */ for (i = 0 ; i < localCt ; i++, varNameObjPtr++) { - Tcl_Obj *varNameObj = *varNameObjPtr; - int len; + Tcl_Obj *varNameObj = *varNameObjPtr; + TCL_SIZE_T len; if (likely(varNameObj != NULL)) { - const char *localName = TclGetStringFromObj(varNameObj, &len); + const char *localName = Tcl_GetStringFromObj(varNameObj, &len); /* fprintf(stderr, ".. [%d] varNameObj %p %p <%s>\n", i, (void *)varNameObj, (void *)varNameObj->typePtr, localName); */ if (unlikely(varName[0] == localName[0] && varName[1] == localName[1] - && len == nameLength + && (TCL_SIZE_T)len == nameLength && memcmp(varName, localName, (size_t)len) == 0)) { return (Tcl_Var) &varFramePtr->compiledLocals[i]; } @@ -4978,18 +4979,19 @@ * *---------------------------------------------------------------------- */ -static Tcl_Var CompiledColonLocalsLookupBuildCache(CallFrame *varFramePtr, - const char *varName, - int nameLength, +static Tcl_Var CompiledColonLocalsLookupBuildCache(CallFrame *varFramePtr, + const char *varName, + TCL_SIZE_T nameLength, Tcl_Obj **localNames, NsfProcContext *ctxPtr) nonnull(1) nonnull(2) nonnull(4) nonnull(5); static Tcl_Var CompiledColonLocalsLookupBuildCache(CallFrame *varFramePtr, const char *varName, - int nameLength, Tcl_Obj **localNames, + TCL_SIZE_T nameLength, Tcl_Obj **localNames, NsfProcContext *ctxPtr) { - int nrColonVars = 0, localCt, i, j; + int nrColonVars = 0, j; + size_t localCt, i; Tcl_Var result; Tcl_Obj **varNameObjPtr; @@ -5028,7 +5030,7 @@ * Allocate colonLocalVarCache in the proper size (keep space for a * terminating element). */ - ctxPtr->colonLocalVarCache = NEW_ARRAY(int, nrColonVars+1); + ctxPtr->colonLocalVarCache = NEW_ARRAY(long, nrColonVars+1); varNameObjPtr = &varFramePtr->localCachePtr->varName0; /* @@ -5042,8 +5044,8 @@ Tcl_Obj *varNameObj = *varNameObjPtr; if (varNameObj != NULL) { - int len; - const char *localName = TclGetStringFromObj(varNameObj, &len); + TCL_SIZE_T len; + const char *localName = Tcl_GetStringFromObj(varNameObj, &len); if (localName[0] == ':') { int k; @@ -5057,11 +5059,12 @@ /* fprintf(stderr, ".. insert %s (%d) on pos %d; check j %d entries \n", localName, i, j, j); */ for (k = 0; k < j; k++) { - int idx, cmp; + int cmp; + long idx; const char *cachedName; idx = ctxPtr->colonLocalVarCache[k]; - cachedName = TclGetStringFromObj(localNames[idx], &len); + cachedName = Tcl_GetStringFromObj(localNames[idx], &len); cmp = strcmp(localName, cachedName); /* fprintf(stderr, "... [%d] cmp newVarName <%s> (%d) with cachendName <%s> (%d) => %d\n", @@ -5080,7 +5083,7 @@ break; } } - ctxPtr->colonLocalVarCache[k] = i; + ctxPtr->colonLocalVarCache[k] = (long)i; j++; if (j == nrColonVars) { @@ -5132,7 +5135,7 @@ result = NULL; } else { Tcl_Obj **localNames; - int nameLength; + TCL_SIZE_T nameLength; Tcl_Command cmd; NsfProcContext *ctxPtr; @@ -5141,7 +5144,7 @@ * variable to search for faster access into local variables. */ localNames = &varFramePtr->localCachePtr->varName0; - nameLength = (int)strlen(varName); + nameLength = (TCL_SIZE_T)strlen(varName); cmd = (Tcl_Command )varFramePtr->procPtr->cmdPtr; ctxPtr = ProcContextRequire(cmd); @@ -5154,7 +5157,7 @@ result = CompiledColonLocalsLookupBuildCache(varFramePtr, varName, nameLength, localNames, ctxPtr); } else { - int i, j; + long i, j; /* * We have a colonLocalVarCache. @@ -5163,11 +5166,13 @@ * termination after O(n/2) on failures. */ result = NULL; - for (i = 0, j = ctxPtr->colonLocalVarCache[0]; j > -1; ++i, j = ctxPtr->colonLocalVarCache[i]) { - int len; + for (i = 0, j = ctxPtr->colonLocalVarCache[0]; + j > -1; + ++i, j = ctxPtr->colonLocalVarCache[i]) { + TCL_SIZE_T len; const char *localName; - localName = TclGetStringFromObj(localNames[j], &len); + localName = Tcl_GetStringFromObj(localNames[j], &len); /* fprintf(stderr, ".. [%d] varNameObj %p <%s> vs <%s>\n", j, (void *)varNameObj, localName, varName); */ @@ -5313,7 +5318,7 @@ } Tcl_ListObjAppendElement(interp, resultObj, - Tcl_NewStringObj(methodName, -1)); + Tcl_NewStringObj(methodName, TCL_INDEX_NONE)); return resultObj; } @@ -5445,7 +5450,7 @@ /* * Does the variable exist in the object's namespace? */ - key = Tcl_NewStringObj(varName, -1); + key = Tcl_NewStringObj(varName, TCL_INDEX_NONE); INCR_REF_COUNT(key); *varPtr = (Tcl_Var)VarHashCreateVar(varTablePtr, key, NULL); @@ -5703,13 +5708,13 @@ * *---------------------------------------------------------------------- */ -static int InterpCompiledColonVarResolver(Tcl_Interp *interp, const char *name, int length, +static int InterpCompiledColonVarResolver(Tcl_Interp *interp, const char *name, size_t length, Tcl_Namespace *UNUSED(context), Tcl_ResolvedVarInfo **rPtr) nonnull(1) nonnull(2) nonnull(5); static int InterpCompiledColonVarResolver(Tcl_Interp *interp, - const char *name, int length, Tcl_Namespace *UNUSED(context), + const char *name, size_t length, Tcl_Namespace *UNUSED(context), Tcl_ResolvedVarInfo **rPtr) { /* * The variable handler is registered, when we have an active Next @@ -5735,7 +5740,7 @@ resVarInfo->vInfo.deleteProc = CompiledColonVarFree; /* if NULL, Tcl does a ckfree on proc clean up */ resVarInfo->lastObject = NULL; resVarInfo->var = NULL; - resVarInfo->nameObj = Tcl_NewStringObj(name+1, length-1); + resVarInfo->nameObj = Tcl_NewStringObj(name+1, (TCL_SIZE_T)length-1); INCR_REF_COUNT(resVarInfo->nameObj); #if defined(VAR_RESOLVER_TRACE) @@ -5945,7 +5950,7 @@ /*fprintf(stderr, "Object Var Resolver, name=%s, obj %p, nsPtr %p, varTablePtr %p\n", varName, (void *)object, (void *)object->nsPtr, (void *)varTablePtr);*/ - keyObj = Tcl_NewStringObj(varName, -1); + keyObj = Tcl_NewStringObj(varName, TCL_INDEX_NONE); INCR_REF_COUNT(keyObj); var = (Tcl_Var)VarHashCreateVar(varTablePtr, keyObj, NULL); @@ -6526,7 +6531,7 @@ Tcl_HashTable *cmdTablePtr = Tcl_Namespace_cmdTablePtr(nsPtr); Tcl_HashSearch hSrch; const Tcl_HashEntry *hPtr; - int expected; + size_t expected; nonnull_assert(interp != NULL); nonnull_assert(nsPtr != NULL); @@ -6966,7 +6971,7 @@ nonnull_assert(interp != NULL); nonnull_assert(parentName != NULL); - result = NsfCallObjectUnknownHandler(interp, Tcl_NewStringObj(parentName, -1)); + result = NsfCallObjectUnknownHandler(interp, Tcl_NewStringObj(parentName, TCL_INDEX_NONE)); if (likely(result == TCL_OK)) { NsfObject *parentObj = (NsfObject *)GetObjectFromString(interp, parentName); @@ -7058,7 +7063,7 @@ /*fprintf(stderr, "NSCheckNamespace parentNs %s parentName of '%s' => '%s'\n", parentNsPtr->fullName, nameString, parentName);*/ } else { - int parentNameLength; + TCL_SIZE_T parentNameLength; const char *n = nameString + strlen(nameString); /* * search for last '::' @@ -7069,7 +7074,7 @@ if (*n == ':' && n > nameString && *(n-1) == ':') { n--; } - parentNameLength = (int)(n - nameString); + parentNameLength = (TCL_SIZE_T)(n - nameString); if (parentNameLength > 0) { DSTRING_INIT(dsPtr); Tcl_DStringAppend(dsPtr, nameString, parentNameLength); @@ -7619,7 +7624,7 @@ buffer[0] = (char)tolower((int)firstChar); resultObj = Tcl_NewStringObj(buffer, 1); INCR_REF_COUNT2("autoname", resultObj); - Tcl_AppendLimitedToObj(resultObj, nextChars, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(resultObj, nextChars, TCL_INDEX_NONE, INT_MAX, NULL); mustCopy = NSF_FALSE; } } @@ -8506,16 +8511,16 @@ resultObj = Tcl_GetObjResult(interp); if (opt->checkoptions & CHECK_OBJINVAR) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("object-invar", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("object-invar", TCL_INDEX_NONE)); } if (opt->checkoptions & CHECK_CLINVAR) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("class-invar", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("class-invar", TCL_INDEX_NONE)); } if (opt->checkoptions & CHECK_PRE) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("pre", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("pre", TCL_INDEX_NONE)); } if (opt->checkoptions & CHECK_POST) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("post", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("post", TCL_INDEX_NONE)); } return TCL_OK; @@ -11197,10 +11202,10 @@ * *---------------------------------------------------------------------- */ -static int FiltersDefined(Tcl_Interp *interp) +static TCL_SIZE_T FiltersDefined(Tcl_Interp *interp) nonnull(1) NSF_pure; -static int +static TCL_SIZE_T FiltersDefined(Tcl_Interp *interp) { nonnull_assert(interp != NULL); @@ -11570,7 +11575,7 @@ Tcl_Obj *g = (Tcl_Obj *) f->clientData; Tcl_ListObjAppendElement(interp, innerList, - Tcl_NewStringObj(simpleName, -1)); + Tcl_NewStringObj(simpleName, TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, innerList, NsfGlobalObjs[NSF_GUARD_OPTION]); Tcl_ListObjAppendElement(interp, innerList, g); Tcl_ListObjAppendElement(interp, list, innerList); @@ -11582,7 +11587,7 @@ MethodHandleObj((NsfObject *)filterClass, !NsfObjectIsClass(&filterClass->object), simpleName)); } else { - Tcl_ListObjAppendElement(interp, list, Tcl_NewStringObj(simpleName, -1)); + Tcl_ListObjAppendElement(interp, list, Tcl_NewStringObj(simpleName, TCL_INDEX_NONE)); } } } @@ -11916,7 +11921,7 @@ Tcl_ListObjAppendElement(interp, list, NsfGlobalObjs[NSF_OBJECT]); Tcl_ListObjAppendElement(interp, list, NsfGlobalObjs[NSF_FILTER]); Tcl_ListObjAppendElement(interp, list, - Tcl_NewStringObj(Tcl_GetCommandName(interp, cmd), -1)); + Tcl_NewStringObj(Tcl_GetCommandName(interp, cmd), TCL_INDEX_NONE)); return list; } @@ -11930,7 +11935,7 @@ Tcl_ListObjAppendElement(interp, list, pl->cl->object.cmdName); Tcl_ListObjAppendElement(interp, list, NsfGlobalObjs[NSF_FILTER]); Tcl_ListObjAppendElement(interp, list, - Tcl_NewStringObj(Tcl_GetCommandName(interp, cmd), -1)); + Tcl_NewStringObj(Tcl_GetCommandName(interp, cmd), TCL_INDEX_NONE)); return list; } } @@ -12287,7 +12292,8 @@ Tcl_Obj *procNameObj /* Name of the procedure. Used for error * messages and trace information. */ ) { - int overflow, limit = 60, nameLen; + int overflow; + TCL_SIZE_T nameLen, limit = 60; const char *procName; /*fprintf(stderr, "MakeProcError %p type %p refCount %d\n", @@ -12298,9 +12304,10 @@ overflow = (nameLen > limit); Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( - "\n (procedure \"%.*s%s\" line %d)", - ((overflow != 0) ? limit : nameLen), procName, - ((overflow != 0) ? "..." : ""), Tcl_GetErrorLine(interp))); + "\n (procedure \"%.*s%s\" line %lu)", + (int)((overflow != 0) ? limit : nameLen), procName, + ((overflow != 0) ? "..." : ""), + (unsigned long)Tcl_GetErrorLine(interp))); } /* @@ -12476,7 +12483,7 @@ if (likely(result == TCL_OK)) { - Tcl_CallFrame_objc(framePtr) = objc; + Tcl_CallFrame_objc(framePtr) = (TCL_SIZE_T)objc; Tcl_CallFrame_objv(framePtr) = objv; Tcl_CallFrame_procPtr(framePtr) = procPtr; Tcl_CallFrame_clientData(framePtr) = cscPtr; @@ -13301,13 +13308,13 @@ *---------------------------------------------------------------------- */ static void ParamDefsFormatOption( - Tcl_Obj *nameStringObj, const char *option, int optionLength, + Tcl_Obj *nameStringObj, const char *option, size_t optionLength, int *colonWritten, int *firstOption ) nonnull(1) nonnull(2) nonnull(4) nonnull(5); static void ParamDefsFormatOption( - Tcl_Obj *nameStringObj, const char *option, int optionLength, + Tcl_Obj *nameStringObj, const char *option, size_t optionLength, int *colonWritten, int *firstOption ) { @@ -13325,7 +13332,7 @@ } else { Tcl_AppendLimitedToObj(nameStringObj, ",", 1, INT_MAX, NULL); } - Tcl_AppendLimitedToObj(nameStringObj, option, optionLength, INT_MAX, NULL); + Tcl_AppendLimitedToObj(nameStringObj, option, (TCL_SIZE_T)optionLength, INT_MAX, NULL); } /* @@ -13400,10 +13407,10 @@ continue; } - nameStringObj = Tcl_NewStringObj(paramsPtr->name, -1); + nameStringObj = Tcl_NewStringObj(paramsPtr->name, TCL_INDEX_NONE); if (paramsPtr->type != NULL) { - ParamDefsFormatOption(nameStringObj, paramsPtr->type, -1, &colonWritten, &first); + ParamDefsFormatOption(nameStringObj, paramsPtr->type, TCL_INDEX_NONE, &colonWritten, &first); } else if (isNonpos && paramsPtr->nrArgs == 0) { ParamDefsFormatOption(nameStringObj, "switch", 6, &colonWritten, &first); } @@ -13413,8 +13420,8 @@ ParamDefsFormatOption(nameStringObj, "optional", 8, &colonWritten, &first); } if ((paramsPtr->flags & NSF_ARG_SUBST_DEFAULT) != 0u) { - char buffer[30]; - int len = 12; + char buffer[30]; + size_t len = 12; memcpy(buffer, "substdefault", (size_t)len); @@ -13509,7 +13516,7 @@ continue; } - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(paramsPtr->name, -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(paramsPtr->name, TCL_INDEX_NONE)); } return listObj; @@ -13561,7 +13568,7 @@ continue; } Tcl_ListObjAppendElement(interp, listObj, (paramsPtr->nameObj != NULL) ? - paramsPtr->nameObj : Tcl_NewStringObj(paramsPtr->name, -1)); + paramsPtr->nameObj : Tcl_NewStringObj(paramsPtr->name, TCL_INDEX_NONE)); } return listObj; @@ -13671,27 +13678,27 @@ nonnull_assert(pPtr != NULL); if (pPtr->nrArgs > 0 && *pPtr->name == '-') { - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, TCL_INDEX_NONE, INT_MAX, NULL); Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); if ((pPtr->flags & NSF_ARG_IS_ENUMERATION) != 0u) { - Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), TCL_INDEX_NONE, INT_MAX, NULL); if ((pPtr->flags & NSF_ARG_MULTIVALUED) != 0u) { Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); } } else { Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); - Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), TCL_INDEX_NONE, INT_MAX, NULL); if ((pPtr->flags & NSF_ARG_MULTIVALUED) != 0u) { Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); } Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); } } else if (*pPtr->name != '-') { Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, TCL_INDEX_NONE, INT_MAX, NULL); Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); } else { - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, TCL_INDEX_NONE, INT_MAX, NULL); } } @@ -13880,7 +13887,8 @@ } if ((pPtr->flags & NSF_ARG_IS_ENUMERATION) != 0u) { - Tcl_AppendLimitedToObj(argStringObj, Nsf_EnumerationTypeGetDomain(pPtr->converter), -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, Nsf_EnumerationTypeGetDomain(pPtr->converter), + TCL_INDEX_NONE, INT_MAX, NULL); } else { NsfParamDefsSyntaxOne(argStringObj, pPtr); } @@ -13889,7 +13897,9 @@ if (pattern != NULL && !ParamsDefMatchPattern(pPtr, pattern)) { continue; } - if (needSpace != 0) Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); + if (needSpace != 0) { + Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); + } Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); NsfParamDefsSyntaxOne(argStringObj, pPtr); Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); @@ -14329,10 +14339,10 @@ */ /*fprintf(stderr, "Nsf_PushFrameCsc %s %s\n", ObjectName(object), Tcl_GetCommandName(interp, cmd));*/ Nsf_PushFrameCsc(interp, cscPtr, framePtr); - result = Tcl_NRCallObjProc(interp, Tcl_Command_objProc(cmd), cp, objc, objv); + result = Tcl_NRCallObjProc(interp, Tcl_Command_objProc(cmd), cp, (TCL_SIZE_T)objc, objv); Nsf_PopFrameCsc(interp, framePtr); } else { - result = Tcl_NRCallObjProc(interp, Tcl_Command_objProc(cmd), cp, objc, objv); + result = Tcl_NRCallObjProc(interp, Tcl_Command_objProc(cmd), cp, (TCL_SIZE_T)objc, objv); } #if defined(NSF_WITH_ASSERTIONS) @@ -15629,11 +15639,13 @@ ) { fprintf(stderr, "################### do NOT trust cached procPtr %p of %s " "(object %s class %s) bodyPtr %p " - "iPtr %p interp %p refCount %d numArgs %d numCompiledLocals %d\n", + "iPtr %p interp %p refCount %lu numArgs %lu numCompiledLocals %lu\n", (void*)procPtr, methodName, ObjectName(object), ClassName(object->cl), (void*)procPtr->bodyPtr, (void*)procPtr->iPtr, (void*)interp, - procPtr->refCount, procPtr->numArgs, procPtr->numCompiledLocals); + (unsigned long)procPtr->refCount, + (unsigned long)procPtr->numArgs, + (unsigned long)procPtr->numCompiledLocals); ccCtxPtr = NULL; } } @@ -16395,7 +16407,7 @@ ALLOC_ON_STACK(Tcl_Obj*, objc+3, tov); if (callInfoObj == NULL) { - callInfoObj = (mustCopy ? Tcl_NewStringObj(methodName, -1) : methodObj); + callInfoObj = (mustCopy ? Tcl_NewStringObj(methodName, TCL_INDEX_NONE) : methodObj); } INCR_REF_COUNT(callInfoObj); @@ -16436,7 +16448,7 @@ ((object->flags & NSF_PER_OBJECT_DISPATCH) != 0u)) && Tcl_ListObjLength(interp, objv[1], &length) == TCL_OK) { if (length > 1) { - Tcl_ListObjIndex(interp, objv[1], length - 1, &tailMethodObj); + Tcl_ListObjIndex(interp, objv[1], (TCL_SIZE_T)length - 1, &tailMethodObj); } } } @@ -16479,7 +16491,7 @@ nonnull_assert(interp != NULL); nonnull_assert(objv != NULL); - return Tcl_NRCallObjProc(interp, NsfObjDispatchNRE, clientData, objc, objv); + return Tcl_NRCallObjProc(interp, NsfObjDispatchNRE, clientData, (TCL_SIZE_T)objc, objv); } int NsfObjDispatchNRE(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) nonnull(1) nonnull(2) nonnull(4); @@ -17397,7 +17409,7 @@ */ if (*pattern != ':' && *pattern+1 != ':') { patternObj = Tcl_NewStringObj("::", 2); - Tcl_AppendLimitedToObj(patternObj, pattern, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(patternObj, pattern, TCL_INDEX_NONE, INT_MAX, NULL); } } if (patternObj != NULL) { @@ -17437,7 +17449,7 @@ nonnull_assert(start != NULL); - Tcl_AppendLimitedToObj(checker, start, (int)len, INT_MAX, NULL); + Tcl_AppendLimitedToObj(checker, start, (TCL_SIZE_T)len, INT_MAX, NULL); return checker; } @@ -17503,7 +17515,7 @@ static void Unescape(Tcl_Obj *objPtr) { - int i, j, l; + TCL_SIZE_T i, j, l; char *string; nonnull_assert(objPtr != NULL); @@ -17692,7 +17704,7 @@ if (paramPtr->converterArg != NULL) { DECR_REF_COUNT(paramPtr->converterArg); } - paramPtr->converterArg = Tcl_NewStringObj(option + 4, (int)optionLength - 4); + paramPtr->converterArg = Tcl_NewStringObj(option + 4, (TCL_SIZE_T)optionLength - 4); /* * In case, we know that we have to unescape double commas, do it here... */ @@ -17751,7 +17763,7 @@ } else if (firstChar == 't' && optionLength >= 6 && strncmp(option, "type=", 5) == 0) { const char* typeValue = option + 5; - int typeValueLength = (int)optionLength - 5; + TCL_SIZE_T typeValueLength = (TCL_SIZE_T)optionLength - 5; if (paramPtr->converter != Nsf_ConvertToObject && paramPtr->converter != Nsf_ConvertToClass ) { @@ -17764,8 +17776,9 @@ if (qualifier != NULL && !isAbsolutePath(typeValue) && isAbsolutePath(qualifier)) { Tcl_DString ds, *dsPtr = &ds; + Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, qualifier, -1); + Tcl_DStringAppend(dsPtr, qualifier, TCL_INDEX_NONE); if (Tcl_DStringLength(dsPtr) > 2) { Tcl_DStringAppend(dsPtr, "::", 2); } @@ -17785,7 +17798,7 @@ if (paramPtr->slotObj != NULL) { DECR_REF_COUNT(paramPtr->slotObj); } - paramPtr->slotObj = Tcl_NewStringObj(option + 5, (int)optionLength - 5); + paramPtr->slotObj = Tcl_NewStringObj(option + 5, (TCL_SIZE_T)optionLength - 5); if (unlikely(unescape)) { Unescape(paramPtr->slotObj); } @@ -17799,7 +17812,7 @@ if (paramPtr->method != NULL) { DECR_REF_COUNT(paramPtr->method); } - paramPtr->method = Tcl_NewStringObj(option + 7, (int)optionLength - 7); + paramPtr->method = Tcl_NewStringObj(option + 7, (TCL_SIZE_T)optionLength - 7); if (unlikely(unescape)) { Unescape(paramPtr->method); } @@ -17821,7 +17834,7 @@ } Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, option, (int)optionLength); + Tcl_DStringAppend(dsPtr, option, (TCL_SIZE_T)optionLength); if (unlikely(paramPtr->converter != NULL)) { NsfPrintError(interp, "parameter option '%s' unknown for parameter type '%s'", @@ -17878,7 +17891,7 @@ if (paramPtr->converterArg != NULL) { DECR_REF_COUNT(paramPtr->converterArg); } - paramPtr->converterArg = Tcl_NewStringObj(stringTypeOpts[i], -1); + paramPtr->converterArg = Tcl_NewStringObj(stringTypeOpts[i], TCL_INDEX_NONE); INCR_REF_COUNT(paramPtr->converterArg); } else { @@ -17973,7 +17986,7 @@ /* For whatever reason, the snippet above seems to be faster than: - argString = TclGetStringFromObj(npav[0], &result); + argString = Tcl_GetStringFromObj(npav[0], &result); length = (size_t) result; */ @@ -18025,7 +18038,7 @@ * Get parameter name */ STRING_NEW(paramPtr->name, argString, j); - paramPtr->nameObj = Tcl_NewStringObj(argName, (isNonposArgument != 0) ? (int)j-1 : (int)j); + paramPtr->nameObj = Tcl_NewStringObj(argName, (isNonposArgument != 0) ? (TCL_SIZE_T)j-1 : (TCL_SIZE_T)j); INCR_REF_COUNT(paramPtr->nameObj); /* @@ -18086,10 +18099,10 @@ */ STRING_NEW(paramPtr->name, argString, length); if (isNonposArgument != 0) { - paramPtr->nameObj = Tcl_NewStringObj(argName, (int)length-1); + paramPtr->nameObj = Tcl_NewStringObj(argName, (TCL_SIZE_T)length-1); } else { (*plainParams) ++; - paramPtr->nameObj = Tcl_NewStringObj(argName, (int)length); + paramPtr->nameObj = Tcl_NewStringObj(argName, (TCL_SIZE_T)length); } INCR_REF_COUNT(paramPtr->nameObj); } @@ -18329,7 +18342,7 @@ fprintf(stderr, "qual %s\n", qualifier); const char *carg = ObjStr(paramPtr->converterArg); if (*carg != ':') { - Tcl_Obj *qualifiedConverterArg = Tcl_NewStringObj(qualifier, -1); + Tcl_Obj *qualifiedConverterArg = Tcl_NewStringObj(qualifier, TCL_INDEX_NONE); Tcl_AppendToObj(qualifiedConverterArg, "::", 2); Tcl_AppendObjToObj(qualifiedConverterArg, paramPtr->converterArg); DECR_REF_COUNT(paramPtr->converterArg); @@ -18813,9 +18826,9 @@ for (pPtr = parsedParam.paramDefs->paramsPtr; pPtr->name != NULL; pPtr++) { if (*pPtr->name == '-') { - Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(pPtr->name+1, -1)); + Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(pPtr->name+1, TCL_INDEX_NONE)); } else { - Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(pPtr->name, -1)); + Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(pPtr->name, TCL_INDEX_NONE)); } } ov[2] = argList; @@ -19153,7 +19166,7 @@ } #endif - Tcl_CallFrame_objc(framePtr) = objc; + Tcl_CallFrame_objc(framePtr) = (TCL_SIZE_T)objc; Tcl_CallFrame_objv(framePtr) = objv; Tcl_CallFrame_procPtr(framePtr) = procPtr; @@ -19418,7 +19431,7 @@ * ::nsf::procs::*. First build the fully qualified name procNameObj. */ Tcl_DStringSetLength(dsPtr, 0); - Tcl_DStringAppend(dsPtr, "::nsf::procs", -1); + Tcl_DStringAppend(dsPtr, "::nsf::procs", TCL_INDEX_NONE); DStringAppendQualName(dsPtr, cmdNsPtr, Tcl_GetCommandName(interp, cmd)); procNameObj = Tcl_NewStringObj(Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr)); @@ -19465,7 +19478,7 @@ for (paramPtr = paramDefs->paramsPtr; paramPtr->name != NULL; paramPtr++) { if (*paramPtr->name == '-') { - Tcl_Obj *varNameObj = Tcl_NewStringObj(paramPtr->name+1, -1); + Tcl_Obj *varNameObj = Tcl_NewStringObj(paramPtr->name+1, TCL_INDEX_NONE); /* * If we have the -ad (for ars digita) flag set, we provide the @@ -19486,7 +19499,7 @@ } Tcl_ListObjAppendElement(interp, argList, varNameObj); } else { - Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(paramPtr->name, -1)); + Tcl_ListObjAppendElement(interp, argList, Tcl_NewStringObj(paramPtr->name, TCL_INDEX_NONE)); } } } @@ -19881,7 +19894,7 @@ Tcl_DString ds, *dsPtr = &ds; DSTRING_INIT(dsPtr); Tcl_DStringAppend(dsPtr, "%1 {", 4); - Tcl_DStringAppend(dsPtr, ObjStr(withDefault), -1); + Tcl_DStringAppend(dsPtr, ObjStr(withDefault), TCL_INDEX_NONE); Tcl_DStringAppend(dsPtr, "}", 1); NsfDeprecatedCmd(interp, "forward option", "-default ...", Tcl_DStringValue(dsPtr)); DSTRING_FREE(dsPtr); @@ -20045,8 +20058,8 @@ ObjectName(parent), prefix, type, (type != NULL) ? ClassName(type) : "");*/ DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, ObjectName_(parent), -1); - Tcl_DStringAppend(dsPtr, prefix, -1); + Tcl_DStringAppend(dsPtr, ObjectName_(parent), TCL_INDEX_NONE); + Tcl_DStringAppend(dsPtr, prefix, TCL_INDEX_NONE); slotContainerObject = GetObjectFromString(interp, Tcl_DStringValue(dsPtr)); if (slotContainerObject != NULL && slotContainerObject->nsPtr @@ -20414,7 +20427,7 @@ int *outObjc, Tcl_Obj ***outObjv, bool *freeArgumentVector ) { Tcl_Obj **nobjv; - int nobjc, oc; + TCL_SIZE_T nobjc, oc; bool inEnsemble; Tcl_CallFrame *framePtr; NsfCallStackContent *cscPtr; @@ -20462,15 +20475,15 @@ oc, objc, inEnsemble, cscPtr->objv); */ if (objc > -1) { - int methodNameLength; + size_t methodNameLength; /* * Arguments were provided. We have to construct an argument * vector with the first argument(s) as the method name. In an * ensemble, we have to insert the objs of the full ensemble name. */ if (inEnsemble) { - methodNameLength = 1 + cscPtr->objc - oc; - nobjc = objc + methodNameLength; + methodNameLength = 1 + (size_t)cscPtr->objc - oc; + nobjc = (TCL_SIZE_T)objc + methodNameLength; nobjv = (Tcl_Obj **)ckalloc((unsigned)sizeof(Tcl_Obj *) * (unsigned)nobjc); MEM_COUNT_ALLOC("nextArgumentVector", nobjv); /* @@ -20480,7 +20493,7 @@ } else { methodNameLength = 1; - nobjc = objc + methodNameLength; + nobjc = (TCL_SIZE_T)objc + methodNameLength; nobjv = (Tcl_Obj **)ckalloc((unsigned)sizeof(Tcl_Obj *) * (unsigned)nobjc); MEM_COUNT_ALLOC("nextArgumentVector", nobjv); /* @@ -20508,15 +20521,15 @@ */ if (cscPtr->objv != NULL) { nobjv = (Tcl_Obj **)cscPtr->objv; - nobjc = cscPtr->objc; + nobjc = (TCL_SIZE_T)cscPtr->objc; } else { nobjc = Tcl_CallFrame_objc(framePtr); nobjv = (Tcl_Obj **)Tcl_CallFrame_objv(framePtr); } } *cscPtrPtr = cscPtr; - *outObjc = nobjc; + *outObjc = (int)nobjc; *outObjv = nobjv; return TCL_OK; @@ -21074,7 +21087,7 @@ buffer[0] = '#'; Nsf_ltoa(buffer+1, (long)Tcl_CallFrame_level(framePtr), &l); - resultObj = Tcl_NewStringObj(buffer, l+1); + resultObj = Tcl_NewStringObj(buffer, (TCL_SIZE_T)l+1); } else { /* * If not called from an NSF frame, return #0 as default. @@ -21151,7 +21164,7 @@ int result; Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, "unset ", -1); + Tcl_DStringAppend(dsPtr, "unset ", TCL_INDEX_NONE); DStringAppendQualName(dsPtr, nsPtr, name); result = Tcl_Eval(interp, Tcl_DStringValue(dsPtr)); @@ -23159,7 +23172,7 @@ */ if (FOR_COLON_RESOLVER(nameString)) { nameString ++; - nameObj = Tcl_NewStringObj(nameString, -1); + nameObj = Tcl_NewStringObj(nameString, TCL_INDEX_NONE); INCR_REF_COUNT(nameObj); } else { nameObj = objv[0]; @@ -23254,11 +23267,11 @@ DECR_REF_COUNT(methodObjPath); if (objc > 1) { - Tcl_ListObjAppendElement(interp, cmd, Tcl_NewListObj(objc-1, objv+1)); + Tcl_ListObjAppendElement(interp, cmd, Tcl_NewListObj((TCL_SIZE_T)objc-1, objv+1)); } } } else { - cmd = Tcl_NewListObj(objc, objv); + cmd = Tcl_NewListObj((TCL_SIZE_T)objc, objv); } Tcl_ListObjAppendElement(interp, script, cmd); @@ -23403,7 +23416,7 @@ * %proc, e.g. for the interceptor slots (such as mixin, ...) */ if (FOR_COLON_RESOLVER(methodName)) { - *out = Tcl_NewStringObj(methodName + 1, -1); + *out = Tcl_NewStringObj(methodName + 1, TCL_INDEX_NONE); } else { *out = objv[0]; } @@ -23510,7 +23523,7 @@ * No match, but insert of flag is required. */ /*fprintf(stderr, "no match, but insert of %s required\n", firstElementString);*/ - *out = Tcl_NewStringObj(firstElementString, -1); + *out = Tcl_NewStringObj(firstElementString, TCL_INDEX_NONE); *outputincr = 1; AddObjToTclList(interp, freeListObjPtr, *out); @@ -23544,7 +23557,7 @@ *out = listElements[nrArgs]; } } else if (c == '%') { - Tcl_Obj *newarg = Tcl_NewStringObj(ForwardArgString, -1); + Tcl_Obj *newarg = Tcl_NewStringObj(ForwardArgString, TCL_INDEX_NONE); *out = newarg; AddObjToTclList(interp, freeListObjPtr, *out); @@ -23554,7 +23567,7 @@ * Evaluate the given command. */ /*fprintf(stderr, "evaluating '%s'\n", ForwardArgString);*/ - result = Tcl_EvalEx(interp, ForwardArgString, -1, 0); + result = Tcl_EvalEx(interp, ForwardArgString, TCL_INDEX_NONE, 0); if (likely(result == TCL_OK)) { *out = Tcl_DuplicateObj(Tcl_GetObjResult(interp)); AddObjToTclList(interp, freeListObjPtr, *out); @@ -23565,7 +23578,7 @@ if (likely(p == ForwardArgString)) { *out = forwardArgObj; } else { - Tcl_Obj *newarg = Tcl_NewStringObj(ForwardArgString, -1); + Tcl_Obj *newarg = Tcl_NewStringObj(ForwardArgString, TCL_INDEX_NONE); *out = newarg; AddObjToTclList(interp, freeListObjPtr, *out); @@ -23608,7 +23621,7 @@ tcd->object = NULL; if (unlikely(tcd->verbose)) { - Tcl_Obj *cmd = Tcl_NewListObj(objc, objv); + Tcl_Obj *cmd = Tcl_NewListObj((TCL_SIZE_T)objc, objv); NsfLog(interp, NSF_LOG_DEBUG, "forwarder calls '%s'", ObjStr(cmd)); DECR_REF_COUNT(cmd); @@ -23618,7 +23631,7 @@ } if (tcd->objProc != NULL) { /*fprintf(stderr, "CallForwarder Tcl_NRCallObjProc %p\n", tcd->clientData);*/ - result = Tcl_NRCallObjProc(interp, tcd->objProc, tcd->clientData, objc, objv); + result = Tcl_NRCallObjProc(interp, tcd->objProc, tcd->clientData, (TCL_SIZE_T)objc, objv); } else if (TclObjIsNsfObject(interp, tcd->cmdName, &object)) { /*fprintf(stderr, "CallForwarder NsfObjDispatch object %s, objc=%d\n", ObjStr(tcd->cmdName), objc);*/ @@ -23629,7 +23642,7 @@ } } else { /*fprintf(stderr, "CallForwarder: no nsf object %s [0] %s\n", ObjStr(tcd->cmdName), ObjStr(objv[0]));*/ - result = Tcl_EvalObjv(interp, objc, objv, 0); + result = Tcl_EvalObjv(interp, (TCL_SIZE_T)objc, objv, 0); } if (tcd->frame == FrameObjectIdx) { @@ -23959,7 +23972,7 @@ tcd->object = NULL; Nsf_PushFrameObj(interp, object, framePtr); - result = Tcl_NRCallObjProc(interp, tcd->objProc, tcd->clientData, objc, objv); + result = Tcl_NRCallObjProc(interp, tcd->objProc, tcd->clientData, (TCL_SIZE_T)objc, objv); Nsf_PopFrameObj(interp, framePtr); return result; @@ -24067,7 +24080,7 @@ const char *methodName, int argc, Tcl_Obj *const argv[]) { int result; - Tcl_Obj *methodObj = Tcl_NewStringObj(methodName, -1); + Tcl_Obj *methodObj = Tcl_NewStringObj(methodName, TCL_INDEX_NONE); nonnull_assert(interp != NULL); nonnull_assert(object != NULL); @@ -24759,13 +24772,14 @@ #endif if (unlikely(currentParamPtr > lastParamPtr)) { - int result; + int result; Tcl_Obj *methodPathObj; methodPathObj = NsfMethodNamePath(interp, CallStackGetTclFrame(interp, NULL, 0), NsfMethodName(procNameObj)); INCR_REF_COUNT(methodPathObj); + /*fprintf(stderr, "call NsfUnexpectedArgumentError 1\n");*/ result = NsfUnexpectedArgumentError(interp, ObjStr(argumentObj), (Nsf_Object*)object, paramPtr, methodPathObj); DECR_REF_COUNT(methodPathObj); @@ -24894,7 +24908,7 @@ && strncmp(argumentString, pPtr->name, (size_t)equalOffset) == 0 && *(pPtr->name+equalOffset) == '\0') { - valueObj = Tcl_NewStringObj(valueInArgument+1, -1); + valueObj = Tcl_NewStringObj(valueInArgument+1, TCL_INDEX_NONE); /*fprintf(stderr, "... value from argument = %s\n", ObjStr(valueObj));*/ NsfFlagObjSet(interp, argumentObj, paramPtr, serial, pPtr, valueObj, NSF_FLAG_CONTAINS_VALUE); @@ -25150,7 +25164,7 @@ * Provide warnings for double-settings. */ if (unlikely((pcPtr->flags[j] & NSF_ARG_SET) != 0u)) { - Tcl_Obj *cmdLineObj = Tcl_NewListObj(objc-1, objv+1); + Tcl_Obj *cmdLineObj = Tcl_NewListObj((TCL_SIZE_T)objc-1, objv+1); INCR_REF_COUNT(cmdLineObj); NsfLog(interp, NSF_LOG_WARN, "Non-positional parameter %s was passed more than once (%s%s%s %s)", @@ -25255,7 +25269,7 @@ nonnull_assert(interp != NULL); if (pattern != NULL && NoMetaChars(pattern)) { - Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, -1); + Tcl_Obj *patternObj = Tcl_NewStringObj(pattern, TCL_INDEX_NONE); INCR_REF_COUNT(patternObj); hPtr = (tablePtr != NULL) ? Tcl_CreateHashEntry(tablePtr, (char *)patternObj, NULL) : NULL; @@ -25385,7 +25399,7 @@ nonnull_assert(procPtr != NULL); body = ObjStr(procPtr->bodyPtr); - Tcl_SetObjResult(interp, Tcl_NewStringObj(StripBodyPrefix(body), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(StripBodyPrefix(body), TCL_INDEX_NONE)); return TCL_OK; } @@ -25503,11 +25517,11 @@ */ if (args->defValuePtr != NULL) { Tcl_AppendToObj(listObj, "?", 1); - Tcl_AppendToObj(listObj, args->name, -1); + Tcl_AppendToObj(listObj, args->name, TCL_INDEX_NONE); Tcl_AppendToObj(listObj, "?", 1); } else { Tcl_AppendToObj(listObj, "/", 1); - Tcl_AppendToObj(listObj, args->name, -1); + Tcl_AppendToObj(listObj, args->name, TCL_INDEX_NONE); Tcl_AppendToObj(listObj, "/", 1); } if (args->nextPtr != NULL) { @@ -25516,7 +25530,7 @@ } else { Tcl_Obj *innerListObj = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, innerListObj, Tcl_NewStringObj(args->name, -1)); + Tcl_ListObjAppendElement(interp, innerListObj, Tcl_NewStringObj(args->name, TCL_INDEX_NONE)); /* * Return default just for NSF_PARAMS_PARAMETER. */ @@ -25561,7 +25575,7 @@ Tcl_SetObjResult(interp, list); DECR_REF_COUNT2("paramDefsObj", list); } else { - Tcl_SetObjResult(interp, Tcl_NewStringObj(methodName, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(methodName, TCL_INDEX_NONE)); } return TCL_OK; } @@ -25643,15 +25657,15 @@ nonnull_assert(tcd != NULL); if (tcd->prefix != NULL) { - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-prefix", -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-prefix", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, listObj, tcd->prefix); } if (tcd->subcommands != NULL) { - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-default", -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-default", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, listObj, tcd->subcommands); } if (tcd->objProc != NULL) { - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-earlybinding", -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-earlybinding", TCL_INDEX_NONE)); } if (tcd->frame == FrameObjectIdx) { Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-frame", 6)); @@ -25716,8 +25730,8 @@ if (!NsfObjectIsClass(object) || withPer_object) { Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("object", 6)); } - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(registerCmdName, -1)); - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(methodName, -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(registerCmdName, TCL_INDEX_NONE)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(methodName, TCL_INDEX_NONE)); if (withObjFrame) { Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-frame", 6)); @@ -25759,7 +25773,7 @@ returnsObj = ParamDefsGetReturns(cmd); if (returnsObj != NULL) { /* TODO: avoid hard-coding the script-level/NX-specific keyword "-returns" */ - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-returns", -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("-returns", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, listObj, returnsObj); } } @@ -25995,9 +26009,9 @@ case InfomethodsubcmdTypeIdx: if (regObject != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("scripted", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("scripted", TCL_INDEX_NONE)); } else { - Tcl_SetObjResult(interp, Tcl_NewStringObj("proc", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("proc", TCL_INDEX_NONE)); } break; @@ -26035,7 +26049,7 @@ } else { Tcl_DString ds, *dsPtr = &ds; - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("::proc", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("::proc", TCL_INDEX_NONE)); Tcl_DStringInit(dsPtr); DStringAppendQualName(dsPtr, Tcl_Command_nsPtr(cmd), methodName); @@ -26066,9 +26080,9 @@ if (assertions != NULL) { NsfProcAssertion *procs = AssertionFindProcs(assertions, methodName); if (procs != NULL) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("-precondition", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("-precondition", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, resultObj, AssertionList(interp, procs->pre)); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("-postcondition", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("-postcondition", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, resultObj, AssertionList(interp, procs->post)); } } @@ -26184,7 +26198,7 @@ switch (subcmd) { case InfomethodsubcmdTypeIdx: - Tcl_SetObjResult(interp, Tcl_NewStringObj("nsfproc", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("nsfproc", TCL_INDEX_NONE)); break; case InfomethodsubcmdBodyIdx: @@ -26196,7 +26210,7 @@ Tcl_DStringInit(dsPtr); DStringAppendQualName(dsPtr, Tcl_Command_nsPtr(cmd), methodName); /* don't hardcode names */ - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("::nsf::proc", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("::nsf::proc", TCL_INDEX_NONE)); if ((tcd->flags & NSF_PROC_FLAG_AD) != 0) { Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("-ad", 3)); } @@ -26323,7 +26337,7 @@ */ switch (subcmd) { case InfomethodsubcmdTypeIdx: - Tcl_SetObjResult(interp, Tcl_NewStringObj("object", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("object", TCL_INDEX_NONE)); break; case InfomethodsubcmdDefinitionIdx: { @@ -26718,28 +26732,28 @@ } if (ProtectionMatches(withCallprotection, cmd) && methodTypeMatch) { - int prefixLength = (prefix != NULL) ? Tcl_DStringLength(prefix) : 0; + TCL_SIZE_T prefixLength = (prefix != NULL) ? Tcl_DStringLength(prefix) : 0; if (prefixLength != 0) { - Tcl_DStringAppend(prefix, key, -1); + Tcl_DStringAppend(prefix, key, TCL_INDEX_NONE); key = Tcl_DStringValue(prefix); } if (dups != NULL) { int new; (void)Tcl_CreateHashEntry(dups, key, &new); if (new != 0) { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, TCL_INDEX_NONE)); } } else { - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, TCL_INDEX_NONE)); } } } return TCL_OK; } else { - int prefixLength = (prefix != NULL) ? Tcl_DStringLength(prefix) : 0; + size_t prefixLength = (prefix != NULL) ? Tcl_DStringLength(prefix) : 0; /* * We have to iterate over the elements. @@ -26754,7 +26768,7 @@ key = Tcl_GetHashKey(tablePtr, hPtr); cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); if (prefixLength != 0) { - Tcl_DStringSetLength(prefix, prefixLength); + Tcl_DStringSetLength(prefix, (TCL_SIZE_T)prefixLength); } methodTypeMatch = MethodTypeMatches(interp, methodType, cmd, object, key, withPer_object, &isObject); @@ -26819,13 +26833,13 @@ Tcl_DString ds, *dsPtr = &ds; DSTRING_INIT(dsPtr); - Tcl_DStringAppend(dsPtr, key, -1); + Tcl_DStringAppend(dsPtr, key, TCL_INDEX_NONE); Tcl_DStringAppend(dsPtr, " ", 1); ListMethodKeys(interp, cmdTablePtr, dsPtr, pattern, methodType, withCallprotection, NSF_TRUE, dups, object, withPer_object); DSTRING_FREE(dsPtr); } else { - Tcl_DStringAppend(prefix, key, -1); + Tcl_DStringAppend(prefix, key, TCL_INDEX_NONE); Tcl_DStringAppend(prefix, " ", 1); ListMethodKeys(interp, cmdTablePtr, prefix, pattern, methodType, withCallprotection, NSF_TRUE, dups, object, withPer_object); @@ -26878,7 +26892,7 @@ if (prefixLength != 0) { - Tcl_DStringAppend(prefix, key, -1); + Tcl_DStringAppend(prefix, key, TCL_INDEX_NONE); key = Tcl_DStringValue(prefix); } @@ -26893,7 +26907,7 @@ continue; } } - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, TCL_INDEX_NONE)); } } /*fprintf(stderr, "listkeys returns '%s'\n", ObjStr(Tcl_GetObjResult(interp)));*/ @@ -27096,7 +27110,7 @@ cmdTablePtr = Tcl_Namespace_cmdTablePtr(nsPtr); dsPtr = &ds; Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, nsPtr->fullName, -1); + Tcl_DStringAppend(dsPtr, nsPtr->fullName, TCL_INDEX_NONE); if (Tcl_DStringLength(dsPtr) > 2) { Tcl_DStringAppend(dsPtr, "::", 2); } @@ -27230,9 +27244,9 @@ nonnull_assert(methodName != NULL); Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, ObjStr(cmdName), -1); + Tcl_DStringAppend(dsPtr, ObjStr(cmdName), TCL_INDEX_NONE); Tcl_DStringAppend(dsPtr, ",", 1); - Tcl_DStringAppend(dsPtr, methodName, -11); + Tcl_DStringAppend(dsPtr, methodName, TCL_INDEX_NONE); if (withPer_object) { Tcl_DStringAppend(dsPtr, ",1", 2); } else { @@ -27637,8 +27651,8 @@ nonnull_assert(interp != NULL); nonnull_assert(obj != NULL); - fprintf(stderr, "*** obj %p refCount %d type <%s> ", - (void *)obj, obj->refCount, ObjTypeStr(obj)); + fprintf(stderr, "*** obj %p refCount %lu type <%s> ", + (void *)obj, (unsigned long)obj->refCount, ObjTypeStr(obj)); if (obj->typePtr == &NsfObjectMethodObjType || obj->typePtr == &NsfInstanceMethodObjType @@ -27710,13 +27724,13 @@ typeString = (obj->typePtr != NULL) ? obj->typePtr->name : ""; resultObj = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("type", -1)); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(typeString, -1)); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("refcount", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("type", TCL_INDEX_NONE)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(typeString, TCL_INDEX_NONE)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("refcount", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewIntObj(obj->refCount)); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("length", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("length", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewIntObj(obj->length)); - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("hex", -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("hex", TCL_INDEX_NONE)); if (obj->bytes != NULL) { size_t i, objLength = (size_t)obj->length; @@ -27729,7 +27743,7 @@ if (objLength > NSF_DEBUG_SHOW_BYTES) { memmove(buffer, trailer, sizeof(buffer) - strlen(buffer) - 1); } - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(buffer, -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); } else { Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj("", 0)); @@ -28126,7 +28140,7 @@ if (osPtr->methods[idx] == NULL) { continue; } - Tcl_ListObjAppendElement(interp, systemMethods, Tcl_NewStringObj(Nsf_SystemMethodOpts[idx], -1)); + Tcl_ListObjAppendElement(interp, systemMethods, Tcl_NewStringObj(Nsf_SystemMethodOpts[idx], TCL_INDEX_NONE)); if (osPtr->handles[idx] || osPtr->protected[idx]) { Tcl_Obj *listObj = Tcl_NewListObj(0, NULL); @@ -28350,7 +28364,7 @@ nonnull_assert(interp != NULL); nsPtr = CallingNameSpace(interp); - Tcl_SetObjResult(interp, Tcl_NewStringObj(nsPtr->fullName, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(nsPtr->fullName, TCL_INDEX_NONE)); return TCL_OK; } @@ -28660,7 +28674,7 @@ */ slaveCmdObj = Tcl_GetObjResult(interp); - slavePtr = Tcl_GetSlave(interp, ObjStr(slaveCmdObj)); + slavePtr = Tcl_GetChild(interp, ObjStr(slaveCmdObj)); if (slavePtr == NULL) { return NsfPrintError(interp, "creation of slave interpreter failed"); @@ -28945,7 +28959,7 @@ * Flush old byte code */ /*fprintf(stderr, "flush byte code\n");*/ - TclFreeIntRep(bodyObj); + TclFreeInternalRep(bodyObj); } } @@ -28983,7 +28997,7 @@ */ deleteProc = NULL; tcd = Tcl_Command_objClientData(cmd); - /*fprintf(stderr, "NsfMethodAliasCmd no wrapper cmd %p\n", cmd);*/ + /*fprintf(stderr, "NsfMethodAliasCmd no wrapper cmd %p\n", (void*)cmd);*/ } switch (withProtection) { @@ -30164,7 +30178,7 @@ } destFullName = toNsPtr->fullName; - destFullNameObj = Tcl_NewStringObj(destFullName, -1); + destFullNameObj = Tcl_NewStringObj(destFullName, TCL_INDEX_NONE); INCR_REF_COUNT(destFullNameObj); varTablePtr = Tcl_Namespace_varTablePtr(fromNsPtr); Tcl_PushCallFrame(interp, (Tcl_CallFrame *)framePtr, toNsPtr, 0); @@ -30366,12 +30380,12 @@ * The converterArg might contain a class for type checking */ if (paramsPtr->converterArg == NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(what, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(what, TCL_INDEX_NONE)); } else { Tcl_SetObjResult(interp, paramsPtr->converterArg); } } else { - Tcl_SetObjResult(interp, Tcl_NewStringObj(paramsPtr->type, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(paramsPtr->type, TCL_INDEX_NONE)); } } } else { @@ -31068,7 +31082,7 @@ cscPtr = CallStackGetTopFrame0(interp); if (cscPtr != NULL) { const char *procName = Tcl_GetCommandName(interp, cscPtr->cmdPtr); - Tcl_SetObjResult(interp, Tcl_NewStringObj(procName, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(procName, TCL_INDEX_NONE)); } else { /* TODO: Is this, practically, reachable? */ return NsfPrintError(interp, "can't find method"); @@ -31101,11 +31115,11 @@ cscPtr = CallStackGetTopFrame(interp, &framePtr); if (cscPtr != NULL) { - int nobjc; - Tcl_Obj **nobjv; + TCL_SIZE_T nobjc; + Tcl_Obj **nobjv; if (cscPtr->objv != NULL) { - nobjc = cscPtr->objc; + nobjc = (TCL_SIZE_T)cscPtr->objc; nobjv = (Tcl_Obj **)cscPtr->objv; } else { nobjc = Tcl_CallFrame_objc(framePtr); @@ -31133,7 +31147,7 @@ cscPtr = CallStackFindActiveFilter(interp); if (cscPtr != NULL) { Tcl_SetObjResult(interp, - Tcl_NewStringObj(MethodName(cscPtr->filterStackEntry->calledProc), -1)); + Tcl_NewStringObj(MethodName(cscPtr->filterStackEntry->calledProc), TCL_INDEX_NONE)); } else { result = NsfPrintError(interp, "called from outside of a filter"); } @@ -31511,7 +31525,7 @@ register Tcl_Obj *objPtr, /* The object to convert. */ const char *qualifier) { - Tcl_Obj *fullParamObj = Tcl_NewStringObj(varNamePrefix, -1); + Tcl_Obj *fullParamObj = Tcl_NewStringObj(varNamePrefix, TCL_INDEX_NONE); int result, possibleUnknowns = 0, plainParams = 0, nrNonposArgs = 0; NsfParamWrapper *paramWrapperPtr = NEW(NsfParamWrapper); @@ -31523,7 +31537,7 @@ paramWrapperPtr->refCount = 1; paramWrapperPtr->canFree = NSF_FALSE; - Tcl_AppendLimitedToObj(fullParamObj, ObjStr(objPtr), -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(fullParamObj, ObjStr(objPtr), TCL_INDEX_NONE, INT_MAX, NULL); INCR_REF_COUNT(fullParamObj); result = ParamDefinitionParse(interp, NsfGlobalObjs[NSF_VALUECHECK], fullParamObj, @@ -31546,7 +31560,7 @@ if (*(paramWrapperPtr->paramPtr->name) == 'r') { paramWrapperPtr->paramPtr->flags |= NSF_ARG_IS_RETURNVALUE; } - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.twoPtrValue.ptr1 = (void *)paramWrapperPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = ¶mObjType; @@ -32816,7 +32830,7 @@ * Return the non-processed leading arguments unless there was an * error (XOTcl convention). */ - Tcl_SetObjResult(interp, Tcl_NewListObj(normalArgs, objv+1)); + Tcl_SetObjResult(interp, Tcl_NewListObj((TCL_SIZE_T)normalArgs, objv+1)); } return result; @@ -32905,7 +32919,7 @@ * between, then evaluate the result. Tcl_EvalObjEx will delete * the object when it decrements its refCount after eval'ing it. */ - Tcl_Obj *objPtr = Tcl_ConcatObj(objc, objv); + Tcl_Obj *objPtr = Tcl_ConcatObj((size_t)objc, objv); result = Tcl_EvalObjEx(interp, objPtr, TCL_EVAL_DIRECT); } @@ -33186,8 +33200,8 @@ static int NsfCAllocMethod(Tcl_Interp *interp, NsfClass *class, Tcl_Obj *nameObj) { const char *nameString; - int result, nameLength = 0; - + int result; + TCL_SIZE_T nameLength = 0; /* * Create a new object from scratch. */ @@ -33199,7 +33213,7 @@ /* * Check for illegal names. */ - nameString = TclGetStringFromObj(nameObj, &nameLength); + nameString = Tcl_GetStringFromObj(nameObj, &nameLength); if (unlikely(NSValidObjectName(nameString, (size_t)nameLength) == 0)) { result = NsfPrintError(interp, "cannot allocate object - illegal name '%s'", nameString); @@ -33244,7 +33258,8 @@ NsfCCreateMethod(Tcl_Interp *interp, NsfClass *class, Tcl_Obj *nameObj, int objc, Tcl_Obj *const objv[]) { NsfObject *newObject = NULL; Tcl_Obj *actualNameObj, *methodObj, *tmpObj = NULL; - int result, nameLength = 0; + int result; + TCL_SIZE_T nameLength = 0; bool autoNameCreate; const char *nameString; Tcl_Namespace *parentNsPtr; @@ -33254,7 +33269,7 @@ nonnull_assert(nameObj != NULL); nonnull_assert(objv != NULL); - nameString = TclGetStringFromObj(nameObj, &nameLength); + nameString = Tcl_GetStringFromObj(nameObj, &nameLength); #if 0 { int i; fprintf(stderr, "NsfCCreateMethod %s create <%s> oc %d ", ClassName(class), ObjStr(nameObj), objc); @@ -33611,7 +33626,7 @@ * Prepend parentName only if it is not "::" */ if (*(parentName + 2) != '\0') { - Tcl_DStringAppend(dsPtr, parentName, -1); + Tcl_DStringAppend(dsPtr, parentName, TCL_INDEX_NONE); } } else { Tcl_Obj *tmpName = NameInNamespaceObj(parentName, CallingNameSpace(interp)); @@ -33620,7 +33635,7 @@ INCR_REF_COUNT(tmpName); completedParentName = ObjStr(tmpName); if (strcmp(completedParentName, "::")) { - Tcl_DStringAppend(dsPtr, ObjStr(tmpName), -1); + Tcl_DStringAppend(dsPtr, ObjStr(tmpName), TCL_INDEX_NONE); } DECR_REF_COUNT(tmpName); } @@ -34294,7 +34309,7 @@ nonnull_assert(interp != NULL); nonnull_assert(object != NULL); - Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetCommandName(interp, object->id), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetCommandName(interp, object->id), TCL_INDEX_NONE)); return TCL_OK; } @@ -34310,7 +34325,7 @@ if (object->id != NULL) { Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(object->id); - Tcl_SetObjResult(interp, Tcl_NewStringObj((nsPtr != NULL) ? nsPtr->fullName : "", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj((nsPtr != NULL) ? nsPtr->fullName : "", TCL_INDEX_NONE)); } return TCL_OK; } @@ -34390,15 +34405,15 @@ * NULL. */ if (likely(varTablePtr != NULL)) { - Tcl_Obj *varList, *element; - int i, length; + Tcl_Obj *varList, *element; + TCL_SIZE_T i, length; ListVarKeys(interp, TclVarHashTablePtr(varTablePtr), pattern); varList = Tcl_GetObjResult(interp); Tcl_ListObjLength(interp, varList, &length); for (i = 0; i < length; i++) { - Tcl_ListObjIndex(interp, varList, i, &element); + Tcl_ListObjIndex(interp, varList, (TCL_SIZE_T)i, &element); if (VarExists(interp, object, ObjStr(element), NULL, NSF_VAR_REQUIRE_DEFINED)) { Tcl_ListObjAppendElement(interp, okList, element); } else { @@ -34552,7 +34567,7 @@ NsfObject *inst = (NsfObject *) Tcl_GetHashKey(tablePtr, hPtr); if (matchObject != NULL && inst == matchObject) { - Tcl_SetStringObj(resultObj, ObjStr(matchObject->cmdName), -1); + Tcl_SetStringObj(resultObj, ObjStr(matchObject->cmdName), TCL_INDEX_NONE); return resultObj; } AppendMatchingElement(interp, resultObj, inst->cmdName, pattern); @@ -35880,14 +35895,11 @@ Tcl_DecrRefCount(tmpObj); assert(Nsf_OT_intType != NULL); - Nsf_OT_byteArrayType = Tcl_GetObjType("bytearray"); - assert(Nsf_OT_byteArrayType != NULL); - { mp_int bignumValue; Tcl_Obj *bigNumObj; - tmpObj = Tcl_NewStringObj("10000000000000000000000", -1); + tmpObj = Tcl_NewStringObj("10000000000000000000000", TCL_INDEX_NONE); Tcl_GetBignumFromObj(NULL, tmpObj, &bignumValue); Nsf_OT_bignumType = tmpObj->typePtr; assert(Nsf_OT_bignumType != NULL); @@ -35901,8 +35913,13 @@ * Get bytearray and proper bytearray from Tcl (latter if available, * introduced in Tcl 8.7a+) */ + Nsf_OT_byteArrayType = Tcl_GetObjType("bytearray"); + tmpObj = Tcl_NewByteArrayObj(NULL, 0); Nsf_OT_properByteArrayType = tmpObj->typePtr; + if (Nsf_OT_byteArrayType == NULL) { + Nsf_OT_byteArrayType = Nsf_OT_properByteArrayType; + } if (Nsf_OT_properByteArrayType == Nsf_OT_byteArrayType) { /* * When both values are the same, we are in a Tcl version before 8.7, @@ -35914,6 +35931,7 @@ } Tcl_DecrRefCount(tmpObj); assert(Nsf_OT_properByteArrayType != NULL); + assert(Nsf_OT_byteArrayType != NULL); NsfMutexUnlock(&initMutex); @@ -36010,7 +36028,7 @@ NsfGlobalObjs = NEW_ARRAY(Tcl_Obj*, nr_elements(NsfGlobalStrings)); for (i = 0; i < nr_elements(NsfGlobalStrings); i++) { - NsfGlobalObjs[i] = Tcl_NewStringObj(NsfGlobalStrings[i], -1); + NsfGlobalObjs[i] = Tcl_NewStringObj(NsfGlobalStrings[i], TCL_INDEX_NONE); INCR_REF_COUNT(NsfGlobalObjs[i]); } @@ -36095,7 +36113,7 @@ static char reportingCmd[] = "puts stderr \"Error in predefined code\n\ $::errorInfo\""; - Tcl_EvalEx(interp, reportingCmd, -1, 0); + Tcl_EvalEx(interp, reportingCmd, TCL_INDEX_NONE, 0); return TCL_ERROR; } } @@ -36115,7 +36133,7 @@ * Obtain type for parsed var name. */ if (Nsf_OT_parsedVarNameType == NULL) { - Tcl_Obj *varNameObj = Tcl_NewStringObj("::nsf::version", -1); + Tcl_Obj *varNameObj = Tcl_NewStringObj("::nsf::version", TCL_INDEX_NONE); Var *arrayPtr; INCR_REF_COUNT(varNameObj); Index: generic/nsf.h =================================================================== diff -u -rf01f68eae4db5c767f8d5ce3cd0e366fb298b73b -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsf.h (.../nsf.h) (revision f01f68eae4db5c767f8d5ce3cd0e366fb298b73b) +++ generic/nsf.h (.../nsf.h) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -67,13 +67,32 @@ # define PRE86 #endif +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<7 +# define PRE87 +#endif + +#if TCL_MAJOR_VERSION==8 +# define PRE9 +#endif + #if defined(PRE86) # define CONST86 # define Tcl_GetErrorLine(interp) (interp)->errorLine #else # define NRE #endif +#ifdef PRE87 +# define Tcl_LibraryInitProc Tcl_PackageInitProc +# define Tcl_GetChild Tcl_GetSlave +# define Tcl_GetParent Tcl_GetMaster +#endif + +#ifdef PRE9 +# define TCL_SIZE_T int +#else +# define TCL_SIZE_T size_t +#endif /* * Feature activation/deactivation */ @@ -512,7 +531,11 @@ * the stubs table. */ #if defined(NRE) -# include "stubs8.6/nsfDecls.h" +# if defined(PRE9) +# include "stubs8.6/nsfDecls.h" +# else +# include "stubs9.0/nsfDecls.h" +# endif #else # include "stubs8.5/nsfDecls.h" #endif Index: generic/nsfAccessInt.h =================================================================== diff -u -r7645e8f88cc6a9e084724840b3a098d632edcb71 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfAccessInt.h (.../nsfAccessInt.h) (revision 7645e8f88cc6a9e084724840b3a098d632edcb71) +++ generic/nsfAccessInt.h (.../nsfAccessInt.h) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -120,16 +120,16 @@ * */ -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>6 && defined(CMD_DYING) -#define TclIsCommandDeleted(cmdPtr) (((unsigned int)Tcl_Command_flags((cmdPtr)) & CMD_DYING) != 0u) -#else +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION<7 && defined(CMD_IS_DELETED) #define TclIsCommandDeleted(cmdPtr) (((unsigned int)Tcl_Command_flags((cmdPtr)) & CMD_IS_DELETED) != 0u) +#else +#define TclIsCommandDeleted(cmdPtr) (((unsigned int)Tcl_Command_flags((cmdPtr)) & CMD_DYING) != 0u) #endif /* * Introduced by a name reform in [a722c92a11], in Oct 2021, the macro - * TclFreeIntRep has been replaced by TclFreeInternalRep. + * TclFreeInternalRep has been replaced by TclFreeInternalRep. * * See also: * @@ -138,8 +138,8 @@ * For Tcl 8.7+, we should better switch to using the public interface * to manipulating the internal rep of Tcl_Objs. */ -#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>6 && defined(TclFreeInternalRep) -# define TclFreeIntRep(objPtr) TclFreeInternalRep((objPtr)) +#if TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION < 7 && defined(TclFreeIntRep) +# define TclFreeInternalRep(objPtr) TclFreeIntRep((objPtr)) #endif Index: generic/nsfDebug.c =================================================================== diff -u -r83e2a1bc1e93733b0459e24666828c4a3f2bce63 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfDebug.c (.../nsfDebug.c) (revision 83e2a1bc1e93733b0459e24666828c4a3f2bce63) +++ generic/nsfDebug.c (.../nsfDebug.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -132,7 +132,8 @@ fprintf(stderr, "caller %p ", (void *)Tcl_CallFrame_callerPtr(f)); fprintf(stderr, "callerV %p ", (void *)Tcl_CallFrame_callerVarPtr(f)); Tcl_GetCommandFullName(interp, (Tcl_Command)f->procPtr->cmdPtr, cmdObj); - fprintf(stderr, "%s (%p) lvl=%d\n", ObjStr(cmdObj), (void *)f->procPtr->cmdPtr, f->level); + fprintf(stderr, "%s (%p) lvl=%li\n", ObjStr(cmdObj), (void *)f->procPtr->cmdPtr, + (unsigned long)f->level); } else { if (f->varTablePtr != NULL) { fprintf(stderr, "var_table = %p ", (void *)f->varTablePtr); @@ -150,7 +151,8 @@ } if (v != NULL && v->isProcCallFrame && v->procPtr && v->procPtr->cmdPtr) { Tcl_GetCommandFullName(interp, (Tcl_Command) v->procPtr->cmdPtr, varCmdObj); - fprintf(stderr, " %s (%d)\n", ObjStr(varCmdObj), v->level); + fprintf(stderr, " %s (%lu)\n", ObjStr(varCmdObj), + (unsigned long)v->level); } else { fprintf(stderr, "- \n"); } Index: generic/nsfError.c =================================================================== diff -u -r42dbfd5df1fa6248468d00c7d68fd699a5a69e64 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfError.c (.../nsfError.c) (revision 42dbfd5df1fa6248468d00c7d68fd699a5a69e64) +++ generic/nsfError.c (.../nsfError.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -76,9 +76,10 @@ void NsfDStringVPrintf(Tcl_DString *dsPtr, const char *fmt, va_list argPtr) { - int result, avail, offset; - va_list argPtrCopy; - bool failure; + int result; + TCL_SIZE_T avail, offset; + va_list argPtrCopy; + bool failure; /* * Tcl_DStringLength returns the current length *without* the @@ -132,10 +133,10 @@ /* * vsnprintf() copied all content, adjust the Tcl_DString length. */ - Tcl_DStringSetLength(dsPtr, offset + result); + Tcl_DStringSetLength(dsPtr, offset + (TCL_SIZE_T)result); } else { - int addedStringLength; + TCL_SIZE_T addedStringLength; /* * vsnprintf() could not copy all content, content was truncated. * Determine the required length (for MSVC), adjust the Tcl_DString @@ -147,7 +148,7 @@ addedStringLength = _vscprintf(fmt, argPtrCopy); va_end(argPtrCopy); #else - addedStringLength = result; + addedStringLength = (TCL_SIZE_T)result; #endif Tcl_DStringSetLength(dsPtr, offset + addedStringLength); @@ -171,7 +172,7 @@ #if defined(_MSC_VER) failure = (result == -1); #else - failure = (result == -1 || result >= avail); + failure = (result == -1 || (TCL_SIZE_T)result >= avail); #endif #if defined(NDEBUG) @@ -303,19 +304,19 @@ const char *cName, *space; Tcl_DStringInit(&errMsg); - Tcl_DStringAppend(&errMsg, "\n ", -1); + Tcl_DStringAppend(&errMsg, "\n ", TCL_INDEX_NONE); if (clName != NULL) { cName = ObjStr(clName); space = " "; } else { cName = ""; space = ""; } - Tcl_DStringAppend(&errMsg, ObjStr(objName), -1); - Tcl_DStringAppend(&errMsg, space, -1); - Tcl_DStringAppend(&errMsg, cName, -1); + Tcl_DStringAppend(&errMsg, ObjStr(objName), TCL_INDEX_NONE); + Tcl_DStringAppend(&errMsg, space, TCL_INDEX_NONE); + Tcl_DStringAppend(&errMsg, cName, TCL_INDEX_NONE); Tcl_DStringAppend(&errMsg, "->", 2); - Tcl_DStringAppend(&errMsg, procName, -1); + Tcl_DStringAppend(&errMsg, procName, TCL_INDEX_NONE); Tcl_AddErrorInfo (interp, Tcl_DStringValue(&errMsg)); Tcl_DStringFree(&errMsg); return TCL_ERROR; @@ -353,7 +354,7 @@ Nsf_DStringPrintf(&ds, "%s should be \"", msg); if (cmdNameObj != NULL) { - Tcl_DStringAppend(&ds, ObjStr(cmdNameObj), -1); + Tcl_DStringAppend(&ds, ObjStr(cmdNameObj), TCL_INDEX_NONE); need_space = NSF_TRUE; } @@ -363,7 +364,7 @@ } INCR_REF_COUNT(methodPathObj); - Tcl_DStringAppend(&ds, ObjStr(methodPathObj), -1); + Tcl_DStringAppend(&ds, ObjStr(methodPathObj), TCL_INDEX_NONE); DECR_REF_COUNT(methodPathObj); need_space = NSF_TRUE; @@ -372,7 +373,7 @@ if (need_space) { Tcl_DStringAppend(&ds, " ", 1); } - Tcl_DStringAppend(&ds, arglist, -1); + Tcl_DStringAppend(&ds, arglist, TCL_INDEX_NONE); } Tcl_DStringAppend(&ds, "\"", 1); @@ -491,8 +492,8 @@ if (pPtr->flags & NSF_ARG_NOCONFIG) { continue; } - Tcl_DStringAppend(dsPtr, pPtr->name, -1); - Tcl_DStringAppend(dsPtr, ", ", -1); + Tcl_DStringAppend(dsPtr, pPtr->name, TCL_INDEX_NONE); + Tcl_DStringAppend(dsPtr, ", ", TCL_INDEX_NONE); } Tcl_DStringSetLength(dsPtr, Tcl_DStringLength(dsPtr) - 2); Tcl_DStringAppend(dsPtr, ";\n", 2); @@ -590,26 +591,26 @@ ) { bool isNamed = (NsfObjErrType && (NsfObjErrType->flags & NSF_ARG_UNNAMED) == 0); int returnValue = !isNamed && NsfObjErrType && (NsfObjErrType->flags & NSF_ARG_IS_RETURNVALUE); - int errMsgLen; + TCL_SIZE_T errMsgLen; const char *prevErrMsg = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &errMsgLen); Tcl_DString ds; Tcl_DStringInit(&ds); if (errMsgLen > 0) { Tcl_DStringAppend(&ds, prevErrMsg, errMsgLen); - Tcl_DStringAppend(&ds, " 2nd error: ", -1); + Tcl_DStringAppend(&ds, " 2nd error: ", TCL_INDEX_NONE); } if (context != NULL) { - Tcl_DStringAppend(&ds, context, -1); + Tcl_DStringAppend(&ds, context, TCL_INDEX_NONE); Tcl_DStringAppend(&ds, ": ", 2); } Nsf_DStringPrintf(&ds, "expected %s but got \"%s\"", type, ObjStr(value)); if (isNamed) { Nsf_DStringPrintf(&ds, " for parameter \"%s\"", NsfObjErrType->name); } else if (returnValue != 0) { - Tcl_DStringAppend(&ds, " as return value", -1); + Tcl_DStringAppend(&ds, " as return value", TCL_INDEX_NONE); } Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds))); Index: generic/nsfFunPtrHashTable.c =================================================================== diff -u -r83e2a1bc1e93733b0459e24666828c4a3f2bce63 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfFunPtrHashTable.c (.../nsfFunPtrHashTable.c) (revision 83e2a1bc1e93733b0459e24666828c4a3f2bce63) +++ generic/nsfFunPtrHashTable.c (.../nsfFunPtrHashTable.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -86,7 +86,12 @@ *---------------------------------------------------------------------- */ -static unsigned int +static +#if defined TCL_HASH_TYPE + TCL_HASH_TYPE +#else + unsigned int +#endif FunPtrKey( Tcl_HashTable *UNUSED(tablePtr), /* Hash table. */ void *keyPtr /* Key from which to compute hash value. */ Index: generic/nsfInt.h =================================================================== diff -u -rf0f87b41b6bb57a518fc1bc52fd2f3422d7a9b07 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfInt.h (.../nsfInt.h) (revision f0f87b41b6bb57a518fc1bc52fd2f3422d7a9b07) +++ generic/nsfInt.h (.../nsfInt.h) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -46,6 +46,19 @@ #ifndef NSF_INCLUDE_nsf_int_h_ #define NSF_INCLUDE_nsf_int_h_ +#ifndef EXTERN +# ifdef __cplusplus +# define EXTERN extern "C" TCL_STORAGE_CLASS +# else +# define EXTERN extern TCL_STORAGE_CLASS +# endif +#endif + +#ifndef CONST86 +# define CONST86 const +#endif + + /* * Well behaved compiler with C99 support should define __STDC_VERSION__ */ @@ -134,6 +147,10 @@ #endif #include +#ifndef TCL_INDEX_NONE +# define TCL_INDEX_NONE -1 +#endif + #include "nsf.h" #include @@ -338,7 +355,7 @@ #if !defined(NDEBUG) # define ISOBJ(o) ((o) != NULL && ISOBJ_(o)) -# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && (((o)->typePtr != NULL) ? ((o)->typePtr->name != NULL) : ((o)->bytes != NULL)) && (((o)->bytes != NULL) ? (o)->length >= -1 : 1) && (o)->refCount >= 0) +# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && (((o)->typePtr != NULL) ? ((o)->typePtr->name != NULL) : ((o)->bytes != NULL)) && (((o)->bytes != NULL) ? (o)->length >= 0 : 1) && (o)->refCount >= 0u) #else # define ISOBJ(o) #endif @@ -356,10 +373,10 @@ #ifdef USE_TCL_STUBS # define DECR_REF_COUNT(A) \ - MEM_COUNT_FREE("INCR_REF_COUNT" #A,(A)); assert((A)->refCount > -1); \ + MEM_COUNT_FREE("INCR_REF_COUNT" #A,(A)); assert((A)->refCount >= 0); \ Tcl_DecrRefCount(A) # define DECR_REF_COUNT2(name,A) \ - MEM_COUNT_FREE("INCR_REF_COUNT-" name,(A)); assert((A)->refCount > -1); \ + MEM_COUNT_FREE("INCR_REF_COUNT-" name,(A)); assert((A)->refCount >= 0); \ Tcl_DecrRefCount(A) #else # define DECR_REF_COUNT(A) \ @@ -830,7 +847,7 @@ * Next Scripting ShadowTclCommands */ typedef struct NsfShadowTclCommandInfo { - TclObjCmdProcType proc; + Tcl_ObjCmdProc *proc; ClientData clientData; int nrArgs; } NsfShadowTclCommandInfo; @@ -1103,7 +1120,11 @@ * */ #if defined(NRE) -# include "stubs8.6/nsfIntDecls.h" +# if defined(PRE9) +# include "stubs8.6/nsfIntDecls.h" +# else +# include "stubs9.0/nsfIntDecls.h" +# endif #else # include "stubs8.5/nsfIntDecls.h" #endif Index: generic/nsfObj.c =================================================================== diff -u -re01e30551cfcc79872de5b8a08a31258e3414c97 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfObj.c (.../nsfObj.c) (revision e01e30551cfcc79872de5b8a08a31258e3414c97) +++ generic/nsfObj.c (.../nsfObj.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -169,7 +169,7 @@ #if defined(METHOD_OBJECT_TRACE) fprintf(stderr, "... NsfMethodObjSet frees old int rep %s\n", (objPtr->typePtr != NULL) ? objPtr->typePtr->name : "none"); #endif - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); mcPtr = NEW(NsfMethodContext); /*fprintf(stderr, "NsfMethodObjSet allocated NsfMethodContext %p for %s\n", mcPtr, ObjStr(objPtr));*/ objPtr->internalRep.twoPtrValue.ptr1 = (void *)mcPtr; @@ -317,7 +317,7 @@ * structure as internal representation. */ if (objPtr->typePtr != &NsfFlagObjType) { - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); flagPtr = NEW(NsfFlag); assert(flagPtr != NULL); /*fprintf(stderr, "NsfFlagObjSet allocated NsfFlag %p for %s\n", flagPtr, ObjStr(objPtr));*/ @@ -541,7 +541,7 @@ * Free the old internal representation and store own structure as internal * representation. */ - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.twoPtrValue.ptr1 = (void *)mixinRegPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = &NsfMixinregObjType; @@ -821,7 +821,7 @@ * Free the old internal representation and store own structure as internal * representation. */ - TclFreeIntRep(objPtr); + TclFreeInternalRep(objPtr); objPtr->internalRep.twoPtrValue.ptr1 = (void *)filterregPtr; objPtr->internalRep.twoPtrValue.ptr2 = NULL; objPtr->typePtr = &NsfFilterregObjType; Index: generic/nsfPointer.c =================================================================== diff -u -r42dbfd5df1fa6248468d00c7d68fd699a5a69e64 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfPointer.c (.../nsfPointer.c) (revision 42dbfd5df1fa6248468d00c7d68fd699a5a69e64) +++ generic/nsfPointer.c (.../nsfPointer.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -74,7 +74,7 @@ int isNew; Tcl_DStringInit(dsPtr); - Tcl_DStringAppend(dsPtr, typeName, -1); + Tcl_DStringAppend(dsPtr, typeName, TCL_INDEX_NONE); Tcl_DStringAppend(dsPtr, ":%d", 3); NsfMutexLock(&pointerMutex); snprintf(buffer, size, Tcl_DStringValue(dsPtr), (*counterPtr)++); Index: generic/nsfProfile.c =================================================================== diff -u -r460ae16a20181968b20b9e576942421fd881bad8 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfProfile.c (.../nsfProfile.c) (revision 460ae16a20181968b20b9e576942421fd881bad8) +++ generic/nsfProfile.c (.../nsfProfile.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -67,9 +67,9 @@ nonnull_assert(dsPtr != NULL); nonnull_assert(object != NULL); - Tcl_DStringAppend(dsPtr, ObjectName_(object), -1); + Tcl_DStringAppend(dsPtr, ObjectName_(object), TCL_INDEX_NONE); Tcl_DStringAppend(dsPtr, " ", 1); - Tcl_DStringAppend(dsPtr, ClassName(object->cl), -1); + Tcl_DStringAppend(dsPtr, ClassName(object->cl), TCL_INDEX_NONE); } /* @@ -98,7 +98,7 @@ Tcl_DStringAppendElement(dsPtr, methodName); if (class != NULL) { Tcl_DStringAppend(dsPtr, " ", 1); - Tcl_DStringAppend(dsPtr, ObjStr(class->object.cmdName), -1); + Tcl_DStringAppend(dsPtr, ObjStr(class->object.cmdName), TCL_INDEX_NONE); } } @@ -176,7 +176,7 @@ NsfProfileMethodLabel(&ds, class, methodName); Tcl_DStringAppend(&ds, "}", 1); - listObj = Tcl_NewListObj(objc, objv); + listObj = Tcl_NewListObj((TCL_SIZE_T)objc, objv); INCR_REF_COUNT(listObj); Nsf_DStringPrintf(&ds, " {%s}", ObjStr(listObj)); DECR_REF_COUNT(listObj); @@ -360,18 +360,18 @@ } Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, fullMethodName, -1); + Tcl_DStringAppend(&ds, fullMethodName, TCL_INDEX_NONE); for (i = 1; i<=nrArgs; i++) { Tcl_DStringAppend(&ds, " ", 1); - Tcl_DStringAppend(&ds, ObjStr(objv[i]), -1); + Tcl_DStringAppend(&ds, ObjStr(objv[i]), TCL_INDEX_NONE); } label = ds.string; } NsfProfileTraceCallAppend(interp, label); Tcl_GetTime(&start); - result = Tcl_NRCallObjProc(interp, ti->proc, ti->clientData, objc, objv); + result = Tcl_NRCallObjProc(interp, ti->proc, ti->clientData, (TCL_SIZE_T)objc, objv); NsfProfileRecordProcData(interp, label, start.sec, start.usec); if (label != fullMethodName) { @@ -908,7 +908,7 @@ char *key = Tcl_GetHashKey(table, hPtr); Tcl_Obj *subList = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, subList, Tcl_NewStringObj(key, -1)); + Tcl_ListObjAppendElement(interp, subList, Tcl_NewStringObj(key, TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, subList, Tcl_NewLongObj(value->microSec)); Tcl_ListObjAppendElement(interp, subList, Tcl_NewLongObj(value->count)); Tcl_ListObjAppendElement(interp, list, subList); Index: generic/nsfShadow.c =================================================================== diff -u -r42dbfd5df1fa6248468d00c7d68fd699a5a69e64 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfShadow.c (.../nsfShadow.c) (revision 42dbfd5df1fa6248468d00c7d68fd699a5a69e64) +++ generic/nsfShadow.c (.../nsfShadow.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -275,7 +275,7 @@ Tcl_DStringInit(&fqNewName); Tcl_DStringAppend(&fqNewName, "::nsf::procs::", 14); - Tcl_DStringAppend(&fqNewName, newName, -1); + Tcl_DStringAppend(&fqNewName, newName, TCL_INDEX_NONE); /* fprintf(stderr, "oldName %s newName %s\n", ObjStr(tcd->procName), Tcl_DStringValue(&fqNewName));*/ result = TclRenameCommand(interp, ObjStr(tcd->procName), Tcl_DStringValue(&fqNewName)); @@ -395,7 +395,7 @@ Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("method", 6)); Tcl_ListObjAppendElement(interp, listObj, (cscPtr->cmdPtr != NULL) - ? Tcl_NewStringObj(Tcl_GetCommandName(interp, cscPtr->cmdPtr), -1) + ? Tcl_NewStringObj(Tcl_GetCommandName(interp, cscPtr->cmdPtr), TCL_INDEX_NONE) : NsfGlobalObjs[NSF_EMPTY]); Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj("frametype", 9)); if (cscPtr->frameType == NSF_CSC_TYPE_PLAIN) { @@ -409,7 +409,7 @@ } else { frameType = "unknown"; } - Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(frameType, -1)); + Tcl_ListObjAppendElement(interp, listObj, Tcl_NewStringObj(frameType, TCL_INDEX_NONE)); Tcl_SetObjResult(interp, listObj); } else if (frameFlags & (FRAME_IS_NSF_OBJECT)) { NsfObject *object = (NsfObject *)Tcl_CallFrame_clientData(varFramePtr); @@ -532,7 +532,7 @@ if (objc > 1) { memcpy(ov+1, objv+1, sizeof(Tcl_Obj *) * ((size_t)objc - 1u)); } - result = Tcl_NRCallObjProc(interp, ti->proc, ti->clientData, objc, objv); + result = Tcl_NRCallObjProc(interp, ti->proc, ti->clientData, (TCL_SIZE_T)objc, objv); FREE_ON_STACK(Tcl_Obj *, ov); return result; } Index: generic/nsfStack.c =================================================================== diff -u -r84ebec01747d68ec9ab8310c0aba7dfd6a2af522 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- generic/nsfStack.c (.../nsfStack.c) (revision 84ebec01747d68ec9ab8310c0aba7dfd6a2af522) +++ generic/nsfStack.c (.../nsfStack.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -268,13 +268,13 @@ (frameFlags & (FRAME_IS_NSF_METHOD|FRAME_IS_NSF_CMETHOD)) ? ((NsfCallStackContent *)Tcl_CallFrame_clientData(framePtr)) : NULL; - fprintf(stderr, "... %16p %.6x %16p %3d %16p %s ov %s %d", + fprintf(stderr, "... %16p %.6x %16p %4lu %16p %s ov %s %ld", (void *)framePtr, frameFlags, Tcl_CallFrame_clientData(framePtr), - Tcl_CallFrame_level(framePtr), + (unsigned long)Tcl_CallFrame_level(framePtr), (void *)Tcl_CallFrame_nsPtr(framePtr), Tcl_CallFrame_nsPtr(framePtr)->fullName, - Tcl_CallFrame_objc(framePtr) > 0 ? ObjStr(Tcl_CallFrame_objv(framePtr)[0]) : "(null)", - Tcl_CallFrame_objc(framePtr) > 0 ? Tcl_CallFrame_objc(framePtr) : -1); + Tcl_CallFrame_objc(framePtr) > 0u ? ObjStr(Tcl_CallFrame_objv(framePtr)[0]) : "(null)", + Tcl_CallFrame_objc(framePtr) > 0u ? (unsigned long)Tcl_CallFrame_objc(framePtr) : 0u); if (cscPtr != NULL) { fprintf(stderr, " csc %p frameType %.4x flags %.6x (%s.%p %s)\n", (void *)cscPtr, @@ -658,7 +658,7 @@ varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(interp); if (likely(varFramePtr != NULL)) { - int lvl = Tcl_CallFrame_level(varFramePtr); + unsigned long lvl = Tcl_CallFrame_level(varFramePtr); do { register unsigned int flags = (unsigned int)Tcl_CallFrame_isProcCallFrame(varFramePtr); @@ -1025,7 +1025,7 @@ } Tcl_ListObjAppendElement(interp, methodPathObj, - Tcl_NewStringObj(Tcl_GetCommandName(interp, cscPtr->cmdPtr), -1)); + Tcl_NewStringObj(Tcl_GetCommandName(interp, cscPtr->cmdPtr), TCL_INDEX_NONE)); elements++; /* Index: generic/stubs9.0/nsfDecls.h =================================================================== diff -u --- generic/stubs9.0/nsfDecls.h (revision 0) +++ generic/stubs9.0/nsfDecls.h (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -0,0 +1,368 @@ +/* + * nsfDecls.h -- + * + * Declarations of functions in the platform independent public Nsf API. + * + * This file is part of the Next Scripting Framework. + * + * Copyright (C) 1999-2014 Gustaf Neumann (a, b) + * Copyright (C) 1999-2007 Uwe Zdun (a, b) + * + * (a) University of Essen + * Specification of Software Systems + * Altendorferstrasse 97-101 + * D-45143 Essen, Germany + * + * (b) Vienna University of Economics and Business + * Institute of Information Systems and New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * This work is licensed under the MIT License https://www.opensource.org/licenses/MIT + * + * Copyright: + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef NSF_INCLUDED_NSFDECLS +#define NSF_INCLUDED_NSFDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the nsf.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Exported function declarations: + */ + +/* 0 */ +EXTERN int Nsf_Init(Tcl_Interp *interp); +/* Slot 1 is reserved */ +/* 2 */ +EXTERN struct Nsf_Class * NsfIsClass(Tcl_Interp *interp, ClientData cd); +/* 3 */ +EXTERN struct Nsf_Object * NsfGetObject(Tcl_Interp *interp, const char *name); +/* 4 */ +EXTERN struct Nsf_Class * NsfGetClass(Tcl_Interp *interp, const char *name); +/* 5 */ +EXTERN int NsfDeleteObject(Tcl_Interp *interp, + struct Nsf_Object *object); +/* 6 */ +EXTERN int NsfRemoveObjectMethod(Tcl_Interp *interp, + struct Nsf_Object *object, + const char *methodName); +/* 7 */ +EXTERN int NsfRemoveClassMethod(Tcl_Interp *interp, + struct Nsf_Class *class, + const char *methodName); +/* 8 */ +EXTERN Tcl_Obj * Nsf_ObjSetVar2(struct Nsf_Object *object, + Tcl_Interp *interp, Tcl_Obj *name1, + Tcl_Obj *name2, Tcl_Obj *valueObj, + unsigned int flags); +/* 9 */ +EXTERN Tcl_Obj * Nsf_ObjGetVar2(struct Nsf_Object *object, + Tcl_Interp *interp, Tcl_Obj *name1, + Tcl_Obj *name2, unsigned int flags); +/* 10 */ +EXTERN int Nsf_UnsetVar2(struct Nsf_Object *object, + Tcl_Interp *interp, const char *name1, + const char *name2, unsigned int flags); +/* 11 */ +EXTERN void NsfDStringVPrintf(Tcl_DString *dsPtr, + const char *fmt, va_list argPtr); +/* 12 */ +EXTERN int NsfPrintError(Tcl_Interp *interp, const char *fmt, ...); +/* 13 */ +EXTERN int NsfErrInProc(Tcl_Interp *interp, Tcl_Obj *objName, + Tcl_Obj *clName, const char *procName); +/* 14 */ +EXTERN int NsfObjErrType(Tcl_Interp *interp, + const char *context, Tcl_Obj *value, + const char *type, + Nsf_Param const *NsfObjErrType); +/* 15 */ +EXTERN void NsfStackDump(Tcl_Interp *interp); +/* 16 */ +EXTERN void NsfSetObjClientData(Tcl_Interp *interp, + Nsf_Object *object, ClientData data); +/* 17 */ +EXTERN ClientData NsfGetObjClientData(Tcl_Interp *interp, + Nsf_Object *object); +/* 18 */ +EXTERN void NsfSetClassClientData(Tcl_Interp *interp, + Nsf_Class *cl, ClientData data); +/* 19 */ +EXTERN ClientData NsfGetClassClientData(Tcl_Interp *interp, + Nsf_Class *cl); +/* 20 */ +EXTERN void NsfRequireObjNamespace(Tcl_Interp *interp, + Nsf_Object *object); +/* 21 */ +EXTERN int NsfCallMethodWithArgs(Tcl_Interp *interp, + Nsf_Object *object, Tcl_Obj *methodObj, + Tcl_Obj *arg1, int givenObjc, + Tcl_Obj *const objv[], unsigned int flags); +/* 22 */ +EXTERN int NsfAddObjectMethod(Tcl_Interp *interp, + struct Nsf_Object *object, + const char *methodName, Tcl_ObjCmdProc *proc, + ClientData clientData, Tcl_CmdDeleteProc *dp, + unsigned int flags); +/* 23 */ +EXTERN int NsfAddClassMethod(Tcl_Interp *interp, + struct Nsf_Class *class, + const char *methodName, Tcl_ObjCmdProc *proc, + ClientData clientData, Tcl_CmdDeleteProc *dp, + unsigned int flags); +/* 24 */ +EXTERN int NsfCreate(Tcl_Interp *interp, Nsf_Class *class, + Tcl_Obj *nameObj, int objc, + Tcl_Obj *const objv[]); +/* 25 */ +EXTERN int Nsf_ArgumentParse(Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[], Nsf_Object *object, + Tcl_Obj *procNameObj, + Nsf_Param const *paramPtr, int nrParams, + int serial, unsigned int processFlags, + Nsf_ParseContext *pcPtr); +/* 26 */ +EXTERN void NsfLog(Tcl_Interp *interp, int requiredLevel, + const char *fmt, ...); +/* 27 */ +EXTERN int Nsf_PointerAdd(Tcl_Interp *interp, char *buffer, + size_t size, const char *typeName, + void *valuePtr); +/* 28 */ +EXTERN int Nsf_PointerDelete(const char *key, void *valuePtr, + int free); +/* 29 */ +EXTERN int Nsf_PointerTypeRegister(Tcl_Interp *interp, + const char*typeName, int *counterPtr); +/* 30 */ +EXTERN int Nsf_ConvertToBoolean(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 31 */ +EXTERN int Nsf_ConvertToClass(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 32 */ +EXTERN int Nsf_ConvertToInt32(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 33 */ +EXTERN int Nsf_ConvertToInteger(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 34 */ +EXTERN int Nsf_ConvertToObject(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 35 */ +EXTERN int Nsf_ConvertToPointer(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 36 */ +EXTERN int Nsf_ConvertToString(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 37 */ +EXTERN int Nsf_ConvertToTclobj(Tcl_Interp *interp, + Tcl_Obj *objPtr, Nsf_Param const *pPtr, + ClientData *clientData, Tcl_Obj **outObjPtr); +/* 38 */ +EXTERN int Nsf_EnumerationTypeRegister(Tcl_Interp *interp, + Nsf_EnumeratorConverterEntry *typeRecords); +/* 39 */ +EXTERN int Nsf_CmdDefinitionRegister(Tcl_Interp *interp, + Nsf_methodDefinition *definitionRecords); +/* 40 */ +EXTERN int NsfArgumentError(Tcl_Interp *interp, + const char *errorMsg, + Nsf_Param const *paramPtr, + Tcl_Obj *cmdNameObj, Tcl_Obj *methodPathObj); +/* 41 */ +EXTERN void Nsf_DStringPrintf(Tcl_DString *dsPtr, + const char *fmt, ...); + +typedef struct { + const struct NsfIntStubs *nsfIntStubs; +} NsfStubHooks; + +typedef struct NsfStubs { + int magic; + const NsfStubHooks *hooks; + + int (*nsf_Init) (Tcl_Interp *interp); /* 0 */ + void (*reserved1)(void); + struct Nsf_Class * (*nsfIsClass) (Tcl_Interp *interp, ClientData cd); /* 2 */ + struct Nsf_Object * (*nsfGetObject) (Tcl_Interp *interp, const char *name); /* 3 */ + struct Nsf_Class * (*nsfGetClass) (Tcl_Interp *interp, const char *name); /* 4 */ + int (*nsfDeleteObject) (Tcl_Interp *interp, struct Nsf_Object *object); /* 5 */ + int (*nsfRemoveObjectMethod) (Tcl_Interp *interp, struct Nsf_Object *object, const char *methodName); /* 6 */ + int (*nsfRemoveClassMethod) (Tcl_Interp *interp, struct Nsf_Class *class, const char *methodName); /* 7 */ + Tcl_Obj * (*nsf_ObjSetVar2) (struct Nsf_Object *object, Tcl_Interp *interp, Tcl_Obj *name1, Tcl_Obj *name2, Tcl_Obj *valueObj, unsigned int flags); /* 8 */ + Tcl_Obj * (*nsf_ObjGetVar2) (struct Nsf_Object *object, Tcl_Interp *interp, Tcl_Obj *name1, Tcl_Obj *name2, unsigned int flags); /* 9 */ + int (*nsf_UnsetVar2) (struct Nsf_Object *object, Tcl_Interp *interp, const char *name1, const char *name2, unsigned int flags); /* 10 */ + void (*nsfDStringVPrintf) (Tcl_DString *dsPtr, const char *fmt, va_list argPtr); /* 11 */ + int (*nsfPrintError) (Tcl_Interp *interp, const char *fmt, ...); /* 12 */ + int (*nsfErrInProc) (Tcl_Interp *interp, Tcl_Obj *objName, Tcl_Obj *clName, const char *procName); /* 13 */ + int (*nsfObjErrType) (Tcl_Interp *interp, const char *context, Tcl_Obj *value, const char *type, Nsf_Param const *NsfObjErrType); /* 14 */ + void (*nsfStackDump) (Tcl_Interp *interp); /* 15 */ + void (*nsfSetObjClientData) (Tcl_Interp *interp, Nsf_Object *object, ClientData data); /* 16 */ + ClientData (*nsfGetObjClientData) (Tcl_Interp *interp, Nsf_Object *object); /* 17 */ + void (*nsfSetClassClientData) (Tcl_Interp *interp, Nsf_Class *cl, ClientData data); /* 18 */ + ClientData (*nsfGetClassClientData) (Tcl_Interp *interp, Nsf_Class *cl); /* 19 */ + void (*nsfRequireObjNamespace) (Tcl_Interp *interp, Nsf_Object *object); /* 20 */ + int (*nsfCallMethodWithArgs) (Tcl_Interp *interp, Nsf_Object *object, Tcl_Obj *methodObj, Tcl_Obj *arg1, int givenObjc, Tcl_Obj *const objv[], unsigned int flags); /* 21 */ + int (*nsfAddObjectMethod) (Tcl_Interp *interp, struct Nsf_Object *object, const char *methodName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *dp, unsigned int flags); /* 22 */ + int (*nsfAddClassMethod) (Tcl_Interp *interp, struct Nsf_Class *class, const char *methodName, Tcl_ObjCmdProc *proc, ClientData clientData, Tcl_CmdDeleteProc *dp, unsigned int flags); /* 23 */ + int (*nsfCreate) (Tcl_Interp *interp, Nsf_Class *class, Tcl_Obj *nameObj, int objc, Tcl_Obj *const objv[]); /* 24 */ + int (*nsf_ArgumentParse) (Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], Nsf_Object *object, Tcl_Obj *procNameObj, Nsf_Param const *paramPtr, int nrParams, int serial, unsigned int processFlags, Nsf_ParseContext *pcPtr); /* 25 */ + void (*nsfLog) (Tcl_Interp *interp, int requiredLevel, const char *fmt, ...); /* 26 */ + int (*nsf_PointerAdd) (Tcl_Interp *interp, char *buffer, size_t size, const char *typeName, void *valuePtr); /* 27 */ + int (*nsf_PointerDelete) (const char *key, void *valuePtr, int free); /* 28 */ + int (*nsf_PointerTypeRegister) (Tcl_Interp *interp, const char*typeName, int *counterPtr); /* 29 */ + int (*nsf_ConvertToBoolean) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 30 */ + int (*nsf_ConvertToClass) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 31 */ + int (*nsf_ConvertToInt32) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 32 */ + int (*nsf_ConvertToInteger) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 33 */ + int (*nsf_ConvertToObject) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 34 */ + int (*nsf_ConvertToPointer) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 35 */ + int (*nsf_ConvertToString) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 36 */ + int (*nsf_ConvertToTclobj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param const *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr); /* 37 */ + int (*nsf_EnumerationTypeRegister) (Tcl_Interp *interp, Nsf_EnumeratorConverterEntry *typeRecords); /* 38 */ + int (*nsf_CmdDefinitionRegister) (Tcl_Interp *interp, Nsf_methodDefinition *definitionRecords); /* 39 */ + int (*nsfArgumentError) (Tcl_Interp *interp, const char *errorMsg, Nsf_Param const *paramPtr, Tcl_Obj *cmdNameObj, Tcl_Obj *methodPathObj); /* 40 */ + void (*nsf_DStringPrintf) (Tcl_DString *dsPtr, const char *fmt, ...); /* 41 */ +} NsfStubs; + +extern const NsfStubs *nsfStubsPtr; + +#ifdef __cplusplus +} +#endif + +#if defined(USE_NSF_STUBS) + +/* + * Inline function declarations: + */ + +#define Nsf_Init \ + (nsfStubsPtr->nsf_Init) /* 0 */ +/* Slot 1 is reserved */ +#define NsfIsClass \ + (nsfStubsPtr->nsfIsClass) /* 2 */ +#define NsfGetObject \ + (nsfStubsPtr->nsfGetObject) /* 3 */ +#define NsfGetClass \ + (nsfStubsPtr->nsfGetClass) /* 4 */ +#define NsfDeleteObject \ + (nsfStubsPtr->nsfDeleteObject) /* 5 */ +#define NsfRemoveObjectMethod \ + (nsfStubsPtr->nsfRemoveObjectMethod) /* 6 */ +#define NsfRemoveClassMethod \ + (nsfStubsPtr->nsfRemoveClassMethod) /* 7 */ +#define Nsf_ObjSetVar2 \ + (nsfStubsPtr->nsf_ObjSetVar2) /* 8 */ +#define Nsf_ObjGetVar2 \ + (nsfStubsPtr->nsf_ObjGetVar2) /* 9 */ +#define Nsf_UnsetVar2 \ + (nsfStubsPtr->nsf_UnsetVar2) /* 10 */ +#define NsfDStringVPrintf \ + (nsfStubsPtr->nsfDStringVPrintf) /* 11 */ +#define NsfPrintError \ + (nsfStubsPtr->nsfPrintError) /* 12 */ +#define NsfErrInProc \ + (nsfStubsPtr->nsfErrInProc) /* 13 */ +#define NsfObjErrType \ + (nsfStubsPtr->nsfObjErrType) /* 14 */ +#define NsfStackDump \ + (nsfStubsPtr->nsfStackDump) /* 15 */ +#define NsfSetObjClientData \ + (nsfStubsPtr->nsfSetObjClientData) /* 16 */ +#define NsfGetObjClientData \ + (nsfStubsPtr->nsfGetObjClientData) /* 17 */ +#define NsfSetClassClientData \ + (nsfStubsPtr->nsfSetClassClientData) /* 18 */ +#define NsfGetClassClientData \ + (nsfStubsPtr->nsfGetClassClientData) /* 19 */ +#define NsfRequireObjNamespace \ + (nsfStubsPtr->nsfRequireObjNamespace) /* 20 */ +#define NsfCallMethodWithArgs \ + (nsfStubsPtr->nsfCallMethodWithArgs) /* 21 */ +#define NsfAddObjectMethod \ + (nsfStubsPtr->nsfAddObjectMethod) /* 22 */ +#define NsfAddClassMethod \ + (nsfStubsPtr->nsfAddClassMethod) /* 23 */ +#define NsfCreate \ + (nsfStubsPtr->nsfCreate) /* 24 */ +#define Nsf_ArgumentParse \ + (nsfStubsPtr->nsf_ArgumentParse) /* 25 */ +#define NsfLog \ + (nsfStubsPtr->nsfLog) /* 26 */ +#define Nsf_PointerAdd \ + (nsfStubsPtr->nsf_PointerAdd) /* 27 */ +#define Nsf_PointerDelete \ + (nsfStubsPtr->nsf_PointerDelete) /* 28 */ +#define Nsf_PointerTypeRegister \ + (nsfStubsPtr->nsf_PointerTypeRegister) /* 29 */ +#define Nsf_ConvertToBoolean \ + (nsfStubsPtr->nsf_ConvertToBoolean) /* 30 */ +#define Nsf_ConvertToClass \ + (nsfStubsPtr->nsf_ConvertToClass) /* 31 */ +#define Nsf_ConvertToInt32 \ + (nsfStubsPtr->nsf_ConvertToInt32) /* 32 */ +#define Nsf_ConvertToInteger \ + (nsfStubsPtr->nsf_ConvertToInteger) /* 33 */ +#define Nsf_ConvertToObject \ + (nsfStubsPtr->nsf_ConvertToObject) /* 34 */ +#define Nsf_ConvertToPointer \ + (nsfStubsPtr->nsf_ConvertToPointer) /* 35 */ +#define Nsf_ConvertToString \ + (nsfStubsPtr->nsf_ConvertToString) /* 36 */ +#define Nsf_ConvertToTclobj \ + (nsfStubsPtr->nsf_ConvertToTclobj) /* 37 */ +#define Nsf_EnumerationTypeRegister \ + (nsfStubsPtr->nsf_EnumerationTypeRegister) /* 38 */ +#define Nsf_CmdDefinitionRegister \ + (nsfStubsPtr->nsf_CmdDefinitionRegister) /* 39 */ +#define NsfArgumentError \ + (nsfStubsPtr->nsfArgumentError) /* 40 */ +#define Nsf_DStringPrintf \ + (nsfStubsPtr->nsf_DStringPrintf) /* 41 */ + +#endif /* defined(USE_NSF_STUBS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* NSF_INCLUDED_NSFDECLS */ + Index: generic/stubs9.0/nsfIntDecls.h =================================================================== diff -u --- generic/stubs9.0/nsfIntDecls.h (revision 0) +++ generic/stubs9.0/nsfIntDecls.h (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -0,0 +1,89 @@ +/* + * nsfIntDecls.h -- + * + * This file contains the declarations for all unsupported + * functions that are exported by the Tcl library. These + * interfaces are not guaranteed to remain the same between + * versions. Use at your own risk. + * + * Copyright (C) 1998-2008 Uwe Zdun (a, b) + * Copyright (C) 1998-2014 Gustaf Neumann (a, b) + * + * (a) University of Essen + * Specification of Software Systems + * Altendorferstrasse 97-101 + * D-45143 Essen, Germany + * + * (b) Vienna University of Economics and Business + * Institute of Information Systems and New Media + * A-1020, Welthandelsplatz 1 + * Vienna, Austria + * + * This work is licensed under the MIT License https://www.opensource.org/licenses/MIT + * + * Copyright: + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef NSF_INCLUDED_NSFINTDECLS +#define NSF_INCLUDED_NSFINTDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the nsfInt.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Exported function declarations: + */ + + +typedef struct NsfIntStubs { + int magic; + void *hooks; + +} NsfIntStubs; + +extern const NsfIntStubs *nsfIntStubsPtr; + +#ifdef __cplusplus +} +#endif + +#if defined(USE_NSF_STUBS) + +/* + * Inline function declarations: + */ + + +#endif /* defined(USE_NSF_STUBS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* NSF_INCLUDED_NSFINTDECLS */ Index: generic/stubs9.0/nsfStubInit.c =================================================================== diff -u --- generic/stubs9.0/nsfStubInit.c (revision 0) +++ generic/stubs9.0/nsfStubInit.c (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -0,0 +1,130 @@ +/* + * nsfStubInit.c -- + * + * This file contains the initializers for the stub vectors of the Next + * Scripting Framework. + * + * Copyright (C) 1999-2014 Gustaf Neumann (a, b) + * + * (a) University of Essen + * Specification of Software Systems + * Altendorferstrasse 97-101 + * D-45143 Essen, Germany + * + * (b) Vienna University of Economics and Business + * Institute of Information Systems and New Media + * A-1020, Welthandelsplatz 1 + * Vienna, Austria + * + * This work is licensed under the MIT License https://www.opensource.org/licenses/MIT + * + * Copyright: + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +#include "nsfInt.h" + +/* + * Remove macros that will interfere with the definitions below. + */ + +/* + * WARNING: The contents of this file is automatically generated by the + * tools/genStubs.tcl script. Any modifications to the function declarations + * below should be made in the generic/tcl.decls script. + */ + +#if defined(PRE86) +EXTERN NsfStubs nsfStubs; +# else +MODULE_SCOPE const NsfStubs nsfStubs; +#endif + + + + +/* !BEGIN!: Do not edit below this line. */ + +static const NsfIntStubs nsfIntStubs = { + TCL_STUB_MAGIC, + 0, +}; + +static const NsfStubHooks nsfStubHooks = { + &nsfIntStubs +}; + +const NsfStubs nsfStubs = { + TCL_STUB_MAGIC, + &nsfStubHooks, + Nsf_Init, /* 0 */ + 0, /* 1 */ + NsfIsClass, /* 2 */ + NsfGetObject, /* 3 */ + NsfGetClass, /* 4 */ + NsfDeleteObject, /* 5 */ + NsfRemoveObjectMethod, /* 6 */ + NsfRemoveClassMethod, /* 7 */ + Nsf_ObjSetVar2, /* 8 */ + Nsf_ObjGetVar2, /* 9 */ + Nsf_UnsetVar2, /* 10 */ + NsfDStringVPrintf, /* 11 */ + NsfPrintError, /* 12 */ + NsfErrInProc, /* 13 */ + NsfObjErrType, /* 14 */ + NsfStackDump, /* 15 */ + NsfSetObjClientData, /* 16 */ + NsfGetObjClientData, /* 17 */ + NsfSetClassClientData, /* 18 */ + NsfGetClassClientData, /* 19 */ + NsfRequireObjNamespace, /* 20 */ + NsfCallMethodWithArgs, /* 21 */ + NsfAddObjectMethod, /* 22 */ + NsfAddClassMethod, /* 23 */ + NsfCreate, /* 24 */ + Nsf_ArgumentParse, /* 25 */ + NsfLog, /* 26 */ + Nsf_PointerAdd, /* 27 */ + Nsf_PointerDelete, /* 28 */ + Nsf_PointerTypeRegister, /* 29 */ + Nsf_ConvertToBoolean, /* 30 */ + Nsf_ConvertToClass, /* 31 */ + Nsf_ConvertToInt32, /* 32 */ + Nsf_ConvertToInteger, /* 33 */ + Nsf_ConvertToObject, /* 34 */ + Nsf_ConvertToPointer, /* 35 */ + Nsf_ConvertToString, /* 36 */ + Nsf_ConvertToTclobj, /* 37 */ + Nsf_EnumerationTypeRegister, /* 38 */ + Nsf_CmdDefinitionRegister, /* 39 */ + NsfArgumentError, /* 40 */ + Nsf_DStringPrintf, /* 41 */ +}; + +/* !END!: Do not edit above this line. */ + +/* + * Local Variables: + * mode: c + * c-basic-offset: 2 + * fill-column: 78 + * End: + */ Index: library/mongodb/nsfmongo.c =================================================================== diff -u -r6b1f85df364e0b7f504dd645341e0207d1ca054b -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision 6b1f85df364e0b7f504dd645341e0207d1ca054b) +++ library/mongodb/nsfmongo.c (.../nsfmongo.c) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -232,8 +232,8 @@ tag = NSF_BSON_REGEX; regex = bson_iter_regex( &i, &options ); elemObj = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, elemObj, Tcl_NewStringObj(regex, -1)); - Tcl_ListObjAppendElement(interp, elemObj, Tcl_NewStringObj(options, -1)); + Tcl_ListObjAppendElement(interp, elemObj, Tcl_NewStringObj(regex, TCL_INDEX_NONE)); + Tcl_ListObjAppendElement(interp, elemObj, Tcl_NewStringObj(options, TCL_INDEX_NONE)); break; } case BSON_TYPE_UTF8: { @@ -250,7 +250,7 @@ case BSON_TYPE_OID: { tag = NSF_BSON_OID; bson_oid_to_string(bson_iter_oid(&i), oidhex); - elemObj = Tcl_NewStringObj(oidhex, -1); + elemObj = Tcl_NewStringObj(oidhex, TCL_INDEX_NONE); break; } case BSON_TYPE_TIMESTAMP: { @@ -292,7 +292,7 @@ tag = NSF_BSON_DECIMAL128; bson_iter_decimal128( &i, &decimal128); bson_decimal128_to_string(&decimal128, string); - elemObj = Tcl_NewStringObj(string, -1); + elemObj = Tcl_NewStringObj(string, TCL_INDEX_NONE); break; } @@ -317,7 +317,7 @@ NsfLog(interp, NSF_LOG_WARN, "BsonToList: unknown type %d", t); } - Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, -1)); + Tcl_ListObjAppendElement(interp, resultObj, Tcl_NewStringObj(key, TCL_INDEX_NONE)); Tcl_ListObjAppendElement(interp, resultObj, NsfMongoGlobalObjs[tag]); Tcl_ListObjAppendElement(interp, resultObj, elemObj); } @@ -719,7 +719,7 @@ return TCL_ERROR; } - Tcl_SetObjResult(interp, Tcl_NewStringObj(channelName, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(channelName, TCL_INDEX_NONE)); return TCL_OK; } @@ -814,7 +814,7 @@ char buffer[POINTER_HANDLE_SIZE]; if (Nsf_PointerAdd(interp, buffer, sizeof(buffer), "mongoc_collection_t", collectionPtr) == TCL_OK) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); result = TCL_OK; } else { mongoc_collection_destroy(collectionPtr); @@ -1288,7 +1288,7 @@ char buffer[POINTER_HANDLE_SIZE]; if (Nsf_PointerAdd(interp, buffer, sizeof(buffer), "mongoc_cursor_t", cursor) == TCL_OK) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); } else { mongoc_cursor_destroy( cursor ); result = TCL_ERROR; @@ -1348,7 +1348,7 @@ if (cursor != NULL) { char buffer[POINTER_HANDLE_SIZE]; if (Nsf_PointerAdd(interp, buffer, sizeof(buffer), "mongoc_cursor_t", cursor) == TCL_OK) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); } else { mongoc_cursor_destroy( cursor ); result = TCL_ERROR; @@ -1440,7 +1440,7 @@ } if (Nsf_PointerAdd(interp, buffer, sizeof(buffer), "mongoc_gridfs_t", gfsPtr) == TCL_OK) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); } else { mongoc_gridfs_destroy(gfsPtr); result = TCL_ERROR; @@ -1652,7 +1652,7 @@ char buffer[POINTER_HANDLE_SIZE]; if (Nsf_PointerAdd(interp, buffer, sizeof(buffer), "mongoc_gridfs_file_t", gridFilePtr) == TCL_OK) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, TCL_INDEX_NONE)); } else { mongoc_gridfs_file_destroy(gridFilePtr); result = TCL_ERROR; @@ -1711,7 +1711,7 @@ static int NsfMongoGridFileGetContentType(Tcl_Interp *interp, mongoc_gridfs_file_t* gridFilePtr) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(mongoc_gridfs_file_get_content_type(gridFilePtr), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(mongoc_gridfs_file_get_content_type(gridFilePtr), TCL_INDEX_NONE)); return TCL_OK; } @@ -1885,7 +1885,7 @@ NsfMongoGlobalObjs = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*)*nr_elements(NsfMongoGlobalStrings)); for (i = 0; i < nr_elements(NsfMongoGlobalStrings); i++) { - NsfMongoGlobalObjs[i] = Tcl_NewStringObj(NsfMongoGlobalStrings[i], -1); + NsfMongoGlobalObjs[i] = Tcl_NewStringObj(NsfMongoGlobalStrings[i], TCL_INDEX_NONE); Tcl_IncrRefCount(NsfMongoGlobalObjs[i]); } Index: library/serialize/serializer.tcl =================================================================== diff -u -r78c12b94b4cdcd5edb70a546b7bbb7c0a4724668 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 78c12b94b4cdcd5edb70a546b7bbb7c0a4724668) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -796,12 +796,15 @@ } else { lappend needed $regObj } + } else { + puts stderr "=== aliasedCmd $aliasedCmd has regObj <$regObj> x '$x' where '$where'" + #lappend needed $x } } - # if {[llength $needed]>0} { - # puts stderr "aliases: $x needs $needed" - # puts stderr "set alias-deps for $x - $handle - $needed" - # } + if {[llength $needed]>0} { + puts stderr "aliases: $x needs $needed" + puts stderr "set alias-deps for $x - $handle - $needed" + } set $handle $needed return $needed } Index: library/xotcl/library/comm/Access.xotcl =================================================================== diff -u -rf10f6e087eba19df21585a1776e095862306855d -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- library/xotcl/library/comm/Access.xotcl (.../Access.xotcl) (revision f10f6e087eba19df21585a1776e095862306855d) +++ library/xotcl/library/comm/Access.xotcl (.../Access.xotcl) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -1,7 +1,7 @@ # -*- tcl -*- $ package provide xotcl::comm::httpAccess 2.0 -set httpAccessVersion [package present xotcl::comm::httpAccess] +set ::httpAccessVersion [package present xotcl::comm::httpAccess] package require xotcl::comm::pcache package require xotcl::comm::mime @@ -681,8 +681,8 @@ Http set proxyhost {} Http set proxyport {} Http set accept */* - if {[info exists argv0]} { - Http set useragent "[file tail $argv0] httpAccess/$httpAccessVersion xotcl/$::xotcl::version ($os)" + if {[info exists ::argv0]} { + Http set useragent "[file tail $::argv0] httpAccess/$::httpAccessVersion xotcl/$::xotcl::version ($os)" } Http proc proxyfilter {host phostv pportv} { my instvar proxyfilter proxyhost proxyport Index: tests/contains.test =================================================================== diff -u -r9e281d5110f397a9e9b8317325d0675f1793246d -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- tests/contains.test (.../contains.test) (revision 9e281d5110f397a9e9b8317325d0675f1793246d) +++ tests/contains.test (.../contains.test) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -3,6 +3,7 @@ package require nx set ::tcl86 [package vsatisfies [package req Tcl] 8.6] +set ::tcl90 [package vsatisfies [package req Tcl] 9.0] # # Intentionally, we do not want to make a "namespace import" in this @@ -183,7 +184,7 @@ set ::errorcode $::errorCode ? {set ::errorMsg} {somethingwrong} -if {$::tcl86} { +if {$::tcl86 || $::tcl90} { set r {somethingwrong while executing "o contains { return -code error -errorcode {FOO bar baz} somethingwrong}"} @@ -193,6 +194,7 @@ invoked from within "o contains { return -code error -errorcode {FOO bar baz} somethingwrong}"} } + ? {set ::errorinfo} $r ? {set ::errorcode} {FOO bar baz} Index: unix/pkgIndex.unix.in =================================================================== diff -u -r6b67a152a9c351a6669aec517b4e982adeafb641 -re48161ab167236344f7d23da3e855c31d1a1ebc7 --- unix/pkgIndex.unix.in (.../pkgIndex.unix.in) (revision 6b67a152a9c351a6669aec517b4e982adeafb641) +++ unix/pkgIndex.unix.in (.../pkgIndex.unix.in) (revision e48161ab167236344f7d23da3e855c31d1a1ebc7) @@ -1,3 +1,3 @@ -package ifneeded nsf @PACKAGE_VERSION@ [list load [file join $dir @PKG_LIB_FILE@] nsf] +package ifneeded nsf @PACKAGE_VERSION@ [list load [file join $dir @PKG_LIB_FILE@] Nsf]