svn commit: trunk/busybox/editors

vda at busybox.net vda at busybox.net
Mon Jan 1 23:53:52 UTC 2007


Author: vda
Date: 2007-01-01 15:53:52 -0800 (Mon, 01 Jan 2007)
New Revision: 17127

Log:
awk: style fixes


Modified:
   trunk/busybox/editors/awk.c


Changeset:
Modified: trunk/busybox/editors/awk.c
===================================================================
--- trunk/busybox/editors/awk.c	2007-01-01 23:53:12 UTC (rev 17126)
+++ trunk/busybox/editors/awk.c	2007-01-01 23:53:52 UTC (rev 17127)
@@ -848,20 +848,16 @@
 	int l;
 
 	if (t.rollback) {
-
 		t.rollback = FALSE;
 
 	} else if (concat_inserted) {
-
 		concat_inserted = FALSE;
 		t.tclass = save_tclass;
 		t.info = save_info;
 
 	} else {
-
 		p = pos;
-
-	readnext:
+ readnext:
 		skip_spaces(&p);
 		lineno = t.lineno;
 		if (*p == '#')
@@ -939,7 +935,7 @@
 				/* it's a name (var/array/function),
 				 * otherwise it's something wrong
 				 */
-				if (! isalnum_(*p))
+				if (!isalnum_(*p))
 					syntax_error(EMSG_UNEXP_TOKEN);
 
 				t.string = --p;
@@ -949,7 +945,7 @@
 				*(p-1) = '\0';
 				tc = TC_VARIABLE;
 				/* also consume whitespace between functionname and bracket */
-				if (! (expected & TC_VARIABLE)) skip_spaces(&p);
+				if (!(expected & TC_VARIABLE)) skip_spaces(&p);
 				if (*p == '(') {
 					tc = TC_FUNCTION;
 				} else {
@@ -1395,14 +1391,14 @@
 /* gradually increasing buffer */
 static void qrealloc(char **b, int n, int *size)
 {
-	if (! *b || n >= *size)
+	if (!*b || n >= *size)
 		*b = xrealloc(*b, *size = n + (n>>1) + 80);
 }
 
 /* resize field storage space */
 static void fsrealloc(int size)
 {
-	static int maxfields = 0;
+	static int maxfields; /* = 0;*/
 	int i;
 
 	if (size >= maxfields) {
@@ -1416,8 +1412,8 @@
 	}
 
 	if (size < nfields) {
-		for (i=size; i<nfields; i++) {
-			clrvar(Fields+i);
+		for (i = size; i < nfields; i++) {
+			clrvar(Fields + i);
 		}
 	}
 	nfields = size;
@@ -1457,8 +1453,8 @@
 		}
 	} else if (c[0] == '\0') {		/* null split */
 		while (*s) {
-			*(s1++) = *(s++);
-			*(s1++) = '\0';
+			*s1++ = *s++;
+			*s1++ = '\0';
 			n++;
 		}
 	} else if (c[0] != ' ') {		/* single-character split */
@@ -1468,17 +1464,17 @@
 		}
 		if (*s1) n++;
 		while ((s1 = strpbrk(s1, c))) {
-			*(s1++) = '\0';
+			*s1++ = '\0';
 			n++;
 		}
 	} else {				/* space split */
 		while (*s) {
 			s = skip_whitespace(s);
-			if (! *s) break;
+			if (!*s) break;
 			n++;
 			while (*s && !isspace(*s))
-				*(s1++) = *(s++);
-			*(s1++) = '\0';
+				*s1++ = *s++;
+			*s1++ = '\0';
 		}
 	}
 	return n;
@@ -1517,7 +1513,7 @@
 	char *b, *sep, *s;
 	int sl, l, len, i, bsize;
 
-	if (! (v->type & VF_SPECIAL))
+	if (!(v->type & VF_SPECIAL))
 		return;
 
 	if (v == V[NF]) {
@@ -1540,7 +1536,8 @@
 			memcpy(b+len, s, l);
 			len += l;
 		}
-		if (b) b[len] = '\0';
+		if (b)
+			b[len] = '\0';
 		setvar_p(V[F0], b);
 		is_f0_split = TRUE;
 
@@ -1556,7 +1553,7 @@
 	} else if (v == V[IGNORECASE]) {
 		icase = istrue(v);
 
-	} else {						/* $n */
+	} else {				/* $n */
 		n = getvar_i(V[NF]);
 		setvar_i(V[NF], n > v-Fields ? n : v-Fields+1);
 		/* right here v is invalid. Just to note... */
@@ -1781,7 +1778,6 @@
 
 		/* if there was an error while sprintf, return value is negative */
 		if (i < j) i = j;
-
 	}
 
 	b = xrealloc(b, i + 1);
@@ -1965,7 +1961,7 @@
 
 	case B_up:
 		to_xxx = toupper;
-lo_cont:
+ lo_cont:
 		s1 = s = xstrdup(as[0]);
 		while (*s1) {
 			*s1 = (*to_xxx)(*s1);
@@ -2053,6 +2049,7 @@
 	static var *fnargs = NULL;
 	static unsigned seed = 1;
 	static regex_t sreg;
+
 	node *op1;
 	var *v1;
 	union {
@@ -2072,7 +2069,7 @@
 		uint32_t info;
 	} X;
 
-	if (! op)
+	if (!op)
 		return setvar_s(res, NULL);
 
 	v1 = nvalloc(2);
@@ -2224,9 +2221,8 @@
 
 		case XC( OC_FNARG ):
 			L.v = &fnargs[op->l.i];
-
-v_cont:
-			res = (op->r.n) ? findvar(iamarray(L.v), R.s) : L.v;
+ v_cont:
+			res = op->r.n ? findvar(iamarray(L.v), R.s) : L.v;
 			break;
 
 		case XC( OC_IN ):
@@ -2240,7 +2236,7 @@
 
 		case XC( OC_MATCH ):
 			op1 = op->r.n;
-re_cont:
+ re_cont:
 			X.re = as_regex(op1, &sreg);
 			R.i = regexec(X.re, L.s, 0, NULL, 0);
 			if (X.re == &sreg) regfree(X.re);




More information about the busybox-cvs mailing list