diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c index c25e71df523..36ae88c8328 100644 --- a/programs/winecfg/driveui.c +++ b/programs/winecfg/driveui.c @@ -440,7 +440,7 @@ static void update_controls(HWND dialog) type = current_drive->type; SendDlgItemMessageW(dialog, IDC_COMBO_TYPE, CB_RESETCONTENT, 0, 0); - for (i = 0; i < sizeof(type_pairs) / sizeof(struct drive_typemap); i++) + for (i = 0; i < ARRAY_SIZE(type_pairs); i++) { WCHAR driveDesc[64]; LoadStringW(GetModuleHandleW(NULL), type_pairs[i].idDesc, driveDesc, ARRAY_SIZE(driveDesc)); diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c index 5304f7240cf..78d89a5ea8e 100644 --- a/programs/winecfg/theme.c +++ b/programs/winecfg/theme.c @@ -635,7 +635,7 @@ static void on_theme_install(HWND dialog) ofn.nFilterIndex = 0; ofn.lpstrFile = file; ofn.lpstrFile[0] = '\0'; - ofn.nMaxFile = sizeof(file)/sizeof(filetitle[0]); + ofn.nMaxFile = ARRAY_SIZE(file); ofn.lpstrFileTitle = filetitle; ofn.lpstrFileTitle[0] = '\0'; ofn.nMaxFileTitle = ARRAY_SIZE(filetitle); @@ -729,8 +729,6 @@ static struct ShellFolderInfo asfiInfo[] = { static struct ShellFolderInfo *psfiSelected = NULL; -#define NUM_ELEMS(x) (sizeof(x)/sizeof(*(x))) - static void init_shell_folder_listview_headers(HWND dialog) { LVCOLUMNW listColumn; RECT viewRect; @@ -763,8 +761,8 @@ static void read_shell_folder_link_targets(void) { WCHAR wszPath[MAX_PATH]; HRESULT hr; int i; - - for (i=0; iroot == HKEY_LOCAL_MACHINE && s->path && - !strncmpiW( s->path, softwareW, sizeof(softwareW)/sizeof(WCHAR) )); + !strncmpiW(s->path, softwareW, ARRAY_SIZE(softwareW))); if (s->value) {