Michael Stefaniuc : gameux/tests: Use the available ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Wed May 30 15:30:50 CDT 2018


Module: wine
Branch: master
Commit: 3be472e1ceb4cb96dd2cae0c17004de98a176ad8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3be472e1ceb4cb96dd2cae0c17004de98a176ad8

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed May 30 01:15:30 2018 +0200

gameux/tests: Use the available ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gameux/tests/gameexplorer.c   | 8 ++++----
 dlls/gameux/tests/gamestatistics.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/gameux/tests/gameexplorer.c b/dlls/gameux/tests/gameexplorer.c
index 05c2a11..0a23586 100644
--- a/dlls/gameux/tests/gameexplorer.c
+++ b/dlls/gameux/tests/gameexplorer.c
@@ -143,7 +143,7 @@ static HRESULT _buildGameRegistryPath(GAME_INSTALL_SCOPE installScope,
     if(gameInstanceId)
     {
         if(SUCCEEDED(hr))
-            hr = (StringFromGUID2(gameInstanceId, sInstanceId, sizeof(sInstanceId)/sizeof(sInstanceId[0])) ? S_OK : E_FAIL);
+            hr = (StringFromGUID2(gameInstanceId, sInstanceId, ARRAY_SIZE(sInstanceId)) ? S_OK : E_FAIL);
 
         if(SUCCEEDED(hr))
         {
@@ -294,7 +294,7 @@ static void _validateGameRegistryValues(int line,
     HRESULT hr;
     WCHAR sGameApplicationId[40];
 
-    hr = (StringFromGUID2(gameApplicationId, sGameApplicationId, sizeof(sGameApplicationId)/sizeof(sGameApplicationId[0])) ? S_OK : E_FAIL);
+    hr = (StringFromGUID2(gameApplicationId, sGameApplicationId, ARRAY_SIZE(sGameApplicationId)) ? S_OK : E_FAIL);
     ok_(__FILE__, line)(hr == S_OK, "cannot convert game application id to string\n");
 
     /* these values exist up from Vista */
@@ -547,7 +547,7 @@ static void test_add_remove_game(void)
     if(ge)
     {
         /* prepare path to binary */
-        dwExeNameLen = GetModuleFileNameW(NULL, sExeName, sizeof (sExeName) / sizeof (sExeName[0]));
+        dwExeNameLen = GetModuleFileNameW(NULL, sExeName, ARRAY_SIZE(sExeName));
         ok(dwExeNameLen != 0, "GetModuleFileNameW returned invalid value\n");
         lstrcpynW(sExePath, sExeName, StrRChrW(sExeName, NULL, '\\') - sExeName + 1);
         bstrExeName = SysAllocString(sExeName);
@@ -625,7 +625,7 @@ static void test_install_uninstall_game(void)
     if(ge2)
     {
         /* prepare path to binary */
-        dwExeNameLen = GetModuleFileNameW(NULL, sExeName, sizeof (sExeName) / sizeof (sExeName[0]));
+        dwExeNameLen = GetModuleFileNameW(NULL, sExeName, ARRAY_SIZE(sExeName));
         ok(dwExeNameLen != 0, "GetModuleFileNameW returned invalid value\n");
         lstrcpynW(sExePath, sExeName, StrRChrW(sExeName, NULL, '\\') - sExeName + 1);
 
diff --git a/dlls/gameux/tests/gamestatistics.c b/dlls/gameux/tests/gamestatistics.c
index ff247fc..d823af1 100644
--- a/dlls/gameux/tests/gamestatistics.c
+++ b/dlls/gameux/tests/gamestatistics.c
@@ -44,7 +44,7 @@ static void test_register_game(IGameExplorer **explorer)
     BSTR bstrExeName, bstrExePath;
 
     /* prepare path to binary */
-    GetModuleFileNameW(NULL, sExeName, sizeof (sExeName) / sizeof (sExeName[0]));
+    GetModuleFileNameW(NULL, sExeName, ARRAY_SIZE(sExeName));
 
     lstrcpyW(pathW, sExeName);
     PathRemoveFileSpecW(pathW);
@@ -101,7 +101,7 @@ static HRESULT _buildStatisticsFilePath(LPCGUID guidApplicationId, LPWSTR *lpSta
     hr = SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, sPath);
 
     if(SUCCEEDED(hr))
-        hr = (StringFromGUID2(guidApplicationId, sGuid, sizeof(sGuid) / sizeof(sGuid[0])) != 0 ? S_OK : E_FAIL);
+        hr = (StringFromGUID2(guidApplicationId, sGuid, ARRAY_SIZE(sGuid)) != 0 ? S_OK : E_FAIL);
 
     if(SUCCEEDED(hr))
     {




More information about the wine-cvs mailing list