From 1965332d5b4fe25d02efad63f985e60f4e3cafd6 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Wed, 8 Aug 2018 11:30:16 +0200 Subject: [PATCH] serialui: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/serialui/confdlg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/serialui/confdlg.c b/dlls/serialui/confdlg.c index 7797c238fc5..cc3350572bb 100644 --- a/dlls/serialui/confdlg.c +++ b/dlls/serialui/confdlg.c @@ -214,7 +214,7 @@ static BOOL SERIALUI_MakeBaudDword(LPDWORD lpdwBaudRate) { unsigned int i; - for(i=0; i<(sizeof(SERIALUI_BaudConvertTable)/sizeof(DWORD)); i+=2) + for(i=0; ilpszDevice ); + GetWindowTextW(hWnd, format, ARRAY_SIZE(format)); + snprintfW(szTitle, ARRAY_SIZE(szTitle), format, info->lpszDevice); SetWindowTextW(hWnd, szTitle); SERIALUI_DCBToDialogInfo(hWnd, info); return TRUE; @@ -501,7 +501,7 @@ BOOL WINAPI drvSetDefaultCommConfigW( if(r != ERROR_SUCCESS) return FALSE; - snprintfW(szKeyName, sizeof(szKeyName)/sizeof(WCHAR), fmt, lpszCommKey ,lpszDevice); + snprintfW(szKeyName, ARRAY_SIZE(szKeyName), fmt, lpszCommKey, lpszDevice); r = RegCreateKeyW(hKeyReg, szKeyName, &hKeyPort); if(r == ERROR_SUCCESS) { @@ -556,7 +556,7 @@ DWORD WINAPI drvGetDefaultCommConfigW( } /* only "com1" - "com9" is allowed */ - r = sizeof(comW) / sizeof(WCHAR); /* len of "com\0" */ + r = ARRAY_SIZE(comW); /* len of "com\0" */ lstrcpynW(szKeyName, lpszDevice, r); /* simulate a lstrcmpnW */ r--; @@ -574,7 +574,7 @@ DWORD WINAPI drvGetDefaultCommConfigW( r = RegConnectRegistryW(NULL, HKEY_LOCAL_MACHINE, &hKeyReg); if(r != ERROR_SUCCESS) return r; - snprintfW(szKeyName, sizeof(szKeyName)/sizeof(WCHAR), fmt, lpszCommKey ,lpszDevice); + snprintfW(szKeyName, ARRAY_SIZE(szKeyName), fmt, lpszCommKey, lpszDevice); r = RegOpenKeyW(hKeyReg, szKeyName, &hKeyPort); if(r == ERROR_SUCCESS) {