[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r8781 - in /libdfp/trunk: include/printf_dfp.h strtod32.c sysdeps/s390/dfpu/numdigits.h
- To: commits@xxxxxxxxxx
- Subject: [commits] r8781 - in /libdfp/trunk: include/printf_dfp.h strtod32.c sysdeps/s390/dfpu/numdigits.h
- From: ryanarn@xxxxxxxxxx
- Date: Fri, 07 Aug 2009 17:28:09 -0000
Author: ryanarn
Date: Fri Aug 7 10:28:09 2009
New Revision: 8781
Log:
2009-08-04 Andreas Krebbel <krebbel@xxxxxxxxxxxxxxxxxx>
* include/printf_dfp.h: Add #include <stdardg.h>.
* sysdeps/s390/dfpu/numdigits.h: Wrap function definitions in FUNC_D
macro. Add PASTE and FUNC_D macro definitions.
* strtod32.c (setexp): Refer to 'getexp' using FUNC_D() macro. Add
PASTE and FUNC_D macro definitions. Reposition dfp*_private.h header
inclusions.
Modified:
libdfp/trunk/include/printf_dfp.h
libdfp/trunk/strtod32.c
libdfp/trunk/sysdeps/s390/dfpu/numdigits.h
Modified: libdfp/trunk/include/printf_dfp.h
==============================================================================
--- libdfp/trunk/include/printf_dfp.h (original)
+++ libdfp/trunk/include/printf_dfp.h Fri Aug 7 10:28:09 2009
@@ -32,6 +32,8 @@
#define DFP_FLAG_DECIMAL_64 (1<<17)
#define DFP_FLAG_DECIMAL_128 (1<<18)
+#include <stdarg.h>
+
/* Internal entry point for formatting DFP. */
extern int __printf_dfp (FILE *, const struct printf_info *,
const void *const *);
Modified: libdfp/trunk/strtod32.c
==============================================================================
--- libdfp/trunk/strtod32.c (original)
+++ libdfp/trunk/strtod32.c Fri Aug 7 10:28:09 2009
@@ -44,14 +44,15 @@
#include <wchar.h>
#include <stdlib.h> /* Pick up the strtod* prototypes. */
-# include <dfpwchar_private.h> /* wcstod* internal interfaces */
-# include <dfpstdlib_private.h> /* strtod* internal interfaces. */
-
#include <stdio.h>
#include <locale.h> /* For newlocale prototype. */
#include <langinfo.h> /* For nl_langinfo prototype. */
#include <ctype.h> /* isspace_l et. al. */
#include <string.h> /* strncasecmp_l */
+
+#include <dfpwchar_private.h> /* wcstod* internal interfaces */
+#include <dfpstdlib_private.h> /* strtod* internal interfaces. */
+
//#include <wctype.h>
@@ -129,9 +130,14 @@
#define FUNCTION_L_INTERNAL PASTE(__FUNCTION_NAME,_l_internal)
/* Extra macros required to get FLT expanded before the pasting. */
-//#define PASTE(a,b) PASTE1(a,b)
-//#define PASTE1(a,b) a##b
-
+#ifndef PASTE
+# define PASTE(a,b) PASTE1(a,b)
+# define PASTE1(a,b) a##b
+#endif
+
+#ifndef FUNC_D
+# define FUNC_D(x) PASTE(x,PASTE(d,_DECIMAL_SIZE))
+#endif
#define RETURN(val,end) \
do { if (endptr != NULL) *endptr = (STRING_TYPE *) (end); \
@@ -970,7 +976,7 @@
while(++exponent < 0)
d32 /= 10;
#else
- d32 = FUNC_D(setexp) (d32, getexp(d32) + exponent);
+ d32 = FUNC_D(setexp) (d32, FUNC_D (getexp) (d32) + exponent);
#endif
return negative? -d32:d32;
Modified: libdfp/trunk/sysdeps/s390/dfpu/numdigits.h
==============================================================================
--- libdfp/trunk/sysdeps/s390/dfpu/numdigits.h (original)
+++ libdfp/trunk/sysdeps/s390/dfpu/numdigits.h Fri Aug 7 10:28:09 2009
@@ -29,6 +29,14 @@
#define NUMDIGITS_SUPPORT 1
+#ifndef DEC_TYPE
+#error DEC_TYPE must be declared
+#endif
+
+#ifndef _DECIMAL_SIZE
+#error _DECIMAL_SIZE must be declared
+#endif
+
#include "dpd-private.h"
#if _DECIMAL_SIZE == 32
@@ -40,9 +48,19 @@
# define DECIMAL_BIAS 6176
#endif
+#ifndef PASTE
+# define PASTE(x,y) PASTE2(x,y)
+# define PASTE2(x,y) x##y
+#endif
+
+#ifndef FUNC_D
+# define FUNC_D(x) PASTE(x,PASTE(d,_DECIMAL_SIZE))
+#endif
+
+
static inline int
-getexp (DEC_TYPE x)
+FUNC_D (getexp) (DEC_TYPE x)
{
int result;
@@ -67,7 +85,7 @@
static inline DEC_TYPE
-FUNC_D(setexp) (DEC_TYPE x, int exp)
+FUNC_D (setexp) (DEC_TYPE x, int exp)
{
#if _DECIMAL_SIZE == 32
_Decimal64 tmp = (_Decimal64)x;
@@ -94,7 +112,7 @@
static inline int
-numdigits (DEC_TYPE x)
+FUNC_D (numdigits) (DEC_TYPE x)
{
int result;
@@ -118,7 +136,7 @@
}
static DEC_TYPE
-left_justify (DEC_TYPE x)
+FUNC_D (left_justify) (DEC_TYPE x)
{
#if _DECIMAL_SIZE == 128
register DEC_TYPE tmp asm ("f0") = x;