Index: TODO =================================================================== diff -u -raa1943604c4de3d538dff67d5e9e238323d37474 -r224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae --- TODO (.../TODO) (revision aa1943604c4de3d538dff67d5e9e238323d37474) +++ TODO (.../TODO) (revision 224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae) @@ -818,6 +818,9 @@ - replace 0 by NULL in calls to GetClassFromObj() - extended regression test +- use size_t where appropriate +- added notnull annotations + TODO: - rename source files from xotcl{Int}.{ch}->next*.* | next-scripting*.* ? Stefan, meinung dazu? Notwending|Empfehlenswert|nicht? @@ -848,7 +851,6 @@ - rename tests from .xotcl to .tcl - info parameter in tcl? -- use size_t where appropriate - copy objectMethod and classMethod as comments to xotcl.c, fix and check order Index: doc/index.html =================================================================== diff -u -rdaafc0f0261f6b47a01c7cc8975acdd66f91f360 -r224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae --- doc/index.html (.../index.html) (revision daafc0f0261f6b47a01c7cc8975acdd66f91f360) +++ doc/index.html (.../index.html) (revision 224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae) @@ -23,7 +23,7 @@
Index: generic/xotcl.c =================================================================== diff -u -raa1943604c4de3d538dff67d5e9e238323d37474 -r224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae --- generic/xotcl.c (.../xotcl.c) (revision aa1943604c4de3d538dff67d5e9e238323d37474) +++ generic/xotcl.c (.../xotcl.c) (revision 224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae) @@ -976,7 +976,7 @@ static XOTclClass* -SearchCMethod(XOTclClass *cl, CONST char *nm, Tcl_Command *cmd) { +SearchCMethod(/*@notnull@*/ XOTclClass *cl, CONST char *nm, Tcl_Command *cmd) { assert(cl); return SearchPLMethod(ComputeOrder(cl, cl->order, Super), nm, cmd); } @@ -1379,7 +1379,7 @@ } extern XOTclClassOpt* -XOTclRequireClassOpt(XOTclClass *cl) { +XOTclRequireClassOpt(/*@notnull@*/ XOTclClass *cl) { assert(cl); if (!cl->opt) { cl->opt = NEW(XOTclClassOpt); @@ -2165,10 +2165,10 @@ * check colons for illegal object/class names */ XOTCLINLINE static int -NSCheckColons(CONST char *name, unsigned l) { +NSCheckColons(CONST char *name, size_t l) { register CONST char *n = name; if (*n == '\0') return 0; /* empty name */ - if (l == 0) l=strlen(name); + if (l == 0) l = strlen(name); if (*(n+l-1) == ':') return 0; /* name ends with : */ if (*n == ':' && *(n+1) != ':') return 0; /* name begins with single : */ for (; *n != '\0'; n++) { @@ -2182,7 +2182,7 @@ * check for parent namespace existance (used before commands are created) */ XOTCLINLINE static int -NSCheckForParent(Tcl_Interp *interp, CONST char *name, unsigned l, XOTclClass *cl) { +NSCheckForParent(Tcl_Interp *interp, CONST char *name, size_t l, XOTclClass *cl) { register CONST char *n = name+l; int rc = 1; @@ -3590,13 +3590,14 @@ */ static int -getAllClassMixinsOf(Tcl_Interp *interp, Tcl_HashTable *destTable, XOTclClass *startCl, +getAllClassMixinsOf(Tcl_Interp *interp, Tcl_HashTable *destTable, /*@notnull@*/ XOTclClass *startCl, int isMixin, int appendResult, CONST char *pattern, XOTclObject *matchObject) { int rc = 0, new = 0; XOTclClass *cl; XOTclClasses *sc; + assert(startCl); /*fprintf(stderr, "startCl = %p %s, opt %p, isMixin %d\n", startCl, className(startCl), startCl->opt, isMixin);*/ @@ -6338,7 +6339,7 @@ } static Tcl_Obj* -ParamCheckObj(Tcl_Interp *interp, CONST char *start, int len) { +ParamCheckObj(Tcl_Interp *interp, CONST char *start, size_t len) { Tcl_Obj *checker = Tcl_NewStringObj("type=", 5); Tcl_AppendLimitedToObj(checker, start, len, INT_MAX, NULL); return checker; @@ -6455,7 +6456,8 @@ static int ParamParse(Tcl_Interp *interp, CONST char *procName, Tcl_Obj *arg, int disallowedFlags, XOTclParam *paramPtr, int *possibleUnknowns, int *plainParams) { - int result, npac, length, j, nameLength, isNonposArgument; + int result, npac, isNonposArgument; + size_t nameLength, length, j; CONST char *argString, *argName; Tcl_Obj **npav; @@ -6493,7 +6495,7 @@ if (argString[j] == ':') { /* we found a ':' */ - int l, start, end; + size_t l, start, end; /* get parameter name */ NEW_STRING(paramPtr->name, argString, j); @@ -7781,7 +7783,7 @@ PrimitiveOCreate(Tcl_Interp *interp, Tcl_Obj *nameObj, XOTclClass *cl) { XOTclObject *object = (XOTclObject*)ckalloc(sizeof(XOTclObject)); CONST char *nameString = ObjStr(nameObj); - unsigned length; + size_t length; #if defined(XOTCLOBJ_TRACE) fprintf(stderr, "CKALLOC Object %p %s\n", object, nameString); @@ -8164,7 +8166,7 @@ PrimitiveCCreate(Tcl_Interp *interp, Tcl_Obj *nameObj, XOTclClass *class) { XOTclClass *cl = (XOTclClass*)ckalloc(sizeof(XOTclClass)); CONST char *nameString = ObjStr(nameObj); - unsigned length; + size_t length; XOTclObject *object = (XOTclObject*)cl; /*fprintf(stderr, "CKALLOC Class %p %s\n", cl, nameString);*/ @@ -8433,10 +8435,10 @@ int objc, Tcl_Obj *CONST objv[]) { XOTclClass *cl = (XOTclClass *) class; int result; + ALLOC_ON_STACK(Tcl_Obj *, objc+2, ov); INCR_REF_COUNT(nameObj); - ALLOC_ON_STACK(Tcl_Obj *, objc+2, ov); ov[0] = NULL; ov[1] = nameObj; if (objc>0) { Index: generic/xotclStack85.c =================================================================== diff -u -r35e0efc0d8851a10c70071c12112b11538ce97af -r224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae --- generic/xotclStack85.c (.../xotclStack85.c) (revision 35e0efc0d8851a10c70071c12112b11538ce97af) +++ generic/xotclStack85.c (.../xotclStack85.c) (revision 224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae) @@ -392,7 +392,7 @@ */ XOTCLINLINE static void -CscInit(XOTclCallStackContent *cscPtr, XOTclObject *object, XOTclClass *cl, Tcl_Command cmd, int frameType) { +CscInit(/*@notnull@*/ XOTclCallStackContent *cscPtr, XOTclObject *object, XOTclClass *cl, Tcl_Command cmd, int frameType) { assert(cscPtr);