Changeset 70460 in webkit


Ignore:
Timestamp:
Oct 25, 2010 10:03:24 AM (13 years ago)
Author:
Patrick Gansterer
Message:

2010-10-25 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Replace _countof with WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=48229

  • wtf/Platform.h:

2010-10-25 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Replace _countof with WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=48229

  • platform/win/FileSystemWin.cpp: (WebCore::openTemporaryFile):
  • platform/wince/FileSystemWinCE.cpp: (WebCore::openTemporaryFile):
  • plugins/win/PluginDatabaseWin.cpp: (WebCore::addPluginPathsFromRegistry): (WebCore::addWindowsMediaPlayerPluginDirectory): (WebCore::addMacromediaPluginDirectories):

2010-10-25 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Replace _countof with WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=48229

  • WebCoreSupport/WebContextMenuClient.cpp: (isPreInspectElementTagSafari):
  • WebView.cpp: (WebView::interpretKeyEvent):

2010-10-25 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Replace _countof with WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=48229

  • WebCoreSupport/EditorClientWinCE.cpp: (WebKit::EditorClientWinCE::interpretKeyEvent):

2010-10-25 Patrick Gansterer <Patrick Gansterer>

Reviewed by David Kilzer.

Replace _countof with WTF_ARRAY_LENGTH
https://bugs.webkit.org/show_bug.cgi?id=48229

  • UIProcess/Launcher/win/ProcessLauncherWin.cpp: (WebKit::ProcessLauncher::launchProcess):
  • UIProcess/Plugins/win/PluginInfoStoreWin.cpp: (WebKit::safariPluginsDirectory): (WebKit::addMozillaPluginDirectories): (WebKit::addWindowsMediaPlayerPluginDirectory): (WebKit::addAdobeAcrobatPluginDirectory): (WebKit::addMacromediaPluginDirectories): (WebKit::addPluginPathsFromRegistry):
  • WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::interpretKeyEvent):
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r70451 r70460  
     12010-10-25  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Replace _countof with WTF_ARRAY_LENGTH
     6        https://bugs.webkit.org/show_bug.cgi?id=48229
     7
     8        * wtf/Platform.h:
     9
    1102010-10-25  Peter Rybin  <peter.rybin@gmail.com>
    211
  • trunk/JavaScriptCore/wtf/Platform.h

    r70434 r70460  
    564564#define assert(x)
    565565
    566 /* _countof is only included in CE6; for CE5 we need to define it ourself */
    567 #ifndef _countof
    568 #define _countof(x) (sizeof(x) / sizeof((x)[0]))
    569 #endif
    570 
    571566#endif  /* OS(WINCE) && !PLATFORM(QT) */
    572567
  • trunk/WebCore/ChangeLog

    r70456 r70460  
     12010-10-25  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Replace _countof with WTF_ARRAY_LENGTH
     6        https://bugs.webkit.org/show_bug.cgi?id=48229
     7
     8        * platform/win/FileSystemWin.cpp:
     9        (WebCore::openTemporaryFile):
     10        * platform/wince/FileSystemWinCE.cpp:
     11        (WebCore::openTemporaryFile):
     12        * plugins/win/PluginDatabaseWin.cpp:
     13        (WebCore::addPluginPathsFromRegistry):
     14        (WebCore::addWindowsMediaPlayerPluginDirectory):
     15        (WebCore::addMacromediaPluginDirectories):
     16
    1172010-10-25  David Hyatt  <hyatt@apple.com>
    218
  • trunk/WebCore/platform/win/FileSystemWin.cpp

    r56825 r70460  
    193193
    194194    char tempPath[MAX_PATH];
    195     int tempPathLength = ::GetTempPathA(_countof(tempPath), tempPath);
    196     if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
     195    int tempPathLength = ::GetTempPathA(WTF_ARRAY_LENGTH(tempPath), tempPath);
     196    if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
    197197        return CString();
    198198
  • trunk/WebCore/platform/wince/FileSystemWinCE.cpp

    r67788 r70460  
    175175
    176176    wchar_t tempPath[MAX_PATH];
    177     int tempPathLength = ::GetTempPath(_countof(tempPath), tempPath);
    178     if (tempPathLength <= 0 || tempPathLength > _countof(tempPath))
     177    int tempPathLength = ::GetTempPath(WTF_ARRAY_LENGTH(tempPath), tempPath);
     178    if (tempPathLength <= 0 || tempPathLength > WTF_ARRAY_LENGTH(tempPath))
    179179        return CString();
    180180
  • trunk/WebCore/plugins/win/PluginDatabaseWin.cpp

    r66234 r70460  
    3535#include <shlwapi.h>
    3636
    37 #if COMPILER(MINGW)
    38 #define _countof(x) (sizeof(x)/sizeof(x[0]))
    39 #endif
    40 
    4137#if OS(WINCE)
    4238// WINCE doesn't support Registry Key Access Rights. The parameter should always be 0
     
    9793    // Enumerate subkeys
    9894    for (int i = 0;; i++) {
    99         DWORD nameLen = _countof(name);
     95        DWORD nameLen = WTF_ARRAY_LENGTH(name);
    10096        result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
    10197
     
    258254    // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
    259255    WCHAR pluginDirectoryStr[_MAX_PATH + 1];
    260     DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, _countof(pluginDirectoryStr));
    261 
    262     if (pluginDirectorySize > 0 && pluginDirectorySize <= _countof(pluginDirectoryStr))
     256    DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(TEXT("%SYSTEMDRIVE%\\PFiles\\Plugins"), pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
     257
     258    if (pluginDirectorySize > 0 && pluginDirectorySize <= WTF_ARRAY_LENGTH(pluginDirectoryStr))
    263259        directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
    264260#endif
     
    411407    WCHAR systemDirectoryStr[MAX_PATH];
    412408
    413     if (GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0)
     409    if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
    414410        return;
    415411
  • trunk/WebKit/win/ChangeLog

    r70436 r70460  
     12010-10-25  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Replace _countof with WTF_ARRAY_LENGTH
     6        https://bugs.webkit.org/show_bug.cgi?id=48229
     7
     8        * WebCoreSupport/WebContextMenuClient.cpp:
     9        (isPreInspectElementTagSafari):
     10        * WebView.cpp:
     11        (WebView::interpretKeyEvent):
     12
    1132010-10-24  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp

    r69924 r70460  
    6161
    6262    TCHAR modulePath[MAX_PATH];
    63     DWORD length = ::GetModuleFileName(0, modulePath, _countof(modulePath));
     63    DWORD length = ::GetModuleFileName(0, modulePath, WTF_ARRAY_LENGTH(modulePath));
    6464    if (!length)
    6565        return false;
  • trunk/WebKit/win/WebView.cpp

    r70377 r70460  
    18341834        keyPressCommandsMap = new HashMap<int, const char*>;
    18351835
    1836         for (unsigned i = 0; i < _countof(keyDownEntries); i++)
     1836        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
    18371837            keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
    18381838
    1839         for (unsigned i = 0; i < _countof(keyPressEntries); i++)
     1839        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
    18401840            keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
    18411841    }
  • trunk/WebKit/wince/ChangeLog

    r70333 r70460  
     12010-10-25  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Replace _countof with WTF_ARRAY_LENGTH
     6        https://bugs.webkit.org/show_bug.cgi?id=48229
     7
     8        * WebCoreSupport/EditorClientWinCE.cpp:
     9        (WebKit::EditorClientWinCE::interpretKeyEvent):
     10
    1112010-10-22  Sam Weinig  <sam@webkit.org>
    212
  • trunk/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp

    r70313 r70460  
    314314        keyPressCommandsMap = new HashMap<int, const char*>;
    315315
    316         for (unsigned i = 0; i < _countof(keyDownEntries); i++)
     316        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
    317317            keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
    318318
    319         for (unsigned i = 0; i < _countof(keyPressEntries); i++)
     319        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
    320320            keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
    321321    }
  • trunk/WebKit2/ChangeLog

    r70459 r70460  
     12010-10-25  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by David Kilzer.
     4
     5        Replace _countof with WTF_ARRAY_LENGTH
     6        https://bugs.webkit.org/show_bug.cgi?id=48229
     7
     8        * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
     9        (WebKit::ProcessLauncher::launchProcess):
     10        * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
     11        (WebKit::safariPluginsDirectory):
     12        (WebKit::addMozillaPluginDirectories):
     13        (WebKit::addWindowsMediaPlayerPluginDirectory):
     14        (WebKit::addAdobeAcrobatPluginDirectory):
     15        (WebKit::addMacromediaPluginDirectories):
     16        (WebKit::addPluginPathsFromRegistry):
     17        * WebProcess/WebPage/win/WebPageWin.cpp:
     18        (WebKit::WebPage::interpretKeyEvent):
     19
    1202010-10-25  Adam Roben  <aroben@apple.com>
    221
  • trunk/WebKit2/UIProcess/Launcher/win/ProcessLauncherWin.cpp

    r68646 r70460  
    6565
    6666    WCHAR pathStr[MAX_PATH];
    67     if (!::GetModuleFileNameW(webKitModule, pathStr, _countof(pathStr)))
     67    if (!::GetModuleFileNameW(webKitModule, pathStr, WTF_ARRAY_LENGTH(pathStr)))
    6868        return;
    6969
  • trunk/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp

    r69790 r70460  
    8383
    8484        WCHAR moduleFileNameStr[MAX_PATH];
    85         int moduleFileNameLen = ::GetModuleFileNameW(0, moduleFileNameStr, _countof(moduleFileNameStr));
    86 
    87         if (!moduleFileNameLen || moduleFileNameLen == _countof(moduleFileNameStr))
     85        int moduleFileNameLen = ::GetModuleFileNameW(0, moduleFileNameStr, WTF_ARRAY_LENGTH(moduleFileNameStr));
     86
     87        if (!moduleFileNameLen || moduleFileNameLen == WTF_ARRAY_LENGTH(moduleFileNameStr))
    8888            return pluginsDirectory;
    8989
     
    110110    // Enumerate subkeys
    111111    for (int i = 0;; i++) {
    112         DWORD nameLen = _countof(name);
     112        DWORD nameLen = WTF_ARRAY_LENGTH(name);
    113113        result = ::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
    114114
     
    144144    // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs
    145145    WCHAR pluginDirectoryStr[MAX_PATH + 1];
    146     DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(L"%SYSTEMDRIVE%\\PFiles\\Plugins", pluginDirectoryStr, _countof(pluginDirectoryStr));
    147 
    148     if (pluginDirectorySize > 0 && pluginDirectorySize <= _countof(pluginDirectoryStr))
     146    DWORD pluginDirectorySize = ::ExpandEnvironmentStringsW(L"%SYSTEMDRIVE%\\PFiles\\Plugins", pluginDirectoryStr, WTF_ARRAY_LENGTH(pluginDirectoryStr));
     147
     148    if (pluginDirectorySize > 0 && pluginDirectorySize <= WTF_ARRAY_LENGTH(pluginDirectoryStr))
    149149        directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1));
    150150
     
    188188    // Enumerate subkeys
    189189    for (int i = 0;; i++) {
    190         DWORD nameLen = _countof(name);
     190        DWORD nameLen = WTF_ARRAY_LENGTH(name);
    191191        result = ::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified);
    192192
     
    223223    WCHAR systemDirectoryStr[MAX_PATH];
    224224
    225     if (!::GetSystemDirectoryW(systemDirectoryStr, _countof(systemDirectoryStr)))
     225    if (!::GetSystemDirectoryW(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr)))
    226226        return;
    227227
     
    313313        // MSDN says that key names have a maximum length of 255 characters.
    314314        wchar_t name[256];
    315         DWORD nameLen = _countof(name);
     315        DWORD nameLen = WTF_ARRAY_LENGTH(name);
    316316        if (::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, 0) != ERROR_SUCCESS)
    317317            break;
  • trunk/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp

    r69671 r70460  
    158158        keyPressCommandsMap = new HashMap<int, const char*>;
    159159
    160         for (unsigned i = 0; i < _countof(keyDownEntries); i++)
     160        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i)
    161161            keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name);
    162162
    163         for (unsigned i = 0; i < _countof(keyPressEntries); i++)
     163        for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i)
    164164            keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name);
    165165    }
Note: See TracChangeset for help on using the changeset viewer.