diff options
author | harti <harti@FreeBSD.org> | 2004-11-30 17:46:29 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-11-30 17:46:29 +0000 |
commit | ba6eb9dcb908ffe7a797968e8a9b7dff037333e4 (patch) | |
tree | 056a9516097226d7d6992273b2586fdf619c382c /usr.bin/make/util.c | |
parent | 82f18a9482f4ba9dc496eb84ba5acec216728a40 (diff) | |
download | FreeBSD-src-ba6eb9dcb908ffe7a797968e8a9b7dff037333e4.zip FreeBSD-src-ba6eb9dcb908ffe7a797968e8a9b7dff037333e4.tar.gz |
Stylification: missing spaces, extra space after function names, casts
and the sizeof operator, missing empty lines, void casts, extra empty lines.
Checked by: diff on make *.o lst.lib/*.o
Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
Diffstat (limited to 'usr.bin/make/util.c')
-rw-r--r-- | usr.bin/make/util.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/usr.bin/make/util.c b/usr.bin/make/util.c index 55e6c3d..29e1e50 100644 --- a/usr.bin/make/util.c +++ b/usr.bin/make/util.c @@ -81,9 +81,9 @@ Debug(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - (void)fflush(stderr); + fflush(stderr); } /*- @@ -103,10 +103,10 @@ Error(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - (void)fprintf(stderr, "\n"); - (void)fflush(stderr); + fprintf(stderr, "\n"); + fflush(stderr); } /*- @@ -130,10 +130,10 @@ Fatal(const char *fmt, ...) if (jobsRunning) Job_Wait(); - (void)vfprintf(stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - (void)fprintf(stderr, "\n"); - (void)fflush(stderr); + fprintf(stderr, "\n"); + fflush(stderr); if (DEBUG(GRAPH2)) Targ_PrintGraph(2); @@ -158,11 +158,11 @@ Punt(const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)fprintf(stderr, "make: "); - (void)vfprintf(stderr, fmt, ap); + fprintf(stderr, "make: "); + vfprintf(stderr, fmt, ap); va_end(ap); - (void)fprintf(stderr, "\n"); - (void)fflush(stderr); + fprintf(stderr, "\n"); + fflush(stderr); DieHorribly(); } @@ -201,6 +201,7 @@ DieHorribly(void) void Finish(int errors) { + Fatal("%d error%s", errors, errors == 1 ? "" : "s"); } @@ -215,7 +216,7 @@ emalloc(size_t len) if ((p = malloc(len)) == NULL) enomem(); - return(p); + return (p); } /* @@ -229,7 +230,7 @@ estrdup(const char *str) if ((p = strdup(str)) == NULL) enomem(); - return(p); + return (p); } /* @@ -239,9 +240,10 @@ estrdup(const char *str) void * erealloc(void *ptr, size_t size) { + if ((ptr = realloc(ptr, size)) == NULL) enomem(); - return(ptr); + return (ptr); } /* @@ -264,13 +266,13 @@ eunlink(const char *file) struct stat st; if (lstat(file, &st) == -1) - return -1; + return (-1); if (S_ISDIR(st.st_mode)) { errno = EISDIR; - return -1; + return (-1); } - return unlink(file); + return (unlink(file)); } /* @@ -280,6 +282,7 @@ eunlink(const char *file) int PrintAddr(void *a, void *b __unused) { + printf("%p ", a); - return 0; + return (0); } |