From eca25ffa988872763ee91c496912bf2d22a0819f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 29 Nov 2016 13:03:15 +0000 Subject: Minor simplifications. Eliminate FUNCPRT from regexp engine. Fix compile-error (non-debug) in tclDictObj.c, from previous commit --- generic/regcustom.h | 1 - generic/regguts.h | 13 ++----------- generic/tclCkalloc.c | 2 +- generic/tclDictObj.c | 2 +- generic/tclRegexp.h | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/generic/regcustom.h b/generic/regcustom.h index 1f00bf4..c4dbc73 100644 --- a/generic/regcustom.h +++ b/generic/regcustom.h @@ -36,7 +36,6 @@ * Overrides for regguts.h definitions, if any. */ -#define FUNCPTR(name, args) (*name)args #define MALLOC(n) (void*)(attemptckalloc(n)) #define FREE(p) ckfree((void*)(p)) #define REALLOC(p,n) (void*)(attemptckrealloc((void*)(p),n)) diff --git a/generic/regguts.h b/generic/regguts.h index 9461136..ad9d5b9 100644 --- a/generic/regguts.h +++ b/generic/regguts.h @@ -49,15 +49,6 @@ #include #endif -/* function-pointer declarator */ -#ifndef FUNCPTR -#if __STDC__ >= 1 -#define FUNCPTR(name, args) (*name)args -#else -#define FUNCPTR(name, args) (*name)() -#endif -#endif - /* memory allocation */ #ifndef MALLOC #define MALLOC(n) malloc(n) @@ -391,7 +382,7 @@ struct subre { */ struct fns { - void FUNCPTR(free, (regex_t *)); + void (*free) (regex_t *); }; /* @@ -408,7 +399,7 @@ struct guts { struct cnfa search; /* for fast preliminary search */ int ntree; /* number of subre's, plus one */ struct colormap cmap; - int FUNCPTR(compare, (const chr *, const chr *, size_t)); + int (*compare) (const chr *, const chr *, size_t); struct subre *lacons; /* lookahead-constraint vector */ int nlacons; /* size of lacons */ }; diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index f30374f..d42536e 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -33,7 +33,7 @@ * "memory tag" command is invoked, to hold the current tag. */ - typedef struct MemTag { +typedef struct MemTag { size_t refCount; /* Number of mem_headers referencing this * tag. */ char string[1]; /* Actual size of string will be as large as diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index d755855..1115999 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -1382,7 +1382,7 @@ Tcl_NewDictObj(void) InitChainTable(dict); dict->epoch = 0; dict->chain = NULL; - dict->refcount = 1; + dict->refCount = 1; DICT(dictPtr) = dict; dictPtr->internalRep.twoPtrValue.ptr2 = NULL; dictPtr->typePtr = &tclDictType; diff --git a/generic/tclRegexp.h b/generic/tclRegexp.h index 3b2433e..eac0aaa 100644 --- a/generic/tclRegexp.h +++ b/generic/tclRegexp.h @@ -37,7 +37,7 @@ typedef struct TclRegexp { * of subexpressions. */ rm_detail_t details; /* Detailed information on match (currently * used only for REG_EXPECT). */ - int refCount; /* Count of number of references to this + unsigned int refCount; /* Count of number of references to this * compiled regexp. */ } TclRegexp; -- cgit v0.12