160
161 static void match_switch_end(struct statement *stmt)
162 {
163
164 if (stmt->type != STMT_SWITCH)
165 return;
166
167 in_switch_stmt--;
168
169 if (!in_switch_stmt)
170 delete_my_states(my_id);
171 }
172
173 void check_missing_break(int id)
174 {
175 my_id = id;
176
177 if (!option_spammy)
178 return;
179
180 add_unmatched_state_hook(my_id, &unmatched_state);
181 add_merge_hook(my_id, &merge_hook);
182
183 add_hook(&match_assign, ASSIGNMENT_HOOK);
184 add_hook(&match_symbol, SYM_HOOK);
185 add_hook(&match_stmt, STMT_HOOK);
186 add_hook(&match_switch, STMT_HOOK);
187 add_hook(&match_switch_end, STMT_HOOK_AFTER);
188 }
|
160
161 static void match_switch_end(struct statement *stmt)
162 {
163
164 if (stmt->type != STMT_SWITCH)
165 return;
166
167 in_switch_stmt--;
168
169 if (!in_switch_stmt)
170 delete_my_states(my_id);
171 }
172
173 void check_missing_break(int id)
174 {
175 my_id = id;
176
177 if (!option_spammy)
178 return;
179
180 set_dynamic_states(my_id);
181 add_unmatched_state_hook(my_id, &unmatched_state);
182 add_merge_hook(my_id, &merge_hook);
183
184 add_hook(&match_assign, ASSIGNMENT_HOOK);
185 add_hook(&match_symbol, SYM_HOOK);
186 add_hook(&match_stmt, STMT_HOOK);
187 add_hook(&match_switch, STMT_HOOK);
188 add_hook(&match_switch_end, STMT_HOOK_AFTER);
189 }
|