Commit f836995e authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

cryptui: Use the ARRAY_SIZE() macro.

parent 8d0ef952
...@@ -7013,32 +7013,32 @@ static void init_columns(HWND lv, DWORD flags) ...@@ -7013,32 +7013,32 @@ static void init_columns(HWND lv, DWORD flags)
column.pszText = buf; column.pszText = buf;
if (!(flags & CRYPTUI_SELECT_ISSUEDTO_COLUMN)) if (!(flags & CRYPTUI_SELECT_ISSUEDTO_COLUMN))
{ {
LoadStringW(hInstance, IDS_SUBJECT_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_SUBJECT_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
if (!(flags & CRYPTUI_SELECT_ISSUEDBY_COLUMN)) if (!(flags & CRYPTUI_SELECT_ISSUEDBY_COLUMN))
{ {
LoadStringW(hInstance, IDS_ISSUER_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_ISSUER_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
if (!(flags & CRYPTUI_SELECT_INTENDEDUSE_COLUMN)) if (!(flags & CRYPTUI_SELECT_INTENDEDUSE_COLUMN))
{ {
LoadStringW(hInstance, IDS_INTENDED_USE_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_INTENDED_USE_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
if (!(flags & CRYPTUI_SELECT_FRIENDLYNAME_COLUMN)) if (!(flags & CRYPTUI_SELECT_FRIENDLYNAME_COLUMN))
{ {
LoadStringW(hInstance, IDS_FRIENDLY_NAME_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_FRIENDLY_NAME_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
if (!(flags & CRYPTUI_SELECT_EXPIRATION_COLUMN)) if (!(flags & CRYPTUI_SELECT_EXPIRATION_COLUMN))
{ {
LoadStringW(hInstance, IDS_EXPIRATION_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_EXPIRATION_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
if (!(flags & CRYPTUI_SELECT_LOCATION_COLUMN)) if (!(flags & CRYPTUI_SELECT_LOCATION_COLUMN))
{ {
LoadStringW(hInstance, IDS_LOCATION_COLUMN, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_LOCATION_COLUMN, buf, ARRAY_SIZE(buf));
SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column); SendMessageW(lv, LVM_INSERTCOLUMNW, i++, (LPARAM)&column);
} }
} }
...@@ -7149,11 +7149,9 @@ static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *a ...@@ -7149,11 +7149,9 @@ static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *a
} }
if (!(flags & CRYPTUI_SELECT_EXPIRATION_COLUMN)) if (!(flags & CRYPTUI_SELECT_EXPIRATION_COLUMN))
{ {
GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, dateFmt, GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, dateFmt, ARRAY_SIZE(dateFmt));
sizeof(dateFmt) / sizeof(dateFmt[0]));
FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime); FileTimeToSystemTime(&cert->pCertInfo->NotAfter, &sysTime);
GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, buf, GetDateFormatW(LOCALE_SYSTEM_DEFAULT, 0, &sysTime, dateFmt, buf, ARRAY_SIZE(buf));
sizeof(buf) / sizeof(buf[0]));
item.pszText = buf; item.pszText = buf;
if (!item.iSubItem) if (!item.iSubItem)
SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item);
...@@ -7167,7 +7165,7 @@ static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *a ...@@ -7167,7 +7165,7 @@ static void add_cert_to_list(HWND lv, PCCERT_CONTEXT cert, DWORD flags, DWORD *a
static int show_fixme; static int show_fixme;
if (!show_fixme++) if (!show_fixme++)
FIXME("showing location is not implemented\n"); FIXME("showing location is not implemented\n");
LoadStringW(hInstance, IDS_NO_IMPL, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_NO_IMPL, buf, ARRAY_SIZE(buf));
if (!item.iSubItem) if (!item.iSubItem)
SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item);
else else
...@@ -7373,10 +7371,9 @@ static LRESULT CALLBACK select_cert_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPA ...@@ -7373,10 +7371,9 @@ static LRESULT CALLBACK select_cert_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPA
{ {
WCHAR buf[40], title[40]; WCHAR buf[40], title[40];
LoadStringW(hInstance, IDS_SELECT_CERT, buf, sizeof(buf) / sizeof(buf[0])); LoadStringW(hInstance, IDS_SELECT_CERT, buf, ARRAY_SIZE(buf));
if (!data->title) if (!data->title)
LoadStringW(hInstance, IDS_SELECT_CERT_TITLE, title, LoadStringW(hInstance, IDS_SELECT_CERT_TITLE, title, ARRAY_SIZE(title));
sizeof(title) / sizeof(title[0]));
MessageBoxW(hwnd, buf, data->title ? data->title : title, MB_OK | MB_ICONWARNING); MessageBoxW(hwnd, buf, data->title ? data->title : title, MB_OK | MB_ICONWARNING);
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment