Changeset 70460 in webkit
- Timestamp:
- Oct 25, 2010 10:03:24 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r70451 r70460 1 2010-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 1 10 2010-10-25 Peter Rybin <peter.rybin@gmail.com> 2 11 -
trunk/JavaScriptCore/wtf/Platform.h
r70434 r70460 564 564 #define assert(x) 565 565 566 /* _countof is only included in CE6; for CE5 we need to define it ourself */567 #ifndef _countof568 #define _countof(x) (sizeof(x) / sizeof((x)[0]))569 #endif570 571 566 #endif /* OS(WINCE) && !PLATFORM(QT) */ 572 567 -
trunk/WebCore/ChangeLog
r70456 r70460 1 2010-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 1 17 2010-10-25 David Hyatt <hyatt@apple.com> 2 18 -
trunk/WebCore/platform/win/FileSystemWin.cpp
r56825 r70460 193 193 194 194 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)) 197 197 return CString(); 198 198 -
trunk/WebCore/platform/wince/FileSystemWinCE.cpp
r67788 r70460 175 175 176 176 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)) 179 179 return CString(); 180 180 -
trunk/WebCore/plugins/win/PluginDatabaseWin.cpp
r66234 r70460 35 35 #include <shlwapi.h> 36 36 37 #if COMPILER(MINGW)38 #define _countof(x) (sizeof(x)/sizeof(x[0]))39 #endif40 41 37 #if OS(WINCE) 42 38 // WINCE doesn't support Registry Key Access Rights. The parameter should always be 0 … … 97 93 // Enumerate subkeys 98 94 for (int i = 0;; i++) { 99 DWORD nameLen = _countof(name);95 DWORD nameLen = WTF_ARRAY_LENGTH(name); 100 96 result = RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified); 101 97 … … 258 254 // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs 259 255 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)) 263 259 directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1)); 264 260 #endif … … 411 407 WCHAR systemDirectoryStr[MAX_PATH]; 412 408 413 if ( GetSystemDirectory(systemDirectoryStr, _countof(systemDirectoryStr)) == 0)409 if (!GetSystemDirectory(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr))) 414 410 return; 415 411 -
trunk/WebKit/win/ChangeLog
r70436 r70460 1 2010-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 1 13 2010-10-24 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
r69924 r70460 61 61 62 62 TCHAR modulePath[MAX_PATH]; 63 DWORD length = ::GetModuleFileName(0, modulePath, _countof(modulePath));63 DWORD length = ::GetModuleFileName(0, modulePath, WTF_ARRAY_LENGTH(modulePath)); 64 64 if (!length) 65 65 return false; -
trunk/WebKit/win/WebView.cpp
r70377 r70460 1834 1834 keyPressCommandsMap = new HashMap<int, const char*>; 1835 1835 1836 for ( unsigned i = 0; i < _countof(keyDownEntries); i++)1836 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) 1837 1837 keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); 1838 1838 1839 for ( unsigned i = 0; i < _countof(keyPressEntries); i++)1839 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) 1840 1840 keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); 1841 1841 } -
trunk/WebKit/wince/ChangeLog
r70333 r70460 1 2010-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 1 11 2010-10-22 Sam Weinig <sam@webkit.org> 2 12 -
trunk/WebKit/wince/WebCoreSupport/EditorClientWinCE.cpp
r70313 r70460 314 314 keyPressCommandsMap = new HashMap<int, const char*>; 315 315 316 for ( unsigned i = 0; i < _countof(keyDownEntries); i++)316 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) 317 317 keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); 318 318 319 for ( unsigned i = 0; i < _countof(keyPressEntries); i++)319 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) 320 320 keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); 321 321 } -
trunk/WebKit2/ChangeLog
r70459 r70460 1 2010-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 1 20 2010-10-25 Adam Roben <aroben@apple.com> 2 21 -
trunk/WebKit2/UIProcess/Launcher/win/ProcessLauncherWin.cpp
r68646 r70460 65 65 66 66 WCHAR pathStr[MAX_PATH]; 67 if (!::GetModuleFileNameW(webKitModule, pathStr, _countof(pathStr)))67 if (!::GetModuleFileNameW(webKitModule, pathStr, WTF_ARRAY_LENGTH(pathStr))) 68 68 return; 69 69 -
trunk/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
r69790 r70460 83 83 84 84 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)) 88 88 return pluginsDirectory; 89 89 … … 110 110 // Enumerate subkeys 111 111 for (int i = 0;; i++) { 112 DWORD nameLen = _countof(name);112 DWORD nameLen = WTF_ARRAY_LENGTH(name); 113 113 result = ::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified); 114 114 … … 144 144 // The new WMP Firefox plugin is installed in \PFiles\Plugins if it can't find any Firefox installs 145 145 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)) 149 149 directories.append(String(pluginDirectoryStr, pluginDirectorySize - 1)); 150 150 … … 188 188 // Enumerate subkeys 189 189 for (int i = 0;; i++) { 190 DWORD nameLen = _countof(name);190 DWORD nameLen = WTF_ARRAY_LENGTH(name); 191 191 result = ::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, &lastModified); 192 192 … … 223 223 WCHAR systemDirectoryStr[MAX_PATH]; 224 224 225 if (!::GetSystemDirectoryW(systemDirectoryStr, _countof(systemDirectoryStr)))225 if (!::GetSystemDirectoryW(systemDirectoryStr, WTF_ARRAY_LENGTH(systemDirectoryStr))) 226 226 return; 227 227 … … 313 313 // MSDN says that key names have a maximum length of 255 characters. 314 314 wchar_t name[256]; 315 DWORD nameLen = _countof(name);315 DWORD nameLen = WTF_ARRAY_LENGTH(name); 316 316 if (::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, 0) != ERROR_SUCCESS) 317 317 break; -
trunk/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp
r69671 r70460 158 158 keyPressCommandsMap = new HashMap<int, const char*>; 159 159 160 for ( unsigned i = 0; i < _countof(keyDownEntries); i++)160 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) 161 161 keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); 162 162 163 for ( unsigned i = 0; i < _countof(keyPressEntries); i++)163 for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) 164 164 keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); 165 165 }
Note: See TracChangeset
for help on using the changeset viewer.