Index: generic/nsf.c =================================================================== diff -u -rfbd52e6cb0bda2ad5428ef9fc91e54f628f920af -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsf.c (.../nsf.c) (revision fbd52e6cb0bda2ad5428ef9fc91e54f628f920af) +++ generic/nsf.c (.../nsf.c) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -2388,7 +2388,7 @@ * returned in the class member "order". During computation, it colors * the processed nodes in WHITE, GRAY or BLACK. * - * Results: + * Results: * Indicates whether a cycle was detected (0) or not (1); and, * therefore, whether the sort failed (0) or suceeded (1). * @@ -2433,9 +2433,9 @@ isAcyclic = 0; break; } - + } - + if (isAcyclic != 0 && withMixinOfs != 0) { NsfCmdList *classMixins = ((cl->opt != NULL) && cl->opt->isClassMixinOf) ? cl->opt->isClassMixinOf : NULL; @@ -3284,7 +3284,7 @@ if (objNameLength > 0) { Tcl_DString ds, *dsPtr = &ds; - + /* obtain parent name */ Tcl_DStringInit(dsPtr); Tcl_DStringAppend(dsPtr, methodName, (int)objNameLength); @@ -4393,7 +4393,7 @@ * Compute the full method name for error messages containing the * ensemble root. * - * Results: + * Results: * Tcl_Obj of reference count 0, caller has to take care for * refcounting * @@ -4409,10 +4409,10 @@ const char *methodName) { Tcl_Obj *resultObj; - + nonnull_assert(interp != NULL); nonnull_assert(methodName != NULL); - + if (framePtr != NULL) { resultObj = CallStackMethodPath(interp, framePtr); } else { @@ -5727,10 +5727,10 @@ Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces, (const char *)varPtr); VarTrace *tracePtr = Tcl_GetHashValue(tPtr); ActiveVarTrace *activePtr; - + while (tracePtr) { VarTrace *prevPtr = tracePtr; - + tracePtr = tracePtr->nextPtr; prevPtr->nextPtr = NULL; Tcl_EventuallyFree(prevPtr, TCL_DYNAMIC); @@ -5763,7 +5763,7 @@ * Results: * None. * - * Side effects: + * Side effects: * Re-initializes the variable table of the cleaned-up namespace * (TclInitVarHashTable). * @@ -6593,7 +6593,7 @@ firstChar = *(nextChars ++); if (isupper((int)firstChar)) { char buffer[1]; - + buffer[0] = (char)tolower((int)firstChar); resultObj = Tcl_NewStringObj(buffer, 1); INCR_REF_COUNT2("autoname", resultObj); @@ -14238,18 +14238,18 @@ if (Tcl_ListObjLength(interp, objv[1], &length) == TCL_OK) { if (length > 1) { Tcl_ListObjIndex(interp, objv[1], length - 1, &tailMethodObj); - } + } } } result = NsfPrintError(interp, "%s: unable to dispatch method '%s'", ObjectName_(object), (tailMethodObj != NULL) ? MethodName(tailMethodObj) : methodName); } - + /* * Reset interp state, unknown has been fired. */ rst->unknown = 0; - + return result; } @@ -18626,9 +18626,9 @@ } } - /* Unset object variables with unset traces pre-emptively. */ + /* Unset object variables with unset traces pre-emptively. */ UnsetTracedVars(interp, object); - + if (object->nsPtr != NULL) { NSCleanupNamespace(interp, object->nsPtr); NSDeleteChildren(interp, object->nsPtr); @@ -20476,7 +20476,7 @@ INCR_REF_COUNT(methodObjPath); Tcl_ListObjAppendList(interp, cmd, methodObjPath); DECR_REF_COUNT(methodObjPath); - + if (objc > 1) { Tcl_ListObjAppendElement(interp, cmd, Tcl_NewListObj(objc-1, objv+1)); } @@ -20915,7 +20915,7 @@ } else { Tcl_Obj **ov, *freeList = NULL; int j, outputincr, outputArg = 0, firstPosArg=1, - totalargs = objc + tcd->nr_args + 3; + totalargs = objc + tcd->nr_args + 3; ALLOC_ON_STACK(Tcl_Obj*, totalargs, OV); ALLOC_ON_STACK(long, totalargs, objvmap); @@ -21013,7 +21013,7 @@ for (j = 0; j < totalargs; j++) { Tcl_Obj *tmp; long pos = objvmap[j], i; - + if (pos == -1 || pos == j) { continue; } @@ -21047,7 +21047,7 @@ */ if (tcd->prefix && objc > 1) { Tcl_Obj *methodName = Tcl_DuplicateObj(tcd->prefix); - + Tcl_AppendObjToObj(methodName, ov[1]); ov[1] = methodName; INCR_REF_COUNT(ov[1]); @@ -27547,7 +27547,7 @@ } return result; } - + /* * From here on, we have to be on a valid nsf frame/level, object has to be * know. @@ -27652,7 +27652,7 @@ break; case CurrentoptionCallinglevelIdx: - /* + /* * Special case of object==NULL handeled above. */ Tcl_SetObjResult(interp, ComputeLevelObj(interp, CALLING_LEVEL)); Index: generic/nsf.h =================================================================== diff -u -r4e70d6d46d845f168e6ff18960f8b5a8e3746e6d -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsf.h (.../nsf.h) (revision 4e70d6d46d845f168e6ff18960f8b5a8e3746e6d) +++ generic/nsf.h (.../nsf.h) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -78,8 +78,8 @@ * Feature activation/deactivation */ -/* - * The following features are controlled via +/* + * The following features are controlled via * configure flags * * --with-dtrace @@ -115,7 +115,7 @@ */ /* Activate/deactivate C-level assert() - Activated automatically when + Activated automatically when NSF_DEVELOPMENT is set #define NDEBUG 1 */ @@ -369,7 +369,7 @@ #endif #if __GNUC_PREREQ(6, 0) -# define NSF_nonnull_assert(assertion) +# define NSF_nonnull_assert(assertion) #else # define NSF_nonnull_assert(assertion) assert((assertion)) #endif Index: generic/nsfInt.h =================================================================== diff -u -r1d1ca561af5942718e613929b36e5d2419e4fe5a -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsfInt.h (.../nsfInt.h) (revision 1d1ca561af5942718e613929b36e5d2419e4fe5a) +++ generic/nsfInt.h (.../nsfInt.h) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -1,4 +1,4 @@ -/* +/* * nsfInt.h -- * * Declarations of the internally used API Functions of the Next @@ -47,8 +47,8 @@ #define _nsf_int_h_ #if defined(HAVE_STDINT_H) -# define HAVE_INTPTR_T -# define HAVE_UINTPTR_T +# define HAVE_INTPTR_T +# define HAVE_UINTPTR_T #endif /* @@ -79,7 +79,7 @@ #if __GNUC_PREREQ(2, 95) /* Use gcc branch prediction hint to minimize cost of e.g. DTrace - * ENABLED checks. + * ENABLED checks. */ # define unlikely(x) (__builtin_expect((x), 0)) # define likely(x) (__builtin_expect((x), 1)) @@ -344,7 +344,7 @@ (e.g., "if(NsfConfigEnabled(...))") */ -#define NsfConfigEnabled__NOOP(...) +#define NsfConfigEnabled__NOOP(...) #define NsfConfigEnabled__open ( #define NsfConfigEnabled__close ) #define NsfConfigEnabled__caller(macro, args) macro args @@ -435,7 +435,7 @@ } NsfStringIncrStruct; -/* +/* * cmd flags */ @@ -633,15 +633,15 @@ typedef enum SystemMethodsIdx { NSF_c_alloc_idx, - NSF_c_create_idx, + NSF_c_create_idx, NSF_c_dealloc_idx, - NSF_c_configureparameter_idx, - NSF_c_recreate_idx, - NSF_o_cleanup_idx, + NSF_c_configureparameter_idx, + NSF_c_recreate_idx, + NSF_o_cleanup_idx, NSF_o_configure_idx, NSF_o_configureparameter_idx, - NSF_o_defaultmethod_idx, - NSF_o_destroy_idx, + NSF_o_defaultmethod_idx, + NSF_o_destroy_idx, NSF_o_init_idx, NSF_o_move_idx, NSF_o_unknown_idx, @@ -651,7 +651,7 @@ #if !defined(NSF_C) EXTERN CONST char *Nsf_SystemMethodOpts[]; -#else +#else CONST char *Nsf_SystemMethodOpts[] = { "-class.alloc", "-class.create", @@ -684,8 +684,8 @@ } NsfObjectSystem; -/* - * Next Scripting global names and strings +/* + * Next Scripting global names and strings * * We provide enums for efficient lookup for corresponding string * names and Tcl_Objs via global arrays. The "constant" Tcl_Objs are @@ -700,18 +700,18 @@ /* var names */ NSF_AUTONAMES, NSF_DEFAULTMETACLASS, NSF_DEFAULTSUPERCLASS, NSF_ARRAY_INITCMD, NSF_ARRAY_CMD, - NSF_ARRAY_ALIAS, NSF_ARRAY_PARAMETERSYNTAX, + NSF_ARRAY_ALIAS, NSF_ARRAY_PARAMETERSYNTAX, NSF_POSITION, NSF_POSITIONAL, NSF_CONFIGURABLE, NSF_PARAMETERSPEC, /* object/class names */ - NSF_METHOD_PARAMETER_SLOT_OBJ, + NSF_METHOD_PARAMETER_SLOT_OBJ, /* constants */ - NSF_ALIAS, NSF_ARGS, NSF_CMD, NSF_FILTER, NSF_FORWARD, + NSF_ALIAS, NSF_ARGS, NSF_CMD, NSF_FILTER, NSF_FORWARD, NSF_METHOD, NSF_OBJECT, NSF_SETTER, NSF_SETTERNAME, NSF_VALUECHECK, NSF_GUARD_OPTION, NSF___UNKNOWN__, NSF_ARRAY, NSF_GET, NSF_SET, NSF_OPTION_STRICT, NSF_OBJECT_UNKNOWN_HANDLER, NSF_ARGUMENT_UNKNOWN_HANDLER, NSF_PARSE_ARGS, /* Partly redefined Tcl commands; leave them together at the end */ - NSF_EXPR, NSF_FORMAT, NSF_INFO_BODY, NSF_INFO_FRAME, NSF_INTERP, + NSF_EXPR, NSF_FORMAT, NSF_INFO_BODY, NSF_INFO_FRAME, NSF_INTERP, NSF_STRING_IS, NSF_EVAL, NSF_RENAME } NsfGlobalNames; @@ -730,15 +730,15 @@ /* object/class names */ "::nx::methodParameterSlot", /* constants */ - "alias", "args", "cmd", "filter", "forward", + "alias", "args", "cmd", "filter", "forward", "method", "object", "setter", "settername", "valuecheck", "-guard", "__unknown__", "::array", "get", "set", "-strict", /* nsf tcl commands */ "::nsf::object::unknown", "::nsf::argument::unknown", "::nsf::parseargs", /* tcl commands */ - "expr", "format", "::tcl::info::body", "::tcl::info::frame", "interp", + "expr", "format", "::tcl::info::body", "::tcl::info::frame", "interp", "::tcl::string::is", "::eval", "rename" }; @@ -750,7 +750,7 @@ EXTERN Tcl_ObjType NsfMixinregObjType; EXTERN int NsfMixinregGet(Tcl_Interp *interp, Tcl_Obj *obj, NsfClass **clPtr, Tcl_Obj **guardObj) nonnull(1) nonnull(2) nonnull(3) nonnull(4); -EXTERN int NsfMixinregInvalidate(Tcl_Interp *interp, Tcl_Obj *obj) +EXTERN int NsfMixinregInvalidate(Tcl_Interp *interp, Tcl_Obj *obj) nonnull(1) nonnull(2); EXTERN Tcl_ObjType NsfFilterregObjType; @@ -769,7 +769,7 @@ typedef enum {SHADOW_LOAD=1, SHADOW_UNLOAD=0, SHADOW_REFETCH=2} NsfShadowOperations; -typedef enum {NSF_PARAMS_NAMES, NSF_PARAMS_LIST, +typedef enum {NSF_PARAMS_NAMES, NSF_PARAMS_LIST, NSF_PARAMS_PARAMETER, NSF_PARAMS_SYNTAX} NsfParamsPrintStyle; int NsfCallCommand(Tcl_Interp *interp, NsfGlobalNames name, @@ -901,7 +901,7 @@ #else # define NSF_PROFILE_TIME_DATA # define NSF_PROFILE_CALL(interp, object, methodName) -# define NSF_PROFILE_EXIT(interp, object, methodName) +# define NSF_PROFILE_EXIT(interp, object, methodName) #endif typedef struct NsfRuntimeState { @@ -911,7 +911,7 @@ struct NsfObjectSystem *objectSystems; /* * namespaces and cmds - */ + */ Tcl_Namespace *NsfNS; /* the ::nsf namespace */ Tcl_Namespace *NsfClassesNS; /* the ::nsf::classes namespace, where classes are created physically */ Tcl_ObjCmdProc *objInterpProc; /* cached result of TclGetObjInterpProc() */ @@ -932,7 +932,7 @@ int errorCount; /* keep track of number of errors to avoid potential error loops */ int unknown; /* keep track whether an unknown method is currently called */ unsigned int overloadedMethods; /* bitarray for tracking overloaded methods */ - /* + /* * Configure options. The following do*-flags could be moved into a * bitarray, but we have only one state per interp, so the win on * memory is very little. @@ -1123,8 +1123,8 @@ int objc, Tcl_Obj *CONST objv[]) nonnull(1) nonnull(2) nonnull(4); -EXTERN int NsfObjWrongArgs(Tcl_Interp *interp, CONST char *msg, - Tcl_Obj *cmdName, Tcl_Obj *methodName, +EXTERN int NsfObjWrongArgs(Tcl_Interp *interp, CONST char *msg, + Tcl_Obj *cmdName, Tcl_Obj *methodName, char *arglist) nonnull(1) nonnull(2); @@ -1136,8 +1136,8 @@ EXTERN void NsfDStringArgv(Tcl_DString *dsPtr, int objc, Tcl_Obj *CONST objv[]) nonnull(1) nonnull(3); -EXTERN Tcl_Obj *NsfMethodNamePath(Tcl_Interp *interp, - Tcl_CallFrame *framePtr, +EXTERN Tcl_Obj *NsfMethodNamePath(Tcl_Interp *interp, + Tcl_CallFrame *framePtr, const char *methodName) nonnull(1) nonnull(3) returns_nonnull; @@ -1167,11 +1167,11 @@ # define NsfClassParamPtrEpochIncr(msg) #endif -/* +/* * NsfFlag type */ EXTERN Tcl_ObjType NsfFlagObjType; -EXTERN int NsfFlagObjSet(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int NsfFlagObjSet(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *baseParamPtr, int serial, Nsf_Param CONST *paramPtr, Tcl_Obj *payload, unsigned int flags); typedef struct { @@ -1185,12 +1185,12 @@ #define NSF_FLAG_DASHDAH 0x01 #define NSF_FLAG_CONTAINS_VALUE 0x02 -/* +/* * NsfMethodContext type */ EXTERN Tcl_ObjType NsfInstanceMethodObjType; EXTERN Tcl_ObjType NsfObjectMethodObjType; -EXTERN int NsfMethodObjSet(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int NsfMethodObjSet(Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_ObjType *objectType, void *context, int methodEpoch, Tcl_Command cmd, NsfClass *cl, unsigned int flags) @@ -1266,15 +1266,15 @@ char *strnstr(const char *buffer, const char *needle, size_t buffer_len); #endif -/* +/* In ANSI mode (ISO C89/90) compilers such as gcc and clang do not define the va_copy macro. However, they *do* in reasonably recent versions provide a prefixed (__*) one. The by-feature test below falls back to the prefixed version, if available, and provides a more general fallback to a simple assignment; this is primarily for MSVC; admittedly, this simplifcation is not generally portable to platform/compiler combos other then x86, but the best I can think of right - now. One might constrain the assignment-fallback to a platform and + now. One might constrain the assignment-fallback to a platform and leave va_copy undefined in uncaught platform cases (?). */ #ifndef va_copy Index: generic/nsfObj.c =================================================================== diff -u -r1d1ca561af5942718e613929b36e5d2419e4fe5a -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsfObj.c (.../nsfObj.c) (revision 1d1ca561af5942718e613929b36e5d2419e4fe5a) +++ generic/nsfObj.c (.../nsfObj.c) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -430,22 +430,22 @@ /* invalid Tcl list */ return result; } - + if (oc == 1) { nameObj = ov[0]; - + /*} else if (oc == 2) { nameObj = ov[0]; guardObj = ov[1];*/ - + } else if (oc == 3 && !strcmp(ObjStr(ov[1]), NsfGlobalStrings[NSF_GUARD_OPTION])) { nameObj = ov[0]; guardObj = ov[2]; - + } else { nameObj = objPtr; } - + /* * Syntax was ok. Try to lookup mixin classes: */ @@ -662,7 +662,7 @@ srcPtr = (Filterreg *)srcObjPtr->internalRep.twoPtrValue.ptr1; assert(srcPtr != NULL); - + #if defined(METHOD_OBJECT_TRACE) fprintf(stderr, "FilterregDupInternalRep src %p dst %p\n", srcObjPtr, dstObjPtr); #endif Index: generic/nsfStack.c =================================================================== diff -u -r099e1eef83f0d87777500409a973844fb650e088 -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsfStack.c (.../nsfStack.c) (revision 099e1eef83f0d87777500409a973844fb650e088) +++ generic/nsfStack.c (.../nsfStack.c) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -820,9 +820,8 @@ static Tcl_Obj* CallStackMethodPath(Tcl_Interp *interp, Tcl_CallFrame *framePtr) { - int elements; - Tcl_Obj *resultObj; - Tcl_Obj *methodPathObj = Tcl_NewListObj(0, NULL); + int elements; + Tcl_Obj *resultObj, *methodPathObj = Tcl_NewListObj(0, NULL); nonnull_assert(interp != NULL); nonnull_assert(framePtr != NULL); @@ -834,7 +833,7 @@ ((unsigned int)Tcl_CallFrame_isProcCallFrame(framePtr) & (FRAME_IS_NSF_CMETHOD|FRAME_IS_NSF_METHOD)) != 0u; framePtr = Tcl_CallFrame_callerPtr(framePtr)) { const NsfCallStackContent *cscPtr = (NsfCallStackContent *)Tcl_CallFrame_clientData(framePtr); - + assert(cscPtr != NULL); /*fprintf(stderr, "--- frame %p cmdPtr %p cmd %s NSF_CSC_TYPE_ENSEMBLE %d \ Index: generic/nsfUtil.c =================================================================== diff -u -r1d1ca561af5942718e613929b36e5d2419e4fe5a -r77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b --- generic/nsfUtil.c (.../nsfUtil.c) (revision 1d1ca561af5942718e613929b36e5d2419e4fe5a) +++ generic/nsfUtil.c (.../nsfUtil.c) (revision 77ba24ec459d9168dbfad4ae0c6eb4b936e8ea6b) @@ -147,8 +147,8 @@ static char *alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static size_t blockIncrement = 8u; /* -static char *alphabet = "ab"; -static int blockIncrement = 2; + static char *alphabet = "ab"; + static int blockIncrement = 2; */ static unsigned char chartable[255] = {0}; @@ -176,7 +176,7 @@ if (currentChar == iss->buffer) { size_t newBufSize = iss->bufSize + blockIncrement; char *newBuffer = ckalloc(newBufSize); - + currentChar = newBuffer+blockIncrement; /*memset(newBuffer, 0, blockIncrement);*/ memcpy(currentChar, iss->buffer, iss->bufSize); @@ -235,8 +235,8 @@ iss->length = 1; /* for (i=1; i<50; i++) { - NsfStringIncr(iss); - fprintf(stderr, "string '%s' (%d)\n", iss->start, iss->length); + NsfStringIncr(iss); + fprintf(stderr, "string '%s' (%d)\n", iss->start, iss->length); } */ } @@ -249,3 +249,11 @@ ckfree(iss->buffer); } +/* + * Local Variables: + * mode: c + * c-basic-offset: 2 + * fill-column: 78 + * indent-tabs-mode: nil + * End: + */