[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 15:30:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9d2f832c60984db67527c059453f1ec060fe6cdb
Author: paroga at webkit.org <paroga at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 5 10:15:23 2010 +0000

    2010-11-05  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by David Kilzer.
    
            Replace ARRAYSIZE with WTF_ARRAY_LENGTH
            https://bugs.webkit.org/show_bug.cgi?id=48903
    
            * platform/UUID.cpp:
            (WebCore::createCanonicalUUIDString):
            * platform/graphics/chromium/FontCacheChromiumWin.cpp:
            (WebCore::FontCache::getFontDataForCharacters):
            * platform/graphics/win/FontCacheWin.cpp:
            (WebCore::FontCache::getLastResortFallbackFont):
            * platform/graphics/win/IconWin.cpp:
            (WebCore::Icon::createIconForFiles):
            * platform/win/ClipboardUtilitiesWin.cpp:
            (WebCore::getWebLocData):
            * platform/win/ClipboardWin.cpp:
            (WebCore::createGlobalHDropContent):
            (WebCore::createGlobalImageFileDescriptor):
            (WebCore::ClipboardWin::files):
            (WebCore::ClipboardWin::writeURL):
            * platform/win/DragDataWin.cpp:
            (WebCore::DragData::asFilenames):
            * platform/win/FileSystemWin.cpp:
            (WebCore::safeCreateFile):
    2010-11-05  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by David Kilzer.
    
            Replace ARRAYSIZE with WTF_ARRAY_LENGTH
            https://bugs.webkit.org/show_bug.cgi?id=48903
    
            * WebCoreSupport/EditorClientEfl.cpp:
            (WebCore::EditorClientEfl::interpretKeyEvent):
    2010-11-05  Patrick Gansterer  <paroga at webkit.org>
    
            Reviewed by David Kilzer.
    
            Replace ARRAYSIZE with WTF_ARRAY_LENGTH
            https://bugs.webkit.org/show_bug.cgi?id=48903
    
            * WebCoreSupport/WebChromeClient.cpp:
            (WebChromeClient::exceededDatabaseQuota):
            * WebKitDLL.cpp:
            (DllGetClassObject):
            * WebView.cpp:
            (WebView::mouseWheel):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 97d783d..0b878b4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-11-05  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Replace ARRAYSIZE with WTF_ARRAY_LENGTH
+        https://bugs.webkit.org/show_bug.cgi?id=48903
+
+        * platform/UUID.cpp:
+        (WebCore::createCanonicalUUIDString):
+        * platform/graphics/chromium/FontCacheChromiumWin.cpp:
+        (WebCore::FontCache::getFontDataForCharacters):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::getLastResortFallbackFont):
+        * platform/graphics/win/IconWin.cpp:
+        (WebCore::Icon::createIconForFiles):
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        (WebCore::getWebLocData):
+        * platform/win/ClipboardWin.cpp:
+        (WebCore::createGlobalHDropContent):
+        (WebCore::createGlobalImageFileDescriptor):
+        (WebCore::ClipboardWin::files):
+        (WebCore::ClipboardWin::writeURL):
+        * platform/win/DragDataWin.cpp:
+        (WebCore::DragData::asFilenames):
+        * platform/win/FileSystemWin.cpp:
+        (WebCore::safeCreateFile):
+
 2010-11-05  Roland Steiner  <rolandsteiner at chromium.org>
 
         Reviewed by Dirk Schulze.
diff --git a/WebCore/platform/UUID.cpp b/WebCore/platform/UUID.cpp
index 5208bee..eb721e0 100644
--- a/WebCore/platform/UUID.cpp
+++ b/WebCore/platform/UUID.cpp
@@ -39,9 +39,6 @@
 
 #if OS(WINDOWS)
 #include <objbase.h>
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(a)           (sizeof(a) / sizeof((a)[0]))
-#endif
 #elif OS(DARWIN)
 #include <CoreFoundation/CoreFoundation.h>
 #elif OS(LINUX) && !PLATFORM(CHROMIUM)
@@ -69,7 +66,7 @@ String createCanonicalUUIDString()
     if (FAILED(hr))
         return String();
     wchar_t uuidStr[40];
