diff options
author | markm <markm@FreeBSD.org> | 2002-07-19 16:38:21 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2002-07-19 16:38:21 +0000 |
commit | d283bf5723a71bac53d4cbb55184ce60003ec349 (patch) | |
tree | 85465d27447276bbeb41537ce1470518f1ecb31b | |
parent | 77c14873f425e4be86a67aab8201b85866f564b1 (diff) | |
download | FreeBSD-src-d283bf5723a71bac53d4cbb55184ce60003ec349.zip FreeBSD-src-d283bf5723a71bac53d4cbb55184ce60003ec349.tar.gz |
Merge conflicts.
-rw-r--r-- | usr.bin/xlint/lint1/err.c | 26 | ||||
-rw-r--r-- | usr.bin/xlint/lint1/mem1.c | 11 | ||||
-rw-r--r-- | usr.bin/xlint/xlint/lint.1 | 18 | ||||
-rw-r--r-- | usr.bin/xlint/xlint/xlint.c | 37 |
4 files changed, 50 insertions, 42 deletions
diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index 9dd804d..5c56638 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.16 2001/12/13 23:56:00 augustss Exp $ */ +/* $NetBSD: err.c,v 1.17 2002/01/31 19:36:54 tv Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -33,7 +33,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: err.c,v 1.16 2001/12/13 23:56:00 augustss Exp $"); +__RCSID("$NetBSD: err.c,v 1.17 2002/01/31 19:36:54 tv Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -50,7 +50,7 @@ int nerr; int sytxerr; -static const char *basename(const char *); +static const char *lbasename(const char *); static void verror(int, va_list); static void vwarning(int, va_list); @@ -384,11 +384,11 @@ msglist(void) } /* - * If Fflag is not set basename() returns a pointer to the last + * If Fflag is not set lbasename() returns a pointer to the last * component of the path, otherwise it returns the argument. */ static const char * -basename(const char *path) +lbasename(const char *path) { const char *cp, *cp1, *cp2; @@ -413,8 +413,8 @@ verror( int n, va_list ap) if (ERR_ISSET(n, &msgset)) return; - fn = basename(curr_pos.p_file); - (void)printf("%s:%d: ", fn, curr_pos.p_line); + fn = lbasename(curr_pos.p_file); + (void)printf("%s(%d): ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf(" [%d]\n", n); nerr++; @@ -432,8 +432,8 @@ vwarning( int n, va_list ap) /* this warning is suppressed by a LINTED comment */ return; - fn = basename(curr_pos.p_file); - (void)printf("%s:%d: warning: ", fn, curr_pos.p_line); + fn = lbasename(curr_pos.p_file); + (void)printf("%s(%d): warning: ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf(" [%d]\n", n); if (wflag) @@ -457,8 +457,8 @@ lerror(const char *msg, ...) const char *fn; va_start(ap, msg); - fn = basename(curr_pos.p_file); - (void)fprintf(stderr, "%s:%d: lint error: ", fn, curr_pos.p_line); + fn = lbasename(curr_pos.p_file); + (void)fprintf(stderr, "%s(%d): lint error: ", fn, curr_pos.p_line); (void)vfprintf(stderr, msg, ap); (void)fprintf(stderr, "\n"); va_end(ap); @@ -485,8 +485,8 @@ message(int n, ...) return; va_start(ap, n); - fn = basename(curr_pos.p_file); - (void)printf("%s:%d: ", fn, curr_pos.p_line); + fn = lbasename(curr_pos.p_file); + (void)printf("%s(%d): ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); (void)printf(" [%d]\n", n); va_end(ap); diff --git a/usr.bin/xlint/lint1/mem1.c b/usr.bin/xlint/lint1/mem1.c index 0a5a879..7a13e7e 100644 --- a/usr.bin/xlint/lint1/mem1.c +++ b/usr.bin/xlint/lint1/mem1.c @@ -1,4 +1,4 @@ -/* $NetBSD: mem1.c,v 1.6 2002/01/29 02:43:39 tv Exp $ */ +/* $NetBSD: mem1.c,v 1.7 2002/01/31 19:36:54 tv Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -33,7 +33,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem1.c,v 1.6 2002/01/29 02:43:39 tv Exp $"); +__RCSID("$NetBSD: mem1.c,v 1.7 2002/01/31 19:36:54 tv Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -200,11 +200,18 @@ xgetblk(mbl_t **mbp, size_t s) { mbl_t *mb; void *p; + size_t t = 0; s = ALIGN(s); if ((mb = *mbp) == NULL || mb->nfree < s) { if ((mb = frmblks) == NULL) { + if (s > mblklen) { + t = mblklen; + mblklen = s; + } mb = xnewblk(); + if (t) + mblklen = t; (void)memset(mb->blk, 0, mb->size); } else { frmblks = mb->nxt; diff --git a/usr.bin/xlint/xlint/lint.1 b/usr.bin/xlint/xlint/lint.1 index 182eddd..13efe22 100644 --- a/usr.bin/xlint/xlint/lint.1 +++ b/usr.bin/xlint/xlint/lint.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: lint.1,v 1.20 2001/12/08 19:27:56 wiz Exp $ +.\" $NetBSD: lint.1,v 1.21 2002/01/03 04:25:18 thorpej Exp $ .\" .\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. .\" Copyright (c) 1994, 1995 Jochen Pohl @@ -278,15 +278,15 @@ not allowed in traditional C. Warnings for constructs which behave differently in traditional C and ANSI C are suppressed. Preprocessor -macros describing the machine type (e.g., -.Dv sun3 ) -and machine architecture (e.g., -.Dv m68k ) -are defined without leading and trailing underscores. -The keywords -.Ic const , volatile +macros describing the machine type (e.g. +.Li sun3 ) +and machine architecture (e.g. +.Li m68k ) +are defined without leading and trailing underscores. The keywords +.Sy const , +.Sy volatile and -.Ic signed +.Sy signed are not available in traditional C mode (although the alternative keywords with leading underscores still are). .It Fl u diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 80e5cf7..a694ff4 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -1,4 +1,4 @@ -/* $NetBSD: xlint.c,v 1.26 2002/01/22 01:14:03 thorpej Exp $ */ +/* $NetBSD: xlint.c,v 1.27 2002/01/31 19:09:33 tv Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -34,7 +34,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.26 2002/01/22 01:14:03 thorpej Exp $"); +__RCSID("$NetBSD: xlint.c,v 1.27 2002/01/31 19:09:33 tv Exp $"); #endif __FBSDID("$FreeBSD$"); @@ -54,6 +54,8 @@ __FBSDID("$FreeBSD$"); #include "lint.h" #include "pathnames.h" +#define DEFAULT_PATH _PATH_DEFPATH + int main(int, char *[]); /* directory for temporary files */ @@ -581,7 +583,7 @@ static void fname(const char *name) { const char *bn, *suff; - char **args, *ofn, *path; + char **args, *ofn, *pathname, *CC; size_t len; int is_stdin; int fd; @@ -639,13 +641,12 @@ fname(const char *name) /* run cc */ if (getenv("CC") == NULL) { - path = xmalloc(strlen(PATH_USRBIN) + sizeof ("/cc")); - (void)sprintf(path, "%s/cc", PATH_USRBIN); - } else { - path = strdup(getenv("CC")); - } + pathname = xmalloc(strlen(PATH_USRBIN) + sizeof ("/cc")); + (void)sprintf(pathname, "%s/cc", PATH_USRBIN); + } else + pathname = strdup(getenv("CC")); - appcstrg(&args, path); + appcstrg(&args, pathname); applst(&args, cflags); applst(&args, lcflags); appcstrg(&args, name); @@ -660,33 +661,33 @@ fname(const char *name) terminate(-1); } - runchild(path, args, cppout, cppoutfd); - free(path); + runchild(pathname, args, cppout, cppoutfd); + free(pathname); freelst(&args); /* run lint1 */ if (!Bflag) { - path = xmalloc(strlen(PATH_LIBEXEC) + sizeof ("/lint1") + + pathname = xmalloc(strlen(PATH_LIBEXEC) + sizeof ("/lint1") + strlen(target_prefix)); - (void)sprintf(path, "%s/%slint1", PATH_LIBEXEC, + (void)sprintf(pathname, "%s/%slint1", PATH_LIBEXEC, target_prefix); } else { /* * XXX Unclear whether we should be using target_prefix * XXX here. --thorpej@wasabisystems.com */ - path = xmalloc(strlen(libexec_path) + sizeof ("/lint1")); - (void)sprintf(path, "%s/lint1", libexec_path); + pathname = xmalloc(strlen(libexec_path) + sizeof ("/lint1")); + (void)sprintf(pathname, "%s/lint1", libexec_path); } - appcstrg(&args, path); + appcstrg(&args, pathname); applst(&args, l1flags); appcstrg(&args, cppout); appcstrg(&args, ofn); - runchild(path, args, ofn, -1); - free(path); + runchild(pathname, args, ofn, -1); + free(pathname); freelst(&args); appcstrg(&p2in, ofn); |