diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-05-27 13:18:51 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-05-27 13:18:51 (GMT) |
commit | d63bdddac575b06d8dbaff5caf199f191258281a (patch) | |
tree | 81621affdfd50f3451faa2c5568732111932e247 /generic/tclCmdMZ.c | |
parent | 4761295d5dc11e76a759fc26de4b30d09bccd1a5 (diff) | |
download | tcl-d63bdddac575b06d8dbaff5caf199f191258281a.zip tcl-d63bdddac575b06d8dbaff5caf199f191258281a.tar.gz tcl-d63bdddac575b06d8dbaff5caf199f191258281a.tar.bz2 |
Made compiling with -Wstrict-prototypes -Wmissing-prototypes much cleaner.
Also added support for [FRQ 951168] but left that switched off by default.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 0e0bffc..17620d2 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.101 2004/04/06 22:25:49 dgp Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.102 2004/05/27 13:18:52 dkf Exp $ */ #include "tclInt.h" @@ -1325,12 +1325,14 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) * comparison in INST_EQ/INST_NEQ/INST_LT/...). */ int i, match, length, nocase = 0, reqlength = -1; - int (*strCmpFn)(); + typedef int (*strCmpFn_t) _ANSI_ARGS_((const char *, const char *, + unsigned int)); + strCmpFn_t strCmpFn; if (objc < 4 || objc > 7) { str_cmp_args: Tcl_WrongNumArgs(interp, 2, objv, - "?-nocase? ?-length int? string1 string2"); + "?-nocase? ?-length int? string1 string2"); return TCL_ERROR; } @@ -1381,7 +1383,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) */ string1 = (char*) Tcl_GetByteArrayFromObj(objv[0], &length1); string2 = (char*) Tcl_GetByteArrayFromObj(objv[1], &length2); - strCmpFn = memcmp; + strCmpFn = (strCmpFn_t) memcmp; } else if ((objv[0]->typePtr == &tclStringType) && (objv[1]->typePtr == &tclStringType)) { /* @@ -1392,7 +1394,8 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) */ string1 = (char*) Tcl_GetUnicodeFromObj(objv[0], &length1); string2 = (char*) Tcl_GetUnicodeFromObj(objv[1], &length2); - strCmpFn = nocase ? Tcl_UniCharNcasecmp : Tcl_UniCharNcmp; + strCmpFn = (strCmpFn_t) + (nocase ? Tcl_UniCharNcasecmp : Tcl_UniCharNcmp); } else { /* * As a catch-all we will work with UTF-8. We cannot use @@ -1404,11 +1407,12 @@ Tcl_StringObjCmd(dummy, interp, objc, objv) string1 = (char*) Tcl_GetStringFromObj(objv[0], &length1); string2 = (char*) Tcl_GetStringFromObj(objv[1], &length2); if ((reqlength < 0) && !nocase) { - strCmpFn = TclpUtfNcmp2; + strCmpFn = (strCmpFn_t) TclpUtfNcmp2; } else { length1 = Tcl_NumUtfChars(string1, length1); length2 = Tcl_NumUtfChars(string2, length2); - strCmpFn = nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp; + strCmpFn = (strCmpFn_t) + (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp); } } |