[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

paroga at webkit.org paroga at webkit.org
Wed Dec 22 16:17:54 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1d25494330e87bc6174a1f36f39018c0af1d62cf
Author: paroga at webkit.org <paroga at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Nov 21 17:09:31 2010 +0000

    2010-11-21  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by Csaba Osztrogonác.
    
            Use WTF_ARRAY_LENGTH in WebCore/platform directory
            https://bugs.webkit.org/show_bug.cgi?id=49881
    
            * platform/KURL.cpp:
            (WebCore::portAllowed):
            * platform/KURLGoogle.cpp:
            (WebCore::portAllowed):
            * platform/MIMETypeRegistry.cpp:
            (WebCore::initializeSupportedImageMIMETypes):
            (WebCore::initializeSupportedJavaScriptMIMETypes):
            (WebCore::initializeSupportedNonImageMimeTypes):
            * platform/UUID.cpp:
            (WebCore::createCanonicalUUIDString):
            * platform/efl/RenderThemeEfl.cpp:
            (WebCore::RenderThemeEfl::applyEdjeStateFromForm):
            * platform/graphics/GraphicsTypes.cpp:
            * platform/graphics/chromium/FontCacheChromiumWin.cpp:
            (WebCore::FontCodepage::if):
            * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
            * platform/graphics/mac/ComplexTextControllerCoreText.cpp:
            (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):
            * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
            (WebCore::disableComponentsOnce):
            * platform/graphics/mac/SimpleFontDataATSUI.mm:
            (WebCore::SimpleFontData::checkShapesArabic):
            * platform/graphics/mac/SimpleFontDataCoreText.cpp:
            (WebCore::SimpleFontData::getCFStringAttributes):
            * platform/graphics/win/GraphicsContextCGWin.cpp:
            (WebCore::GraphicsContext::drawLineForTextChecking):
            * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
            (WebCore::disableComponentsOnce):
            * platform/graphics/win/QTMovie.cpp:
            (QTMovie::load):
            * platform/network/cf/SocketStreamHandleCFNet.cpp:
            (WebCore::SocketStreamHandle::createStreams):
            * platform/text/TextEncodingRegistry.cpp:
            (WebCore::pruneBlacklistedCodecs):
            * platform/text/transcoder/FontTranscoder.cpp:
            (WebCore::FontTranscoder::FontTranscoder):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72498 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ec9bbb4..68ce856 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,47 @@
+2010-11-21  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Use WTF_ARRAY_LENGTH in WebCore/platform directory
+        https://bugs.webkit.org/show_bug.cgi?id=49881
+
+        * platform/KURL.cpp:
+        (WebCore::portAllowed):
+        * platform/KURLGoogle.cpp:
+        (WebCore::portAllowed):
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedImageMIMETypes):
+        (WebCore::initializeSupportedJavaScriptMIMETypes):
+        (WebCore::initializeSupportedNonImageMimeTypes):
+        * platform/UUID.cpp:
+        (WebCore::createCanonicalUUIDString):
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::applyEdjeStateFromForm):
+        * platform/graphics/GraphicsTypes.cpp:
+        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+        (WebCore::FontCodepage::if):
+        * platform/graphics/chromium/FontUtilsChromiumWin.cpp:
+        * platform/graphics/mac/ComplexTextControllerCoreText.cpp:
+        (WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText):
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::disableComponentsOnce):
+        * platform/graphics/mac/SimpleFontDataATSUI.mm:
+        (WebCore::SimpleFontData::checkShapesArabic):
+        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+        (WebCore::SimpleFontData::getCFStringAttributes):
+        * platform/graphics/win/GraphicsContextCGWin.cpp:
+        (WebCore::GraphicsContext::drawLineForTextChecking):
+        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
+        (WebCore::disableComponentsOnce):
+        * platform/graphics/win/QTMovie.cpp:
+        (QTMovie::load):
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::createStreams):
+        * platform/text/TextEncodingRegistry.cpp:
+        (WebCore::pruneBlacklistedCodecs):
+        * platform/text/transcoder/FontTranscoder.cpp:
+        (WebCore::FontTranscoder::FontTranscoder):
+
 2010-11-20  Andreas Kling  <kling at webkit.org>
 
         Rubber-stamped by Antonio Gomes.
