diff options
author | nijtmans <nijtmans@noemail.net> | 2009-02-10 23:08:56 (GMT) |
---|---|---|
committer | nijtmans <nijtmans@noemail.net> | 2009-02-10 23:08:56 (GMT) |
commit | 491a735b8ed591e2bb516fc47cf0b3e0d5dc0dcb (patch) | |
tree | a407af9f40cff9d5a67f7ecf3a88b22578e0f842 /generic/tclScan.c | |
parent | 228226b45f89df593f47066d1f2add74e5422610 (diff) | |
download | tcl-491a735b8ed591e2bb516fc47cf0b3e0d5dc0dcb.zip tcl-491a735b8ed591e2bb516fc47cf0b3e0d5dc0dcb.tar.gz tcl-491a735b8ed591e2bb516fc47cf0b3e0d5dc0dcb.tar.bz2 |
- eliminate some unnessary type casts
- some internal const decorations
- spacing
FossilOrigin-Name: a45c7b126b9137976cd91960cb3e2ecb5201d222
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index d05cb8f..07bbedd 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclScan.c,v 1.30 2008/12/10 18:21:47 ferrieux Exp $ + * RCS: @(#) $Id: tclScan.c,v 1.31 2009/02/10 23:09:04 nijtmans Exp $ */ #include "tclInt.h" @@ -45,10 +45,10 @@ typedef struct CharSet { * Declarations for functions used only in this file. */ -static char * BuildCharSet(CharSet *cset, char *format); +static const char * BuildCharSet(CharSet *cset, const char *format); static int CharInSet(CharSet *cset, int ch); static void ReleaseCharSet(CharSet *cset); -static int ValidateFormat(Tcl_Interp *interp, char *format, +static int ValidateFormat(Tcl_Interp *interp, const char *format, int numVars, int *totalVars); /* @@ -69,14 +69,14 @@ static int ValidateFormat(Tcl_Interp *interp, char *format, *---------------------------------------------------------------------- */ -static char * +static const char * BuildCharSet( CharSet *cset, - char *format) /* Points to first char of set. */ + const char *format) /* Points to first char of set. */ { Tcl_UniChar ch, start; int offset, nranges; - char *end; + const char *end; memset(cset, 0, sizeof(CharSet)); @@ -252,7 +252,7 @@ ReleaseCharSet( static int ValidateFormat( Tcl_Interp *interp, /* Current interpreter. */ - char *format, /* The format string. */ + const char *format, /* The format string. */ int numVars, /* The number of variables passed to the scan * command. */ int *totalSubs) /* The number of variables that will be @@ -343,7 +343,7 @@ ValidateFormat( */ if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - value = strtoul(format-1, &format, 10); /* INTL: "C" locale. */ + value = strtoul(format-1, (char **) &format, 10); /* INTL: "C" locale. */ flags |= SCAN_WIDTH; format += Tcl_UtfToUniChar(format, &ch); } @@ -559,7 +559,7 @@ Tcl_ScanObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char *format; + const char *format; int numVars, nconversions, totalVars = -1; int objIndex, offset, i, result, code; long value; @@ -676,7 +676,7 @@ Tcl_ScanObjCmd( */ if ((ch < 0x80) && isdigit(UCHAR(ch))) { /* INTL: "C" locale. */ - width = (int) strtoul(format-1, &format, 10);/* INTL: "C" locale. */ + width = (int) strtoul(format-1, (char **) &format, 10);/* INTL: "C" locale. */ format += Tcl_UtfToUniChar(format, &ch); } else { width = 0; |