Module Name: src Committed By: rillig Date: Sat Sep 4 14:26:32 UTC 2021
Modified Files: src/usr.bin/xlint/common: emit.c externs.h src/usr.bin/xlint/lint1: emit1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: use 'char' as type for passing characters to functions No functional change. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.bin/xlint/common/emit.c cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/common/externs.h cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/lint2/emit2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/common/emit.c diff -u src/usr.bin/xlint/common/emit.c:1.13 src/usr.bin/xlint/common/emit.c:1.14 --- src/usr.bin/xlint/common/emit.c:1.13 Sun Aug 22 15:06:49 2021 +++ src/usr.bin/xlint/common/emit.c Sat Sep 4 14:26:32 2021 @@ -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 @@ outclr(void) * 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 @@ outchar(int c) * 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 @@ outqchar(int c) 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; } } Index: src/usr.bin/xlint/common/externs.h diff -u src/usr.bin/xlint/common/externs.h:1.21 src/usr.bin/xlint/common/externs.h:1.22 --- src/usr.bin/xlint/common/externs.h:1.21 Tue Aug 31 17:22:24 2021 +++ src/usr.bin/xlint/common/externs.h Sat Sep 4 14:26:32 2021 @@ -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 ob_t ob; 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); Index: src/usr.bin/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.54 src/usr.bin/xlint/lint1/emit1.c:1.55 --- src/usr.bin/xlint/lint1/emit1.c:1.54 Thu Sep 2 07:04:41 2021 +++ src/usr.bin/xlint/lint1/emit1.c Sat Sep 4 14:26:32 2021 @@ -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 @@ outcall(const tnode_t *tn, bool rvused, } /* 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); Index: src/usr.bin/xlint/lint2/emit2.c diff -u src/usr.bin/xlint/lint2/emit2.c:1.23 src/usr.bin/xlint/lint2/emit2.c:1.24 --- src/usr.bin/xlint/lint2/emit2.c:1.23 Sun Aug 29 10:13:02 2021 +++ src/usr.bin/xlint/lint2/emit2.c Sat Sep 4 14:26:32 2021 @@ -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 outfiles(void); static void outtype(type_t *tp) { - int t, s, na; + char t, s; + int na; tspec_t ts; type_t **ap;