From 3be472e1ceb4cb96dd2cae0c17004de98a176ad8 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 30 May 2018 01:15:30 +0200 Subject: [PATCH] gameux/tests: Use the available ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- 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 05c2a1104f0..0a235863bfe 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 ff247fcb172..d823af1aab2 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)) {