Andrew Talbot : setupapi: Constify some variables.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 27 13:57:13 CDT 2007


Module: wine
Branch: master
Commit: 3bf6315af2fe961365da3844a04bbe2d0c7ac2f0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3bf6315af2fe961365da3844a04bbe2d0c7ac2f0

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Mon Aug 27 16:09:06 2007 +0100

setupapi: Constify some variables.

---

 dlls/setupapi/parser.c           |   16 ++++++++--------
 dlls/setupapi/setupapi_private.h |    4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c
index d5b7643..f7a9bd4 100644
--- a/dlls/setupapi/parser.c
+++ b/dlls/setupapi/parser.c
@@ -175,7 +175,7 @@ static void *grow_array( void *array, unsigned int *count, size_t elem )
 
 
 /* get the directory of the inf file (as counted string, not null-terminated) */
-static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len )
+static const WCHAR *get_inf_dir( const struct inf_file *file, unsigned int *len )
 {
     const WCHAR *p = strrchrW( file->filename, '\\' );
     *len = p ? (p + 1 - file->filename) : 0;
@@ -184,7 +184,7 @@ static const WCHAR *get_inf_dir( struct inf_file *file, unsigned int *len )
 
 
 /* find a section by name */
-static int find_section( struct inf_file *file, const WCHAR *name )
+static int find_section( const struct inf_file *file, const WCHAR *name )
 {
     unsigned int i;
 
@@ -303,7 +303,7 @@ static struct field *add_field( struct inf_file *file, const WCHAR *text )
 
 
 /* retrieve the string substitution for a directory id */
-static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned int *len )
+static const WCHAR *get_dirid_subst( const struct inf_file *file, int dirid, unsigned int *len )
 {
     const WCHAR *ret;
 
@@ -316,7 +316,7 @@ static const WCHAR *get_dirid_subst( struct inf_file *file, int dirid, unsigned
 
 /* retrieve the string substitution for a given string, or NULL if not found */
 /* if found, len is set to the substitution length */
-static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, unsigned int *len,
+static const WCHAR *get_string_subst( const struct inf_file *file, const WCHAR *str, unsigned int *len,
                                       BOOL no_trailing_slash )
 {
     static const WCHAR percent = '%';
@@ -365,7 +365,7 @@ static const WCHAR *get_string_subst( struct inf_file *file, const WCHAR *str, u
 /* do string substitutions on the specified text */
 /* the buffer is assumed to be large enough */
 /* returns necessary length not including terminating null */
-unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCHAR *buffer,
+unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text, WCHAR *buffer,
                                    unsigned int size )
 {
     const WCHAR *start, *subst, *p;
@@ -418,7 +418,7 @@ unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text, WCH
 /* do string substitutions on the specified text */
 /* the buffer is assumed to be large enough */
 /* returns necessary length not including terminating null */
-unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text, char *buffer,
+unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text, char *buffer,
                                    unsigned int size )
 {
     WCHAR buffW[MAX_STRING_LEN+1];
@@ -471,14 +471,14 @@ static inline enum parser_state set_state( struct parser *parser, enum parser_st
 
 
 /* check if the pointer points to an end of file */
-static inline int is_eof( struct parser *parser, const WCHAR *ptr )
+static inline int is_eof( const struct parser *parser, const WCHAR *ptr )
 {
     return (ptr >= parser->end || *ptr == CONTROL_Z);
 }
 
 
 /* check if the pointer points to an end of line */
-static inline int is_eol( struct parser *parser, const WCHAR *ptr )
+static inline int is_eol( const struct parser *parser, const WCHAR *ptr )
 {
     return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == '\n');
 }
diff --git a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h
index 32f1661..a3fe223 100644
--- a/dlls/setupapi/setupapi_private.h
+++ b/dlls/setupapi/setupapi_private.h
@@ -45,9 +45,9 @@ static inline WCHAR *strdupAtoW( const char *str )
 
 struct inf_file;
 extern const WCHAR *DIRID_get_string( int dirid );
-extern unsigned int PARSER_string_substA( struct inf_file *file, const WCHAR *text,
+extern unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text,
                                           char *buffer, unsigned int size );
-extern unsigned int PARSER_string_substW( struct inf_file *file, const WCHAR *text,
+extern unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text,
                                           WCHAR *buffer, unsigned int size );
 extern const WCHAR *PARSER_get_inf_filename( HINF hinf );
 extern WCHAR *PARSER_get_src_root( HINF hinf );




More information about the wine-cvs mailing list