Commit ff9adb8d authored by andersca@apple.com's avatar andersca@apple.com

Stop bringing in the std namespace

https://bugs.webkit.org/show_bug.cgi?id=123273

Reviewed by Andreas Kling.

Source/WebCore:

* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::renderFromBuffer):
(WebCore::AudioBufferSourceNode::startGrain):
(WebCore::AudioBufferSourceNode::totalPitchRate):
* Modules/webaudio/AudioNodeInput.cpp:
(WebCore::AudioNodeInput::numberOfChannels):
* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
(WebCore::AudioScheduledSourceNode::stop):
* Modules/webaudio/AudioSummingJunction.cpp:
* Modules/webaudio/DelayDSPKernel.cpp:
(WebCore::DelayDSPKernel::process):
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::offlineRender):
* Modules/webaudio/OscillatorNode.cpp:
* Modules/webaudio/PannerNode.cpp:
(WebCore::PannerNode::dopplerRate):
* Modules/webaudio/WaveShaperDSPKernel.cpp:
(WebCore::WaveShaperDSPKernel::processCurve):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
* Modules/websockets/WebSocket.cpp:
(WebCore::saturateAdd):
* Modules/websockets/WebSocketChannel.cpp:
* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame):
* accessibility/AccessibilityARIAGrid.cpp:
* accessibility/AccessibilityARIAGridCell.cpp:
* accessibility/AccessibilityARIAGridRow.cpp:
* accessibility/AccessibilityList.cpp:
* accessibility/AccessibilityListBox.cpp:
* accessibility/AccessibilityListBoxOption.cpp:
* accessibility/AccessibilityNodeObject.cpp:
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityRenderObject.cpp:
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
* accessibility/AccessibilityTableCell.cpp:
* accessibility/AccessibilityTableColumn.cpp:
* accessibility/AccessibilityTableHeaderContainer.cpp:
* accessibility/AccessibilityTableRow.cpp:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::setTimeout):
(WebCore::setMaximumAge):
* bindings/js/ScriptController.cpp:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::writeLittleEndian):
(WebCore::CloneSerializer::write):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::readString):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::getFontFace):
* css/CSSGradientValue.cpp:
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseColorParameters):
(WebCore::CSSParser::parseHSLParameters):
* css/CSSReflectValue.cpp:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyFontSize::applyValue):
* css/PropertySetCSSStyleDeclaration.cpp:
* css/SVGCSSParser.cpp:
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::getLayeredShorthandValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::viewportPercentageValue):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* dom/ContainerNode.cpp:
* dom/Document.cpp:
(WebCore::Document::minimumLayoutDelay):
* dom/Node.cpp:
(WebCore::Node::compareDocumentPosition):
* dom/Range.cpp:
(WebCore::Range::toString):
(WebCore::Range::textRects):
(WebCore::Range::textQuads):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::scheduleAnimation):
* dom/StyledElement.cpp:
(WebCore::StyledElement::makePresentationAttributeCacheKey):
* dom/Text.cpp:
* dom/ViewportArguments.cpp:
(WebCore::clampLengthValue):
(WebCore::clampScaleValue):
(WebCore::ViewportArguments::resolve):
(WebCore::computeMinimumScaleFactorForContentContained):
(WebCore::restrictMinimumScaleFactorToViewportSize):
* editing/AlternativeTextController.cpp:
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::deleteInsignificantText):
* editing/Editor.cpp:
(WebCore::Editor::setComposition):
(WebCore::Editor::compositionRange):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleTextNode):
(WebCore::TextIterator::handleTextBox):
(WebCore::CharacterIterator::string):
(WebCore::SearchBuffer::SearchBuffer):
(WebCore::SearchBuffer::append):
(WebCore::SearchBuffer::prependContext):
(WebCore::SearchBuffer::search):
* editing/VisibleUnits.cpp:
(WebCore::startOfParagraph):
* editing/htmlediting.cpp:
* editing/markup.cpp:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didReceiveResponse):
(WebCore::FileReaderLoader::didReceiveData):
* history/BackForwardList.cpp:
(WebCore::BackForwardList::backListWithLimit):
(WebCore::BackForwardList::forwardListWithLimit):
* history/PageCache.cpp:
(WebCore::PageCache::setCapacity):
* html/BaseDateAndTimeInputType.cpp:
* html/FTPDirectoryDocument.cpp:
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::getRegion):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
(WebCore::parseColorStringWithCrazyLegacyRules):
* html/HTMLFormControlElement.cpp:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::getTextFieldValues):
* html/HTMLImageElement.cpp:
* html/HTMLInputElement.cpp:
* html/HTMLMapElement.cpp:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::textTrackAddCue):
(WebCore::HTMLMediaElement::textTrackRemoveCue):
(WebCore::HTMLMediaElement::rewind):
(WebCore::HTMLMediaElement::seek):
(WebCore::HTMLMediaElement::duration):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::updateListBoxSelection):
* html/HTMLSourceElement.cpp:
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::colSpan):
(WebCore::HTMLTableCellElement::rowSpan):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::parseAttribute):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionStart):
(WebCore::HTMLTextFormControlElement::setSelectionEnd):
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
* html/HTMLTrackElement.cpp:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::scale):
* html/InputType.cpp:
(WebCore::InputType::valueAsDouble):
* html/MediaController.cpp:
(MediaController::duration):
(MediaController::currentTime):
(MediaController::setCurrentTime):
(MediaController::updateReadyState):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::setValueAsDouble):
(WebCore::NumberInputType::setValueAsDecimal):
(WebCore::NumberInputType::createStepRange):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleKeydownEvent):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::startSearchEventTimer):
* html/StepRange.cpp:
(WebCore::StepRange::clampValue):
(WebCore::StepRange::parseStep):
* html/TimeRanges.cpp:
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
(WebCore::adjustBubblePosition):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::normalizeRect):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
(WebCore::WebGLRenderingContext::validateCompressedTexFuncData):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlRewindButtonElement::defaultEventHandler):
* html/shadow/MediaControlsApple.cpp:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
* inspector/ContentSearchUtils.cpp:
* inspector/DOMEditor.cpp:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::diff):
* inspector/InjectedScriptHost.cpp:
* loader/ProgressTracker.cpp:
(WebCore::ProgressTracker::incrementProgress):
* loader/cache/CachedImage.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::adjustWindowRect):
* page/EventHandler.cpp:
(WebCore::MaximumDurationTracker::~MaximumDurationTracker):
* page/FrameTree.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::adjustedDeferredRepaintDelay):
(WebCore::FrameView::autoSizeIfEnabled):
* page/PrintContext.cpp:
(WebCore::PrintContext::computeAutomaticScaleFactor):
* page/SpatialNavigation.cpp:
(WebCore::entryAndExitPointsForDirection):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations):
(WebCore::PropertyWrapperShadow::blendMismatchedShadowLists):
* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::FloatRect):
(WebCore::FloatRect::intersect):
(WebCore::FloatRect::uniteEvenIfEmpty):
(WebCore::FloatRect::extend):
(WebCore::FloatRect::fitToPoints):
* platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
(WebCore::GlyphPageTreeNode::getChild):
* platform/graphics/IntRect.cpp:
(WebCore::IntRect::intersect):
(WebCore::IntRect::unite):
(WebCore::IntRect::uniteIfNonZero):
* platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::intersect):
(WebCore::LayoutRect::unite):
(WebCore::LayoutRect::uniteIfNonZero):
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyGeneric):
(WebCore::FEMorphology::platformApplySoftware):
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
* platform/text/TextCodecICU.cpp:
* rendering/LineWidth.cpp:
(WebCore::LineWidth::fitBelowFloats):
(WebCore::LineWidth::computeAvailableWidthFromLeftAndRight):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::availableLogicalWidthForLine):
(WebCore::RenderBlock::availableLogicalWidthForContent):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::computePreferredLogicalWidths):
(WebCore::RenderFieldset::layoutSpecialExcludedChild):
(WebCore::RenderFieldset::paintBoxDecorations):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::updateLogicalWidth):
(WebCore::RenderFlowThread::addForcedRegionBreak):
* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::layoutWithFlattening):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::layOutAxis):
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computePreferredLogicalWidths):
* rendering/RenderTableCell.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::selectionHeight):
(WebCore::RootInlineBox::selectionHeightAdjustedForPrecedingBlock):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layout):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layout):
* rendering/style/RenderStyle.h:
* rendering/style/StyleGeneratedImage.cpp:
(WebCore::StyleGeneratedImage::imageSize):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::fontSizeForKeyword):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setCurrentTime):

