Module Name:    src
Committed By:   njoly
Date:           Wed Jul 27 15:08:43 UTC 2011

Modified Files:
        src/sys/arch/alpha/alpha: autoconf.c

Log Message:
Make atoi() use strtoll from libkern.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/alpha/alpha/autoconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/alpha/autoconf.c
diff -u src/sys/arch/alpha/alpha/autoconf.c:1.49 src/sys/arch/alpha/alpha/autoconf.c:1.50
--- src/sys/arch/alpha/alpha/autoconf.c:1.49	Tue Jul 26 14:59:03 2011
+++ src/sys/arch/alpha/alpha/autoconf.c	Wed Jul 27 15:08:42 2011
@@ -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

Reply via email to