Index: generic/nsfInt.h =================================================================== diff -u -r4b4a7349ffab8d3629796f3b56a47cbc19e72d88 -rb089be700bb58579a48e77619512a47eb3c5562d --- generic/nsfInt.h (.../nsfInt.h) (revision 4b4a7349ffab8d3629796f3b56a47cbc19e72d88) +++ generic/nsfInt.h (.../nsfInt.h) (revision b089be700bb58579a48e77619512a47eb3c5562d) @@ -6,7 +6,7 @@ * * Copyright (C) 1999-2016 Gustaf Neumann (a, b) * Copyright (C) 1999-2007 Uwe Zdun (a, b) - * Copyright (C) 2011-2013 Stefan Sobernig (b) + * Copyright (C) 2011-2016 Stefan Sobernig (b) * * (a) University of Essen * Specification of Software Systems @@ -179,7 +179,7 @@ # define MEM_COUNT_RELEASE() #endif -# define STRING_NEW(target, p, l) (target) = ckalloc((l)+1); strncpy((target), (p), (l)); *((target)+(l)) = '\0'; \ +# define STRING_NEW(target, p, l) (target) = ckalloc((unsigned)(l)+1u); strncpy((target), (p), (l)); *((target)+(l)) = '\0'; \ MEM_COUNT_ALLOC(#target, (target)) # define STRING_FREE(key, p) MEM_COUNT_FREE((key), (p)); ckfree((p)) @@ -195,10 +195,13 @@ #define nr_elements(arr) ((int) (sizeof(arr) / sizeof((arr)[0]))) +/* + * Tcl 8.6 uses (unsigned) per default + */ # define NEW(type) \ - (type *)ckalloc(sizeof(type)); MEM_COUNT_ALLOC(#type, NULL) + (type *)ckalloc((unsigned)sizeof(type)); MEM_COUNT_ALLOC(#type, NULL) # define NEW_ARRAY(type,n) \ - (type *)ckalloc(sizeof(type)*(size_t)(n)); MEM_COUNT_ALLOC(#type "*", NULL) + (type *)ckalloc((unsigned)sizeof(type)*(unsigned)(n)); MEM_COUNT_ALLOC(#type "*", NULL) # define FREE(type, var) \ ckfree((char*) (var)); MEM_COUNT_FREE(#type,(var)) @@ -269,15 +272,10 @@ #endif #if !defined(NDEBUG) -# if defined(PRE86) -# define ISOBJ(o) ((o) != NULL && ISOBJ_(o)) -# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? ((o)->typePtr->name != NULL) : ((o)->bytes != NULL)) && (o)->length >= -1 && (o)->refCount >= 0) -# else -# define ISOBJ(o) ((o) != NULL && ISOBJ_(o)) -# define ISOBJ_(o) ((o) != (void*)0xdeadbeaf && ((o)->typePtr ? (o)->typePtr->name != NULL : ((o)->bytes != NULL)) && ((o)->bytes != NULL ? (o)->length >= 0 : 1) && (o)->refCount >= 0) -# endif -#else # 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) +#else +# define ISOBJ(o) #endif #define NSF_ABBREV_MIN_CHARS 4 @@ -989,6 +987,11 @@ #endif /* + * Prototypes for method definitions + */ +EXTERN Tcl_ObjCmdProc NsfObjDispatch; + +/* * NsfObject Reference Accounting */ EXTERN void NsfCleanupObject_(NsfObject *object) nonnull(1); @@ -1119,9 +1122,6 @@ EXTERN int NsfGetClassFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, NsfClass **clPtr, int withUnknown) nonnull(1) nonnull(2) nonnull(3); -EXTERN int NsfObjDispatch(ClientData cd, Tcl_Interp *interp, - 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, @@ -1171,9 +1171,13 @@ * NsfFlag type */ EXTERN Tcl_ObjType NsfFlagObjType; -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); +EXTERN int NsfFlagObjSet(Tcl_Interp *UNUSED(interp), + Tcl_Obj *objPtr, + Nsf_Param const *baseParamPtr, + int serial, + Nsf_Param const *paramPtr, + Tcl_Obj *payload, + unsigned int flags); typedef struct { CONST Nsf_Param *signature; int serial; @@ -1190,10 +1194,14 @@ */ EXTERN Tcl_ObjType NsfInstanceMethodObjType; EXTERN Tcl_ObjType NsfObjectMethodObjType; -EXTERN int NsfMethodObjSet(Tcl_Interp *interp, Tcl_Obj *objPtr, +EXTERN int NsfMethodObjSet(Tcl_Interp *UNUSED(interp), + Tcl_Obj *objPtr, Tcl_ObjType *objectType, - void *context, int methodEpoch, - Tcl_Command cmd, NsfClass *cl, unsigned int flags) + void *context, + int methodEpoch, + Tcl_Command cmd, + NsfClass *cl, + unsigned int flags) nonnull(1) nonnull(2) nonnull(3) nonnull(4) nonnull(6); @@ -1285,4 +1293,11 @@ #endif #endif +/* In Tcl 8.6 (tclInt.h), vsnprintf is mapped to _vsnprintf. In Tcl + 8.5, this is missing from tclInt.h. So ... */ + +#if defined(PRE86) && defined(_MSC_VER) +#define vsnprintf _vsnprintf +#endif + #endif /* _nsf_int_h_ */