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

wineps.drv: Use the ARRAY_SIZE() macro.

parent f00c5c2a
......@@ -285,7 +285,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
res = di->pi->ppd->DefaultResolution;
len = sprintfW(buf, resW, res);
buf[len++] = ' ';
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, sizeof(buf)/sizeof(buf[0]) - len);
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, 0, MAKELONG(res, res));
Cursel = 0;
......@@ -317,7 +317,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
else
len = sprintfW(buf, resxyW, res->resx, res->resy);
buf[len++] = ' ';
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, sizeof(buf)/sizeof(buf[0]) - len);
LoadStringW(PSDRV_hInstance, IDS_DPI, buf + len, ARRAY_SIZE(buf) - len);
idx = SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, idx, MAKELONG(res->resx, res->resy));
......@@ -557,7 +557,7 @@ INT PSDRV_ExtDeviceMode(LPSTR lpszDriver, HWND hwnd, LPDEVMODEA lpdmOutput,
WCHAR SetupW[64];
static const WCHAR PAPERW[] = {'P','A','P','E','R','\0'};
LoadStringW(PSDRV_hInstance, IDS_SETUP, SetupW, sizeof(SetupW)/sizeof(SetupW[0]));
LoadStringW(PSDRV_hInstance, IDS_SETUP, SetupW, ARRAY_SIZE(SetupW));
hinstComctl32 = LoadLibraryA("comctl32.dll");
pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32,
"CreatePropertySheetPageW");
......
......@@ -93,27 +93,27 @@ HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patter
switch(physDev->pen.style) {
case PS_DASH:
memcpy( physDev->pen.dash, PEN_dash, sizeof(PEN_dash) );
physDev->pen.dash_len = sizeof(PEN_dash) / sizeof(DWORD);
physDev->pen.dash_len = ARRAY_SIZE( PEN_dash );
break;
case PS_DOT:
memcpy( physDev->pen.dash, PEN_dot, sizeof(PEN_dot) );
physDev->pen.dash_len = sizeof(PEN_dot) / sizeof(DWORD);
physDev->pen.dash_len = ARRAY_SIZE( PEN_dot );
break;
case PS_DASHDOT:
memcpy( physDev->pen.dash, PEN_dashdot, sizeof(PEN_dashdot) );
physDev->pen.dash_len = sizeof(PEN_dashdot) / sizeof(DWORD);
physDev->pen.dash_len = ARRAY_SIZE( PEN_dashdot );
break;
case PS_DASHDOTDOT:
memcpy( physDev->pen.dash, PEN_dashdotdot, sizeof(PEN_dashdotdot) );
physDev->pen.dash_len = sizeof(PEN_dashdotdot) / sizeof(DWORD);
physDev->pen.dash_len = ARRAY_SIZE( PEN_dashdotdot );
break;
case PS_ALTERNATE:
memcpy( physDev->pen.dash, PEN_alternate, sizeof(PEN_alternate) );
physDev->pen.dash_len = sizeof(PEN_alternate) / sizeof(DWORD);
physDev->pen.dash_len = ARRAY_SIZE( PEN_alternate );
break;
case PS_USERSTYLE:
......
......@@ -70,7 +70,7 @@ static const OTTable tables_templ[] = {
};
struct tagTYPE42 {
OTTable tables[sizeof(tables_templ)/sizeof(tables_templ[0])];
OTTable tables[ARRAY_SIZE(tables_templ)];
int glyf_tab, loca_tab, head_tab; /* indices of glyf, loca and head tables */
int hmtx_tab, maxp_tab;
int num_of_written_tables;
......@@ -138,7 +138,7 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
RECT *bbox, UINT emsize)
{
DWORD i, j, tablepos, nb_blocks, glyf_off = 0, loca_off = 0, cur_off;
WORD num_of_tables = sizeof(tables_templ) / sizeof(tables_templ[0]) - 1;
WORD num_of_tables = ARRAY_SIZE(tables_templ) - 1;
char *buf;
TYPE42 *t42;
static const char start[] = /* name, fontbbox */
......
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