-    int num = StringFromGUID2(uuid, reinterpret_cast<LPOLESTR>(uuidStr), ARRAYSIZE(uuidStr));
+    int num = StringFromGUID2(uuid, reinterpret_cast<LPOLESTR>(uuidStr), WTF_ARRAY_LENGTH(uuidStr));
     ASSERT(num == 39);
     String canonicalUuidStr = String(uuidStr + 1, num - 3).lower(); // remove opening and closing bracket and make it lower.
     ASSERT(canonicalUuidStr[uuidVersionIdentifierIndex] == uuidVersionRequired);
diff --git a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
index 7c3e450..384b1c5 100644
--- a/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontCacheChromiumWin.cpp
@@ -391,10 +391,10 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
     int numFonts = 0;
     if (script == USCRIPT_HAN) {
         panUniFonts = cjkFonts;
-        numFonts = ARRAYSIZE(cjkFonts);
+        numFonts = WTF_ARRAY_LENGTH(cjkFonts);
     } else {
         panUniFonts = commonFonts;
-        numFonts = ARRAYSIZE(commonFonts);
+        numFonts = WTF_ARRAY_LENGTH(commonFonts);
     }
     // Font returned from GetFallbackFamily may not cover |characters|
     // because it's based on script to font mapping. This problem is
diff --git a/WebCore/platform/graphics/win/FontCacheWin.cpp b/WebCore/platform/graphics/win/FontCacheWin.cpp
index 2240f80..e800245 100644
--- a/WebCore/platform/graphics/win/FontCacheWin.cpp
+++ b/WebCore/platform/graphics/win/FontCacheWin.cpp
@@ -330,7 +330,7 @@ SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& font
         AtomicString("Arial")
     };
     SimpleFontData* simpleFont;