diff --git a/WebCore/platform/KURL.cpp b/WebCore/platform/KURL.cpp
index 3ac5d86..60049df 100644
--- a/WebCore/platform/KURL.cpp
+++ b/WebCore/platform/KURL.cpp
@@ -1796,7 +1796,7 @@ bool portAllowed(const KURL& url)
         6669, // Alternate IRC [Apple addition]
         invalidPortNumber, // Used to block all invalid port numbers
     };
-    const unsigned short* const blockedPortListEnd = blockedPortList + sizeof(blockedPortList) / sizeof(blockedPortList[0]);
+    const unsigned short* const blockedPortListEnd = blockedPortList + WTF_ARRAY_LENGTH(blockedPortList);
 
 #ifndef NDEBUG
     // The port list must be sorted for binary_search to work.
diff --git a/WebCore/platform/KURLGoogle.cpp b/WebCore/platform/KURLGoogle.cpp
index 726bc57..6d63734 100644
--- a/WebCore/platform/KURLGoogle.cpp
+++ b/WebCore/platform/KURLGoogle.cpp
@@ -893,7 +893,7 @@ bool portAllowed(const KURL& url)
         6669, // Alternate IRC [Apple addition]
         invalidPortNumber, // Used to block all invalid port numbers
     };
-    const unsigned short* const blockedPortListEnd = blockedPortList + sizeof(blockedPortList) / sizeof(blockedPortList[0]);
+    const unsigned short* const blockedPortListEnd = blockedPortList + WTF_ARRAY_LENGTH(blockedPortList);
 
 #ifndef NDEBUG
     // The port list must be sorted for binary_search to work.
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index c152a36..f3cccc0 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -119,7 +119,7 @@ static void initializeSupportedImageMIMETypes()
         "image/x-icon",    // ico
         "image/x-xbitmap"  // xbm
     };
-    for (size_t i = 0; i < sizeof(types) / sizeof(types[0]); ++i) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(types); ++i) {
         supportedImageMIMETypes->add(types[i]);
         supportedImageResourceMIMETypes->add(types[i]);
     }
@@ -187,7 +187,7 @@ static void initializeSupportedJavaScriptMIMETypes()
         "text/jscript",
         "text/livescript",
     };
-    for (size_t i = 0; i < sizeof(types) / sizeof(types[0]); ++i)
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(types); ++i)
       supportedJavaScriptMIMETypes->add(types[i]);
 }
 
@@ -222,7 +222,7 @@ static void initializeSupportedNonImageMimeTypes()
     COMPILE_ASSERT(sizeof(types) / sizeof(types[0]) <= 16,
                    nonimage_mime_types_must_be_less_than_or_equal_to_16);
 
-    for (size_t i = 0; i < sizeof(types)/sizeof(types[0]); ++i)
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(types); ++i)
         supportedNonImageMIMETypes->add(types[i]);
 
     ArchiveFactory::registerKnownArchiveMIMETypes();
diff --git a/WebCore/platform/UUID.cpp b/WebCore/platform/UUID.cpp
index eb721e0..faad008 100644
--- a/WebCore/platform/UUID.cpp
+++ b/WebCore/platform/UUID.cpp
@@ -95,7 +95,7 @@ String createCanonicalUUIDString()
     return canonicalUuidStr;
 #elif OS(LINUX) && PLATFORM(CHROMIUM)
     unsigned randomData[4];
