summaryrefslogtreecommitdiff
path: root/usr/src/lib/libbc/libc/gen/common/atoi.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libbc/libc/gen/common/atoi.c')
-rw-r--r--usr/src/lib/libbc/libc/gen/common/atoi.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/usr/src/lib/libbc/libc/gen/common/atoi.c b/usr/src/lib/libbc/libc/gen/common/atoi.c
deleted file mode 100644
index 0ace01d68b..0000000000
--- a/usr/src/lib/libbc/libc/gen/common/atoi.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/* Copyright (c) 1984 AT&T */
-/* All Rights Reserved */
-
-#pragma ident "%Z%%M% %I% %E% SMI" /* from S5R2 2.1 */
-
-/*LINTLIBRARY*/
-#include <ctype.h>
-
-#define ATOI
-
-#ifdef ATOI
-typedef int TYPE;
-#define NAME atoi
-#else
-typedef long TYPE;
-#define NAME atol
-#endif
-
-TYPE
-NAME(p)
-register char *p;
-{
- register TYPE n;
- register int c, neg = 0;
-
- if (!isdigit(c = *p)) {
- while (isspace(c))
- c = *++p;
- switch (c) {
- case '-':
- neg++;
- case '+': /* fall-through */
- c = *++p;
- }
- if (!isdigit(c))
- return (0);
- }
- for (n = '0' - c; isdigit(c = *++p); ) {
- n *= 10; /* two steps to avoid unnecessary overflow */
- n += '0' - c; /* accum neg to avoid surprises at MAX */
- }
- return (neg ? n : -n);
-}