WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
namespacestdisnan.diff
namespacestdisnan.diff (text/plain), 8.38 KB, created by
Xan Lopez
on 2011-04-22 15:59:39 PDT
(
hide
)
Description:
namespacestdisnan.diff
Filename:
MIME Type:
Creator:
Xan Lopez
Created:
2011-04-22 15:59:39 PDT
Size:
8.38 KB
patch
obsolete
>From ab4cec578f2b0108987d2a530f56179dbc3b7e36 Mon Sep 17 00:00:00 2001 >From: Xan Lopez <xlopez@igalia.com> >Date: Fri, 22 Apr 2011 15:57:56 -0700 >Subject: [PATCH] Source/WebCore: > >2011-04-22 Xan Lopez <xlopez@igalia.com> > > Reviewed by NOBODY (OOPS!). > > Colliding isinf/isnan between C99 and C++0x with GCC 4.6.0 > https://bugs.webkit.org/show_bug.cgi?id=59249 > > Don't use "using namespace std;" in files where isnan or isinf are > used, since it can lead to ambiguity in C++0x compilers. See the > bug for more details. > > * html/HTMLInputElement.cpp: drop "using namespace std;" > (WebCore::HTMLInputElement::applyStep): use std:: prefix explictly. > (WebCore::HTMLInputElement::stepUpFromRenderer): ditto. > * html/NumberInputType.cpp: do using std::numeric_limits; instead > of using namespace std; > >Source/JavaScriptCore: > >2011-04-22 Xan Lopez <xlopez@igalia.com> > > Reviewed by NOBODY (OOPS!). > > Colliding isinf/isnan between C99 and C++0x with GCC 4.6.0 > https://bugs.webkit.org/show_bug.cgi?id=59249 > > Don't use "using namespace std;" in files where isnan or isinf are > used, since it can lead to ambiguity in C++0x compilers. See the > bug for more details. > > * bytecompiler/BytecodeGenerator.cpp: drop "using namespace std;" > (JSC::BytecodeGenerator::BytecodeGenerator): use std:: prefix explictly. > (JSC::BytecodeGenerator::newRegister): ditto. > * wtf/MathExtras.h: do not import isnan and isinf into the global > namespace with GCC in C++0x mode, since it will collide with the > C99 functions. >--- > Source/JavaScriptCore/ChangeLog | 18 ++++++++++++++++++ > .../bytecompiler/BytecodeGenerator.cpp | 6 ++---- > Source/JavaScriptCore/wtf/MathExtras.h | 2 ++ > Source/WebCore/ChangeLog | 17 +++++++++++++++++ > Source/WebCore/html/HTMLInputElement.cpp | 10 ++++------ > Source/WebCore/html/NumberInputType.cpp | 2 +- > 6 files changed, 44 insertions(+), 11 deletions(-) > >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 005ffd5..57a58a2 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2011-04-22 Xan Lopez <xlopez@igalia.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Colliding isinf/isnan between C99 and C++0x with GCC 4.6.0 >+ https://bugs.webkit.org/show_bug.cgi?id=59249 >+ >+ Don't use "using namespace std;" in files where isnan or isinf are >+ used, since it can lead to ambiguity in C++0x compilers. See the >+ bug for more details. >+ >+ * bytecompiler/BytecodeGenerator.cpp: drop "using namespace std;" >+ (JSC::BytecodeGenerator::BytecodeGenerator): use std:: prefix explictly. >+ (JSC::BytecodeGenerator::newRegister): ditto. >+ * wtf/MathExtras.h: do not import isnan and isinf into the global >+ namespace with GCC in C++0x mode, since it will collide with the >+ C99 functions. >+ > 2011-04-22 Patrick Gansterer <paroga@webkit.org> > > Unreviewed. Build fix for ENABLE(INTERPRETER) after r84556. >diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >index 83e4592..3616c7d 100644 >--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp >@@ -36,8 +36,6 @@ > #include "ScopeChain.h" > #include "UString.h" > >-using namespace std; >- > namespace JSC { > > /* >@@ -267,7 +265,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, ScopeChainNode* s > > if (entry.isNull()) > newGlobals.add(function->ident().impl()); >- functionInfo[i] = make_pair(entry.getIndex(), entry.isReadOnly()); >+ functionInfo[i] = std::make_pair(entry.getIndex(), entry.isReadOnly()); > } > > Vector<bool, 16> shouldCreateVar(varStack.size()); >@@ -636,7 +634,7 @@ bool BytecodeGenerator::isLocalConstant(const Identifier& ident) > RegisterID* BytecodeGenerator::newRegister() > { > m_calleeRegisters.append(m_calleeRegisters.size()); >- m_codeBlock->m_numCalleeRegisters = max<int>(m_codeBlock->m_numCalleeRegisters, m_calleeRegisters.size()); >+ m_codeBlock->m_numCalleeRegisters = std::max<int>(m_codeBlock->m_numCalleeRegisters, m_calleeRegisters.size()); > return &m_calleeRegisters.last(); > } > >diff --git a/Source/JavaScriptCore/wtf/MathExtras.h b/Source/JavaScriptCore/wtf/MathExtras.h >index fac187c..78eb467 100644 >--- a/Source/JavaScriptCore/wtf/MathExtras.h >+++ b/Source/JavaScriptCore/wtf/MathExtras.h >@@ -240,8 +240,10 @@ inline int clampToInteger(unsigned value) > > #if !COMPILER(MSVC) && !(COMPILER(RVCT) && PLATFORM(BREWMP)) && !OS(SOLARIS) && !OS(SYMBIAN) > using std::isfinite; >+#ifndef __GXX_EXPERIMENTAL_CXX0X__ > using std::isinf; > using std::isnan; >+#endif > using std::signbit; > #endif > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8029043..d774744 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2011-04-22 Xan Lopez <xlopez@igalia.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Colliding isinf/isnan between C99 and C++0x with GCC 4.6.0 >+ https://bugs.webkit.org/show_bug.cgi?id=59249 >+ >+ Don't use "using namespace std;" in files where isnan or isinf are >+ used, since it can lead to ambiguity in C++0x compilers. See the >+ bug for more details. >+ >+ * html/HTMLInputElement.cpp: drop "using namespace std;" >+ (WebCore::HTMLInputElement::applyStep): use std:: prefix explictly. >+ (WebCore::HTMLInputElement::stepUpFromRenderer): ditto. >+ * html/NumberInputType.cpp: do using std::numeric_limits; instead >+ of using namespace std; >+ > 2011-04-22 Dan Bernstein <mitz@apple.com> > > Reviewed by Sam Weinig. >diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp >index 630978a..2c481a9 100644 >--- a/Source/WebCore/html/HTMLInputElement.cpp >+++ b/Source/WebCore/html/HTMLInputElement.cpp >@@ -54,8 +54,6 @@ > #include <wtf/MathExtras.h> > #include <wtf/StdLibExtras.h> > >-using namespace std; >- > namespace WebCore { > > using namespace HTMLNames; >@@ -325,7 +323,7 @@ void HTMLInputElement::applyStep(double count, ExceptionCode& ec) > ec = INVALID_STATE_ERR; > return; > } >- const double nan = numeric_limits<double>::quiet_NaN(); >+ const double nan = std::numeric_limits<double>::quiet_NaN(); > double current = m_inputType->parseToDoubleWithDecimalPlaces(value(), nan, ¤tDecimalPlaces); > if (!isfinite(current)) { > ec = INVALID_STATE_ERR; >@@ -345,7 +343,7 @@ void HTMLInputElement::applyStep(double count, ExceptionCode& ec) > newValue = m_inputType->minimum(); > unsigned baseDecimalPlaces; > double base = m_inputType->stepBaseWithDecimalPlaces(&baseDecimalPlaces); >- baseDecimalPlaces = min(baseDecimalPlaces, 16u); >+ baseDecimalPlaces = std::min(baseDecimalPlaces, 16u); > if (newValue < pow(10.0, 21.0)) { > if (stepMismatch(value())) { > double scale = pow(10.0, static_cast<double>(max(stepDecimalPlaces, currentDecimalPlaces))); >@@ -1380,7 +1378,7 @@ void HTMLInputElement::stepUpFromRenderer(int n) > else if (!getAllowedValueStepWithDecimalPlaces(&step, &stepDecimalPlaces)) > return; > base = m_inputType->stepBaseWithDecimalPlaces(&baseDecimalPlaces); >- baseDecimalPlaces = min(baseDecimalPlaces, 16u); >+ baseDecimalPlaces = std::min(baseDecimalPlaces, 16u); > > int sign; > if (step > 0) >@@ -1390,7 +1388,7 @@ void HTMLInputElement::stepUpFromRenderer(int n) > else > sign = 0; > >- const double nan = numeric_limits<double>::quiet_NaN(); >+ const double nan = std::numeric_limits<double>::quiet_NaN(); > String currentStringValue = value(); > double current = m_inputType->parseToDouble(currentStringValue, nan); > if (!isfinite(current)) { >diff --git a/Source/WebCore/html/NumberInputType.cpp b/Source/WebCore/html/NumberInputType.cpp >index af30345..02bc620 100644 >--- a/Source/WebCore/html/NumberInputType.cpp >+++ b/Source/WebCore/html/NumberInputType.cpp >@@ -48,7 +48,7 @@ > namespace WebCore { > > using namespace HTMLNames; >-using namespace std; >+using std::numeric_limits; > > static const double numberDefaultStep = 1.0; > static const double numberStepScaleFactor = 1.0; >-- >1.7.4.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 59249
:
90789
|
90792
|
92342
|
142978
|
142982