Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint lint: use 'char' as type for passing character...
details: https://anonhg.NetBSD.org/src/rev/18c02a89a3c4
branches: trunk
changeset: 1023358:18c02a89a3c4
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Sep 04 14:26:32 2021 +0000
description:
lint: use 'char' as type for passing characters to functions
No functional change.
diffstat:
usr.bin/xlint/common/emit.c | 16 ++++++++--------
usr.bin/xlint/common/externs.h | 6 +++---
usr.bin/xlint/lint1/emit1.c | 6 +++---
usr.bin/xlint/lint2/emit2.c | 7 ++++---
4 files changed, 18 insertions(+), 17 deletions(-)
diffs (130 lines):
diff -r e2cb4e32d023 -r 18c02a89a3c4 usr.bin/xlint/common/emit.c
--- a/usr.bin/xlint/common/emit.c Sat Sep 04 14:07:51 2021 +0000
+++ b/usr.bin/xlint/common/emit.c Sat Sep 04 14:26:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit.c,v 1.13 2021/08/22 15:06:49 rillig Exp $ */
+/* $NetBSD: emit.c,v 1.14 2021/09/04 14:26:32 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit.c,v 1.13 2021/08/22 15:06:49 rillig Exp $");
+__RCSID("$NetBSD: emit.c,v 1.14 2021/09/04 14:26:32 rillig Exp $");
#endif
#include <stdio.h>
@@ -123,12 +123,12 @@
* write a character to the output buffer
*/
void
-outchar(int c)
+outchar(char c)
{
if (ob.o_next == ob.o_end)
outxbuf();
- *ob.o_next++ = (char)c;
+ *ob.o_next++ = c;
}
#if defined(IS_LINT1)
@@ -136,7 +136,7 @@
* write a character to the output buffer, quoted if necessary
*/
void
-outqchar(int c)
+outqchar(char c)
{
if (ch_isprint(c) && c != '\\' && c != '"' && c != '\'') {
@@ -175,9 +175,9 @@
outchar('a');
break;
default:
- outchar((((unsigned char)c >> 6) & 07) + '0');
- outchar((((unsigned char)c >> 3) & 07) + '0');
- outchar((c & 07) + '0');
+ outchar((char)((((unsigned char)c >> 6) & 07) + '0'));
+ outchar((char)((((unsigned char)c >> 3) & 07) + '0'));
+ outchar((char)((c & 07) + '0'));
break;
}
}
diff -r e2cb4e32d023 -r 18c02a89a3c4 usr.bin/xlint/common/externs.h
--- a/usr.bin/xlint/common/externs.h Sat Sep 04 14:07:51 2021 +0000
+++ b/usr.bin/xlint/common/externs.h Sat Sep 04 14:26:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs.h,v 1.21 2021/08/31 17:22:24 rillig Exp $ */
+/* $NetBSD: externs.h,v 1.22 2021/09/04 14:26:32 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -61,8 +61,8 @@
extern void outopen(const char *);
extern void outclose(void);
extern void outclr(void);
-extern void outchar(int);
-extern void outqchar(int);
+extern void outchar(char);
+extern void outqchar(char);
extern void outstrg(const char *);
extern void outint(int);
#define outname(a) outname1(__FILE__, __LINE__, a);
diff -r e2cb4e32d023 -r 18c02a89a3c4 usr.bin/xlint/lint1/emit1.c
--- a/usr.bin/xlint/lint1/emit1.c Sat Sep 04 14:07:51 2021 +0000
+++ b/usr.bin/xlint/lint1/emit1.c Sat Sep 04 14:26:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.54 2021/09/02 07:04:41 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.55 2021/09/04 14:26:32 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.54 2021/09/02 07:04:41 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.55 2021/09/04 14:26:32 rillig Exp $");
#endif
#include "lint1.h"
@@ -413,7 +413,7 @@
}
/* return value discarded/used/ignored */
- outchar(rvdisc ? 'd' : (rvused ? 'u' : 'i'));
+ outchar((char)(rvdisc ? 'd' : (rvused ? 'u' : 'i')));
/* name of the called function */
outname(tn->tn_left->tn_left->tn_sym->s_name);
diff -r e2cb4e32d023 -r 18c02a89a3c4 usr.bin/xlint/lint2/emit2.c
--- a/usr.bin/xlint/lint2/emit2.c Sat Sep 04 14:07:51 2021 +0000
+++ b/usr.bin/xlint/lint2/emit2.c Sat Sep 04 14:26:32 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emit2.c,v 1.23 2021/08/29 10:13:02 rillig Exp $ */
+/* $NetBSD: emit2.c,v 1.24 2021/09/04 14:26:32 rillig 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: emit2.c,v 1.23 2021/08/29 10:13:02 rillig Exp $");
+__RCSID("$NetBSD: emit2.c,v 1.24 2021/09/04 14:26:32 rillig Exp $");
#endif
#include "lint2.h"
@@ -50,7 +50,8 @@
static void
outtype(type_t *tp)
{
- int t, s, na;
+ char t, s;
+ int na;
tspec_t ts;
type_t **ap;
Home |
Main Index |
Thread Index |
Old Index