diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 15:06:47 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 15:06:47 (GMT) |
commit | 2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98 (patch) | |
tree | ed891ab3e00ea5888426f25d675aff2d89a00b1d /generic/tclRegexp.c | |
parent | 0d3106376c20bbe48cba344885fcad371b72b50f (diff) | |
download | tcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.zip tcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.tar.gz tcl-2ff0db90f57b60e46b714f2b5cdb1d2c5eacce98.tar.bz2 |
Adjust ckalloc/ckfree macros to greatly reduce number of explicit casts in
rest of Tcl source code. No ABI change. API change *should* be harmless.
Diffstat (limited to 'generic/tclRegexp.c')
-rw-r--r-- | generic/tclRegexp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c index c3ff608..5c5af7b 100644 --- a/generic/tclRegexp.c +++ b/generic/tclRegexp.c @@ -905,7 +905,7 @@ CompileRegexp( * This is a new expression, so compile it and add it to the cache. */ - regexpPtr = (TclRegexp *) ckalloc(sizeof(TclRegexp)); + regexpPtr = ckalloc(sizeof(TclRegexp)); regexpPtr->objPtr = NULL; regexpPtr->string = NULL; regexpPtr->details.rm_extend.rm_so = -1; @@ -932,7 +932,7 @@ CompileRegexp( * Clean up and report errors in the interpreter, if possible. */ - ckfree((char *)regexpPtr); + ckfree(regexpPtr); if (interp) { TclRegError(interp, "couldn't compile regular expression pattern: ", status); @@ -960,7 +960,7 @@ CompileRegexp( * the entire pattern. */ - regexpPtr->matches = (regmatch_t *) + regexpPtr->matches = ckalloc(sizeof(regmatch_t) * (regexpPtr->re.re_nsub + 1)); /* @@ -987,7 +987,7 @@ CompileRegexp( tsdPtr->patLengths[i+1] = tsdPtr->patLengths[i]; tsdPtr->regexps[i+1] = tsdPtr->regexps[i]; } - tsdPtr->patterns[0] = ckalloc((unsigned) length+1); + tsdPtr->patterns[0] = ckalloc(length + 1); memcpy(tsdPtr->patterns[0], string, (unsigned) length + 1); tsdPtr->patLengths[0] = length; tsdPtr->regexps[0] = regexpPtr; @@ -1020,9 +1020,9 @@ FreeRegexp( TclDecrRefCount(regexpPtr->globObjPtr); } if (regexpPtr->matches) { - ckfree((char *) regexpPtr->matches); + ckfree(regexpPtr->matches); } - ckfree((char *) regexpPtr); + ckfree(regexpPtr); } /* |