From dce425341171ec5784c87165e23883630971bd97 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Tue, 26 Nov 2019 14:48:49 -0300 Subject: Refactor *cvt functions implementation (2/2) This patch refactors the *cvt functions implementation in a way that makes it easier to re-use them for implementing the IEEE long double on powerpc64le. By removing the macros that generate the function names (APPEND combined with FUNC_PREFIX), the new code makes it easier to define new function names, such as __qecvtieee128. Tested that installed stripped binaries for all build-many-glibcs targets remain identical before and after this patch. Also tested for powerpc64le and x86_64. Reviewed-by: Paul E. Murphy --- misc/efgcvt_r-template.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'misc/efgcvt_r-template.c') diff --git a/misc/efgcvt_r-template.c b/misc/efgcvt_r-template.c index 1cd335afe7..977750118c 100644 --- a/misc/efgcvt_r-template.c +++ b/misc/efgcvt_r-template.c @@ -28,12 +28,10 @@ #define APPEND(a, b) APPEND2 (a, b) #define APPEND2(a, b) a##b -#define __APPEND(a, b) __APPEND2 (a, b) -#define __APPEND2(a, b) __##a##b int -__APPEND (FUNC_PREFIX, fcvt_r) (FLOAT_TYPE value, int ndigit, int *decpt, - int *sign, char *buf, size_t len) +__FCVT_R (FLOAT_TYPE value, int ndigit, int *decpt, int *sign, + char *buf, size_t len) { ssize_t n; ssize_t i; @@ -127,8 +125,8 @@ __APPEND (FUNC_PREFIX, fcvt_r) (FLOAT_TYPE value, int ndigit, int *decpt, } int -__APPEND (FUNC_PREFIX, ecvt_r) (FLOAT_TYPE value, int ndigit, int *decpt, - int *sign, char *buf, size_t len) +__ECVT_R (FLOAT_TYPE value, int ndigit, int *decpt, int *sign, + char *buf, size_t len) { int exponent = 0; @@ -187,8 +185,8 @@ __APPEND (FUNC_PREFIX, ecvt_r) (FLOAT_TYPE value, int ndigit, int *decpt, *sign = isfinite (value) ? signbit (value) != 0 : 0; } else - if (__APPEND (FUNC_PREFIX, fcvt_r) (value, MIN (ndigit, NDIGIT_MAX) - 1, - decpt, sign, buf, len)) + if (__FCVT_R (value, MIN (ndigit, NDIGIT_MAX) - 1, + decpt, sign, buf, len)) return -1; *decpt += exponent; -- cgit 1.4.1