about summary refs log tree commit diff
path: root/sysdeps/wordsize-64
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2020-12-08 18:15:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2020-12-08 18:15:27 +0000
commit224b419d1e750e3e9ced5c57774bb2bdd5292e28 (patch)
tree270809a5e89155afa1990475bcff36a5d7ae6f24 /sysdeps/wordsize-64
parent4d3a77c73594c3704992f8d5b779c8be053cff35 (diff)
downloadglibc-224b419d1e750e3e9ced5c57774bb2bdd5292e28.tar.gz
glibc-224b419d1e750e3e9ced5c57774bb2bdd5292e28.tar.xz
glibc-224b419d1e750e3e9ced5c57774bb2bdd5292e28.zip
Make strtoimax, strtoumax, wcstoimax, wcstoumax into aliases
The functions strtoimax, strtoumax, wcstoimax, wcstoumax currently
have three implementations each (wordsize-32, wordsize-64 and dummy
implementation in stdlib/ using #error), defining the functions as
thin wrappers round corresponding *_internal functions.  Simplify the
code by changing them into aliases of functions such as strtol and
wcstoull.  This is more consistent with how e.g. imaxdiv is handled.

Tested for x86_64 and x86.
Diffstat (limited to 'sysdeps/wordsize-64')
-rw-r--r--sysdeps/wordsize-64/strtoimax.c27
-rw-r--r--sysdeps/wordsize-64/strtol.c1
-rw-r--r--sysdeps/wordsize-64/strtoul.c1
-rw-r--r--sysdeps/wordsize-64/strtoumax.c28
-rw-r--r--sysdeps/wordsize-64/wcstoimax.c28
-rw-r--r--sysdeps/wordsize-64/wcstol.c1
-rw-r--r--sysdeps/wordsize-64/wcstoul.c1
-rw-r--r--sysdeps/wordsize-64/wcstoumax.c28
8 files changed, 4 insertions, 111 deletions
diff --git a/sysdeps/wordsize-64/strtoimax.c b/sysdeps/wordsize-64/strtoimax.c
deleted file mode 100644
index 9df5f2f250..0000000000
--- a/sysdeps/wordsize-64/strtoimax.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Convert string to maximal integer.
-   Copyright (C) 1997-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <inttypes.h>
-#include <stdlib.h>
-
-intmax_t
-strtoimax (const char *__restrict nptr, char **__restrict endptr, int base)
-{
-  return __strtol_internal (nptr, endptr, base, 0);
-}
diff --git a/sysdeps/wordsize-64/strtol.c b/sysdeps/wordsize-64/strtol.c
index ac17bbe4c8..a1b2374153 100644
--- a/sysdeps/wordsize-64/strtol.c
+++ b/sysdeps/wordsize-64/strtol.c
@@ -14,3 +14,4 @@ weak_alias (strtol, strtoll)
 libc_hidden_ver (strtol, strtoll)
 weak_alias (strtol, strtoq)
 libc_hidden_ver (strtol, strtoq)
+weak_alias (strtol, strtoimax)
diff --git a/sysdeps/wordsize-64/strtoul.c b/sysdeps/wordsize-64/strtoul.c
index 401882ce0d..856aa11dee 100644
--- a/sysdeps/wordsize-64/strtoul.c
+++ b/sysdeps/wordsize-64/strtoul.c
@@ -12,3 +12,4 @@ strong_alias (__strtoul_internal, __strtoull_internal)
 libc_hidden_ver (__strtoul_internal, __strtoull_internal)
 weak_alias (strtoul, strtoull)
 weak_alias (strtoul, strtouq)
+weak_alias (strtoul, strtoumax)
diff --git a/sysdeps/wordsize-64/strtoumax.c b/sysdeps/wordsize-64/strtoumax.c
deleted file mode 100644
index aad697bb40..0000000000
--- a/sysdeps/wordsize-64/strtoumax.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Convert string to maximal unsigned integer.
-   Copyright (C) 1997-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <inttypes.h>
-#include <stdlib.h>
-
-uintmax_t
-strtoumax (const char *__restrict nptr, char **__restrict endptr, int base)
-{
-  return __strtoul_internal (nptr, endptr, base, 0);
-}
-libc_hidden_def (strtoumax)
diff --git a/sysdeps/wordsize-64/wcstoimax.c b/sysdeps/wordsize-64/wcstoimax.c
deleted file mode 100644
index 6a91737936..0000000000
--- a/sysdeps/wordsize-64/wcstoimax.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Convert wide-character string to maximal integer.
-   Copyright (C) 1997-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <inttypes.h>
-#include <wchar.h>
-
-intmax_t
-wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-	   int base)
-{
-  return __wcstol_internal (nptr, endptr, base, 0);
-}
diff --git a/sysdeps/wordsize-64/wcstol.c b/sysdeps/wordsize-64/wcstol.c
index b10895a82b..f99c273d95 100644
--- a/sysdeps/wordsize-64/wcstol.c
+++ b/sysdeps/wordsize-64/wcstol.c
@@ -12,3 +12,4 @@ strong_alias (__wcstol_internal, __wcstoll_internal)
 libc_hidden_ver (__wcstol_internal, __wcstoll_internal)
 weak_alias (wcstol, wcstoll)
 weak_alias (wcstol, wcstoq)
+weak_alias (wcstol, wcstoimax)
diff --git a/sysdeps/wordsize-64/wcstoul.c b/sysdeps/wordsize-64/wcstoul.c
index 2becb80744..e1458e17f3 100644
--- a/sysdeps/wordsize-64/wcstoul.c
+++ b/sysdeps/wordsize-64/wcstoul.c
@@ -12,3 +12,4 @@ strong_alias (__wcstoul_internal, __wcstoull_internal)
 libc_hidden_ver (__wcstoul_internal, __wcstoull_internal)
 weak_alias (wcstoul, wcstoull)
 weak_alias (wcstoul, wcstouq)
+weak_alias (wcstoul, wcstoumax)
diff --git a/sysdeps/wordsize-64/wcstoumax.c b/sysdeps/wordsize-64/wcstoumax.c
deleted file mode 100644
index c11053c5b6..0000000000
--- a/sysdeps/wordsize-64/wcstoumax.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Convert wide-character string to maximal unsigned integer.
-   Copyright (C) 1997-2020 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#include <inttypes.h>
-#include <wchar.h>
-
-uintmax_t
-wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
-	   int base)
-{
-  return __wcstoul_internal (nptr, endptr, base, 0);
-}