From f77baaa830bf601012962d41c1e9cf6a9987e725 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Fri, 20 Jul 2018 21:45:50 +0200 Subject: [PATCH] fusion: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/fusion/asmcache.c | 8 ++++---- dlls/fusion/fusion.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/fusion/asmcache.c b/dlls/fusion/asmcache.c index 668aa8777e9..deca5f4c37b 100644 --- a/dlls/fusion/asmcache.c +++ b/dlls/fusion/asmcache.c @@ -117,14 +117,14 @@ static BOOL get_assembly_directory(LPWSTR dir, DWORD size, const char *version, if (!strcmp(version, "v4.0.30319")) { strcpyW(dir + len, dotnet); - len += sizeof(dotnet)/sizeof(WCHAR) -1; + len += ARRAY_SIZE(dotnet) - 1; strcpyW(dir + len, gac + 1); - len += sizeof(gac)/sizeof(WCHAR) - 2; + len += ARRAY_SIZE(gac) - 2; } else { strcpyW(dir + len, gac); - len += sizeof(gac)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(gac) - 1; } switch (architecture) { @@ -433,7 +433,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface, WCHAR asmdir[MAX_PATH], *p, **external_files = NULL, *dst_dir = NULL; PEKIND architecture; char *clr_version; - DWORD i, count = 0, src_len, dst_len = sizeof(format_v40)/sizeof(format_v40[0]); + DWORD i, count = 0, src_len, dst_len = ARRAY_SIZE(format_v40); HRESULT hr; TRACE("(%p, %d, %s, %p)\n", iface, dwFlags, diff --git a/dlls/fusion/fusion.c b/dlls/fusion/fusion.c index b038b380922..a57d7e067c5 100644 --- a/dlls/fusion/fusion.c +++ b/dlls/fusion/fusion.c @@ -144,9 +144,9 @@ HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, case ASM_CACHE_GAC: { strcpyW(path + len, assembly); - len += sizeof(assembly)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(assembly) - 1; strcpyW(path + len, gac); - len += sizeof(gac)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(gac) - 1; break; } case ASM_CACHE_DOWNLOAD: @@ -156,13 +156,13 @@ HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, } case ASM_CACHE_ROOT: strcpyW(path + len, assembly); - len += sizeof(assembly)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(assembly) - 1; break; case ASM_CACHE_ROOT_EX: strcpyW(path + len, dotnet); - len += sizeof(dotnet)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(dotnet) - 1; strcpyW(path + len, assembly); - len += sizeof(assembly)/sizeof(WCHAR) - 1; + len += ARRAY_SIZE(assembly) - 1; break; default: return E_INVALIDARG;