1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Use the new & improved printf rather than homegrown kludges.

Proposed by: bde
This commit is contained in:
Poul-Henning Kamp 1996-01-16 18:13:18 +00:00
parent ab29fc2265
commit 7c145fea92
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13469
3 changed files with 16 additions and 28 deletions

View File

@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
* $Id: si.c,v 1.32 1996/01/02 09:20:29 peter Exp $
* $Id: si.c,v 1.34 1996/01/09 03:01:45 peter Exp $
*/
#ifndef lint
@ -151,10 +151,6 @@ static struct tty *si_tty;
extern int si_dsize;
extern unsigned char si_download[];
#ifdef DEVFS
static char chardev[] = "0123456789abcdef";
#endif
struct si_softc {
int sc_type; /* adapter type */
char *sc_typename; /* adapter type string */
@ -705,19 +701,19 @@ siattach(id)
/* path name devsw minor type uid gid perm*/
for ( x = 0; x < sc->sc_nport; x++ ) {
y = x + 1; /* For sync with the manuals that start at 1 */
sprintf(name,"ttyA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttyA%02d", y);
sc->devfs_token[x].ttyd = devfs_add_devsw(
"/", name, &si_cdevsw, x,
DV_CHR, 0, 0, 0600);
sprintf(name,"cuaA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"cuaA%02d", y);
sc->devfs_token[x].cuaa = devfs_add_devsw(
"/", name, &si_cdevsw, x + 128,
DV_CHR, 0, 0, 0600);
sprintf(name,"ttyiA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttyiA%02d", y);
sc->devfs_token[x].ttyi = devfs_add_devsw(
"/", name, &si_cdevsw, x + 0x10000,
DV_CHR, 0, 0, 0600);
sprintf(name,"ttylA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttylA%02d", y);
sc->devfs_token[x].ttyl = devfs_add_devsw(
"/", name, &si_cdevsw, x + 0x20000,
DV_CHR, 0, 0, 0600);

View File

@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
* $Id: si.c,v 1.32 1996/01/02 09:20:29 peter Exp $
* $Id: si.c,v 1.34 1996/01/09 03:01:45 peter Exp $
*/
#ifndef lint
@ -151,10 +151,6 @@ static struct tty *si_tty;
extern int si_dsize;
extern unsigned char si_download[];
#ifdef DEVFS
static char chardev[] = "0123456789abcdef";
#endif
struct si_softc {
int sc_type; /* adapter type */
char *sc_typename; /* adapter type string */
@ -705,19 +701,19 @@ siattach(id)
/* path name devsw minor type uid gid perm*/
for ( x = 0; x < sc->sc_nport; x++ ) {
y = x + 1; /* For sync with the manuals that start at 1 */
sprintf(name,"ttyA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttyA%02d", y);
sc->devfs_token[x].ttyd = devfs_add_devsw(
"/", name, &si_cdevsw, x,
DV_CHR, 0, 0, 0600);
sprintf(name,"cuaA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"cuaA%02d", y);
sc->devfs_token[x].cuaa = devfs_add_devsw(
"/", name, &si_cdevsw, x + 128,
DV_CHR, 0, 0, 0600);
sprintf(name,"ttyiA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttyiA%02d", y);
sc->devfs_token[x].ttyi = devfs_add_devsw(
"/", name, &si_cdevsw, x + 0x10000,
DV_CHR, 0, 0, 0600);
sprintf(name,"ttylA%c%c", chardev[y / 10], chardev[y % 10]);
sprintf(name,"ttylA%02d", y);
sc->devfs_token[x].ttyl = devfs_add_devsw(
"/", name, &si_cdevsw, x + 0x20000,
DV_CHR, 0, 0, 0600);

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
* $Id: wd.c,v 1.100 1995/12/11 04:55:45 dyson Exp $
* $Id: wd.c,v 1.101 1995/12/11 05:02:40 dyson Exp $
*/
/* TODO:
@ -471,18 +471,14 @@ wdattach(struct isa_device *dvp)
((dvp->id_flags) >> (16 * unit));
if (wdgetctlr(du) == 0) {
char buf[sizeof du->dk_params.wdp_model + 1];
/*
* Print out description of drive.
* wdp_model may not be null terminated, and printf
* doesn't support "%.*s" :-(, so copy wdp_model
* and add a null before printing.
* wdp_model may not be null terminated.
*/
bcopy(du->dk_params.wdp_model, buf, sizeof buf - 1);
buf[sizeof buf - 1] = '\0';
printf("wdc%d: unit %d (wd%d): <%s>",
dvp->id_unit, unit, lunit, buf);
printf("wdc%d: unit %d (wd%d): <%.*s>",
dvp->id_unit, unit, lunit,
sizeof du->dk_params.wdp_model,
du->dk_params.wdp_model);
if (du->dk_flags & DKFL_32BIT)
printf(", 32-bit");
if (du->dk_multi > 1)