projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
18e573c
)
Slightly simplify daisy chaining gotos.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 16 Nov 2008 10:25:16 +0000
(10:25 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sun, 16 Nov 2008 10:25:16 +0000
(10:25 +0000)
[r23704]
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
2a05c7b
..
417b1e2
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-118,7
+118,7
@@
static statement_t *current_parent = NULL;
static ms_try_statement_t *current_try = NULL;
static linkage_kind_t current_linkage = LINKAGE_INVALID;
static goto_statement_t *goto_first = NULL;
static ms_try_statement_t *current_try = NULL;
static linkage_kind_t current_linkage = LINKAGE_INVALID;
static goto_statement_t *goto_first = NULL;
-static goto_statement_t
*goto_last
= NULL;
+static goto_statement_t
**goto_anchor
= NULL;
static label_statement_t *label_first = NULL;
static label_statement_t **label_anchor = NULL;
/** current translation unit. */
static label_statement_t *label_first = NULL;
static label_statement_t **label_anchor = NULL;
/** current translation unit. */
@@
-5272,8
+5272,8
@@
static void check_labels(void)
"label '%Y' used but not defined", label->base.symbol);
}
}
"label '%Y' used but not defined", label->base.symbol);
}
}
- goto_first = NULL;
- goto_
last = NULL
;
+ goto_first
= NULL;
+ goto_
anchor = &goto_first
;
if (warning.unused_label) {
for (const label_statement_t *label_statement = label_first;
if (warning.unused_label) {
for (const label_statement_t *label_statement = label_first;
@@
-9841,12
+9841,8
@@
static statement_t *parse_goto(void)
}
/* remember the goto's in a list for later checking */
}
/* remember the goto's in a list for later checking */
- if (goto_last == NULL) {
- goto_first = &statement->gotos;
- } else {
- goto_last->next = &statement->gotos;
- }
- goto_last = &statement->gotos;
+ *goto_anchor = &statement->gotos;
+ goto_anchor = &statement->gotos.next;
expect(';');
expect(';');