maint: style changes

* src/scan-code.l: Remove useless braces.
Formatting changes.
Prefer NULL to 0.
* src/muscle-tab.c, src/system.h: Formatting changes.
This commit is contained in:
Akim Demaille
2012-07-25 17:57:57 +02:00
parent f9b8635172
commit 9b8585410a
4 changed files with 110 additions and 112 deletions

View File

@@ -36,41 +36,41 @@ void muscle_free (void);
extern struct obstack muscle_obstack;
#define MUSCLE_INSERT_BOOL(Key, Value) \
do { \
do { \
int v = Value; \
MUSCLE_INSERT_INT (Key, v); \
} while(0)
} while (0)
#define MUSCLE_INSERT_INT(Key, Value) \
do { \
do { \
obstack_fgrow1 (&muscle_obstack, "%d", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while(0)
} while (0)
#define MUSCLE_INSERT_LONG_INT(Key, Value) \
do { \
do { \
obstack_fgrow1 (&muscle_obstack, "%ld", Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while(0)
} while (0)
#define MUSCLE_INSERT_STRING_RAW(Key, Value) \
do { \
do { \
obstack_sgrow (&muscle_obstack, Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while(0)
} while (0)
#define MUSCLE_INSERT_STRING(Key, Value) \
do { \
do { \
MUSCLE_OBSTACK_SGROW (&muscle_obstack, Value); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while(0)
} while (0)
#define MUSCLE_OBSTACK_SGROW(Obstack, Value) \
do { \
do { \
char const *p; \
for (p = Value; *p; p++) \
switch (*p) \
@@ -81,16 +81,16 @@ do { \
case ']': obstack_sgrow (Obstack, "@}" ); break; \
default: obstack_1grow (Obstack, *p); break; \
} \
} while(0)
} while (0)
#define MUSCLE_INSERT_C_STRING(Key, Value) \
do { \
do { \
MUSCLE_OBSTACK_SGROW (&muscle_obstack, \
quotearg_style (c_quoting_style, \
Value)); \
obstack_1grow (&muscle_obstack, 0); \
muscle_insert (Key, obstack_finish (&muscle_obstack)); \
} while(0)
} while (0)
/* Append VALUE to the current value of KEY. If KEY did not already
exist, create it. Use MUSCLE_OBSTACK. De-allocate the previously

View File

@@ -181,19 +181,17 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$"
<SC_RULE_ACTION>
{
"$"("<"{tag}">")?{ref} {
ref_tail_fields = 0;
ref_tail_fields = NULL;
handle_action_dollar (self->rule, yytext, *loc);
if (ref_tail_fields) {
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
}
need_semicolon = true;
}
"@"{ref} {
ref_tail_fields = 0;
ref_tail_fields = NULL;
handle_action_at (self->rule, yytext, *loc);
if (ref_tail_fields) {
if (ref_tail_fields)
obstack_sgrow (&obstack_for_string, ref_tail_fields);
}
need_semicolon = true;
}
"$" {
@@ -345,7 +343,7 @@ typedef struct
not visible from current midrule. */
#define VARIANT_NOT_VISIBLE_FROM_MIDRULE (1 << 2)
static variant *variant_table = 0;
static variant *variant_table = NULL;
static unsigned variant_table_size = 0;
static unsigned variant_count = 0;
@@ -367,7 +365,7 @@ static void
variant_table_free (void)
{
free (variant_table);
variant_table = 0;
variant_table = NULL;
variant_table_size = variant_count = 0;
}
@@ -410,7 +408,7 @@ variant_add (uniqstr id, location id_loc, unsigned symbol_index,
}
static const char *
get_at_spec(unsigned symbol_index)
get_at_spec (unsigned symbol_index)
{
static char at_buf[20];
if (symbol_index == 0)

View File

@@ -164,32 +164,32 @@ typedef size_t uintptr_t;
obstack_grow (Obs, Str, strlen (Str))
# define obstack_fgrow1(Obs, Format, Arg1) \
do { \
do { \
char buf[4096]; \
sprintf (buf, Format, Arg1); \
obstack_grow (Obs, buf, strlen (buf)); \
} while (0)
} while (0)
# define obstack_fgrow2(Obs, Format, Arg1, Arg2) \
do { \
do { \
char buf[4096]; \
sprintf (buf, Format, Arg1, Arg2); \
obstack_grow (Obs, buf, strlen (buf)); \
} while (0)
} while (0)
# define obstack_fgrow3(Obs, Format, Arg1, Arg2, Arg3) \
do { \
do { \
char buf[4096]; \
sprintf (buf, Format, Arg1, Arg2, Arg3); \
obstack_grow (Obs, buf, strlen (buf)); \
} while (0)
} while (0)
# define obstack_fgrow4(Obs, Format, Arg1, Arg2, Arg3, Arg4) \
do { \
do { \
char buf[4096]; \
sprintf (buf, Format, Arg1, Arg2, Arg3, Arg4); \
obstack_grow (Obs, buf, strlen (buf)); \
} while (0)
} while (0)
@@ -216,14 +216,14 @@ do { \
`---------------------*/
# define LIST_FREE(Type, List) \
do { \
do { \
Type *_node, *_next; \
for (_node = List; _node; _node = _next) \
{ \
_next = _node->next; \
free (_node); \
} \
} while (0)
} while (0)
/*---------------------------------------------.