[cfe-commits] r39972 - /cfe/trunk/Lex/LiteralSupport.cpp
Chris Lattner
sabre at nondot.org
Tue Jul 17 08:27:33 PDT 2007
Author: lattner
Date: Tue Jul 17 10:27:33 2007
New Revision: 39972
URL: http://llvm.org/viewvc/llvm-project?rev=39972&view=rev
Log:
strtod is more portable than strtof apparently. Instead of making this conditional,
just always use strtod. This is temporary code anyway.
Modified:
cfe/trunk/Lex/LiteralSupport.cpp
Modified: cfe/trunk/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/LiteralSupport.cpp?rev=39972&r1=39971&r2=39972&view=diff
==============================================================================
--- cfe/trunk/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/Lex/LiteralSupport.cpp Tue Jul 17 10:27:33 2007
@@ -19,12 +19,6 @@
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/Config/config.h"
-#if HAVE_STRTOF
-#else
-# define strtof strtod
-#endif
-
using namespace clang;
/// HexDigitValue - Return the value of the specified hex digit, or -1 if it's
@@ -423,7 +417,7 @@
char floatChars[256];
strncpy(floatChars, ThisTokBegin, ThisTokEnd-ThisTokBegin);
floatChars[ThisTokEnd-ThisTokBegin] = '\0';
- return strtof(floatChars, 0);
+ return (float)strtod(floatChars, 0);
}
void NumericLiteralParser::Diag(SourceLocation Loc, unsigned DiagID,
More information about the cfe-commits
mailing list