-    for (int i = 0; i < ARRAYSIZE(fallbackFonts); ++i) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(fallbackFonts); ++i) {
         if (simpleFont = getCachedFontData(fontDescription, fallbackFonts[i])) {
             fallbackFontName = fallbackFonts[i];
             return simpleFont;
diff --git a/WebCore/platform/graphics/win/IconWin.cpp b/WebCore/platform/graphics/win/IconWin.cpp
index 05959e0..4d4d219 100644
--- a/WebCore/platform/graphics/win/IconWin.cpp
+++ b/WebCore/platform/graphics/win/IconWin.cpp
@@ -69,7 +69,7 @@ PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
     return 0;
 #else
     TCHAR buffer[MAX_PATH];    
-    UINT length = ::GetSystemDirectory(buffer, ARRAYSIZE(buffer));
+    UINT length = ::GetSystemDirectory(buffer, WTF_ARRAY_LENGTH(buffer));
     if (!length)
         return 0;
     
diff --git a/WebCore/platform/win/ClipboardUtilitiesWin.cpp b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
index 19888bf..eb1e659 100644
--- a/WebCore/platform/win/ClipboardUtilitiesWin.cpp
+++ b/WebCore/platform/win/ClipboardUtilitiesWin.cpp
@@ -86,13 +86,13 @@ static bool getWebLocData(IDataObject* dataObject, String& url, String* title)
     if (!hdrop)
         return false;
 
-    if (!DragQueryFileW(hdrop, 0, filename, ARRAYSIZE(filename)))
+    if (!DragQueryFileW(hdrop, 0, filename, WTF_ARRAY_LENGTH(filename)))
         goto exit;
 
     if (_wcsicmp(PathFindExtensionW(filename), L".url"))
         goto exit;    
     
-    if (!GetPrivateProfileStringW(L"InternetShortcut", L"url", 0, urlBuffer, ARRAYSIZE(urlBuffer), filename))
+    if (!GetPrivateProfileStringW(L"InternetShortcut", L"url", 0, urlBuffer, WTF_ARRAY_LENGTH(urlBuffer), filename))
         goto exit;
     
     if (title) {
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index 5bc2557..58cfe44 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -207,7 +207,7 @@ static HGLOBAL createGlobalHDropContent(const KURL& url, String& fileName, Share
 #else
         WCHAR tempPath[MAX_PATH];
         WCHAR extension[MAX_PATH];
-        if (!::GetTempPath(ARRAYSIZE(tempPath), tempPath))
+        if (!::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath))
             return 0;
         if (!::PathAppend(tempPath, fileName.charactersWithNullTermination()))
             return 0;
@@ -285,7 +285,7 @@ static HGLOBAL createGlobalImageFileDescriptor(const String& url, const String&
         return 0;
     }
 
-    int maxSize = min(fsPath.length(), ARRAYSIZE(fgd->fgd[0].cFileName));
+    int maxSize = min(fsPath.length(), WTF_ARRAY_LENGTH(fgd->fgd[0].cFileName));
     CopyMemory(fgd->fgd[0].cFileName, (LPCWSTR)fsPath.characters(), maxSize * sizeof(UChar));
     GlobalUnlock(memObj);
     
@@ -554,7 +554,7 @@ PassRefPtr<FileList> ClipboardWin::files() const
     WCHAR filename[MAX_PATH];
     UINT fileCount = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
     for (UINT i = 0; i < fileCount; i++) {
-        if (!DragQueryFileW(hdrop, i, filename, ARRAYSIZE(filename)))
+        if (!DragQueryFileW(hdrop, i, filename, WTF_ARRAY_LENGTH(filename)))
             continue;
         files->append(File::create(reinterpret_cast<UChar*>(filename)));
     }
@@ -717,7 +717,7 @@ void ClipboardWin::writeURL(const KURL& kurl, const String& titleStr, Frame*)
     fgd->fgd[0].dwFlags = FD_FILESIZE;
     fgd->fgd[0].nFileSizeLow = content.length();
 
-    unsigned maxSize = min(fsPath.length(), ARRAYSIZE(fgd->fgd[0].cFileName));
+    unsigned maxSize = min(fsPath.length(), WTF_ARRAY_LENGTH(fgd->fgd[0].cFileName));
     CopyMemory(fgd->fgd[0].cFileName, fsPath.characters(), maxSize * sizeof(UChar));
     GlobalUnlock(urlFileDescriptor);
 
diff --git a/WebCore/platform/win/DragDataWin.cpp b/WebCore/platform/win/DragDataWin.cpp
index 05f9103..56345e2 100644
--- a/WebCore/platform/win/DragDataWin.cpp
+++ b/WebCore/platform/win/DragDataWin.cpp
@@ -72,7 +72,7 @@ void DragData::asFilenames(Vector<String>& result) const
 
     const unsigned numFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0);
     for (unsigned i = 0; i < numFiles; i++) {
-        if (!DragQueryFileW(hdrop, 0, filename, ARRAYSIZE(filename)))
+        if (!DragQueryFileW(hdrop, 0, filename, WTF_ARRAY_LENGTH(filename)))
             continue;
         result.append((UChar*)filename);
     }
diff --git a/WebCore/platform/win/FileSystemWin.cpp b/WebCore/platform/win/FileSystemWin.cpp
index 2cca08c..cef7196 100644
--- a/WebCore/platform/win/FileSystemWin.cpp
+++ b/WebCore/platform/win/FileSystemWin.cpp
@@ -274,7 +274,7 @@ bool safeCreateFile(const String& path, CFDataRef data)
 {
     // Create a temporary file.
     WCHAR tempDirPath[MAX_PATH];
-    if (!GetTempPathW(ARRAYSIZE(tempDirPath), tempDirPath))
+    if (!GetTempPathW(WTF_ARRAY_LENGTH(tempDirPath), tempDirPath))
         return false;
 
     WCHAR tempPath[MAX_PATH];
diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index b85ddde..9937de4 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-05  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Replace ARRAYSIZE with WTF_ARRAY_LENGTH
+        https://bugs.webkit.org/show_bug.cgi?id=48903
+
+        * WebCoreSupport/EditorClientEfl.cpp:
+        (WebCore::EditorClientEfl::interpretKeyEvent):
+
 2010-11-04  Ryuan Choi  <ryuan.choi at samsung.com>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
index a63b712..9184812 100644
--- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp
@@ -292,8 +292,6 @@ static const KeyPressEntry keyPressEntries[] = {
     { '\r',   AltKey | ShiftKey,  "InsertNewline"                               },
 };
 
-#define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0]))
-
 const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event)
 {
     ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent);
@@ -305,10 +303,10 @@ const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event)
         keyDownCommandsMap = new HashMap<int, const char*>;
         keyPressCommandsMap = new HashMap<int, const char*>;
 
-        for (unsigned i = 0; i < ARRAYSIZE(keyDownEntries); i++)
+        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
             keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
 
-        for (unsigned i = 0; i < ARRAYSIZE(keyPressEntries); i++)
+        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
             keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
     }
 
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index cc30abf..75966d1 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-05  Patrick Gansterer  <paroga at webkit.org>
+
+        Reviewed by David Kilzer.
+
+        Replace ARRAYSIZE with WTF_ARRAY_LENGTH
+        https://bugs.webkit.org/show_bug.cgi?id=48903
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::exceededDatabaseQuota):
+        * WebKitDLL.cpp:
+        (DllGetClassObject):
+        * WebView.cpp:
+        (WebView::mouseWheel):
+
 2010-11-02  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index b1332ed..ebea786 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -592,7 +592,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database
             HMODULE safariHandle = GetModuleHandle(TEXT("Safari.exe"));
             if (!safariHandle)
                 return;
