diff options
-rw-r--r-- | ckaliases.c | 53 | ||||
-rw-r--r-- | gram.y | 28 | ||||
-rw-r--r-- | lex.l | 12 |
3 files changed, 31 insertions, 62 deletions
diff --git a/ckaliases.c b/ckaliases.c index d77e62d..da0a5c1 100644 --- a/ckaliases.c +++ b/ckaliases.c | |||
@@ -52,4 +52,3 @@ TC (unsigned *R, int n) | |||
52 | rowi = R; | 52 | rowi = R; |
53 | while (rowi < relend) | 53 | while (rowi < relend) { |
54 | { | ||
55 | ccol = cword; | 54 | ccol = cword; |
@@ -57,6 +56,4 @@ TC (unsigned *R, int n) | |||
57 | 56 | ||
58 | while (rowj < relend) | 57 | while (rowj < relend) { |
59 | { | 58 | if (*ccol & mask) { |
60 | if (*ccol & mask) | ||
61 | { | ||
62 | rp = rowi; | 59 | rp = rowi; |
@@ -66,5 +63,3 @@ TC (unsigned *R, int n) | |||
66 | *rowj++ |= *rp++; | 63 | *rowj++ |= *rp++; |
67 | } | 64 | } else { |
68 | else | ||
69 | { | ||
70 | rowj = (unsigned *) ((char *) rowj + rowsize); | 65 | rowj = (unsigned *) ((char *) rowj + rowsize); |
@@ -76,4 +71,3 @@ TC (unsigned *R, int n) | |||
76 | mask <<= 1; | 71 | mask <<= 1; |
77 | if (mask == 0) | 72 | if (mask == 0) { |
78 | { | ||
79 | mask = 1; | 73 | mask = 1; |
@@ -93,4 +87,3 @@ slist_add (SLIST **plist, char *str) | |||
93 | 87 | ||
94 | if (!*plist) | 88 | if (!*plist) { |
95 | { | ||
96 | *plist = xmalloc(sizeof(**plist)); | 89 | *plist = xmalloc(sizeof(**plist)); |
@@ -99,9 +92,6 @@ slist_add (SLIST **plist, char *str) | |||
99 | 92 | ||
100 | if ((*plist)->head == NULL) | 93 | if ((*plist)->head == NULL) { |
101 | { | ||
102 | (*plist)->head = p; | 94 | (*plist)->head = p; |
103 | (*plist)->count = 0; | 95 | (*plist)->count = 0; |
104 | } | 96 | } else { |
105 | else | ||
106 | { | ||
107 | (*plist)->tail->next = p; | 97 | (*plist)->tail->next = p; |
@@ -117,4 +107,3 @@ slist_append (SLIST **pdst, SLIST *src) | |||
117 | 107 | ||
118 | if (!*pdst) | 108 | if (!*pdst) { |
119 | { | ||
120 | *pdst = xmalloc(sizeof(**pdst)); | 109 | *pdst = xmalloc(sizeof(**pdst)); |
@@ -153,4 +142,3 @@ slist_destroy (SLIST **plist) | |||
153 | p = (*plist)->head; | 142 | p = (*plist)->head; |
154 | while (p) | 143 | while (p) { |
155 | { | ||
156 | struct string_list *next = p->next; | 144 | struct string_list *next = p->next; |
@@ -164,4 +152,3 @@ slist_destroy (SLIST **plist) | |||
164 | 152 | ||
165 | typedef struct | 153 | typedef struct { |
166 | { | ||
167 | char *name; | 154 | char *name; |
@@ -229,4 +216,3 @@ end_aliases () | |||
229 | for (i = 1; i < alias_count; i++) | 216 | for (i = 1; i < alias_count; i++) |
230 | if (alias_cmp (aliases + i - 1, aliases + i) == 0) | 217 | if (alias_cmp(aliases + i - 1, aliases + i) == 0) { |
231 | { | ||
232 | error(0, 0, "alias `%s' multiply defined", aliases[i].name); | 218 | error(0, 0, "alias `%s' multiply defined", aliases[i].name); |
@@ -268,9 +254,6 @@ mark_connected (unsigned *r, unsigned size) | |||
268 | 254 | ||
269 | for (i = 0; i < alias_count; i++) | 255 | for (i = 0; i < alias_count; i++) { |
270 | { | 256 | if (aliases[i].exp) { |
271 | if (aliases[i].exp) | ||
272 | { | ||
273 | struct string_list *p; | 257 | struct string_list *p; |
274 | for (p = aliases[i].exp->head; p; p = p->next) | 258 | for (p = aliases[i].exp->head; p; p = p->next) { |
275 | { | ||
276 | int n = find_alias(p->str); | 259 | int n = find_alias(p->str); |
@@ -288,6 +271,4 @@ check_circular_deps (unsigned *r, unsigned size) | |||
288 | 271 | ||
289 | for (i = 0; i < alias_count; i++) | 272 | for (i = 0; i < alias_count; i++) { |
290 | { | 273 | if (alias_bitisset(r, size, i, i)) { |
291 | if (alias_bitisset (r, size, i, i)) | ||
292 | { | ||
293 | error(0, 0, "%s: circular dependency", aliases[i].name); | 274 | error(0, 0, "%s: circular dependency", aliases[i].name); |
@@ -81,4 +81,3 @@ email : string | |||
81 | { | 81 | { |
82 | if (restricted && ($1[0] == '|' || $1[0] == '/')) | 82 | if (restricted && ($1[0] == '|' || $1[0] == '/')) { |
83 | { | ||
84 | yyerror("Construct not allowed"); | 83 | yyerror("Construct not allowed"); |
@@ -96,4 +95,3 @@ email : string | |||
96 | { | 95 | { |
97 | if (restricted) | 96 | if (restricted) { |
98 | { | ||
99 | yyerror("Include statement is not allowed"); | 97 | yyerror("Include statement is not allowed"); |
@@ -171,6 +169,5 @@ main (int argc, char **argv) | |||
171 | program_name = argv[0]; | 169 | program_name = argv[0]; |
172 | while ((c = getopt_long (argc, argv, "-d:f:hp:ruvw:", options, NULL)) != EOF) | 170 | while ((c = getopt_long(argc, argv, "-d:f:hp:ruvw:", |
173 | { | 171 | options, NULL)) != EOF) { |
174 | switch (c) | 172 | switch (c) { |
175 | { | ||
176 | case 1: | 173 | case 1: |
@@ -184,6 +181,4 @@ main (int argc, char **argv) | |||
184 | case 'd': | 181 | case 'd': |
185 | for (p = optarg; *p; p++) | 182 | for (p = optarg; *p; p++) { |
186 | { | 183 | switch (*p) { |
187 | switch (*p) | ||
188 | { | ||
189 | case '-': | 184 | case '-': |
@@ -215,6 +210,4 @@ main (int argc, char **argv) | |||
215 | read_include(&file_list, optarg); | 210 | read_include(&file_list, optarg); |
216 | if (file_list) | 211 | if (file_list) { |
217 | { | 212 | for (s = file_list->head; s; s = s->next) { |
218 | for (s = file_list->head; s; s = s->next) | ||
219 | { | ||
220 | openaliases_prefix(optarg, s->str); | 213 | openaliases_prefix(optarg, s->str); |
@@ -263,4 +256,3 @@ main (int argc, char **argv) | |||
263 | read_include(&cw_list, cwfile); | 256 | read_include(&cw_list, cwfile); |
264 | while (argc--) | 257 | while (argc--) { |
265 | { | ||
266 | openaliases(*argv++); | 258 | openaliases(*argv++); |
@@ -98,4 +98,3 @@ unescape_char (int c) | |||
98 | 98 | ||
99 | for (p = escape_transtab; *p; p += 2) | 99 | for (p = escape_transtab; *p; p += 2) { |
100 | { | ||
101 | if (*p == c) | 100 | if (*p == c) |
@@ -152,4 +151,3 @@ openaliases_prefix (char *prefix, char *name) | |||
152 | 151 | ||
153 | if (!S_ISDIR (st.st_mode)) | 152 | if (!S_ISDIR(st.st_mode)) { |
154 | { | ||
155 | char *p = strrchr(prefix, '/'); | 153 | char *p = strrchr(prefix, '/'); |
@@ -185,4 +183,3 @@ read_include (SLIST **plist, char *name) | |||
185 | 183 | ||
186 | if (!fp) | 184 | if (!fp) { |
187 | { | ||
188 | error_at_line(0, 0, file_name, line_num, | 185 | error_at_line(0, 0, file_name, line_num, |
@@ -194,4 +191,3 @@ read_include (SLIST **plist, char *name) | |||
194 | 191 | ||
195 | while (p = fgets (buffer, sizeof buffer, fp)) | 192 | while (p = fgets(buffer, sizeof buffer, fp)) { |
196 | { | ||
197 | char *q; | 193 | char *q; |