Commit ceb06647 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

wineps.drv: Enable compilation with long types.

parent 71189f62
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = wineps.drv
IMPORTS = user32 gdi32 winspool advapi32
......
......@@ -60,7 +60,7 @@ BOOL CDECL PSDRV_PatBlt(PHYSDEV dev, struct bitblt_coords *dst, DWORD dwRop)
return TRUE;
}
default:
FIXME("Unsupported rop %06x\n", dwRop);
FIXME("Unsupported rop %06lx\n", dwRop);
return FALSE;
}
}
......@@ -68,7 +68,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
USHORT usUnitsPerEm, usWinAscent, usWinDescent;
SHORT sAscender, sDescender, sLineGap, sAvgCharWidth;
TRACE("'%s' %i\n", afm->FontName, lfHeight);
TRACE("'%s' %li\n", afm->FontName, lfHeight);
if (lfHeight < 0) /* match em height */
{
......@@ -142,9 +142,9 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
font->strikeoutPosition = tm->tmAscent / 2;
font->strikeoutThickness = font->underlineThickness;
TRACE("Selected PS font '%s' size %d weight %d.\n", afm->FontName,
TRACE("Selected PS font '%s' size %d weight %ld.\n", afm->FontName,
font->size.xx, tm->tmWeight );
TRACE("H = %d As = %d Des = %d IL = %d EL = %d\n", tm->tmHeight,
TRACE("H = %ld As = %ld Des = %ld IL = %ld EL = %ld\n", tm->tmHeight,
tm->tmAscent, tm->tmDescent, tm->tmInternalLeading,
tm->tmExternalLeading);
}
......@@ -308,7 +308,7 @@ const AFMMETRICS *PSDRV_UVMetrics(LONG UV, const AFM *afm)
if (needle == NULL)
{
WARN("No glyph for U+%.4X in %s\n", UV, afm->FontName);
WARN("No glyph for U+%.4lX in %s\n", UV, afm->FontName);
needle = afm->Metrics;
}
......
......@@ -73,7 +73,7 @@ void PSDRV_CreateColor( PHYSDEV dev, PSCOLOR *pscolor, COLORREF wincolor )
float r, g, b;
if(ctype != 0 && ctype != 2)
FIXME("Colour is %08x\n", wincolor);
FIXME("Colour is %08lx\n", wincolor);
r = (wincolor & 0xff) / 256.0;
g = ((wincolor >> 8) & 0xff) / 256.0;
......
......@@ -655,14 +655,14 @@ static void get_post2_custom_glyph_name(BYTE *post2header, DWORD size, WORD inde
name_offset += name_length;
if(name_offset + sizeof(BYTE) > size)
{
FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n",
FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%ld)\n",
name_offset + 1, size);
return;
}
name_length = (post2header + name_offset)[0];
if(name_offset + name_length > size)
{
FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n",
FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%ld)\n",
name_offset + name_length, size);
return;
}
......
......@@ -456,7 +456,7 @@ INT WINAPI DrvDocumentProperties(HWND hwnd, const WCHAR *device, DEVMODEW *outpu
{
PRINTERINFO *pi;
TRACE("(hwnd=%p, Device='%s', devOut=%p, devIn=%p, Mode=%04x)\n",
TRACE("(hwnd=%p, Device='%s', devOut=%p, devIn=%p, Mode=%04lx)\n",
hwnd, debugstr_w(device), output, input, mode);
if (!(pi = PSDRV_FindPrinterInfo(device))) return -1;
......@@ -468,7 +468,7 @@ INT WINAPI DrvDocumentProperties(HWND hwnd, const WCHAR *device, DEVMODEW *outpu
/* If DM_MODIFY is set, change settings in accordance with lpdmInput */
if ((mode & DM_MODIFY) && input)
{
TRACE("DM_MODIFY set. devIn->dmFields = %08x\n", input->dmFields);
TRACE("DM_MODIFY set. devIn->dmFields = %08lx\n", input->dmFields);
PSDRV_MergeDevmodes(pi->Devmode, (PSDRV_DEVMODE *)input, pi);
}
......@@ -681,7 +681,7 @@ DWORD WINAPI DrvDeviceCapabilities(HANDLE printer, WCHAR *device_name, WORD capa
ret = 0;
if(pi->ppd->DefaultDuplex && pi->ppd->DefaultDuplex->WinDuplex != 0)
ret = 1;
TRACE("DC_DUPLEX: returning %d\n", ret);
TRACE("DC_DUPLEX: returning %ld\n", ret);
break;
case DC_EMF_COMPLIANT:
......
......@@ -69,7 +69,7 @@ INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_dat
return 0;
} else {
DWORD num = (cbInput < sizeof(DWORD)) ? *(const USHORT *)in_data : *(const DWORD *)in_data;
TRACE("QUERYESCSUPPORT for %d\n", num);
TRACE("QUERYESCSUPPORT for %ld\n", num);
switch(num) {
case NEXTBAND:
......@@ -112,7 +112,7 @@ INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_dat
return FALSE; /* suppress the FIXME below */
default:
FIXME("QUERYESCSUPPORT(%d) - not supported.\n", num);
FIXME("QUERYESCSUPPORT(%ld) - not supported.\n", num);
return FALSE;
}
}
......@@ -149,7 +149,7 @@ INT CDECL PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_dat
{
DRAWPATRECT *dpr = (DRAWPATRECT*)in_data;
FIXME("DRAWPATTERNRECT(pos (%d,%d), size %dx%d, style %d, pattern %x), stub!\n",
FIXME("DRAWPATTERNRECT(pos (%ld,%ld), size %ldx%ld, style %d, pattern %x), stub!\n",
dpr->ptPosition.x, dpr->ptPosition.y,
dpr->ptSize.x, dpr->ptSize.y,
dpr->wStyle, dpr->wPattern
......@@ -453,7 +453,7 @@ INT CDECL PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
if (!OpenPrinterW( physDev->pi->friendly_name, &physDev->job.hprinter, &prn_def ))
{
WARN("OpenPrinter(%s, ...) failed: %d\n",
WARN("OpenPrinter(%s, ...) failed: %ld\n",
debugstr_w(physDev->pi->friendly_name), GetLastError());
return 0;
}
......@@ -474,7 +474,7 @@ INT CDECL PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
is done during winspool.drv,ScheduleJob */
physDev->job.id = StartDocPrinterW(physDev->job.hprinter, 1, (LPBYTE) &di);
if(!physDev->job.id) {
WARN("StartDocPrinter() failed: %d\n", GetLastError());
WARN("StartDocPrinter() failed: %ld\n", GetLastError());
ClosePrinter(physDev->job.hprinter);
return 0;
}
......
......@@ -50,7 +50,7 @@ HFONT CDECL PSDRV_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags )
*aa_flags = GGO_BITMAP; /* no anti-aliasing on printer devices */
TRACE("FaceName = %s Height = %d Italic = %d Weight = %d\n",
TRACE("FaceName = %s Height = %ld Italic = %d Weight = %ld\n",
debugstr_w(lf.lfFaceName), lf.lfHeight, lf.lfItalic,
lf.lfWeight);
......
......@@ -110,7 +110,7 @@ BOOL CDECL PSDRV_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT botto
{
char buf[256];
sprintf(buf, "N %d %d %d %d B\n", rect.right - rect.left, rect.bottom - rect.top, rect.left, rect.top);
sprintf(buf, "N %ld %ld %ld %ld B\n", rect.right - rect.left, rect.bottom - rect.top, rect.left, rect.top);
write_spool(dev, buf, strlen(buf));
physDev->job.passthrough_state = passthrough_had_rect;
return TRUE;
......
......@@ -108,7 +108,7 @@ static const struct gdi_dc_funcs psdrv_funcs;
*/
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
TRACE("(%p, %ld, %p)\n", hinst, reason, reserved);
switch(reason) {
......@@ -187,7 +187,7 @@ while (0)
CHECK_FIELD(DM_DITHERTYPE);
CHECK_FIELD(DM_PANNINGWIDTH);
CHECK_FIELD(DM_PANNINGHEIGHT);
if (fields) TRACE(" %#x", fields);
if (fields) TRACE(" %#lx", fields);
TRACE("\n");
#undef CHECK_FIELD
}
......@@ -205,7 +205,7 @@ static void dump_devmode(const DEVMODEW *dm)
TRACE("dmDriverVersion: 0x%04x\n", dm->dmDriverVersion);
TRACE("dmSize: 0x%04x\n", dm->dmSize);
TRACE("dmDriverExtra: 0x%04x\n", dm->dmDriverExtra);
TRACE("dmFields: 0x%04x\n", dm->dmFields);
TRACE("dmFields: 0x%04lx\n", dm->dmFields);
dump_fields(dm->dmFields);
TRACE("dmOrientation: %d\n", dm->dmOrientation);
TRACE("dmPaperSize: %d\n", dm->dmPaperSize);
......@@ -222,9 +222,9 @@ static void dump_devmode(const DEVMODEW *dm)
TRACE("dmCollate: %d\n", dm->dmCollate);
TRACE("dmFormName: %s\n", debugstr_w(dm->dmFormName));
TRACE("dmLogPixels %u\n", dm->dmLogPixels);
TRACE("dmBitsPerPel %u\n", dm->dmBitsPerPel);
TRACE("dmPelsWidth %u\n", dm->dmPelsWidth);
TRACE("dmPelsHeight %u\n", dm->dmPelsHeight);
TRACE("dmBitsPerPel %lu\n", dm->dmBitsPerPel);
TRACE("dmPelsWidth %lu\n", dm->dmPelsWidth);
TRACE("dmPelsHeight %lu\n", dm->dmPelsHeight);
}
static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE *physDev )
......@@ -307,13 +307,13 @@ static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE *physDev )
physDev->ImageableArea.top = physDev->PageSize.cy =
physDev->Devmode->dmPublic.dmPaperLength * physDev->logPixelsY / 254;
} else {
FIXME("Odd dmFields %x\n", physDev->Devmode->dmPublic.dmFields);
FIXME("Odd dmFields %lx\n", physDev->Devmode->dmPublic.dmFields);
SetRectEmpty(&physDev->ImageableArea);
physDev->PageSize.cx = 0;
physDev->PageSize.cy = 0;
}
TRACE("ImageableArea = %s: PageSize = %dx%d\n", wine_dbgstr_rect(&physDev->ImageableArea),
TRACE("ImageableArea = %s: PageSize = %ldx%ld\n", wine_dbgstr_rect(&physDev->ImageableArea),
physDev->PageSize.cx, physDev->PageSize.cy);
/* these are in device units */
......@@ -671,7 +671,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCWSTR name)
lstrcpyW( pi->friendly_name, name );
if (OpenPrinterW( pi->friendly_name, &hPrinter, NULL ) == 0) {
ERR ("OpenPrinter failed with code %i\n", GetLastError ());
ERR ("OpenPrinter failed with code %li\n", GetLastError ());
goto fail;
}
......
......@@ -60,7 +60,7 @@ HPEN CDECL PSDRV_SelectPen( PHYSDEV dev, HPEN hpen, const struct brush_pattern *
logpen.lopnColor = elp->elpColor;
}
TRACE("hpen = %p colour = %08x\n", hpen, logpen.lopnColor);
TRACE("hpen = %p colour = %08lx\n", hpen, logpen.lopnColor);
physDev->pen.width = logpen.lopnWidth.x;
if ((logpen.lopnStyle & PS_GEOMETRIC) || (physDev->pen.width > 1))
......
......@@ -758,7 +758,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
SIZE sz;
if(parse_resolution(tuple.value, &sz))
{
TRACE("DefaultResolution %dx%d\n", sz.cx, sz.cy);
TRACE("DefaultResolution %ldx%ld\n", sz.cx, sz.cy);
ppd->DefaultResolution = sz.cx;
}
else
......@@ -772,7 +772,7 @@ PPD *PSDRV_ParsePPD( const WCHAR *fname, HANDLE printer )
{
RESOLUTION *res;
TRACE("Resolution %dx%d, invocation %s\n", sz.cx, sz.cy, tuple.value);
TRACE("Resolution %ldx%ld, invocation %s\n", sz.cx, sz.cy, tuple.value);
res = HeapAlloc( GetProcessHeap(), 0, sizeof(*res) );
res->resx = sz.cx;
......
......@@ -168,7 +168,7 @@ static const char psarc[] = /* x, y, w, h, ang1, ang2 */
"tmpmtrx setmatrix\n";
static const char pscurveto[] = /* x1, y1, x2, y2, x3, y3 */
"%d %d %d %d %d %d curveto\n";
"%ld %ld %ld %ld %ld %ld curveto\n";
static const char psgsave[] =
"gsave\n";
......@@ -207,7 +207,7 @@ static const char psrotate[] = /* ang */
"%.1f rotate\n";
static const char psarrayput[] =
"%s %d %d put\n";
"%s %d %ld put\n";
static const char psarraydef[] =
"/%s %d array def\n";
......@@ -680,7 +680,7 @@ BOOL PSDRV_WriteSetPen(PHYSDEV dev)
if (physDev->pen.dash_len)
{
for (i = pos = 0; i < physDev->pen.dash_len; i++)
pos += sprintf( buf + pos, " %u", physDev->pen.dash[i] );
pos += sprintf( buf + pos, " %lu", physDev->pen.dash[i] );
buf[0] = '[';
sprintf(buf + pos, "] %u setdash\n", 0);
}
......@@ -963,7 +963,7 @@ BOOL PSDRV_WriteDIBPatternDict(PHYSDEV dev, const BITMAPINFO *bmi, BYTE *bits, U
INT w, h, x, y, w_mult, h_mult, abs_height = abs( bmi->bmiHeader.biHeight );
COLORREF map[2];
TRACE( "size %dx%dx%d\n",
TRACE( "size %ldx%ldx%d\n",
bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bmi->bmiHeader.biBitCount);
if(bmi->bmiHeader.biBitCount != 1) {
......
......@@ -77,8 +77,8 @@ TYPE1 *T1_download_header(PHYSDEV dev, char *ps_name, RECT *bbox, UINT emsize)
" /FontName /%s def\n"
" /Encoding 256 array 0 1 255{1 index exch /.notdef put} for def\n"
" /PaintType 0 def\n"
" /FontMatrix [1 %d div 0 0 1 %d div 0 0] def\n"
" /FontBBox [%d %d %d %d] def\n"
" /FontMatrix [1 %ld div 0 0 1 %ld div 0 0] def\n"
" /FontBBox [%ld %ld %ld %ld] def\n"
" /FontType 1 def\n"
" /Private 7 dict begin\n"
" /RD {string currentfile exch readhexstring pop} def\n"
......@@ -545,12 +545,12 @@ BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index, char *glyph_name
"/%s findfont dup\n"
"/Private get begin\n"
"/CharStrings get begin\n"
"/%s %d RD\n";
"/%s %ld RD\n";
static const char glyph_def_end[] =
"ND\n"
"end end\n";
TRACE("%d %s\n", index, glyph_name);
TRACE("%ld %s\n", index, glyph_name);
assert(pdl->type == Type1);
t1 = pdl->typeinfo.Type1;
......@@ -649,7 +649,7 @@ BOOL T1_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index, char *glyph_name
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(glyph_def_begin) +
strlen(pdl->ps_name) + strlen(glyph_name) + 100);
sprintf(buf, "%%%%glyph %04x\n", index);
sprintf(buf, "%%%%glyph %04lx\n", index);
PSDRV_WriteSpool(dev, buf, strlen(buf));
len = str_get_bytes(charstring, &bytes);
......
......@@ -157,13 +157,13 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
" currentdict end def\n"
" /sfnts [\n";
static const char TT_offset_table[] = "<00010000%04x%04x%04x%04x\n";
static const char TT_table_dir_entry[] = "%08x%08x%08x%08x\n";
static const char TT_table_dir_entry[] = "%08lx%08lx%08lx%08lx\n";
static const char storage[] ="]\nhavetype42gdir{pop}{{string} forall}ifelse\n";
static const char end[] = "] def\n"
"havetype42gdir{/GlyphDirectory 256 dict def\n"
" sfnts 0 get dup\n"
" %d <6c6f6378000000000000000000000000> putinterval\n" /* replace loca entry with dummy locx */
" %d <676c6678000000000000000000000000> putinterval\n" /* replace glyf entry with dummy glfx */
" %ld <6c6f6378000000000000000000000000> putinterval\n" /* replace loca entry with dummy locx */
" %ld <676c6678000000000000000000000000> putinterval\n" /* replace glyf entry with dummy glfx */
" }if\n"
"currentdict end dup /FontName get exch definefont pop\n";
......@@ -190,7 +190,7 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
t42->maxp_tab = i;
}
if(i < num_of_tables) {
TRACE("Table %d has length %d. Will use Type 1 font instead.\n", i, t42->tables[i].len);
TRACE("Table %ld has length %ld. Will use Type 1 font instead.\n", i, t42->tables[i].len);
T42_free(t42);
return NULL;
}
......@@ -265,7 +265,7 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
PSDRV_WriteSpool(dev, "[ ", 2);
for(i = 1; t42->glyf_blocks[i]; i++) {
sprintf(buf,"%d ", t42->glyf_blocks[i] - t42->glyf_blocks[i-1] + 1);
sprintf(buf,"%ld ", t42->glyf_blocks[i] - t42->glyf_blocks[i-1] + 1);
/* again add one byte for old PostScript rips */
PSDRV_WriteSpool(dev, buf, strlen(buf));
if(i % 8 == 0)
......@@ -291,16 +291,16 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
static const char glyph_def[] =
"/%s findfont exch 1 index\n"
"havetype42gdir\n"
"{/GlyphDirectory get begin %d exch def end}\n"
"{/GlyphDirectory get begin %ld exch def end}\n"
"{/sfnts get 4 index get 3 index 2 index putinterval pop}\n"
"ifelse\n"
"/CharStrings get\n"
"begin\n"
" /%s %d def\n"
" /%s %ld def\n"
"end\n"
"pop pop\n";
TRACE("%d %s\n", index, glyph_name);
TRACE("%ld %s\n", index, glyph_name);
assert(pdl->type == Type42);
t42 = pdl->typeinfo.Type42;
......@@ -315,7 +315,7 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
}
if(!get_glyf_pos(t42, index, &start, &end)) return FALSE;
TRACE("start = %x end = %x\n", start, end);
TRACE("start = %lx end = %lx\n", start, end);
if(GET_BE_WORD(t42->tables[t42->glyf_tab].data + start) == 0xffff) {
/* Composite glyph */
......@@ -327,7 +327,7 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
sg_flags = GET_BE_WORD(sg_start);
sg_index = GET_BE_WORD(sg_start + 2);
TRACE("Sending subglyph %04x for glyph %04x\n", sg_index, index);
TRACE("Sending subglyph %04lx for glyph %04lx\n", sg_index, index);
get_glyph_name(dev->hdc, sg_index, sg_name);
T42_download_glyph(dev, pdl, sg_index, sg_name);
sg_start += 4;
......@@ -352,7 +352,7 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
/* we don't have a string for the gdir and glyf tables, but we do have a
string for the TT header. So the offset we need is tables - 2 */
sprintf(buf, "%d %d\n", t42->num_of_written_tables - 2 + i, start - t42->glyf_blocks[i-1]);
sprintf(buf, "%ld %ld\n", t42->num_of_written_tables - 2 + i, start - t42->glyf_blocks[i-1]);
PSDRV_WriteSpool(dev, buf, strlen(buf));
PSDRV_WriteSpool(dev, "<", 1);
......
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