Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/stand/boot KNF & notably, use u_int rather tha...
details: https://anonhg.NetBSD.org/src/rev/ab166a3a73ea
branches: trunk
changeset: 582058:ab166a3a73ea
user: junyoung <junyoung%NetBSD.org@localhost>
date: Wed Jun 15 08:03:07 2005 +0000
description:
KNF & notably, use u_int rather than unsigned int for now for consistency.
This should be reversed eventually...
diffstat:
sys/arch/i386/stand/boot/boot2.c | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diffs (121 lines):
diff -r a5ba7b40c031 -r ab166a3a73ea sys/arch/i386/stand/boot/boot2.c
--- a/sys/arch/i386/stand/boot/boot2.c Wed Jun 15 07:29:20 2005 +0000
+++ b/sys/arch/i386/stand/boot/boot2.c Wed Jun 15 08:03:07 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot2.c,v 1.5 2004/11/25 08:30:52 christos Exp $ */
+/* $NetBSD: boot2.c,v 1.6 2005/06/15 08:03:07 junyoung Exp $ */
/*
* Copyright (c) 2003
@@ -86,7 +86,7 @@
char *sprint_bootsel(const char *);
void bootit(const char *, int, int);
void print_banner(void);
-void boot2(uint32_t, uint32_t);
+void boot2(u_int, u_int);
void command_help(char *);
void command_ls(char *);
@@ -108,7 +108,7 @@
int
parsebootfile(const char *fname, char **fsname, char **devname,
- u_int *unit, u_int *partition, const char **file)
+ u_int *unit, u_int *partition, const char **file)
{
const char *col;
@@ -124,16 +124,16 @@
if((col = strchr(fname, ':'))) { /* device given */
static char savedevname[MAXDEVNAME+1];
int devlen;
- unsigned int u = 0, p = 0;
+ u_int u = 0, p = 0;
int i = 0;
devlen = col - fname;
if (devlen > MAXDEVNAME)
- return(EINVAL);
+ return EINVAL;
#define isvalidname(c) ((c) >= 'a' && (c) <= 'z')
if (!isvalidname(fname[i]))
- return(EINVAL);
+ return EINVAL;
do {
savedevname[i] = fname[i];
i++;
@@ -143,7 +143,7 @@
#define isnum(c) ((c) >= '0' && (c) <= '9')
if (i < devlen) {
if (!isnum(fname[i]))
- return(EUNIT);
+ return EUNIT;
do {
u *= 10;
u += fname[i++] - '0';
@@ -153,12 +153,12 @@
#define isvalidpart(c) ((c) >= 'a' && (c) <= 'z')
if (i < devlen) {
if (!isvalidpart(fname[i]))
- return(EPART);
+ return EPART;
p = fname[i++] - 'a';
}
if (i != devlen)
- return(ENXIO);
+ return ENXIO;
*devname = savedevname;
*unit = u;
@@ -169,7 +169,7 @@
if (*fname)
*file = fname;
- return(0);
+ return 0;
}
char *
@@ -183,9 +183,9 @@
if (parsebootfile(filename, &fsname, &devname, &unit,
&partition, &file) == 0) {
sprintf(buf, "%s%d%c:%s", devname, unit, 'a' + partition, file);
- return(buf);
+ return buf;
}
- return("(invalid)");
+ return "(invalid)";
}
void
@@ -216,9 +216,8 @@
printf(">> Memory: %d/%d k\n", getbasemem(), getextmem());
}
-
void
-boot2(uint32_t boot_biosdev, uint32_t boot_biossector)
+boot2(u_int boot_biosdev, u_int boot_biossector)
{
int currname;
char c;
@@ -237,7 +236,7 @@
/* try to set default device to what BIOS tells us */
bios2dev(boot_biosdev, &default_devname, &default_unit,
- boot_biossector, &default_partition);
+ boot_biossector, &default_partition);
/* if the user types "boot" without filename */
default_filename = DEFFILENAME;
@@ -363,7 +362,7 @@
const struct cons_devs *cdp;
for (cdp = cons_devs; cdp->name; cdp++) {
- if (!strcmp(arg, cdp->name)) {
+ if (strcmp(arg, cdp->name) == 0) {
initio(cdp->tag);
print_banner();
return;
Home |
Main Index |
Thread Index |
Old Index