>From 638e60a89af1fe479ebd49a9be8ca62ee928053b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 14 Jan 2016 17:18:38 -0800
Subject: [PATCH 1/3] * testsuite.c: White space fixes.

---
 testsuite.c | 309 +++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 161 insertions(+), 148 deletions(-)

diff --git a/testsuite.c b/testsuite.c
index f835ef4..6a1fd8a 100644
--- a/testsuite.c
+++ b/testsuite.c
@@ -225,10 +225,10 @@ main(int argc, char *argv[])
 	char const *tostr = "2038-01-19";
 	char const *incstr = "997"; /* rather arbitrary, but useful if prime */
 
-	for(; argi < argc && argv[argi][0] == '-'; argi++) {
+	for (; argi < argc && argv[argi][0] == '-'; argi++) {
 		char *p;
-		for(p = &argv[argi][1]; *p != '\0'; p++) {
-			switch(*p) {
+		for (p = &argv[argi][1]; *p != '\0'; p++) {
+			switch (*p) {
 				case 'f':
 					fromstr = argv[++argi];
 					break;
@@ -252,7 +252,7 @@ main(int argc, char *argv[])
 				default:
 					fprintf(stderr,
 						"%s: unknown option -%c\n",
-								progname, *p);
+						progname, *p);
 			}
 		}
 	}
@@ -262,20 +262,20 @@ main(int argc, char *argv[])
 
 	/* TODO: check for -x plus input file, other mismatched args */
 
-	if(calltzset) {
+	if (calltzset) {
 		tzset();
 	}
 
-	if(exhaustive) {
+	if (exhaustive) {
 		struct tm from, to;
 		time_t inc;
 
-		if(sscanf(fromstr, "%d-%d-%d",
-			    &from.tm_year, &from.tm_mon, &from.tm_mday) != 3) {
-			fprintf(stderr,
-				    "%s: syntax error in from string \"%s\"\n",
-							progname, fromstr);
-			}
+		if (sscanf(fromstr, "%d-%d-%d",
+			   &from.tm_year, &from.tm_mon, &from.tm_mday)
+		    != 3)
+		  fprintf(stderr, "%s: syntax error in from string \"%s\"\n",
+			  progname, fromstr);
+
 		from.tm_year -= 1900;
 		from.tm_mon--;
 		from.tm_hour = from.tm_min = from.tm_sec = 0;
@@ -283,12 +283,13 @@ main(int argc, char *argv[])
 		from.tm_wday = 0;
 		from.tm_yday = 0;
 
-		if(sscanf(tostr, "%d-%d-%d",
-				  &to.tm_year, &to.tm_mon, &to.tm_mday) != 3) {
-			fprintf(stderr,
-				    "%s: syntax error in to string \"%s\"\n",
-							progname, tostr);
-		}
+		if (sscanf(tostr, "%d-%d-%d",
+			   &to.tm_year, &to.tm_mon, &to.tm_mday)
+		    != 3)
+		  fprintf(stderr,
+			  "%s: syntax error in to string \"%s\"\n",
+			  progname, tostr);
+
 		to.tm_year -= 1900;
 		to.tm_mon--;
 		to.tm_hour = to.tm_min = to.tm_sec = 0;
@@ -299,14 +300,14 @@ main(int argc, char *argv[])
 		inc = atol(incstr);
 
 		run_exhaustive(&from, &to, inc);
-	} else if(argi == argc) {
+	} else if (argi == argc) {
 		printf("%s: reading tests from standard input\n", progname);
 		runtests(stdin, "standard input");
 	} else {
 		FILE *fp;
-		for(; argi < argc; argi++) {
+		for (; argi < argc; argi++) {
 			fp = fopen(argv[argi], "r");
-			if(fp == NULL) {
+			if (fp == NULL) {
 				fprintf(stderr, "%s: can't open %s: %s\n",
 					progname, argv[argi], strerror(errno));
 				ferrs++;
@@ -317,15 +318,15 @@ main(int argc, char *argv[])
 		}
 	}
 
-	if(errs != 0 || ferrs != 0) {
+	if (errs != 0 || ferrs != 0) {
 		printf("%d tests failed", errs);
-		if(ferrs != 0)
+		if (ferrs != 0)
 			printf(", %d other errors", ferrs);
 		printf("\n");
 	}
 
-	if(ferrs != 0) return 2;
-	if(errs != 0) return 1;
+	if (ferrs != 0) return 2;
+	if (errs != 0) return 1;
 	return 0;
 }
 
@@ -344,76 +345,77 @@ basictest(time_t t, struct tm const *itmp, int flags, char const *tag)
 	tm = *itmp;
 
 	/* Ye olde C-style exception handling */
-	if((sig = setjmp(jmpbuf)) != 0) {
-		printf("%s: %s\n", tag, sig == SIGALRM ? "taking too long" :
-						         "exception");
+	if ((sig = setjmp(jmpbuf)) != 0) {
+		printf("%s: %s\n", tag,
+		       sig == SIGALRM ? "taking too long" : "exception");
 		errs++;
 		return;	/* skips further tests for this test case */
 	}
 
 	alarm(1);
 
-	if(!(flags & DENORM)) {
+	if (!(flags & DENORM)) {
 
-		if(flags & LOCAL) {
+		if (flags & LOCAL) {
 			tmp = localtime(&t);
 		} else {
 			tmp = gmtime(&t);
 		}
 
-		if(tmp == NULL) {
+		if (tmp == NULL) {
 			printf("%s: %s failed\n", tag,
-			     (flags & LOCAL) ? "localtime" : "gmtime");
+			       (flags & LOCAL) ? "localtime" : "gmtime");
 			errs++;
 			return;	/* skips further tests for this test case */
 		}
 
 		tm2 = *tmp;
 
-		if(tmcmp(&tm, &tm2) != 0) {
-			printf("%s: expected %04d-%02d-%02d %02d:%02d:%02d, got %04d-%02d-%02d %02d:%02d:%02d\n",
-				tag,
-				tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
-					tm.tm_hour, tm.tm_min, tm.tm_sec,
-				tm2.tm_year+1900, tm2.tm_mon+1, tm2.tm_mday,
-					tm2.tm_hour, tm2.tm_min, tm2.tm_sec);
+		if (tmcmp(&tm, &tm2) != 0) {
+			printf(("%s: expected %04d-%02d-%02d %02d:%02d:%02d, "
+				"got %04d-%02d-%02d %02d:%02d:%02d\n"),
+			       tag,
+			       tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+			       tm.tm_hour, tm.tm_min, tm.tm_sec,
+			       tm2.tm_year+1900, tm2.tm_mon+1, tm2.tm_mday,
+			       tm2.tm_hour, tm2.tm_min, tm2.tm_sec);
 			errs++;
 		}
-		if(tm.tm_wday != -1) {
-			if(tm2.tm_wday != tm.tm_wday) {
+		if (tm.tm_wday != -1) {
+			if (tm2.tm_wday != tm.tm_wday) {
 				printf("%s: expected wday %d, got %d\n",
-					tag, tm.tm_wday, tm2.tm_wday);
+				       tag, tm.tm_wday, tm2.tm_wday);
 				errs++;
 			}
 		}
-		if(tm.tm_yday != -1) {
-			if(tm2.tm_yday != tm.tm_yday) {
+		if (tm.tm_yday != -1) {
+			if (tm2.tm_yday != tm.tm_yday) {
 				printf("%s: expected yday %d, got %d\n",
-					tag, tm.tm_yday, tm2.tm_yday);
+				       tag, tm.tm_yday, tm2.tm_yday);
 				errs++;
 			}
 		}
-		if(tm.tm_isdst != -1) {
-			if(tm2.tm_isdst != tm.tm_isdst) {
+		if (tm.tm_isdst != -1) {
+			if (tm2.tm_isdst != tm.tm_isdst) {
 				printf("%s: expected dst %d, got %d\n",
-					tag, tm.tm_isdst, tm2.tm_isdst);
+				       tag, tm.tm_isdst, tm2.tm_isdst);
 				errs++;
 			}
 		}
 #ifdef TM_ZONE
-		if(tm.TM_ZONE && *tm.TM_ZONE) {
-			if(!Streq(tm2.TM_ZONE, tm.TM_ZONE)) {
+		if (tm.TM_ZONE && *tm.TM_ZONE) {
+			if (!Streq(tm2.TM_ZONE, tm.TM_ZONE)) {
 				printf("%s: expected \"%s\", got \"%s\"\n",
-					tag, tm.TM_ZONE, tm2.TM_ZONE);
+				       tag, tm.TM_ZONE, tm2.TM_ZONE);
 				errs++;
 			}
 		}
 #endif
 #ifdef TM_GMTOFF
-		if(tm.TM_GMTOFF != -1) {
-			if(tm2.TM_GMTOFF != tm.TM_GMTOFF) {
+		if (tm.TM_GMTOFF != -1) {
+			if (tm2.TM_GMTOFF != tm.TM_GMTOFF) {
 				printf("%s: expected offset %ld, got %ld\n",
-					tag, tm.TM_GMTOFF, tm2.TM_GMTOFF);
+				       tag, tm.TM_GMTOFF, tm2.TM_GMTOFF);
 				errs++;
 			}
 		}
@@ -421,13 +423,13 @@ basictest(time_t t, struct tm const *itmp, int flags, char const *tag)
 	}
 
 	/* now inverse */
-	if(!(flags & NOINV)) {
+	if (!(flags & NOINV)) {
 
 		tm.tm_isdst = -1;
 		tm.tm_wday = 0;
 		tm.tm_yday = 0;
 
-		if(flags & LOCAL) {
+		if (flags & LOCAL) {
 			t2 = mktime(&tm);
 		} else {
 #ifdef TEST_QUICK_TIMEGM
@@ -437,9 +439,9 @@ basictest(time_t t, struct tm const *itmp, int flags, char const *tag)
 #endif
 		}
 
-		if(t2 != t) {
+		if (t2 != t) {
 			printf("%s: inverse expected %ld, got %ld\n",
-					tag, t, t2);
+			       tag, t, t2);
 			errs++;
 		}
 	}
@@ -464,36 +466,41 @@ runtests(FILE *fp, char const *name)
 	int i;
 	int flags;
 
-	while(fgets(line, sizeof(line), fp) != NULL) {
+	while (fgets(line, sizeof line, fp) != NULL) {
 		lineno++;
-		if((p = strrchr(line, '\n')) != NULL) *p = '\0';
-		if((p = strrchr(line, '\r')) != NULL) *p = '\0';
-		if((p = strchr(line, '#')) != NULL) *p = '\0';
-		if(*line == '\0') continue;
+		if ((p = strrchr(line, '\n')) != NULL) *p = '\0';
+		if ((p = strrchr(line, '\r')) != NULL) *p = '\0';
+		if ((p = strchr(line, '#')) != NULL) *p = '\0';
+		if (*line == '\0') continue;
 		ac = getargs(av, line, MAXARGS);
-		if(ac == 0) continue;
+		if (ac == 0) continue;
 
-		snprintf(tag, sizeof(tag), "%s, line %d: %s",
-							name, lineno, av[0]);
+		snprintf(tag, sizeof tag, "%s, line %d: %s",
+			 name, lineno, av[0]);
 
-		if(Streq(av[0], "tz")) {
+		if (Streq(av[0], "tz")) {
 			setenv("TZ", av[1], 1);
-		} else if(Streq(av[0], "localtime") || Streq(av[0], "gmtime")) {
-			if(ac < 4) {
+		} else if (Streq(av[0], "localtime")
+			   || Streq(av[0], "gmtime")) {
+			if (ac < 4) {
 				fprintf(stderr,
-				    "%s: %s, line %d: %s: too few arguments\n",
+					("%s: %s, line %d: %s: "
+					 "too few arguments\n"),
 					progname, name, lineno, av[0]);
 				continue;
 			}
 
 			t = atoll(av[1]);
 
-			if(sscanf(av[2], "%d-%d-%d",
-			    &tm.tm_year, &tm.tm_mon, &tm.tm_mday) != 3 ||
-				sscanf(av[3], "%d:%d:%d",
-				   &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 3) {
+			if ((sscanf(av[2], "%d-%d-%d",
+				   &tm.tm_year, &tm.tm_mon, &tm.tm_mday)
+			     != 3)
+			    || (sscanf(av[3], "%d:%d:%d",
+				       &tm.tm_hour, &tm.tm_min, &tm.tm_sec)
+				!= 3)) {
 				fprintf(stderr,
-				 "%s: %s, line %d: %s: bad date/time syntax\n",
+					("%s: %s, line %d: %s: "
+					 "bad date/time syntax\n"),
 					progname, name, lineno, av[0]);
 				continue;
 			}
@@ -511,43 +518,44 @@ runtests(FILE *fp, char const *name)
 #ifdef TM_GMTOFF
 			tm.TM_GMTOFF = -1;
 #endif
-			if(Streq(av[0], "localtime")) flags |= LOCAL;
+			if (Streq(av[0], "localtime")) flags |= LOCAL;
 
-			for(i = 4; i < ac; i++) {
+			for (i = 4; i < ac; i++) {
 				char *k = av[i];
 				char *v = strchr(av[i], '=');
-				if(v == NULL) {
+				if (v == NULL) {
 					fprintf(stderr,
-			    "%s: %s, line %d: %s bad aux parm syntax \"%s\"\n",
+						("%s: %s, line %d: %s bad aux "
+						 "parm syntax \"%s\"\n"),
 						progname, name, lineno,
-							av[0], av[i]);
+						av[0], av[i]);
 					continue;
 				}
 				*v++ = '\0';
-				if(Streq(k, "fl")) {
+				if (Streq(k, "fl")) {
 					/* scan comma-separated list */
-					for(p = v; p && *p; ) {
+					for (p = v; p && *p; ) {
 						char *p2 = strchr(p, ',');
-						if(p2 != NULL) *p2 = '\0';
-						if(Streq(p, "noi"))
+						if (p2 != NULL) *p2 = '\0';
+						if (Streq(p, "noi"))
 							flags |= NOINV;
-						else if(Streq(p, "denorm"))
+						else if (Streq(p, "denorm"))
 							flags |= DENORM;
-						if(p2) p = p2 + 1;
+						if (p2) p = p2 + 1;
 						else   p = NULL;
 					}
-				} else if(Streq(k, "wd")) {
+				} else if (Streq(k, "wd")) {
 					tm.tm_wday = atoi(v);
-				} else if(Streq(k, "yd")) {
+				} else if (Streq(k, "yd")) {
 					tm.tm_yday = atoi(v);
-				} else if(Streq(k, "dst")) {
+				} else if (Streq(k, "dst")) {
 					tm.tm_isdst = atoi(v);
 #ifdef TM_ZONE
-				} else if(Streq(k, "z")) {
+				} else if (Streq(k, "z")) {
 					tm.TM_ZONE = v;
 #endif
 #ifdef TM_GMTOFF
-				} else if(Streq(k, "o")) {
+				} else if (Streq(k, "o")) {
 					tm.TM_GMTOFF = atol(v);
 #endif
 				}
@@ -557,7 +565,8 @@ runtests(FILE *fp, char const *name)
 
 		} else {
 			fprintf(stderr,
-		      "%s: %s, line %d: warning: unrecognized operator '%s'\n",
+				("%s: %s, line %d: warning: "
+				 "unrecognized operator '%s'\n"),
 				progname, name, lineno, av[0]);
 		}
 	}
@@ -575,26 +584,26 @@ run_exhaustive(struct tm const *from, struct tm const *to, time_t inc)
 	static int beenhere = 0;
 
 	printf("exhaustive tests: from %d-%02d-%02d ",
-			from->tm_year+1900, from->tm_mon+1, from->tm_mday);
+	       from->tm_year+1900, from->tm_mon+1, from->tm_mday);
 	printf("to %d-%02d-%02d by %ld\n",
-		to->tm_year+1900, to->tm_mon+1, to->tm_mday, inc);
+	       to->tm_year+1900, to->tm_mon+1, to->tm_mday, inc);
 
 	tm = *from;
 	t = quick_timegm(from);
 
 	tm.tm_wday = (t / 86400 + EPOCH_WDAY) % 7;
-	if(tm.tm_wday < 0) tm.tm_wday += 7;
+	if (tm.tm_wday < 0) tm.tm_wday += 7;
 
 	tm.tm_yday = 0;
-	for(i = 0; i < tm.tm_mon; i++)
+	for (i = 0; i < tm.tm_mon; i++)
 		tm.tm_yday += monthlens[isleap(1900+tm.tm_year)][i];
 	tm.tm_yday += tm.tm_mday - 1;
 
-	while(tmcmp(&tm, to) <= 0) {
+	while (tmcmp(&tm, to) <= 0) {
 
 		ntests++;
 
-		snprintf(tag, sizeof(tag), "%ld", t);
+		snprintf(tag, sizeof tag, "%ld", t);
 
 		/*
 		 *  This do/while loop runs exactly once, and is here just
@@ -634,9 +643,10 @@ run_exhaustive(struct tm const *from, struct tm const *to, time_t inc)
 
 			t2 = mktime(&tmcopy);
 
-			if(t2 == -1) {
-				if(tm.tm_hour == 2) {
-					/* assume ambiguous DST (maybe temporary) */
+			if (t2 == -1) {
+				if (tm.tm_hour == 2) {
+					/* assume ambiguous DST
+					   (maybe temporary) */
 					break;	/* continue to next case */
 				}
 
@@ -646,40 +656,44 @@ run_exhaustive(struct tm const *from, struct tm const *to, time_t inc)
 			}
 
 			tmp = localtime(&t2);
-			if(tmp == NULL) {
+			if (tmp == NULL) {
 				printf("%s: %s failed\n", tag, "localtime");
 				errs++;
 				break;	/* skips further tests for this case */
 			}
 
-			if(tmcmp(&tm, tmp) != 0) {
-				printf("%s: expected %04d-%02d-%02d %02d:%02d:%02d, got %04d-%02d-%02d %02d:%02d:%02d\n",
-				    tag,
-				    tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
-					tm.tm_hour, tm.tm_min, tm.tm_sec,
-				    tmp->tm_year+1900, tmp->tm_mon+1, tmp->tm_mday,
-					tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
+			if (tmcmp(&tm, tmp) != 0) {
+				printf(("%s: expected %04d-%02d-%02d "
+					"%02d:%02d:%02d, got %04d-%02d-%02d "
+					"%02d:%02d:%02d\n"),
+				       tag,
+				       tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+				       tm.tm_hour, tm.tm_min, tm.tm_sec,
+				       tmp->tm_year+1900, tmp->tm_mon+1,
+				       tmp->tm_mday,
+				       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
 				errs++;
 			}
 
 #ifdef TM_GMTOFF
-			if(tmp->TM_GMTOFF == 0 && !beenhere) {
+			if (tmp->TM_GMTOFF == 0 && !beenhere) {
 				fprintf(stderr,
-	"%s: no or GMT/UTC time zone set, so no nontrivial tz offset tested\n",
-								progname);
+					("%s: no or GMT/UTC time zone set, "
+					 "so no nontrivial tz offset tested\n"),
+					progname);
 				fprintf(stderr,
-				       "try setting TZ or invoking with -s\n");
+					"try setting TZ or invoking with -s\n");
 				beenhere = 1;
 			}
 
-			if(t - t2 != tmp->TM_GMTOFF) {
-				printf(
-				"%s: tm_gmtoff not as expected: %ld vs. %ld\n",
-						tag, t - t2, tmp->TM_GMTOFF);
+			if (t - t2 != tmp->TM_GMTOFF) {
+				printf(("%s: tm_gmtoff not as expected: "
+					"%ld vs. %ld\n"),
+				       tag, t - t2, tmp->TM_GMTOFF);
 				errs++;
 			}
 #endif
-		} while(0);
+		} while (0);
 
 		t += inc;
 
@@ -702,12 +716,13 @@ run_exhaustive(struct tm const *from, struct tm const *to, time_t inc)
 		tm.tm_wday = (tm.tm_wday + tmpi) % 7;
 		tm.tm_yday += tmpi;	/* overflow handled in mday loop */
 
-		while(tm.tm_mday > monthlens[isleap(1900+tm.tm_year)][tm.tm_mon]) {
+		while (tm.tm_mday
+		       > monthlens[isleap(1900+tm.tm_year)][tm.tm_mon]) {
 			tm.tm_mday -= monthlens[isleap(1900+tm.tm_year)]
 					       [tm.tm_mon];
 			tm.tm_mon++;
 
-			if(tm.tm_mon >= 12) {
+			if (tm.tm_mon >= 12) {
 				tm.tm_yday -= isleap(1900+tm.tm_year) ? 366
 								      : 365;
 				tm.tm_year++;
@@ -722,17 +737,17 @@ run_exhaustive(struct tm const *from, struct tm const *to, time_t inc)
 static int
 tmcmp(struct tm const *tm1, struct tm const *tm2)
 {
-	if(tm1->tm_year != tm2->tm_year)
+	if (tm1->tm_year != tm2->tm_year)
 		return (tm1->tm_year < tm2->tm_year) ? -1 : 1;
-	else if(tm1->tm_mon != tm2->tm_mon)
+	else if (tm1->tm_mon != tm2->tm_mon)
 		return (tm1->tm_mon < tm2->tm_mon) ? -1 : 1;
-	else if(tm1->tm_mday != tm2->tm_mday)
+	else if (tm1->tm_mday != tm2->tm_mday)
 		return (tm1->tm_mday < tm2->tm_mday) ? -1 : 1;
-	else if(tm1->tm_hour != tm2->tm_hour)
+	else if (tm1->tm_hour != tm2->tm_hour)
 		return (tm1->tm_hour < tm2->tm_hour) ? -1 : 1;
-	else if(tm1->tm_min != tm2->tm_min)
+	else if (tm1->tm_min != tm2->tm_min)
 		return (tm1->tm_min < tm2->tm_min) ? -1 : 1;
-	else if(tm1->tm_sec != tm2->tm_sec)
+	else if (tm1->tm_sec != tm2->tm_sec)
 		return (tm1->tm_sec < tm2->tm_sec) ? -1 : 1;
 	else return 0;
 }
@@ -742,19 +757,19 @@ quick_timegm(struct tm const *tmp)
 {
 	int m;
 	time_t r = (time_t)(1900 + tmp->tm_year - 1970) * 365 * 86400;
-	r += nleapsbetween(1970, 1900 + tmp->tm_year-1) * (time_t)86400;
+	r += nleapsbetween(1970, 1900 + tmp->tm_year-1) * (time_t) 86400;
 #ifdef DEBUG
 	printf("quick_timegm: nleapsbetween: %d\n",
-				nleapsbetween(1970, 1900 + tmp->tm_year-1));
+	       nleapsbetween(1970, 1900 + tmp->tm_year-1));
 #endif
-	for(m = 0; m < tmp->tm_mon; m++)
+	for (m = 0; m < tmp->tm_mon; m++)
 		r += monthlens[isleap(1900+tmp->tm_year)][m] * 86400;
 	r += (tmp->tm_mday - 1) * 86400;
 	r += (tmp->tm_hour * 60 + tmp->tm_min) * 60 + tmp->tm_sec;
 #ifdef DEBUG
 	printf("quick_timegm: %04d-%02d-%02d %02d:%02d:%02d -> %ld\n",
-		1900+tmp->tm_year, tmp->tm_mon+1, tmp->tm_mday,
-			tmp->tm_hour, tmp->tm_min, tmp->tm_sec, r);
+	       1900+tmp->tm_year, tmp->tm_mon+1, tmp->tm_mday,
+	       tmp->tm_hour, tmp->tm_min, tmp->tm_sec, r);
 #endif
 	return r;
 }
@@ -768,9 +783,9 @@ isleap(int y)
 static int
 nleapsbetween(int y1, int y2)
 {
-	if(y1 == y2) {
+	if (y1 == y2) {
 		return 0;	/* unnecessary optimization */
-	} else if(y1 != 0) {
+	} else if (y1 != 0) {
 		return nleapsbetween(0, y2) - nleapsbetween(0, y1);
 	} else {
 		/*
@@ -780,11 +795,11 @@ nleapsbetween(int y1, int y2)
 		 */
 		int ret = 0;
 		int q = y2 / 4;
-		if(y2 % 4 < 0) q--;
+		if (y2 % 4 < 0) q--;
 		ret += q;
-		q = y2 / 100; if(y2 % 100 < 0) q--;
+		q = y2 / 100; if (y2 % 100 < 0) q--;
 		ret -= q;
-		q = y2 / 400; if(y2 % 400 < 0) q--;
+		q = y2 / 400; if (y2 % 400 < 0) q--;
 		ret += q;
 		return ret;
 	}
@@ -804,8 +819,6 @@ catchsig(int sig)
  *  returned.
  */
 
-#include <stdio.h>
-
 #define iswhite(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
 
 static int
@@ -815,26 +828,26 @@ getargs(char *argv[], char *line, int maxargs)
 
 	nargs = 0;
 
-	while(1) {
-		while(iswhite(*line))
+	while (1) {
+		while (iswhite(*line))
 			line++;
 
-		if(*line == '\0') {
-			if(nargs < maxargs) *argv = NULL;
-			return(nargs);
+		if (*line == '\0') {
+			if (nargs < maxargs) *argv = NULL;
+			return nargs;
 		}
 
 		*argv++ = line;
 		nargs++;
 
-		while(!iswhite(*line) && *line != '\0')
+		while (!iswhite(*line) && *line != '\0')
 			line++;
 
-		if(*line == '\0') {
-			if(nargs < maxargs) *argv = NULL;
-			return(nargs);
+		if (*line == '\0') {
+			if (nargs < maxargs) *argv = NULL;
+			return nargs;
 		}
 		*line++ = '\0';
-		if(nargs == maxargs) return(nargs);
+		if (nargs == maxargs) return nargs;
 	}
 }
-- 
2.5.0

