diff options
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); } |