@@ -137,17 +137,18 @@ def emit_warning(self, ln, msg, warning=True):
137137
138138 log_msg = f"{ self .fname } :{ ln } { msg } "
139139
140+ if not warning :
141+ self .config .log .info (log_msg )
142+ return
143+
140144 if self .entry :
141145 # Delegate warning output to output logic, as this way it
142146 # will report warnings/info only for symbols that are output
143147
144- self .entry .warnings .append (( warning , log_msg ) )
148+ self .entry .warnings .append (log_msg )
145149 return
146150
147- if warning :
148- self .config .log .warning (log_msg )
149- else :
150- self .config .log .info (log_msg )
151+ self .config .log .warning (log_msg )
151152
152153 def dump_section (self , start_new = True ):
153154 """
@@ -556,7 +557,6 @@ def dump_struct(self, ln, proto):
556557
557558 if not members :
558559 self .emit_warning (ln , f"{ proto } error: Cannot parse struct or union!" )
559- self .config .errors += 1
560560 return
561561
562562 if self .entry .identifier != declaration_name :
@@ -831,7 +831,6 @@ def dump_enum(self, ln, proto):
831831
832832 if not members :
833833 self .emit_warning (ln , f"{ proto } : error: Cannot parse enum!" )
834- self .config .errors += 1
835834 return
836835
837836 if self .entry .identifier != declaration_name :
@@ -1132,7 +1131,6 @@ def dump_typedef(self, ln, proto):
11321131 return
11331132
11341133 self .emit_warning (ln , "error: Cannot parse typedef!" )
1135- self .config .errors += 1
11361134
11371135 @staticmethod
11381136 def process_export (function_table , line ):
@@ -1677,4 +1675,3 @@ def run(self):
16771675 self .process_docblock (ln , line )
16781676 except OSError :
16791677 self .config .log .error (f"Error: Cannot open file { self .fname } " )
1680- self .config .errors += 1
0 commit comments