-    for (size_t i = 0; i < sizeof(randomData) / sizeof(randomData[0]); ++i)
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(randomData); ++i)
         randomData[i] = static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0));
 
     // Format as Version 4 UUID.
diff --git a/WebCore/platform/efl/RenderThemeEfl.cpp b/WebCore/platform/efl/RenderThemeEfl.cpp
index 6076747..7cf635f 100644
--- a/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -247,11 +247,10 @@ void RenderThemeEfl::applyEdjeStateFromForm(Evas_Object* o, ControlStates states
         "window-inactive",
         "indeterminate"
     };
-    size_t i, last = sizeof(signals) / sizeof(signals[0]);
 
     edje_object_signal_emit(o, "reset", "");
 
-    for (i = 0; i < last; i++) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(signals); ++i) {
         if (states & (1 << i))
             edje_object_signal_emit(o, signals[i], "");
     }
diff --git a/WebCore/platform/graphics/GraphicsTypes.cpp b/WebCore/platform/graphics/GraphicsTypes.cpp
index 761bf40..dd52ba9 100644
--- a/WebCore/platform/graphics/GraphicsTypes.cpp
+++ b/WebCore/platform/graphics/GraphicsTypes.cpp
@@ -47,7 +47,7 @@ static const char* const compositeOperatorNames[] = {
     "highlight",
     "lighter"
 };
-const int numCompositeOperatorNames = sizeof(compositeOperatorNames) / sizeof(compositeOperatorNames[0]);
+const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames);
 
 bool parseCompositeOperator(const String& s, CompositeOperator& op)
 {
diff --git a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index 384b1c5..347a3fb 100644
--- a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -211,9 +211,8 @@ static bool LookupAltName(const String& name, String& altName)
     static NameMap* fontNameMap = 0;
 
     if (!fontNameMap) {
-        size_t numElements = sizeof(namePairs) / sizeof(NamePair);
         fontNameMap = new NameMap;
-        for (size_t i = 0; i < numElements; ++i)
+        for (size_t i = 0; i < WTF_ARRAY_LENGTH(namePairs); ++i)
             fontNameMap->set(String(namePairs[i].name), &(namePairs[i].altNameCodepage));
     }
 
diff --git a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
index e725c50..bea0572 100644
--- a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.cpp
@@ -150,14 +150,14 @@ void initializeScriptFontMap(ScriptToFontMap& scriptFontMap)
         {USCRIPT_MYANMAR, myanmarFonts},
     };
 
-    for (int i = 0; i < sizeof(fontMap) / sizeof(fontMap[0]); ++i)
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i)
         scriptFontMap[fontMap[i].script] = fontMap[i].family;
 
     // FIXME: Instead of scanning the hard-coded list, we have to 
     // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts
     // when it's possible (e.g. using OS/2 table). If we do that, this 
     // had better be pulled out of here.
-    for (int i = 0; i < sizeof(scriptToFontFamilies) / sizeof(scriptToFontFamilies[0]); ++i) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) {
         UScriptCode script = scriptToFontFamilies[i].script;
         scriptFontMap[script] = 0;
         const UChar** familyPtr = scriptToFontFamilies[i].families;
diff --git a/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp b/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
index cbb7610..42e7897 100644
--- a/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp
@@ -138,8 +138,8 @@ void ComplexTextController::collectComplexTextRunsForCharactersCoreText(const UC
         const short rtlForcedEmbeddingLevelValue = 1;
         static const void* ltrOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &ltrForcedEmbeddingLevelValue) };
         static const void* rtlOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &rtlForcedEmbeddingLevelValue) };
