Ignore:
Timestamp:
Oct 16, 2007, 1:13:24 PM (18 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • wtf/ASCIICType.h: Added.
  • wtf/DisallowCType.h: Added.
  • kjs/config.h: Include DisallowCType.h.
  • kjs/date_object.cpp: (KJS::skipSpacesAndComments): (KJS::findMonth): (KJS::parseDate):
  • kjs/function.cpp: (KJS::decode):
  • kjs/ustring.cpp: (KJS::UString::toDouble): Use ASCIICType.h functions instead of ctype.h ones.

WebCore:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • ForwardingHeaders/wtf/ASCIICType.h: Added.
  • ForwardingHeaders/wtf/DisallowCType.h: Added.
  • WebCorePrefix.h: Get rid of inclusion of <ctype.h>.
  • config.h: Include DisallowCType.h.
  • css/CSSParser.cpp: (WebCore::ParseString::lower):
  • css/CSSPrimitiveValue.cpp: (WebCore::isCSSTokenizerIdentifier):
  • css/CSSStyleDeclaration.cpp: (WebCore::propertyID):
  • html/HTMLSelectElement.cpp: (WebCore::stripLeadingWhiteSpace):
  • html/HTMLTokenizer.cpp: (WebCore::tagMatch):
  • loader/FTPDirectoryParser.cpp: (WebCore::parseOneFTPLine):
  • loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::checkForHeadCharset):
  • platform/DeprecatedCString.cpp: (WebCore::DeprecatedCString::lower): (WebCore::DeprecatedCString::upper): (WebCore::DeprecatedCString::find): (WebCore::DeprecatedCString::contains):
  • platform/DeprecatedString.cpp: (WebCore::equalCaseInsensitive): (WebCore::isCharacterAllowedInBase): (WebCore::DeprecatedString::find): (WebCore::DeprecatedString::contains): (WebCore::toIntegralType):
  • platform/DeprecatedString.h: (WebCore::DeprecatedChar::isSpace): (WebCore::DeprecatedChar::lower): (WebCore::DeprecatedChar::upper):
  • platform/KURL.cpp: (WebCore::KURL::parse):
  • platform/StringImpl.cpp: (WebCore::isSpace): (WebCore::StringImpl::containsOnlyWhitespace): (WebCore::StringImpl::isLower): (WebCore::StringImpl::lower): (WebCore::StringImpl::find): (WebCore::StringImpl::reverseFind): (WebCore::equalIgnoringCase):
  • platform/TextEncodingRegistry.cpp: (WebCore::TextEncodingNameHash::equal): (WebCore::TextEncodingNameHash::hash): (WebCore::atomicCanonicalTextEncodingName):
  • platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent):
  • platform/win/KeyEventWin.cpp: (WebCore::keyIdentifierForWindowsKeyCode):
  • platform/win/PopupMenuWin.cpp: (WebCore::isASCIIPrintable): (WebCore::PopupWndProc):
  • plugins/win/PluginViewWin.cpp: (WebCore::capitalizeRFC822HeaderFieldName):
  • rendering/RenderText.cpp: (WebCore::RenderText::widthFromCache): Use ASCIICType.h functions instead of ctype.h ones.

WebKit:

Reviewed by Maciej and Geoff (and looked over by Eric).

  • ForwardingHeaders/wtf/ASCIICType.h: Added.
  • ForwardingHeaders/wtf/DisallowCType.h: Added.
  • WebKitPrefix.h: Include DisallowCType.h.
  • Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use toASCIILower.
  • WebView/WebHTMLView.mm: (-[WebHTMLView callWebCoreCommand:]): Use toASCIIUpper. (-[WebTextCompleteController filterKeyDown:]): Add a list of specific character codes, instead of using ispunct.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r26454 r26676  
    11/*
    2  *  This file is part of the KDE libraries
    32 *  Copyright (C) 1999-2000 Harri Porten ([email protected])
    4  *  Copyright (C) 2004 Apple Computer, Inc.
     3 *  Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
    54 *
    65 *  This library is free software; you can redistribute it and/or
     
    4140#endif
    4241
    43 #include <ctype.h>
    4442#include <float.h>
    4543#include <limits.h>
     
    5553#include "DateMath.h"
    5654
     55#include <wtf/ASCIICType.h>
    5756#include <wtf/MathExtras.h>
    5857#include <wtf/StringExtras.h>
     
    6160    #include <CoreFoundation/CoreFoundation.h>
    6261#endif
     62
     63using namespace WTF;
    6364
    6465namespace KJS {
     
    743744};
    744745
    745 inline static void skipSpacesAndComments(const char *&s)
     746inline static void skipSpacesAndComments(const char*& s)
    746747{
    747748    int nesting = 0;
    748749    char ch;
    749750    while ((ch = *s)) {
    750         if (!isspace(ch)) {
     751        if (!isASCIISpace(ch)) {
    751752            if (ch == '(')
    752753                nesting++;
     
    761762
    762763// returns 0-11 (Jan-Dec); -1 on failure
    763 static int findMonth(const char *monthStr)
     764static int findMonth(const char* monthStr)
    764765{
    765766    assert(monthStr);
     
    768769        if (!*monthStr)
    769770            return -1;
    770         needle[i] = static_cast<char>(tolower(*monthStr++));
     771        needle[i] = static_cast<char>(toASCIILower(*monthStr++));
    771772    }
    772773    needle[3] = '\0';
     
    806807    const char *wordStart = dateString;
    807808    // Check contents of first words if not number
    808     while (*dateString && !isdigit(*dateString)) {
    809         if (isspace(*dateString) || *dateString == '(') {
     809    while (*dateString && !isASCIIDigit(*dateString)) {
     810        if (isASCIISpace(*dateString) || *dateString == '(') {
    810811            if (dateString - wordStart >= 3)
    811812                month = findMonth(wordStart);
     
    956957
    957958            // ':40 GMT'
    958             if (*dateString && *dateString != ':' && !isspace(*dateString))
     959            if (*dateString && *dateString != ':' && !isASCIISpace(*dateString))
    959960                return NaN;
    960961
Note: See TracChangeset for help on using the changeset viewer.