Source/WebKit/mac:

* WebView/WebFrameView.mm:
(-[WebFrameView _verticalPageScrollDistance]):
(-[WebFrameView _horizontalPageScrollDistance]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _scaleFactorForPrintOperation:]):
* WebView/WebView.mm:
(+[WebView _setCacheModel:]):
(+[WebView _maxCacheModelInAnyInstance]):
(+[WebView _cacheModelChangedNotification:]):
(+[WebView _preferencesRemovedNotification:]):

Source/WebKit2:

* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::platformSetCacheModel):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 03250c99
This diff is collapsed.
......@@ -40,8 +40,6 @@
#include <wtf/MathExtras.h>
#include <wtf/StdLibExtras.h>
using namespace std;
namespace WebCore {
const double DefaultGrainDuration = 0.020; // 20ms
......@@ -231,7 +229,7 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination
double loopStartFrame = m_loopStart * buffer()->sampleRate();
double loopEndFrame = m_loopEnd * buffer()->sampleRate();
virtualEndFrame = min(loopEndFrame, virtualEndFrame);
virtualEndFrame = std::min(loopEndFrame, virtualEndFrame);
virtualDeltaFrames = virtualEndFrame - loopStartFrame;
}
......@@ -261,8 +259,8 @@ bool AudioBufferSourceNode::renderFromBuffer(AudioBus* bus, unsigned destination
endFrame = static_cast<unsigned>(virtualEndFrame);
while (framesToProcess > 0) {
int framesToEnd = endFrame - readIndex;
int framesThisTime = min(framesToProcess, framesToEnd);
framesThisTime = max(0, framesThisTime);
int framesThisTime = std::min(framesToProcess, framesToEnd);
framesThisTime = std::max(0, framesThisTime);
for (unsigned i = 0; i < numberOfChannels; ++i)
memcpy(destinationChannels[i] + writeIndex, sourceChannels[i] + readIndex, sizeof(float) * framesThisTime);
......@@ -398,8 +396,8 @@ void AudioBufferSourceNode::startGrain(double when, double grainOffset, double g
// Do sanity checking of grain parameters versus buffer size.
double bufferDuration = buffer()->duration();
grainOffset = max(0.0, grainOffset);
grainOffset = min(bufferDuration, grainOffset);
grainOffset = std::max(0.0, grainOffset);
grainOffset = std::min(bufferDuration, grainOffset);
m_grainOffset = grainOffset;
// Handle default/unspecified duration.
......@@ -407,8 +405,8 @@ void AudioBufferSourceNode::startGrain(double when, double grainOffset, double g
if (!grainDuration)
grainDuration = maxDuration;
grainDuration = max(0.0, grainDuration);
grainDuration = min(maxDuration, grainDuration);
grainDuration = std::max(0.0, grainDuration);
grainDuration = std::min(maxDuration, grainDuration);
m_grainDuration = grainDuration;
m_isGrain = true;
......@@ -447,10 +445,10 @@ double AudioBufferSourceNode::totalPitchRate()
double totalRate = dopplerRate * sampleRateFactor * basePitchRate;
// Sanity check the total rate. It's very important that the resampler not get any bad rate values.
totalRate = max(0.0, totalRate);
totalRate = std::max(0.0, totalRate);
if (!totalRate)
totalRate = 1; // zero rate is considered illegal
totalRate = min(MaxRate, totalRate);
totalRate = std::min(MaxRate, totalRate);
bool isTotalRateValid = !std::isnan(totalRate) && !std::isinf(totalRate);
ASSERT(isTotalRateValid);
......
......@@ -33,8 +33,6 @@
#include "AudioNodeOutput.h"
#include <algorithm>
using namespace std;
namespace WebCore {
AudioNodeInput::AudioNodeInput(AudioNode* node)
......@@ -157,11 +155,11 @@ unsigned AudioNodeInput::numberOfChannels() const
AudioNodeOutput* output = *i;
// Use output()->numberOfChannels() instead of output->bus()->numberOfChannels(),
// because the calling of AudioNodeOutput::bus() is not safe here.
maxChannels = max(maxChannels, output->numberOfChannels());
maxChannels = std::max(maxChannels, output->numberOfChannels());
}
if (mode == AudioNode::ClampedMax)
maxChannels = min(maxChannels, static_cast<unsigned>(node()->channelCount()));
maxChannels = std::min(maxChannels, static_cast<unsigned>(node()->channelCount()));
return maxChannels;
}
......
......@@ -34,8 +34,6 @@
#include <algorithm>
#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
void AudioParamTimeline::setValueAtTime(float value, float time)
......@@ -189,9 +187,9 @@ float AudioParamTimeline::valuesForTimeRangeImpl(
// until we reach the first event time.
double firstEventTime = m_events[0].time();
if (firstEventTime > startTime) {
double fillToTime = min(endTime, firstEventTime);
double fillToTime = std::min(endTime, firstEventTime);
unsigned fillToFrame = AudioUtilities::timeToSampleFrame(fillToTime - startTime, sampleRate);
fillToFrame = min(fillToFrame, numberOfValues);
fillToFrame = std::min(fillToFrame, numberOfValues);
for (; writeIndex < fillToFrame; ++writeIndex)
values[writeIndex] = defaultValue;
......@@ -222,9 +220,9 @@ float AudioParamTimeline::valuesForTimeRangeImpl(
float k = deltaTime > 0 ? 1 / deltaTime : 0;
double sampleFrameTimeIncr = 1 / sampleRate;
double fillToTime = min(endTime, time2);
double fillToTime = std::min(endTime, time2);
unsigned fillToFrame = AudioUtilities::timeToSampleFrame(fillToTime - startTime, sampleRate);
fillToFrame = min(fillToFrame, numberOfValues);
fillToFrame = std::min(fillToFrame, numberOfValues);
ParamEvent::Type nextEventType = nextEvent ? static_cast<ParamEvent::Type>(nextEvent->type()) : ParamEvent::LastType /* unknown */;
......@@ -316,9 +314,9 @@ float AudioParamTimeline::valuesForTimeRangeImpl(
// instead of the next event time.
unsigned nextEventFillToFrame = fillToFrame;
float nextEventFillToTime = fillToTime;
fillToTime = min(endTime, time1 + duration);
fillToTime = std::min(endTime, time1 + duration);
fillToFrame = AudioUtilities::timeToSampleFrame(fillToTime - startTime, sampleRate);
fillToFrame = min(fillToFrame, numberOfValues);
fillToFrame = std::min(fillToFrame, numberOfValues);
// Index into the curve data using a floating-point value.
// We're scaling the number of curve points by the duration (see curvePointsPerFrame).
......
......@@ -35,8 +35,6 @@
#include <algorithm>
#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
const double AudioScheduledSourceNode::UnknownTime = -1;
......@@ -93,7 +91,7 @@ void AudioScheduledSourceNode::updateSchedulingInfo(size_t quantumFrameSize,
}
quantumFrameOffset = startFrame > quantumStartFrame ? startFrame - quantumStartFrame : 0;
quantumFrameOffset = min(quantumFrameOffset, quantumFrameSize); // clamp to valid range
quantumFrameOffset = std::min(quantumFrameOffset, quantumFrameSize); // clamp to valid range
nonSilentFramesToProcess = quantumFrameSize - quantumFrameOffset;
if (!nonSilentFramesToProcess) {
......@@ -159,7 +157,7 @@ void AudioScheduledSourceNode::stop(double when, ExceptionCode& ec)
return;
}
when = max(0.0, when);
when = std::max<double>(0, when);
m_endTime = when;
}
......
......@@ -32,8 +32,6 @@
#include "AudioNodeOutput.h"
#include <algorithm>
using namespace std;
namespace WebCore {
AudioSummingJunction::AudioSummingJunction(AudioContext* context)
......
......@@ -31,8 +31,6 @@
#include "AudioUtilities.h"
#include <algorithm>
using namespace std;
namespace WebCore {
const float SmoothingTimeConstant = 0.020f; // 20ms
......@@ -112,8 +110,8 @@ void DelayDSPKernel::process(const float* source, float* destination, size_t fra
delayTime = delayProcessor() ? delayProcessor()->delayTime()->finalValue() : m_desiredDelayFrames / sampleRate;
// Make sure the delay time is in a valid range.
delayTime = min(maxTime, delayTime);
delayTime = max(0.0, delayTime);
delayTime = std::min(maxTime, delayTime);
delayTime = std::max(0.0, delayTime);
if (m_firstTime) {
m_currentDelayTime = delayTime;
......
......@@ -33,8 +33,6 @@
#include "HRTFDatabaseLoader.h"
#include <algorithm>
#include <wtf/MainThread.h>
using namespace std;
namespace WebCore {
......@@ -133,7 +131,7 @@ void OfflineAudioDestinationNode::offlineRender()
// Render one render quantum.
render(0, m_renderBus.get(), renderQuantumSize);
size_t framesAvailableToCopy = min(framesToProcess, renderQuantumSize);
size_t framesAvailableToCopy = std::min(framesToProcess, renderQuantumSize);
for (unsigned channelIndex = 0; channelIndex < numberOfChannels; ++channelIndex) {
const float* source = m_renderBus->channel(channelIndex)->data();
......
......@@ -37,8 +37,6 @@
#include <algorithm>
#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
using namespace VectorMath;
......
......@@ -38,8 +38,6 @@
#include "ScriptExecutionContext.h"
#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
static void fixNANs(double &x)
......@@ -353,8 +351,8 @@ float PannerNode::dopplerRate()
sourceProjection = -sourceProjection;
double scaledSpeedOfSound = speedOfSound / dopplerFactor;
listenerProjection = min(listenerProjection, scaledSpeedOfSound);
sourceProjection = min(sourceProjection, scaledSpeedOfSound);
listenerProjection = std::min(listenerProjection, scaledSpeedOfSound);
sourceProjection = std::min(sourceProjection, scaledSpeedOfSound);
dopplerShift = ((speedOfSound - dopplerFactor * listenerProjection) / (speedOfSound - dopplerFactor * sourceProjection));
fixNANs(dopplerShift); // avoid illegal values
......
......@@ -35,8 +35,6 @@
const unsigned RenderingQuantum = 128;
using namespace std;
namespace WebCore {
WaveShaperDSPKernel::WaveShaperDSPKernel(WaveShaperProcessor* processor)
......@@ -112,10 +110,10 @@ void WaveShaperDSPKernel::processCurve(const float* source, float* destination,
// Clip index to the input range of the curve.
// This takes care of input outside of nominal range -1 -> +1
index1 = max(index1, 0);
index1 = min(index1, curveLength - 1);
index2 = max(index2, 0);
index2 = min(index2, curveLength - 1);
index1 = std::max(index1, 0);
index1 = std::min(index1, curveLength - 1);
index2 = std::max(index2, 0);
index2 = std::min(index2, curveLength - 1);
double value1 = curveData[index1];
double value2 = curveData[index2];
......
......@@ -50,8 +50,6 @@
#include <wtf/StdLibExtras.h>
#include <wtf/text/CString.h>
using namespace std;
namespace WebCore {
static DatabaseTracker* staticTracker = 0;
......@@ -141,7 +139,7 @@ bool DatabaseTracker::hasAdequateQuotaForOrigin(SecurityOrigin* origin, unsigned
unsigned long long usage = usageForOrigin(origin);
// If the database will fit, allow its creation.
unsigned long long requirement = usage + max(1UL, estimatedSize);
unsigned long long requirement = usage + std::max<unsigned long long>(1, estimatedSize);
if (requirement < usage) {
// The estimated size is so big it causes an overflow; don't allow creation.
err = DatabaseError::DatabaseSizeOverflowed;
......
......@@ -64,8 +64,6 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/text/WTFString.h>
using namespace std;
namespace WebCore {
const size_t maxReasonSizeInBytes = 123;
......@@ -121,8 +119,8 @@ static String joinStrings(const Vector<String>& strings, const char* separator)
static unsigned long saturateAdd(unsigned long a, unsigned long b)
{
if (numeric_limits<unsigned long>::max() - a < b)
return numeric_limits<unsigned long>::max();
if (std::numeric_limits<unsigned long>::max() - a < b)
return std::numeric_limits<unsigned long>::max();
return a + b;
}
......
......@@ -66,8 +66,6 @@
#include <wtf/text/StringHash.h>
#include <wtf/text/WTFString.h>
using namespace std;
namespace WebCore {
const double TCPMaximumSegmentLifetime = 2 * 60.0;
......
......@@ -29,8 +29,6 @@
#include <wtf/CryptographicallyRandomNumber.h>
#include <wtf/MathExtras.h>
using namespace std;
namespace WebCore {
// Constants for hybi-10 frame format.
......@@ -97,7 +95,7 @@ WebSocketFrame::ParseFrameResult WebSocketFrame::parseFrame(char* data, size_t d
static const uint64_t maxPayloadLength = UINT64_C(0x7FFFFFFFFFFFFFFF);
size_t maskingKeyLength = masked ? maskingKeyWidthInBytes : 0;
if (payloadLength64 > maxPayloadLength || payloadLength64 + maskingKeyLength > numeric_limits<size_t>::max()) {
if (payloadLength64 > maxPayloadLength || payloadLength64 + maskingKeyLength > std::numeric_limits<size_t>::max()) {
errorString = "WebSocket frame length too large: " + String::number(payloadLength64) + " bytes";
return FrameError;
}
......
......@@ -36,8 +36,6 @@
#include "AccessibilityTableRow.h"
#include "RenderObject.h"
using namespace std;
namespace WebCore {
AccessibilityARIAGrid::AccessibilityARIAGrid(RenderObject* renderer)
......
......@@ -33,8 +33,6 @@
#include "AccessibilityTable.h"
#include "AccessibilityTableRow.h"
using namespace std;
namespace WebCore {
AccessibilityARIAGridCell::AccessibilityARIAGridCell(RenderObject* renderer)
......
......@@ -33,8 +33,6 @@
#include "AccessibilityTable.h"
#include "RenderObject.h"
using namespace std;
namespace WebCore {
AccessibilityARIAGridRow::AccessibilityARIAGridRow(RenderObject* renderer)
......
......@@ -33,8 +33,6 @@
#include "HTMLNames.h"
#include "RenderObject.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -37,8 +37,6 @@
#include "RenderListBox.h"
#include "RenderObject.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -41,8 +41,6 @@
#include "RenderListBox.h"
#include "RenderObject.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -82,8 +82,6 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/CharacterNames.h>
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -67,8 +67,6 @@
#include <wtf/text/WTFString.h>
#include <wtf/unicode/CharacterNames.h>
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -101,8 +101,6 @@
#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/CharacterNames.h>
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -382,7 +382,7 @@ void AccessibilityTable::addChildren()
appendedRows.add(row);
}
maxColumnCount = max(tableSection->numColumns(), maxColumnCount);
maxColumnCount = std::max(tableSection->numColumns(), maxColumnCount);
tableSection = table->sectionBelow(tableSection, SkipEmptySections);
}
......
......@@ -34,8 +34,6 @@
#include "RenderObject.h"
#include "RenderTableCell.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -36,8 +36,6 @@
#include "RenderTableCell.h"
#include "RenderTableSection.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -32,8 +32,6 @@
#include "AXObjectCache.h"
#include "AccessibilityTable.h"
using namespace std;
namespace WebCore {
AccessibilityTableHeaderContainer::AccessibilityTableHeaderContainer()
......
......@@ -37,8 +37,6 @@
#include "RenderTableCell.h"
#include "RenderTableRow.h"
using namespace std;
namespace WebCore {
using namespace HTMLNames;
......
......@@ -75,7 +75,6 @@
using namespace WebCore;
using namespace HTMLNames;
using namespace std;
static NSArray *convertMathPairsToNSArray(const AccessibilityObject::AccessibilityMathMultiscriptPairs& pairs, NSString *subscriptKey, NSString *superscriptKey)
{
......
......@@ -77,7 +77,6 @@
using namespace WebCore;
using namespace HTMLNames;
using namespace std;
// Cell Tables
#ifndef NSAccessibilitySelectedCellsAttribute
......@@ -3619,7 +3618,7 @@ static RenderObject* rendererForView(NSView* view)
if (index >= childCount)
return nil;
NSUInteger arrayLength = min(childCount - index, maxCount);
NSUInteger arrayLength = std::min(childCount - index, maxCount);
return [children subarrayWithRange:NSMakeRange(index, arrayLength)];
} else if (m_object->isTree()) {
// Tree objects return their rows as their children. We can use the original method in this case.
......@@ -3631,7 +3630,7 @@ static RenderObject* rendererForView(NSView* view)
if (index >= childCount)
return nil;
unsigned available = min(childCount - index, maxCount);
unsigned available = std::min(childCount - index, maxCount);
NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:available];
for (unsigned added = 0; added < available; ++index, ++added) {
......
......@@ -45,7 +45,6 @@
using namespace JSC;
using namespace WTF;
using namespace std;
namespace WebCore {
......@@ -389,7 +388,7 @@ void JSCSSStyleDeclaration::getOwnPropertyNames(JSObject* object, ExecState* exe
Vector<String, numCSSProperties> jsPropertyNames;
for (int id = firstCSSProperty; id < firstCSSProperty + numCSSProperties; ++id)
jsPropertyNames.append(getJSPropertyName(static_cast<CSSPropertyID>(id)));
sort(jsPropertyNames.begin(), jsPropertyNames.end(), WTF::codePointCompareLessThan);
std::sort(jsPropertyNames.begin(), jsPropertyNames.end(), WTF::codePointCompareLessThan);
propertyIdentifiers = new Identifier[numCSSProperties];
for (int i = 0; i < numCSSProperties; ++i)
......
......@@ -38,7 +38,6 @@
#include "PositionOptions.h"
using namespace JSC;
using namespace std;
namespace WebCore {
......@@ -54,7 +53,7 @@ static void setTimeout(PositionOptions* options, const double& timeout)
// If the value is positive infinity, there's nothing to do.
if (!(std::isinf(timeout) && (timeout > 0))) {
// Wrap to int32 and force non-negative to match behavior of window.setTimeout.
options->setTimeout(max(0, static_cast<int>(timeout)));
options->setTimeout(std::max<int>(0, timeout));
}
}
......@@ -65,7 +64,7 @@ static void setMaximumAge(PositionOptions* options, const double& maximumAge)
options->clearMaximumAge();
} else {
// Wrap to int32 and force non-negative to match behavior of window.setTimeout.
options->setMaximumAge(max(0, static_cast<int>(maximumAge)));
options->setMaximumAge(std::max<int>(0, maximumAge));
}
}
......
......@@ -56,7 +56,6 @@
#include <wtf/text/TextPosition.h>
using namespace JSC;
using namespace std;
namespace WebCore {
......
......@@ -69,7 +69,6 @@
#include <wtf/Vector.h>
using namespace JSC;
using namespace std;
#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN) || CPU(NEEDS_ALIGNED_ACCESS)
#define ASSUME_LITTLE_ENDIAN 0
......@@ -312,7 +311,7 @@ template <> void writeLittleEndian<uint8_t>(Vector<uint8_t>& buffer, uint8_t val
template <typename T> static bool writeLittleEndian(Vector<uint8_t>& buffer, const T* values, uint32_t length)
{
if (length > numeric_limits<uint32_t>::max() / sizeof(T))
if (length > std::numeric_limits<uint32_t>::max() / sizeof(T))
return false;
#if ASSUME_LITTLE_ENDIAN
......@@ -821,7 +820,7 @@ private:
}
// Guard against overflow
if (str.length() > (numeric_limits<uint32_t>::max() - sizeof(uint32_t)) / sizeof(UChar)) {
if (str.length() > (std::numeric_limits<uint32_t>::max() - sizeof(uint32_t)) / sizeof(UChar)) {
fail();
return;
}
......@@ -1109,10 +1108,10 @@ public:
const Vector<uint8_t>& buffer)
{
if (!buffer.size())
return make_pair(jsNull(), UnspecifiedError);
return std::make_pair(jsNull(), UnspecifiedError);
CloneDeserializer deserializer(exec, globalObject, messagePorts, arrayBufferContentsArray, buffer);
if (!deserializer.isValid())
return make_pair(JSValue(), ValidationError);
return std::make_pair(JSValue(), ValidationError);
return deserializer.deserialize();
}
......@@ -1283,7 +1282,7 @@ private:
static bool readString(const uint8_t*& ptr, const uint8_t* end, String& str, unsigned length)
{
if (length >= numeric_limits<int32_t>::max() / sizeof(UChar))
if (length >= std::numeric_limits<int32_t>::max() / sizeof(UChar))
return false;