-        static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, sizeof(optionKeys) / sizeof(*optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-        static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, sizeof(optionKeys) / sizeof(*optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+        static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+        static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
 
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
         ProviderInfo info = { cp, length, fontData->getCFStringAttributes(m_font.typesettingFeatures()) };
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 6da0da1..1538e07 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -316,7 +316,7 @@ static void disableComponentsOnce()
         {'imdc', 'pdf ', 'appl', 0, 0},  
     };
 
-    for (size_t i = 0; i < sizeof(componentsToDisable)/sizeof(componentsToDisable[0]); ++i) 
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(componentsToDisable); ++i) 
         wkQTMovieDisableComponent(componentsToDisable[i]);
 }
 
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm b/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm
index beea018..6aa0a39 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm
@@ -59,7 +59,7 @@ void SimpleFontData::checkShapesArabic() const
     // heuristic is that if such a font has a glyph metamorphosis table, then
     // it includes shaping information for Arabic.
     FourCharCode tables[] = { 'morx', 'mort' };
-    for (unsigned i = 0; i < sizeof(tables) / sizeof(tables[0]); ++i) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(tables); ++i) {
         ByteCount tableSize;
         OSStatus status = ATSFontGetTable(fontID, tables[i], 0, 0, 0, &tableSize);
         if (status == noErr) {
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
index db6de49..452bd54 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
+++ b/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp
@@ -62,15 +62,13 @@ CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typese
         const void* valuesWithKerningDisabled[] = { platformData().ctFont(), kerningAdjustment, allowLigatures
             ? ligaturesAllowed : ligaturesNotAllowed, orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
         attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningDisabled, valuesWithKerningDisabled,
-            sizeof(keysWithKerningDisabled) / sizeof(*keysWithKerningDisabled),
-            &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+            WTF_ARRAY_LENGTH(keysWithKerningDisabled), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     } else {
         // By omitting the kCTKernAttributeName attribute, we get Core Text's standard kerning.
         static const void* keysWithKerningEnabled[] = { kCTFontAttributeName, kCTLigatureAttributeName, kCTVerticalFormsAttributeName };
         const void* valuesWithKerningEnabled[] = { platformData().ctFont(), allowLigatures ? ligaturesAllowed : ligaturesNotAllowed, orientation() == Vertical ? kCFBooleanTrue : kCFBooleanFalse };
         attributesDictionary.adoptCF(CFDictionaryCreate(0, keysWithKerningEnabled, valuesWithKerningEnabled,
-            sizeof(keysWithKerningEnabled) / sizeof(*keysWithKerningEnabled),
-            &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+            WTF_ARRAY_LENGTH(keysWithKerningEnabled), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     }
 
     return attributesDictionary.get();
diff --git a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
index c9288e5..ab3b5bb 100644
--- a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
+++ b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
@@ -228,20 +228,17 @@ void GraphicsContext::drawLineForTextChecking(const IntPoint& point, int width,
     const float lowerOpacity = 0.88f;
 
     //Top line
-    CGContextSetLineDash(context, edge_offset, edge_dash_lengths, 
-                         sizeof(edge_dash_lengths) / sizeof(edge_dash_lengths[0]));
+    CGContextSetLineDash(context, edge_offset, edge_dash_lengths, WTF_ARRAY_LENGTH(edge_dash_lengths));
     CGContextSetAlpha(context, upperOpacity);
     CGContextStrokeLineSegments(context, upperPoints, 2);
  
     // Middle line
-    CGContextSetLineDash(context, middle_offset, middle_dash_lengths, 
-                         sizeof(middle_dash_lengths) / sizeof(middle_dash_lengths[0]));
+    CGContextSetLineDash(context, middle_offset, middle_dash_lengths, WTF_ARRAY_LENGTH(middle_dash_lengths));
     CGContextSetAlpha(context, middleOpacity);
     CGContextStrokeLineSegments(context, middlePoints, 2);
     
     // Bottom line
-    CGContextSetLineDash(context, edge_offset, edge_dash_lengths,
-                         sizeof(edge_dash_lengths) / sizeof(edge_dash_lengths[0]));
+    CGContextSetLineDash(context, edge_offset, edge_dash_lengths, WTF_ARRAY_LENGTH(edge_dash_lengths));
     CGContextSetAlpha(context, lowerOpacity);
     CGContextStrokeLineSegments(context, lowerPoints, 2);
 
diff --git a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
index 8eaf2a9..2b24a24 100644
--- a/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
+++ b/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
@@ -316,7 +316,7 @@ static void disableComponentsOnce()
         {'eat ', 'TEXT', 'tx3g', 0, 0},  
     };
 
-    for (size_t i = 0; i < sizeof(componentsToDisable) / sizeof(componentsToDisable[0]); ++i) 
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(componentsToDisable); ++i) 
         QTMovie::disableComponent(componentsToDisable[i]);
 }
 
diff --git a/WebCore/platform/graphics/win/QTMovie.cpp b/WebCore/platform/graphics/win/QTMovie.cpp
index e425bf8..efaf218 100644
--- a/WebCore/platform/graphics/win/QTMovie.cpp
+++ b/WebCore/platform/graphics/win/QTMovie.cpp
@@ -548,7 +548,7 @@ void QTMovie::load(CFURLRef url, bool preservesPitch)
     movieProps[moviePropCount].propStatus = 0; 
     moviePropCount++; 
 
-    ASSERT(moviePropCount <= sizeof(movieProps) / sizeof(movieProps[0]));
+    ASSERT(moviePropCount <= WTF_ARRAY_LENGTH(movieProps));
     m_private->m_loadError = NewMovieFromProperties(moviePropCount, movieProps, 0, 0, &m_private->m_movie);
 
 end:
diff --git a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
index 800301a..24b5835 100644
--- a/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
@@ -332,7 +332,7 @@ void SocketStreamHandle::createStreams()
         // But SOCKS5 credentials don't work at the time of this writing anyway, see <rdar://6776698>.
         const void* proxyKeys[] = { kCFStreamPropertySOCKSProxyHost, kCFStreamPropertySOCKSProxyPort };
         const void* proxyValues[] = { m_proxyHost.get(), m_proxyPort.get() };
-        RetainPtr<CFDictionaryRef> connectDictionary(AdoptCF, CFDictionaryCreate(0, proxyKeys, proxyValues, sizeof(proxyKeys) / sizeof(*proxyKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+        RetainPtr<CFDictionaryRef> connectDictionary(AdoptCF, CFDictionaryCreate(0, proxyKeys, proxyValues, WTF_ARRAY_LENGTH(proxyKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
         CFReadStreamSetProperty(m_readStream.get(), kCFStreamPropertySOCKSProxy, connectDictionary.get());
         break;
         }
@@ -344,7 +344,7 @@ void SocketStreamHandle::createStreams()
     if (shouldUseSSL()) {
         const void* keys[] = { kCFStreamSSLPeerName, kCFStreamSSLLevel };
         const void* values[] = { host.get(), kCFStreamSocketSecurityLevelNegotiatedSSL };
-        RetainPtr<CFDictionaryRef> settings(AdoptCF, CFDictionaryCreate(0, keys, values, sizeof(keys) / sizeof(*keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+        RetainPtr<CFDictionaryRef> settings(AdoptCF, CFDictionaryCreate(0, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
         CFReadStreamSetProperty(m_readStream.get(), kCFStreamPropertySSLSettings, settings.get());
         CFWriteStreamSetProperty(m_writeStream.get(), kCFStreamPropertySSLSettings, settings.get());
     }
diff --git a/WebCore/platform/text/TextEncodingRegistry.cpp b/WebCore/platform/text/TextEncodingRegistry.cpp
index fbe5826..6bf5552 100644
--- a/WebCore/platform/text/TextEncodingRegistry.cpp
+++ b/WebCore/platform/text/TextEncodingRegistry.cpp
@@ -189,8 +189,7 @@ static void addToTextCodecMap(const char* name, NewTextCodecFunction function, c
 
 static void pruneBlacklistedCodecs()
 {
-    size_t blacklistedCodecListLength = sizeof(textEncodingNameBlacklist) / sizeof(textEncodingNameBlacklist[0]);
-    for (size_t i = 0; i < blacklistedCodecListLength; ++i) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(textEncodingNameBlacklist); ++i) {
         const char* atomicName = textEncodingNameMap->get(textEncodingNameBlacklist[i]);
         if (!atomicName)
             continue;
diff --git a/WebCore/platform/text/transcoder/FontTranscoder.cpp b/WebCore/platform/text/transcoder/FontTranscoder.cpp
index 8e2f33f..68601f9 100644
--- a/WebCore/platform/text/transcoder/FontTranscoder.cpp
+++ b/WebCore/platform/text/transcoder/FontTranscoder.cpp
@@ -41,23 +41,23 @@ FontTranscoder::FontTranscoder()
 {
     m_converterTypes.add("MS PGothic", BackslashToYenSign);
     UChar unicodeNameMSPGothic[] = {0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x30B4, 0x30B7, 0x30C3, 0x30AF};
-    m_converterTypes.add(AtomicString(unicodeNameMSPGothic, sizeof(unicodeNameMSPGothic) / sizeof(UChar)), BackslashToYenSign);
+    m_converterTypes.add(AtomicString(unicodeNameMSPGothic, WTF_ARRAY_LENGTH(unicodeNameMSPGothic)), BackslashToYenSign);
 
     m_converterTypes.add("MS PMincho", BackslashToYenSign);
     UChar unicodeNameMSPMincho[] = {0xFF2D, 0xFF33, 0x0020, 0xFF30, 0x660E, 0x671D};
-    m_converterTypes.add(AtomicString(unicodeNameMSPMincho, sizeof(unicodeNameMSPMincho) / sizeof(UChar)), BackslashToYenSign);
+    m_converterTypes.add(AtomicString(unicodeNameMSPMincho, WTF_ARRAY_LENGTH(unicodeNameMSPMincho)), BackslashToYenSign);
 
     m_converterTypes.add("MS Gothic", BackslashToYenSign);
     UChar unicodeNameMSGothic[] = {0xFF2D, 0xFF33, 0x0020, 0x30B4, 0x30B7, 0x30C3, 0x30AF};
-    m_converterTypes.add(AtomicString(unicodeNameMSGothic, sizeof(unicodeNameMSGothic) / sizeof(UChar)), BackslashToYenSign);
+    m_converterTypes.add(AtomicString(unicodeNameMSGothic, WTF_ARRAY_LENGTH(unicodeNameMSGothic)), BackslashToYenSign);
 
     m_converterTypes.add("MS Mincho", BackslashToYenSign);
     UChar unicodeNameMSMincho[] = {0xFF2D, 0xFF33, 0x0020, 0x660E, 0x671D};
-    m_converterTypes.add(AtomicString(unicodeNameMSMincho, sizeof(unicodeNameMSMincho) / sizeof(UChar)), BackslashToYenSign);
+    m_converterTypes.add(AtomicString(unicodeNameMSMincho, WTF_ARRAY_LENGTH(unicodeNameMSMincho)), BackslashToYenSign);
 
     m_converterTypes.add("Meiryo", BackslashToYenSign);
     UChar unicodeNameMeiryo[] = {0x30E1, 0x30A4, 0x30EA, 0x30AA};
-    m_converterTypes.add(AtomicString(unicodeNameMeiryo, sizeof(unicodeNameMeiryo) / sizeof(UChar)), BackslashToYenSign);
+    m_converterTypes.add(AtomicString(unicodeNameMeiryo, WTF_ARRAY_LENGTH(unicodeNameMeiryo)), BackslashToYenSign);
 }
 
 FontTranscoder::ConverterType FontTranscoder::converterType(const FontDescription& fontDescription, const TextEncoding* encoding) const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list