summaryrefslogtreecommitdiffstats
path: root/usr.bin/xlint/lint1
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-07-19 16:38:21 +0000
committermarkm <markm@FreeBSD.org>2002-07-19 16:38:21 +0000
commitd283bf5723a71bac53d4cbb55184ce60003ec349 (patch)
tree85465d27447276bbeb41537ce1470518f1ecb31b /usr.bin/xlint/lint1
parent77c14873f425e4be86a67aab8201b85866f564b1 (diff)
downloadFreeBSD-src-d283bf5723a71bac53d4cbb55184ce60003ec349.zip
FreeBSD-src-d283bf5723a71bac53d4cbb55184ce60003ec349.tar.gz
Merge conflicts.
Diffstat (limited to 'usr.bin/xlint/lint1')
-rw-r--r--usr.bin/xlint/lint1/err.c26
-rw-r--r--usr.bin/xlint/lint1/mem1.c11
2 files changed, 22 insertions, 15 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;
OpenPOWER on IntegriCloud