setupapi: Constify some variables

Andrew Talbot andrew.talbot at talbotville.com
Mon Aug 27 10:09:06 CDT 2007


Changelog:
    setupapi: Constify some variables.

diff -urN a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c
--- a/dlls/setupapi/parser.c	2007-08-13 17:54:18.000000000 +0100
+++ b/dlls/setupapi/parser.c	2007-08-27 15:46:04.000000000 +0100
@@ -175,7 +175,7 @@
 
 
 /* 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 @@
 
 
 /* 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 @@
 
 
 /* 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 @@
 
 /* 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 @@
 /* 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 @@
 /* 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 @@
 
 
 /* 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 -urN a/dlls/setupapi/setupapi_private.h b/dlls/setupapi/setupapi_private.h
--- a/dlls/setupapi/setupapi_private.h	2007-03-21 13:18:32.000000000 +0000
+++ b/dlls/setupapi/setupapi_private.h	2007-08-27 15:46:37.000000000 +0100
@@ -45,9 +45,9 @@
 
 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-patches mailing list