summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2013-03-04 19:44:25 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-03-04 19:44:25 (GMT)
commita75760ff7d9bedcb1377fc3441f5e38178da1d6a (patch) (side-by-side diff)
tree39413a06ee259848dfc2cb585a357ddac5d2d4ca
parent860ec4960ff61cf3b2e98e0d020e7f8a93a56008 (diff)
downloadalck-a75760ff7d9bedcb1377fc3441f5e38178da1d6a.tar.gz
alck-a75760ff7d9bedcb1377fc3441f5e38178da1d6a.tar.bz2
Switch to a "right" style.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ckaliases.c53
-rw-r--r--gram.y28
-rw-r--r--lex.l12
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)
rowi = R;
- while (rowi < relend)
- {
+ while (rowi < relend) {
ccol = cword;
@@ -57,6 +56,4 @@ TC (unsigned *R, int n)
- while (rowj < relend)
- {
- if (*ccol & mask)
- {
+ while (rowj < relend) {
+ if (*ccol & mask) {
rp = rowi;
@@ -66,5 +63,3 @@ TC (unsigned *R, int n)
*rowj++ |= *rp++;
- }
- else
- {
+ } else {
rowj = (unsigned *) ((char *) rowj + rowsize);
@@ -76,4 +71,3 @@ TC (unsigned *R, int n)
mask <<= 1;
- if (mask == 0)
- {
+ if (mask == 0) {
mask = 1;
@@ -93,4 +87,3 @@ slist_add (SLIST **plist, char *str)
- if (!*plist)
- {
+ if (!*plist) {
*plist = xmalloc (sizeof (**plist));
@@ -99,9 +92,6 @@ slist_add (SLIST **plist, char *str)
- if ((*plist)->head == NULL)
- {
+ if ((*plist)->head == NULL) {
(*plist)->head = p;
(*plist)->count = 0;
- }
- else
- {
+ } else {
(*plist)->tail->next = p;
@@ -117,4 +107,3 @@ slist_append (SLIST **pdst, SLIST *src)
- if (!*pdst)
- {
+ if (!*pdst) {
*pdst = xmalloc (sizeof (**pdst));
@@ -153,4 +142,3 @@ slist_destroy (SLIST **plist)
p = (*plist)->head;
- while (p)
- {
+ while (p) {
struct string_list *next = p->next;
@@ -164,4 +152,3 @@ slist_destroy (SLIST **plist)
-typedef struct
-{
+typedef struct {
char *name;
@@ -229,4 +216,3 @@ end_aliases ()
for (i = 1; i < alias_count; i++)
- if (alias_cmp (aliases + i - 1, aliases + i) == 0)
- {
+ if (alias_cmp(aliases + i - 1, aliases + i) == 0) {
error (0, 0, "alias `%s' multiply defined", aliases[i].name);
@@ -268,9 +254,6 @@ mark_connected (unsigned *r, unsigned size)
- for (i = 0; i < alias_count; i++)
- {
- if (aliases[i].exp)
- {
+ for (i = 0; i < alias_count; i++) {
+ if (aliases[i].exp) {
struct string_list *p;
- for (p = aliases[i].exp->head; p; p = p->next)
- {
+ for (p = aliases[i].exp->head; p; p = p->next) {
int n = find_alias (p->str);
@@ -288,6 +271,4 @@ check_circular_deps (unsigned *r, unsigned size)
- for (i = 0; i < alias_count; i++)
- {
- if (alias_bitisset (r, size, i, i))
- {
+ for (i = 0; i < alias_count; i++) {
+ if (alias_bitisset(r, size, i, i)) {
error (0, 0, "%s: circular dependency", aliases[i].name);
diff --git a/gram.y b/gram.y
index dd323be..34d46e2 100644
--- a/gram.y
+++ b/gram.y
@@ -81,4 +81,3 @@ email : string
{
- if (restricted && ($1[0] == '|' || $1[0] == '/'))
- {
+ if (restricted && ($1[0] == '|' || $1[0] == '/')) {
yyerror ("Construct not allowed");
@@ -96,4 +95,3 @@ email : string
{
- if (restricted)
- {
+ if (restricted) {
yyerror ("Include statement is not allowed");
@@ -171,6 +169,5 @@ main (int argc, char **argv)
program_name = argv[0];
- while ((c = getopt_long (argc, argv, "-d:f:hp:ruvw:", options, NULL)) != EOF)
- {
- switch (c)
- {
+ while ((c = getopt_long(argc, argv, "-d:f:hp:ruvw:",
+ options, NULL)) != EOF) {
+ switch (c) {
case 1:
@@ -184,6 +181,4 @@ main (int argc, char **argv)
case 'd':
- for (p = optarg; *p; p++)
- {
- switch (*p)
- {
+ for (p = optarg; *p; p++) {
+ switch (*p) {
case '-':
@@ -215,6 +210,4 @@ main (int argc, char **argv)
read_include (&file_list, optarg);
- if (file_list)
- {
- for (s = file_list->head; s; s = s->next)
- {
+ if (file_list) {
+ for (s = file_list->head; s; s = s->next) {
openaliases_prefix (optarg, s->str);
@@ -263,4 +256,3 @@ main (int argc, char **argv)
read_include (&cw_list, cwfile);
- while (argc--)
- {
+ while (argc--) {
openaliases (*argv++);
diff --git a/lex.l b/lex.l
index ba48a9c..c71d4b9 100644
--- a/lex.l
+++ b/lex.l
@@ -98,4 +98,3 @@ unescape_char (int c)
- for (p = escape_transtab; *p; p += 2)
- {
+ for (p = escape_transtab; *p; p += 2) {
if (*p == c)
@@ -152,4 +151,3 @@ openaliases_prefix (char *prefix, char *name)
- if (!S_ISDIR (st.st_mode))
- {
+ if (!S_ISDIR(st.st_mode)) {
char *p = strrchr (prefix, '/');
@@ -185,4 +183,3 @@ read_include (SLIST **plist, char *name)
- if (!fp)
- {
+ if (!fp) {
error_at_line (0, 0, file_name, line_num,
@@ -194,4 +191,3 @@ read_include (SLIST **plist, char *name)
- while (p = fgets (buffer, sizeof buffer, fp))
- {
+ while (p = fgets(buffer, sizeof buffer, fp)) {
char *q;

Return to:

Send suggestions and report system problems to the System administrator.