diff options
author | Roger Leigh <rleigh@codelibre.net> | 2021-01-31 21:13:48 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@codelibre.net> | 2021-01-31 21:13:48 +0000 |
commit | a8d63da69ee41a48d01c756b134939dd080e279a (patch) | |
tree | d230f8a09074cbafaafe0b16911b5ca89f994bf9 | |
parent | 8ac5d3bb77f7e9b0325465ba04ad5f5bb9bea925 (diff) | |
download | libtiff-git-a8d63da69ee41a48d01c756b134939dd080e279a.tar.gz |
Use C99 strtol, strtoul, strtoll and strtoull
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | libtiff/tif_config.h.cmake.in | 12 | ||||
-rw-r--r-- | libtiff/tif_config.vc.h | 6 | ||||
-rw-r--r-- | nmake.opt | 4 | ||||
-rwxr-xr-x | port/CMakeLists.txt | 17 | ||||
-rw-r--r-- | port/Makefile.am | 4 | ||||
-rw-r--r-- | port/Makefile.vc | 38 | ||||
-rw-r--r-- | port/_strtol.h | 160 | ||||
-rw-r--r-- | port/_strtoul.h | 127 | ||||
-rw-r--r-- | port/libport.h | 13 | ||||
-rw-r--r-- | port/strtol.c | 45 | ||||
-rw-r--r-- | port/strtoll.c | 44 | ||||
-rw-r--r-- | port/strtoul.c | 44 | ||||
-rw-r--r-- | port/strtoull.c | 44 |
15 files changed, 2 insertions, 564 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a939c95..58b7e627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,10 +302,6 @@ report_values(TIFF_SSIZE_T) check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP) check_symbol_exists(setmode "unistd.h" HAVE_SETMODE) check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) -check_symbol_exists(strtol "stdlib.h" HAVE_STRTOL) -check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL) -check_symbol_exists(strtoul "stdlib.h" HAVE_STRTOUL) -check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL) check_symbol_exists(getopt "unistd.h;stdio.h" HAVE_GETOPT) if(NOT HAVE_SNPRINTF) diff --git a/configure.ac b/configure.ac index e84cbf6b..75b8f470 100644 --- a/configure.ac +++ b/configure.ac @@ -243,10 +243,6 @@ AC_CHECK_FUNCS([mmap setmode snprintf]) dnl Will use local replacements for unavailable functions AC_REPLACE_FUNCS(getopt) AC_REPLACE_FUNCS(snprintf) -AC_REPLACE_FUNCS(strtol) -AC_REPLACE_FUNCS(strtoll) -AC_REPLACE_FUNCS(strtoul) -AC_REPLACE_FUNCS(strtoull) dnl --------------------------------------------------------------------------- dnl Check the native cpu bit order. diff --git a/libtiff/tif_config.h.cmake.in b/libtiff/tif_config.h.cmake.in index dedc1675..00e051a9 100644 --- a/libtiff/tif_config.h.cmake.in +++ b/libtiff/tif_config.h.cmake.in @@ -65,18 +65,6 @@ /* Define to 1 if you have the <strings.h> header file. */ #cmakedefine HAVE_STRINGS_H 1 -/* Define to 1 if you have the `strtol' function. */ -#cmakedefine HAVE_STRTOL 1 - -/* Define to 1 if you have the `strtoll' function. */ -#cmakedefine HAVE_STRTOLL 1 - -/* Define to 1 if you have the `strtoul' function. */ -#cmakedefine HAVE_STRTOUL 1 - -/* Define to 1 if you have the `strtoull' function. */ -#cmakedefine HAVE_STRTOULL 1 - /* Define to 1 if you have the <sys/time.h> header file. */ #cmakedefine HAVE_SYS_TIME_H 1 diff --git a/libtiff/tif_config.vc.h b/libtiff/tif_config.vc.h index 84b650da..023c9641 100644 --- a/libtiff/tif_config.vc.h +++ b/libtiff/tif_config.vc.h @@ -71,12 +71,6 @@ # else # define HAVE_SNPRINTF 1 # endif -# define HAVE_STRTOL 1 -# define HAVE_STRTOUL 1 -# if _MSC_VER >= 1900 /* Visual Studio 2015 added strtoll/strtoull */ -# define HAVE_STRTOLL 1 -# define HAVE_STRTOULL 1 -# endif #endif /* Define to 1 if your processor stores words with the most significant byte @@ -110,10 +110,6 @@ CHECK_JPEG_YCBCR_SUBSAMPLING = 1 # -# Indicate if the compiler provides strtoll/strtoull (default 1) -# Users of MSVC++ 14.0 ("Visual Studio 2015") and later should set this to 1 -HAVE_STRTOLL = 1 - # # Pick debug or optimized build flags. We default to an optimized build # with no debugging information. diff --git a/port/CMakeLists.txt b/port/CMakeLists.txt index 80dd43c5..5073a70e 100755 --- a/port/CMakeLists.txt +++ b/port/CMakeLists.txt @@ -26,10 +26,7 @@ set(port_HEADERS libport.h) set(port_SOURCES dummy.c) set(port_optional_SOURCES getopt.c - strtol.c - strtoll.c - strtoul.c - strtoull.c) +) set(port_USED_FILES ${port_SOURCES} ${port_HEADERS}) @@ -39,18 +36,6 @@ endif() if(MSVC AND NOT HAVE_SNPRINTF) list(APPEND port_USED_FILES snprintf.c) endif() -if(NOT HAVE_STRTOL) - list(APPEND port_USED_FILES strtol.c) -endif() -if(NOT HAVE_STRTOLL) - list(APPEND port_USED_FILES strtoll.c) -endif() -if(NOT HAVE_STRTOUL) - list(APPEND port_USED_FILES strtoul.c) -endif() -if(NOT HAVE_STRTOULL) - list(APPEND port_USED_FILES strtoull.c) -endif() add_library(port STATIC ${port_USED_FILES}) diff --git a/port/Makefile.am b/port/Makefile.am index 250479fe..4d6e11d0 100644 --- a/port/Makefile.am +++ b/port/Makefile.am @@ -27,9 +27,7 @@ EXTRA_DIST = \ CMakeLists.txt \ Makefile.vc \ libport.h \ - snprintf.c \ - _strtol.h \ - _strtoul.h + snprintf.c noinst_LTLIBRARIES = libport.la libport_la_SOURCES = dummy.c libport.h diff --git a/port/Makefile.vc b/port/Makefile.vc index 83d47e71..880079d5 100644 --- a/port/Makefile.vc +++ b/port/Makefile.vc @@ -27,48 +27,10 @@ !INCLUDE ..\nmake.opt -HAVE_STRTOL = 1 -HAVE_STRTOUL = 1 - -# strtoul()/strtoull() are provided together -!IF $(HAVE_STRTOLL) -HAVE_STRTOULL = 1 -!ELSE -HAVE_STRTOULL = 0 -!endif - -!IF $(HAVE_STRTOL) -STRTOL_OBJ = -!ELSE -STRTOL_OBJ = strtol.obj -!ENDIF - -!IF $(HAVE_STRTOUL) -STRTOUL_OBJ = -!ELSE -STRTOUL_OBJ = strtoul.obj -!ENDIF - -!IF $(HAVE_STRTOLL) -STRTOLL_OBJ = -!ELSE -STRTOLL_OBJ = strtoll.obj -!ENDIF - -!IF $(HAVE_STRTOULL) -STRTOULL_OBJ = -!ELSE -STRTOULL_OBJ = strtoull.obj -!ENDIF - INCL = -I..\libtiff OBJ = \ snprintf.obj \ - $(STRTOL_OBJ) \ - $(STRTOUL_OBJ) \ - $(STRTOLL_OBJ) \ - $(STRTOULL_OBJ) \ getopt.obj all: libport.lib diff --git a/port/_strtol.h b/port/_strtol.h deleted file mode 100644 index 73a10063..00000000 --- a/port/_strtol.h +++ /dev/null @@ -1,160 +0,0 @@ -/* $NetBSD: _strtol.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */ - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Original version ID: - * NetBSD: src/lib/libc/locale/_wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp - */ - -#include <assert.h> - -/* - * function template for strtol, strtoll and strtoimax. - * - * parameters: - * _FUNCNAME : function name - * __INT : return type - * __INT_MIN : lower limit of the return type - * __INT_MAX : upper limit of the return type - */ -__INT -_FUNCNAME(const char *nptr, char **endptr, int base) -{ - const char *s; - __INT acc, cutoff; - unsigned char c; - int i, neg, any, cutlim; - - assert(nptr != NULL); - /* endptr may be NULL */ - - /* check base value */ - if (base && (base < 2 || base > 36)) { - errno = EINVAL; - if (endptr != NULL) - /* LINTED interface specification */ - *endptr = (char *)(nptr); - return 0; - } - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - s = nptr; - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else { - neg = 0; - if (c == '+') - c = *s++; - } - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X') && - ((s[1] >= '0' && s[1] <= '9') || - (s[1] >= 'a' && s[1] <= 'f') || - (s[1] >= 'A' && s[1] <= 'F'))) { - c = s[1]; - s += 2; - base = 16; - } else if (base == 0) - base = (c == '0' ? 8 : 10); - - /* - * Compute the cutoff value between legal numbers and illegal - * numbers. That is the largest legal value, divided by the - * base. An input number that is greater than this value, if - * followed by a legal input character, is too big. One that - * is equal to this value may be valid or not; the limit - * between valid and invalid numbers is then based on the last - * digit. For instance, if the range for longs is - * [-2147483648..2147483647] and the input base is 10, - * cutoff will be set to 214748364 and cutlim to either - * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated - * a value > 214748364, or equal but the next digit is > 7 (or 8), - * the number is too big, and we will return a range error. - * - * Set any if any `digits' consumed; make it negative to indicate - * overflow. - */ - cutoff = (__INT)(neg ? __INT_MIN : __INT_MAX); - cutlim = (int)(cutoff % base); - cutoff /= base; - if (neg) { - if (cutlim > 0) { - cutlim -= base; - cutoff += 1; - } - cutlim = -cutlim; - } - for (acc = 0, any = 0;; c = *s++) { - if (c >= '0' && c <= '9') - i = c - '0'; - else if (c >= 'a' && c <= 'z') - i = (c - 'a') + 10; - else if (c >= 'A' && c <= 'Z') - i = (c - 'A') + 10; - else - break; - if (i >= base) - break; - if (any < 0) - continue; - if (neg) { - if (acc < cutoff || (acc == cutoff && i > cutlim)) { - acc = __INT_MIN; - any = -1; - errno = ERANGE; - } else { - any = 1; - acc *= base; - acc -= i; - } - } else { - if (acc > cutoff || (acc == cutoff && i > cutlim)) { - acc = __INT_MAX; - any = -1; - errno = ERANGE; - } else { - any = 1; - acc *= base; - acc += i; - } - } - } - if (endptr != NULL) - /* LINTED interface specification */ - *endptr = (char *)(any ? s - 1 : nptr); - return(acc); -} diff --git a/port/_strtoul.h b/port/_strtoul.h deleted file mode 100644 index 5cb62168..00000000 --- a/port/_strtoul.h +++ /dev/null @@ -1,127 +0,0 @@ -/* $NetBSD: _strtoul.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */ - -/*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Original version ID: - * NetBSD: src/lib/libc/locale/_wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp - */ - -#include <assert.h> - -/* - * function template for strtoul, strtoull and strtoumax. - * - * parameters: - * _FUNCNAME : function name - * __UINT : return type - * __UINT_MAX : upper limit of the return type - */ -__UINT -_FUNCNAME(const char *nptr, char **endptr, int base) -{ - const char *s; - __UINT acc, cutoff; - unsigned char c; - int i, neg, any, cutlim; - - assert(nptr != NULL); - /* endptr may be NULL */ - - /* check base value */ - if (base && (base < 2 || base > 36)) { - errno = EINVAL; - if (endptr != NULL) - /* LINTED interface specification */ - *endptr = (char *)(nptr); - return 0; - } - - /* - * Skip white space and pick up leading +/- sign if any. - * If base is 0, allow 0x for hex and 0 for octal, else - * assume decimal; if base is already 16, allow 0x. - */ - s = nptr; - do { - c = *s++; - } while (isspace(c)); - if (c == '-') { - neg = 1; - c = *s++; - } else { - neg = 0; - if (c == '+') - c = *s++; - } - if ((base == 0 || base == 16) && - c == '0' && (*s == 'x' || *s == 'X') && - ((s[1] >= '0' && s[1] <= '9') || - (s[1] >= 'a' && s[1] <= 'f') || - (s[1] >= 'A' && s[1] <= 'F'))) { - c = s[1]; - s += 2; - base = 16; - } else if (base == 0) - base = (c == '0' ? 8 : 10); - - /* - * See strtol for comments as to the logic used. - */ - cutoff = ((__UINT)__UINT_MAX / (__UINT)base); - cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base); - for (acc = 0, any = 0;; c = *s++) { - if (c >= '0' && c <= '9') - i = c - '0'; - else if (c >= 'a' && c <= 'z') - i = (c - 'a') + 10; - else if (c >= 'A' && c <= 'Z') - i = (c - 'A') + 10; - else - break; - if (i >= base) - break; - if (any < 0) - continue; - if (acc > cutoff || (acc == cutoff && i > cutlim)) { - acc = __UINT_MAX; - any = -1; - errno = ERANGE; - } else { - any = 1; - acc *= (__UINT)base; - acc += i; - } - } - if (neg && any > 0) - acc = -acc; - if (endptr != NULL) - /* LINTED interface specification */ - *endptr = (char *)(any ? s - 1 : nptr); - return(acc); -} diff --git a/port/libport.h b/port/libport.h index 55ec2a79..7921c9e1 100644 --- a/port/libport.h +++ b/port/libport.h @@ -38,19 +38,6 @@ extern int optopt; # define HAVE_GETOPT 1 #endif -#if !defined(HAVE_STRTOL) -long strtol(const char *nptr, char **endptr, int base); -#endif -#if !defined(HAVE_STRTOLL) -long long strtoll(const char *nptr, char **endptr, int base); -#endif -#if !defined(HAVE_STRTOUL) -unsigned long strtoul(const char *nptr, char **endptr, int base); -#endif -#if !defined(HAVE_STRTOULL) -unsigned long long strtoull(const char *nptr, char **endptr, int base); -#endif - #if !defined(HAVE_SNPRINTF) #undef vsnprintf #define vsnprintf _TIFF_vsnprintf_f diff --git a/port/strtol.c b/port/strtol.c deleted file mode 100644 index a355dde9..00000000 --- a/port/strtol.c +++ /dev/null @@ -1,45 +0,0 @@ -/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */ - -/*- - * Copyright (c) 2005 The DragonFly Project. All rights reserved. - * Copyright (c) 2003 Citrus Project, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $"); -#endif - -#include <assert.h> -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <stdlib.h> - -#define _FUNCNAME strtol -#define __INT long -#define __INT_MIN LONG_MIN -#define __INT_MAX LONG_MAX - -#include "_strtol.h" diff --git a/port/strtoll.c b/port/strtoll.c deleted file mode 100644 index 4784b098..00000000 --- a/port/strtoll.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */ - -/*- - * Copyright (c) 2005 The DragonFly Project. All rights reserved. - * Copyright (c) 2003 Citrus Project, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $"); -#endif - -#include <assert.h> -#include <ctype.h> -#include <errno.h> -#include <stdlib.h> - -#define _FUNCNAME strtoll -#define __INT long long -#define __INT_MIN LLONG_MIN -#define __INT_MAX LLONG_MAX - -#include "_strtol.h" diff --git a/port/strtoul.c b/port/strtoul.c deleted file mode 100644 index dbd44f16..00000000 --- a/port/strtoul.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */ - -/*- - * Copyright (c) 2005 The DragonFly Project. All rights reserved. - * Copyright (c) 2003 Citrus Project, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $"); -#endif - -#include <assert.h> -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <stdlib.h> - -#define _FUNCNAME strtoul -#define __UINT unsigned long int -#define __UINT_MAX ULONG_MAX - -#include "_strtoul.h" diff --git a/port/strtoull.c b/port/strtoull.c deleted file mode 100644 index 91e4ddfb..00000000 --- a/port/strtoull.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */ - -/*- - * Copyright (c) 2005 The DragonFly Project. All rights reserved. - * Copyright (c) 2003 Citrus Project, - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if 0 -__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $"); -#endif - -#include <assert.h> -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <stdlib.h> - -#define _FUNCNAME strtoull -#define __UINT unsigned long long int -#define __UINT_MAX ULLONG_MAX - -#include "_strtoul.h" |