diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-01-03 08:28:12 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-01-03 08:28:12 +0000 |
commit | 634c54310c92c48dd4eceec602e230a021bdcfc5 (patch) | |
tree | 9f5732a180b8daacf176e42511b0a72c972c7a4b /source3/param/params.c | |
parent | 47a7f0cfb5006fb41239a6cd81cce5e35fde750a (diff) | |
download | samba-634c54310c92c48dd4eceec602e230a021bdcfc5.tar.gz samba-634c54310c92c48dd4eceec602e230a021bdcfc5.tar.bz2 samba-634c54310c92c48dd4eceec602e230a021bdcfc5.zip |
Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings. (Adds a lot of const).
Andrew Bartlett
(This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
Diffstat (limited to 'source3/param/params.c')
-rw-r--r-- | source3/param/params.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/param/params.c b/source3/param/params.c index bc93a1fedf..892e5476cc 100644 --- a/source3/param/params.c +++ b/source3/param/params.c @@ -201,7 +201,7 @@ static int Continuation(char *line, int pos ) } -static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) +static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) ) /* ------------------------------------------------------------------------ ** * Scan a section name, and pass the name to function sfunc(). * @@ -219,7 +219,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) int c; int i; int end; - char *func = "params.c:Section() -"; + const char *func = "params.c:Section() -"; i = 0; /* <i> is the offset of the next free byte in bufr[] and */ end = 0; /* <end> is the current "end of string" offset. In most */ @@ -297,7 +297,7 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) return( False ); } /* Section */ -static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) +static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *), int c ) /* ------------------------------------------------------------------------ ** * Scan a parameter name and value, and pass these two fields to pfunc(). * @@ -325,7 +325,7 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) int i = 0; /* Position within bufr. */ int end = 0; /* bufr[end] is current end-of-string. */ int vstart = 0; /* Starting position of the parameter value. */ - char *func = "params.c:Parameter() -"; + const char *func = "params.c:Parameter() -"; /* Read the parameter name. */ while( 0 == vstart ) /* Loop until we've found the start of the value. */ @@ -445,8 +445,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) } /* Parameter */ static BOOL Parse( myFILE *InFile, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Scan & parse the input. * @@ -505,7 +505,7 @@ static BOOL Parse( myFILE *InFile, return( True ); } /* Parse */ -static myFILE *OpenConfFile( char *FileName ) +static myFILE *OpenConfFile( const char *FileName ) /* ------------------------------------------------------------------------ ** * Open a configuration file. * @@ -516,7 +516,7 @@ static myFILE *OpenConfFile( char *FileName ) * ------------------------------------------------------------------------ ** */ { - char *func = "params.c:OpenConfFile() -"; + const char *func = "params.c:OpenConfFile() -"; extern BOOL in_client; int lvl = in_client?1:0; myFILE *ret; @@ -538,9 +538,9 @@ static myFILE *OpenConfFile( char *FileName ) return( ret ); } /* OpenConfFile */ -BOOL pm_process( char *FileName, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ) +BOOL pm_process( const char *FileName, + BOOL (*sfunc)(const char *), + BOOL (*pfunc)(const char *, const char *) ) /* ------------------------------------------------------------------------ ** * Process the named parameter file. * @@ -557,7 +557,7 @@ BOOL pm_process( char *FileName, { int result; myFILE *InFile; - char *func = "params.c:pm_process() -"; + const char *func = "params.c:pm_process() -"; InFile = OpenConfFile( FileName ); /* Open the config file. */ if( NULL == InFile ) |