[ros-diffs] [hpoussin] 19184: assert -> ASSERT

hpoussin at svn.reactos.com hpoussin at svn.reactos.com
Sat Nov 12 21:18:51 CET 2005


assert -> ASSERT
Initialize error_line in all cases (Merge from Wine)
Modified: trunk/reactos/lib/setupapi/parser.c
  _____  

Modified: trunk/reactos/lib/setupapi/parser.c
--- trunk/reactos/lib/setupapi/parser.c	2005-11-12 20:15:20 UTC (rev
19183)
+++ trunk/reactos/lib/setupapi/parser.c	2005-11-12 20:18:29 UTC (rev
19184)
@@ -213,7 +213,7 @@

     struct section *section;
     struct line *line;
 
-    assert( section_index >= 0 && section_index < file->nb_sections );
+    ASSERT( section_index >= 0 && section_index < file->nb_sections );
 
     section = file->sections[section_index];
     if (section->nb_lines == section->alloc_lines)  /* need to grow the
section */
@@ -420,7 +420,7 @@
 /* push the current state on the parser stack */
 inline static void push_state( struct parser *parser, enum parser_state
state )
 {
-    assert( parser->stack_pos <
sizeof(parser->stack)/sizeof(parser->stack[0]) );
+    ASSERT( parser->stack_pos <
sizeof(parser->stack)/sizeof(parser->stack[0]) );
     parser->stack[parser->stack_pos++] = state;
 }
 
@@ -428,7 +428,7 @@
 /* pop the current state */
 inline static void pop_state( struct parser *parser )
 {
-    assert( parser->stack_pos );
+    ASSERT( parser->stack_pos );
     parser->state = parser->stack[--parser->stack_pos];
 }
 
@@ -509,12 +509,12 @@
     {
         if (parser->cur_section == -1)  /* got a line before the first
section */
         {
-            parser->error = ERROR_WRONG_INF_STYLE;
+            parser->error = ERROR_EXPECTED_SECTION_NAME;
             return NULL;
         }
         if (!(parser->line = add_line( parser->file,
parser->cur_section ))) goto error;
     }
-    else assert(!is_key);
+    else ASSERT(!is_key);
 
     text = push_string( parser->file, parser->token );
     if ((field = add_field( parser->file, text )))
@@ -964,6 +964,7 @@
                 if (!strcmpiW( field->text, Windows95 )) goto done;
             }
         }
+        if (error_line) *error_line = 0;
         err = ERROR_WRONG_INF_STYLE;
     }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051112/cc113154/attachment.html


More information about the Ros-diffs mailing list