diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index dfdca49e792..4d7b020e14b 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -150,7 +150,6 @@ static const struct vid_mode vid_modes_test[] = { {0, 0, 0, 0, DM_DISPLAYFREQUENCY, 0} */ }; -#define vid_modes_cnt (sizeof(vid_modes_test) / sizeof(vid_modes_test[0])) static void test_ChangeDisplaySettingsEx(void) { @@ -237,7 +236,7 @@ static void test_ChangeDisplaySettingsEx(void) memset(&dm, 0, sizeof(dm)); dm.dmSize = sizeof(dm); - for (i = 0; i < vid_modes_cnt; i++) + for (i = 0; i < ARRAY_SIZE(vid_modes_test); i++) { dm.dmPelsWidth = vid_modes_test[i].w; dm.dmPelsHeight = vid_modes_test[i].h; diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index ac706aa4bf9..1f10d66dcdb 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -84,8 +84,6 @@ static const char* szAWRClass = "Winsize"; static HMENU hmenu; static DWORD our_pid; -#define COUNTOF(arr) (sizeof(arr)/sizeof(arr[0])) - static void dump_minmax_info( const MINMAXINFO *minmax ) { trace("Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n", @@ -5289,9 +5287,9 @@ static void test_AWR_window_size(BOOL menu) /* A exhaustive check of all the styles takes too long * so just do a (hopefully representative) sample */ - for (i = 0; i < COUNTOF(styles); ++i) + for (i = 0; i < ARRAY_SIZE(styles); ++i) test_AWRwindow(szAWRClass, styles[i], 0, menu); - for (i = 0; i < COUNTOF(exStyles); ++i) { + for (i = 0; i < ARRAY_SIZE(exStyles); ++i) { test_AWRwindow(szAWRClass, WS_POPUP, exStyles[i], menu); test_AWRwindow(szAWRClass, WS_THICKFRAME, exStyles[i], menu); } @@ -5306,13 +5304,13 @@ static void test_AWR_flags(void) DWORD i, j, k, style, exstyle; RECT rect, rect2; - for (i = 0; i < (1 << COUNTOF(styles)); i++) + for (i = 0; i < (1 << ARRAY_SIZE(styles)); i++) { - for (k = style = 0; k < COUNTOF(styles); k++) if (i & (1 << k)) style |= styles[k]; + for (k = style = 0; k < ARRAY_SIZE(styles); k++) if (i & (1 << k)) style |= styles[k]; - for (j = 0; j < (1 << COUNTOF(exStyles)); j++) + for (j = 0; j < (1 << ARRAY_SIZE(exStyles)); j++) { - for (k = exstyle = 0; k < COUNTOF(exStyles); k++) if (j & (1 << k)) exstyle |= exStyles[k]; + for (k = exstyle = 0; k < ARRAY_SIZE(exStyles); k++) if (j & (1 << k)) exstyle |= exStyles[k]; SetRect( &rect, 100, 100, 200, 200 ); rect2 = rect; AdjustWindowRectEx( &rect, style, FALSE, exstyle ); @@ -5329,7 +5327,6 @@ static void test_AWR_flags(void) } } } -#undef COUNTOF #define SHOWSYSMETRIC(SM) trace(#SM "=%d\n", GetSystemMetrics(SM))