+2014-10-14 Joel Brobecker <brobecker@adacore.com>
+
+ * d-demangle.c: Replace strtold with strtod in global comment.
+ (strtold): Remove declaration.
+ (strtod): New declaration.
+ (dlang_parse_real): Declare value as double instead of long
+ double. Replace call to strtold by call to strtod.
+ Update format in call to snprintf.
+
2014-09-26 Jason Merrill <jason@redhat.com>
* cp-demangle.c (d_substitution): Handle abi tags on abbreviation.
/* This file exports one function; dlang_demangle.
- This file imports strtol and strtold for decoding mangled literals. */
+ This file imports strtol and strtod for decoding mangled literals. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#include <stdlib.h>
#else
extern long strtol (const char *nptr, char **endptr, int base);
-extern long double strtold (const char *nptr, char **endptr);
+extern double strtod (const char *nptr, char **endptr);
#endif
#include <demangle.h>
{
char buffer[64];
int len = 0;
- long double value;
+ double value;
char *endptr;
/* Handle NAN and +-INF. */
/* Convert buffer from hexadecimal to floating-point. */
buffer[len] = '\0';
- value = strtold (buffer, &endptr);
+ value = strtod (buffer, &endptr);
if (endptr == NULL || endptr != (buffer + len))
return NULL;
- len = snprintf (buffer, sizeof(buffer), "%#Lg", value);
+ len = snprintf (buffer, sizeof(buffer), "%#g", value);
string_appendn (decl, buffer, len);
return mangled;
}