wineps.drv: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f00c5c2a37
commit
ead1a3d10d
|
@ -285,7 +285,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
||||||
res = di->pi->ppd->DefaultResolution;
|
res = di->pi->ppd->DefaultResolution;
|
||||||
len = sprintfW(buf, resW, res);
|
len = sprintfW(buf, resW, res);
|
||||||
buf[len++] = ' ';
|
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_ADDSTRING, 0, (LPARAM)buf);
|
||||||
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, 0, MAKELONG(res, res));
|
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, 0, MAKELONG(res, res));
|
||||||
Cursel = 0;
|
Cursel = 0;
|
||||||
|
@ -317,7 +317,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
|
||||||
else
|
else
|
||||||
len = sprintfW(buf, resxyW, res->resx, res->resy);
|
len = sprintfW(buf, resxyW, res->resx, res->resy);
|
||||||
buf[len++] = ' ';
|
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);
|
idx = SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_ADDSTRING, 0, (LPARAM)buf);
|
||||||
SendDlgItemMessageW(hwnd, IDD_QUALITY, CB_SETITEMDATA, idx, MAKELONG(res->resx, res->resy));
|
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];
|
WCHAR SetupW[64];
|
||||||
static const WCHAR PAPERW[] = {'P','A','P','E','R','\0'};
|
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");
|
hinstComctl32 = LoadLibraryA("comctl32.dll");
|
||||||
pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32,
|
pCreatePropertySheetPage = (void*)GetProcAddress(hinstComctl32,
|
||||||
"CreatePropertySheetPageW");
|
"CreatePropertySheetPageW");
|
||||||
|
|
|
@ -93,27 +93,27 @@ HPEN PSDRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *patter
|
||||||
switch(physDev->pen.style) {
|
switch(physDev->pen.style) {
|
||||||
case PS_DASH:
|
case PS_DASH:
|
||||||
memcpy( physDev->pen.dash, PEN_dash, sizeof(PEN_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;
|
break;
|
||||||
|
|
||||||
case PS_DOT:
|
case PS_DOT:
|
||||||
memcpy( physDev->pen.dash, PEN_dot, sizeof(PEN_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;
|
break;
|
||||||
|
|
||||||
case PS_DASHDOT:
|
case PS_DASHDOT:
|
||||||
memcpy( physDev->pen.dash, PEN_dashdot, sizeof(PEN_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;
|
break;
|
||||||
|
|
||||||
case PS_DASHDOTDOT:
|
case PS_DASHDOTDOT:
|
||||||
memcpy( physDev->pen.dash, PEN_dashdotdot, sizeof(PEN_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;
|
break;
|
||||||
|
|
||||||
case PS_ALTERNATE:
|
case PS_ALTERNATE:
|
||||||
memcpy( physDev->pen.dash, PEN_alternate, sizeof(PEN_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;
|
break;
|
||||||
|
|
||||||
case PS_USERSTYLE:
|
case PS_USERSTYLE:
|
||||||
|
|
|
@ -70,7 +70,7 @@ static const OTTable tables_templ[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tagTYPE42 {
|
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 glyf_tab, loca_tab, head_tab; /* indices of glyf, loca and head tables */
|
||||||
int hmtx_tab, maxp_tab;
|
int hmtx_tab, maxp_tab;
|
||||||
int num_of_written_tables;
|
int num_of_written_tables;
|
||||||
|
@ -138,7 +138,7 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
|
||||||
RECT *bbox, UINT emsize)
|
RECT *bbox, UINT emsize)
|
||||||
{
|
{
|
||||||
DWORD i, j, tablepos, nb_blocks, glyf_off = 0, loca_off = 0, cur_off;
|
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;
|
char *buf;
|
||||||
TYPE42 *t42;
|
TYPE42 *t42;
|
||||||
static const char start[] = /* name, fontbbox */
|
static const char start[] = /* name, fontbbox */
|
||||||
|
|
Loading…
Reference in New Issue