-            GetModuleFileName(safariHandle, path, ARRAYSIZE(path));
+            GetModuleFileName(safariHandle, path, WTF_ARRAY_LENGTH(path));
             DWORD handle;
             DWORD versionSize = GetFileVersionInfoSize(path, &handle);
             if (!versionSize)
diff --git a/WebKit/win/WebKitDLL.cpp b/WebKit/win/WebKitDLL.cpp
index f8aa261..bc7aa60 100644
--- a/WebKit/win/WebKitDLL.cpp
+++ b/WebKit/win/WebKitDLL.cpp
@@ -78,7 +78,7 @@ STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID /*lpRe
 STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
 {
     bool found = false;
-    for (int i = 0; i < ARRAYSIZE(gRegCLSIDs); i++) {
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(gRegCLSIDs); ++i) {
         if (IsEqualGUID(rclsid, gRegCLSIDs[i])) {
             found = true;
             break;
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index fb62809..e99b9da 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -1634,9 +1634,9 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel)
         TCHAR className[256];
 
         // Make sure truncation won't affect the comparison.
-        ASSERT(ARRAYSIZE(className) > _tcslen(PopupMenuWin::popupClassName()));
+        ASSERT(WTF_ARRAY_LENGTH(className) > _tcslen(PopupMenuWin::popupClassName()));
 
-        if (GetClassName(focusedWindow, className, ARRAYSIZE(className)) && !_tcscmp(className, PopupMenuWin::popupClassName())) {
+        if (GetClassName(focusedWindow, className, WTF_ARRAY_LENGTH(className)) && !_tcscmp(className, PopupMenuWin::popupClassName())) {
             // We don't let the WebView scroll here for two reasons - 1) To match Firefox behavior, 2) If we do scroll, we lose the
             // focus ring around the select menu.
             SetFocus(m_viewWindow);
@@ -2331,7 +2331,7 @@ static String webKitVersion()
     } *lpTranslate;
 
     TCHAR path[MAX_PATH];
-    GetModuleFileName(gInstance, path, ARRAYSIZE(path));
+    GetModuleFileName(gInstance, path, WTF_ARRAY_LENGTH(path));
     DWORD handle;
     DWORD versionSize = GetFileVersionInfoSize(path, &handle);
     if (!versionSize)
@@ -2345,7 +2345,7 @@ static String webKitVersion()
     if (!VerQueryValue(data, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate))
         goto exit;
     TCHAR key[256];
-    _stprintf_s(key, ARRAYSIZE(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage);
+    _stprintf_s(key, WTF_ARRAY_LENGTH(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage);
     LPCTSTR productVersion;
     UINT productVersionLength;
     if (!VerQueryValue(data, (LPTSTR)(LPCTSTR)key, (void**)&productVersion, &productVersionLength))

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list