@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.49 2011/07/26 14:59:03 njoly Exp $ */
+/* $NetBSD: autoconf.c,v 1.50 2011/07/27 15:08:42 njoly Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.49 2011/07/26 14:59:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.50 2011/07/27 15:08:42 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,7 +63,7 @@
struct bootdev_data *bootdev_data;
void parse_prom_bootdev(void);
-static int atoi(const char *);
+static inline int atoi(const char *);
/*
* cpu_configure:
@@ -163,28 +163,10 @@
bootdev_data = &bd;
}
-static int
+static inline int
atoi(const char *s)
{
- int n, neg;
-
- n = 0;
- neg = 0;
-
- while (*s == '-') {
- s++;
- neg = !neg;
- }
-
- while (*s != '\0') {
- if (*s < '0' && *s > '9')
- break;
-
- n = (10 * n) + (*s - '0');
- s++;
- }
-
- return (neg ? -n : n);
+ return (int)strtoll(s, NULL, 10);
}
void