Commit 177350d0 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

riched20: Win64 printf format warning fixes.

parent 781f3f78
......@@ -6,7 +6,6 @@ MODULE = riched20.dll
IMPORTLIB = libriched20.$(IMPLIBEXT)
IMPORTS = ole32 user32 gdi32 kernel32
EXTRALIBS = -luuid
EXTRADEFS = -DWINE_NO_LONG_AS_INT
C_SRCS = \
caret.c \
......
......@@ -65,7 +65,7 @@ static ULONG WINAPI EnumFormatImpl_AddRef(IEnumFORMATETC *iface)
{
EnumFormatImpl *This = (EnumFormatImpl*)iface;
LONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
......@@ -73,7 +73,7 @@ static ULONG WINAPI EnumFormatImpl_Release(IEnumFORMATETC *iface)
{
EnumFormatImpl *This = (EnumFormatImpl*)iface;
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref);
TRACE("(%p) ref=%d\n", This, ref);
if(!ref) {
HeapFree(GetProcessHeap(), 0, This->fmtetc);
......@@ -88,7 +88,7 @@ static HRESULT WINAPI EnumFormatImpl_Next(IEnumFORMATETC *iface, ULONG celt,
{
EnumFormatImpl *This = (EnumFormatImpl*)iface;
ULONG count = 0;
TRACE("(%p)->(%ld %p %p)\n", This, celt, rgelt, pceltFetched);
TRACE("(%p)->(%d %p %p)\n", This, celt, rgelt, pceltFetched);
if(!rgelt)
return E_INVALIDARG;
......@@ -107,7 +107,7 @@ static HRESULT WINAPI EnumFormatImpl_Skip(IEnumFORMATETC *iface, ULONG celt)
{
EnumFormatImpl *This = (EnumFormatImpl*)iface;
ULONG count = 0;
TRACE("(%p)->(%ld)\n", This, celt);
TRACE("(%p)->(%d)\n", This, celt);
count = min(celt, This->fmtetc_cnt-This->cur);
This->cur += count;
......@@ -181,7 +181,7 @@ static ULONG WINAPI DataObjectImpl_AddRef(IDataObject* iface)
{
DataObjectImpl *This = (DataObjectImpl*)iface;
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%ld\n", This, ref);
TRACE("(%p) ref=%d\n", This, ref);
return ref;
}
......@@ -189,7 +189,7 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
{
DataObjectImpl *This = (DataObjectImpl*)iface;
ULONG ref = InterlockedDecrement(&This->ref);
TRACE("(%p) ref=%ld\n",This, ref);
TRACE("(%p) ref=%d\n",This, ref);
if(!ref) {
if(This->unicode) GlobalFree(This->unicode);
......@@ -204,7 +204,7 @@ static ULONG WINAPI DataObjectImpl_Release(IDataObject* iface)
static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pformatetc, STGMEDIUM *pmedium)
{
DataObjectImpl *This = (DataObjectImpl*)iface;
TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat, pformatetc->tymed);
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", This, pformatetc->cfFormat, pformatetc->tymed);
if(pformatetc->lindex != -1)
return DV_E_LINDEX;
......@@ -237,7 +237,7 @@ static HRESULT WINAPI DataObjectImpl_QueryGetData(IDataObject* iface, FORMATETC
DataObjectImpl *This = (DataObjectImpl*)iface;
UINT i;
BOOL foundFormat = FALSE;
TRACE("(%p)->(fmt=0x%08x tym=0x%08lx)\n", This, pformatetc->cfFormat, pformatetc->tymed);
TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", This, pformatetc->cfFormat, pformatetc->tymed);
if(pformatetc->lindex != -1)
return DV_E_LINDEX;
......@@ -277,10 +277,10 @@ static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwD
IEnumFORMATETC **ppenumFormatEtc)
{
DataObjectImpl *This = (DataObjectImpl*)iface;
TRACE("(%p)->(%ld)\n", This, dwDirection);
TRACE("(%p)->(%d)\n", This, dwDirection);
if(dwDirection != DATADIR_GET) {
FIXME("Unsupported direction: %ld\n", dwDirection);
FIXME("Unsupported direction: %d\n", dwDirection);
/* WinXP riched20 also returns E_NOTIMPL in this case */
return E_NOTIMPL;
}
......@@ -386,7 +386,7 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, CHARRANGE *lpchrg)
HRESULT ME_GetDataObject(ME_TextEditor *editor, CHARRANGE *lpchrg, LPDATAOBJECT *lplpdataobj)
{
DataObjectImpl *obj;
TRACE("(%p,%ld,%ld)\n", editor, lpchrg->cpMin, lpchrg->cpMax);
TRACE("(%p,%d,%d)\n", editor, lpchrg->cpMin, lpchrg->cpMax);
obj = HeapAlloc(GetProcessHeap(), 0, sizeof(DataObjectImpl));
if(cfRTF == 0)
......
......@@ -271,7 +271,7 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
WCHAR wszText[STREAMIN_BUFFER_SIZE+1];
WCHAR *pText;
TRACE("%08lx %p\n", dwFormat, stream);
TRACE("%08x %p\n", dwFormat, stream);
do {
long nWideChars = 0;
......@@ -784,11 +784,11 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, CHARRANGE *chrg, const WCHAR *te
ME_DisplayItem *para;
WCHAR wLastChar = ' ';
TRACE("flags==0x%08lx, chrg->cpMin==%ld, chrg->cpMax==%ld text==%s\n",
TRACE("flags==0x%08x, chrg->cpMin==%d, chrg->cpMax==%d text==%s\n",
flags, chrg->cpMin, chrg->cpMax, debugstr_w(text));
if (flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD))
FIXME("Flags 0x%08lx not implemented\n",
FIXME("Flags 0x%08x not implemented\n",
flags & ~(FR_DOWN | FR_MATCHCASE | FR_WHOLEWORD));
nMin = chrg->cpMin;
......@@ -1466,7 +1466,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_NCCREATE:
{
CREATESTRUCTW *pcs = (CREATESTRUCTW *)lParam;
TRACE("WM_NCCREATE: style 0x%08lx\n", pcs->style);
TRACE("WM_NCCREATE: style 0x%08x\n", pcs->style);
editor = ME_MakeEditor(hWnd);
SetWindowLongPtrW(hWnd, 0, (LONG_PTR)editor);
pcs = 0; /* ignore */
......@@ -1490,7 +1490,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
{
CHARRANGE *pRange = (CHARRANGE *)lParam;
ME_GetSelection(editor, (int *)&pRange->cpMin, (int *)&pRange->cpMax);
TRACE("EM_EXGETSEL = (%ld,%ld)\n", pRange->cpMin, pRange->cpMax);
TRACE("EM_EXGETSEL = (%d,%d)\n", pRange->cpMin, pRange->cpMax);
return 0;
}
case EM_SETUNDOLIMIT:
......@@ -1600,7 +1600,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
int start, end;
CHARRANGE range = *(CHARRANGE *)lParam;
TRACE("EM_EXSETSEL (%ld,%ld)\n", range.cpMin, range.cpMax);
TRACE("EM_EXSETSEL (%d,%d)\n", range.cpMin, range.cpMax);
/* if cpMin < 0, then selection is deselected and caret moved to end of
* the current selection */
......@@ -1975,7 +1975,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
int nStart, nCount;
if (ex->flags & ~(GT_SELECTION | GT_USECRLF))
FIXME("GETTEXTEX flags 0x%08lx not supported\n", ex->flags & ~(GT_SELECTION | GT_USECRLF));
FIXME("GETTEXTEX flags 0x%08x not supported\n", ex->flags & ~(GT_SELECTION | GT_USECRLF));
if (ex->flags & GT_SELECTION)
{
......@@ -2030,7 +2030,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case EM_GETTEXTRANGE:
{
TEXTRANGEW *rng = (TEXTRANGEW *)lParam;
TRACE("EM_GETTEXTRANGE min=%ld max=%ld unicode=%d emul1.0=%d length=%d\n",
TRACE("EM_GETTEXTRANGE min=%d max=%d unicode=%d emul1.0=%d length=%d\n",
rng->chrg.cpMin, rng->chrg.cpMax, IsWindowUnicode(hWnd),
editor->bEmulateVersion10, ME_GetTextLength(editor));
if (IsWindowUnicode(hWnd))
......
......@@ -352,7 +352,7 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) {
rc.right = c->rcView.left+run->pt.x+run->nWidth;
rc.top = c->pt.y+run->pt.y;
rc.bottom = c->pt.y+run->pt.y+height;
TRACE("rc = (%ld, %ld, %ld, %ld)\n", rc.left, rc.top, rc.right, rc.bottom);
TRACE("rc = (%d, %d, %d, %d)\n", rc.left, rc.top, rc.right, rc.bottom);
if (run->nFlags & MERF_SKIPPED)
DrawFocusRect(c->hDC, &rc);
else
......
......@@ -96,7 +96,7 @@ IRichEditOle_fnAddRef(IRichEditOle *me)
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
ULONG ref = InterlockedIncrement( &This->ref );
TRACE("%p ref = %lu\n", This, ref);
TRACE("%p ref = %u\n", This, ref);
return ref;
}
......@@ -107,7 +107,7 @@ IRichEditOle_fnRelease(IRichEditOle *me)
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
ULONG ref = InterlockedDecrement(&This->ref);
TRACE ("%p ref=%lu\n", This, ref);
TRACE ("%p ref=%u\n", This, ref);
if (!ref)
{
......@@ -158,7 +158,7 @@ IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg,
IRichEditOleImpl *This = impl_from_IRichEditOle(me);
CHARRANGE tmpchrg;
TRACE("(%p,%p,%ld)\n",This, lpchrg, reco);
TRACE("(%p,%p,%d)\n",This, lpchrg, reco);
if(!lplpdataobj)
return E_INVALIDARG;
if(!lpchrg) {
......
......@@ -121,7 +121,7 @@ void ME_CheckCharOffsets(ME_TextEditor *editor)
ofs = 0;
break;
case diRun:
TRACE_(richedit_check)("run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = \"%s\", flags=%08x, fx&mask = %08lx\n",
TRACE_(richedit_check)("run, real ofs = %d (+ofsp = %d), counted = %d, len = %d, txt = \"%s\", flags=%08x, fx&mask = %08x\n",
p->member.run.nCharOfs, p->member.run.nCharOfs+ofsp, ofsp+ofs,
p->member.run.strText->nLen, debugstr_w(p->member.run.strText->szData),
p->member.run.nFlags,
......@@ -284,7 +284,7 @@ ME_DisplayItem *ME_SplitRun(ME_Context *c, ME_DisplayItem *item, int nVChar)
run = &item->member.run;
TRACE("Before split: %s(%ld, %ld)\n", debugstr_w(run->strText->szData),
TRACE("Before split: %s(%d, %d)\n", debugstr_w(run->strText->szData),
run->pt.x, run->pt.y);
item2 = ME_SplitRunSimple(editor, item, nVChar);
......@@ -302,7 +302,7 @@ ME_DisplayItem *ME_SplitRun(ME_Context *c, ME_DisplayItem *item, int nVChar)
TRACE("Before check after split\n");
ME_CheckCharOffsets(editor);
TRACE("After check after split\n");
TRACE("After split: %s(%ld, %ld), %s(%ld, %ld)\n",
TRACE("After split: %s(%d, %d), %s(%d, %d)\n",
debugstr_w(run->strText->szData), run->pt.x, run->pt.y,
debugstr_w(run2->strText->szData), run2->pt.x, run2->pt.y);
}
......
......@@ -121,7 +121,7 @@ static ULONG WINAPI fnTextSrv_AddRef(ITextServices *iface)
ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
DWORD ref = InterlockedIncrement(&This->ref);
TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, ref - 1);
TRACE("(%p/%p)->() AddRef from %d\n", This, iface, ref - 1);
return ref;
}
......@@ -130,7 +130,7 @@ static ULONG WINAPI fnTextSrv_Release(ITextServices *iface)
ICOM_THIS_MULTI(ITextServicesImpl, lpVtbl, iface);
DWORD ref = InterlockedDecrement(&This->ref);
TRACE("(%p/%p)->() Release from %ld\n", This, iface, ref + 1);
TRACE("(%p/%p)->() Release from %d\n", This, iface, ref + 1);
if (!ref)
{
......
......@@ -51,16 +51,16 @@ ME_StreamOutFlush(ME_OutStream *pStream)
EDITSTREAM *stream = pStream->stream;
do {
TRACE("sending %lu bytes\n", pStream->pos - nStart);
TRACE("sending %u bytes\n", pStream->pos - nStart);
/* Some apps seem not to set *pcb unless a problem arises, relying
on initial random nWritten value, which is usually >STREAMOUT_BUFFER_SIZE */
nRemaining = pStream->pos - nStart;
nWritten = 0xDEADBEEF;
stream->dwError = stream->pfnCallback(stream->dwCookie, (LPBYTE)pStream->buffer + nStart,
pStream->pos - nStart, &nWritten);
TRACE("error=%lu written=%lu\n", stream->dwError, nWritten);
TRACE("error=%u written=%u\n", stream->dwError, nWritten);
if (nWritten > (pStream->pos - nStart) || nWritten<0) {
FIXME("Invalid returned written size *pcb: 0x%x (%ld) instead of %ld\n",
FIXME("Invalid returned written size *pcb: 0x%x (%d) instead of %d\n",
(unsigned)nWritten, nWritten, nRemaining);
nWritten = nRemaining;
}
......@@ -78,7 +78,7 @@ static LONG
ME_StreamOutFree(ME_OutStream *pStream)
{
LONG written = pStream->written;
TRACE("total length = %lu\n", written);
TRACE("total length = %u\n", written);
FREE_OBJ(pStream);
return written;
......@@ -346,13 +346,13 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para)
strcat(props, "\\sl-480\\slmult1");
break;
case 3:
sprintf(props + strlen(props), "\\sl%ld\\slmult0", fmt->dyLineSpacing);
sprintf(props + strlen(props), "\\sl%d\\slmult0", fmt->dyLineSpacing);
break;
case 4:
sprintf(props + strlen(props), "\\sl-%ld\\slmult0", fmt->dyLineSpacing);
sprintf(props + strlen(props), "\\sl-%d\\slmult0", fmt->dyLineSpacing);
break;
case 5:
sprintf(props + strlen(props), "\\sl-%ld\\slmult1", fmt->dyLineSpacing * 240 / 20);
sprintf(props + strlen(props), "\\sl-%d\\slmult1", fmt->dyLineSpacing * 240 / 20);
break;
}
}
......@@ -377,15 +377,15 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para)
strcat(props, "\\intbl");
if (fmt->dwMask & PFM_OFFSET)
sprintf(props + strlen(props), "\\li%ld", fmt->dxOffset);
sprintf(props + strlen(props), "\\li%d", fmt->dxOffset);
if (fmt->dwMask & PFM_OFFSETINDENT || fmt->dwMask & PFM_STARTINDENT)
sprintf(props + strlen(props), "\\fi%ld", fmt->dxStartIndent);
sprintf(props + strlen(props), "\\fi%d", fmt->dxStartIndent);
if (fmt->dwMask & PFM_RIGHTINDENT)
sprintf(props + strlen(props), "\\ri%ld", fmt->dxRightIndent);
sprintf(props + strlen(props), "\\ri%d", fmt->dxRightIndent);
if (fmt->dwMask & PFM_SPACEAFTER)
sprintf(props + strlen(props), "\\sa%ld", fmt->dySpaceAfter);
sprintf(props + strlen(props), "\\sa%d", fmt->dySpaceAfter);
if (fmt->dwMask & PFM_SPACEBEFORE)
sprintf(props + strlen(props), "\\sb%ld", fmt->dySpaceBefore);
sprintf(props + strlen(props), "\\sb%d", fmt->dySpaceBefore);
if (fmt->dwMask & PFM_STYLE)
sprintf(props + strlen(props), "\\s%d", fmt->sStyle);
......@@ -409,7 +409,7 @@ ME_StreamOutRTFParaProps(ME_OutStream *pStream, ME_DisplayItem *para)
}
if (fmt->rgxTabs[i] >> 28 <= 5)
strcat(props, leader[fmt->rgxTabs[i] >> 28]);
sprintf(props+strlen(props), "\\tx%ld", fmt->rgxTabs[i]&0x00FFFFFF);
sprintf(props+strlen(props), "\\tx%d", fmt->rgxTabs[i]&0x00FFFFFF);
}
}
......@@ -486,9 +486,9 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
/* CFM_LINK is not streamed out by M$ */
if (fmt->dwMask & CFM_OFFSET) {
if (fmt->yOffset >= 0)
sprintf(props + strlen(props), "\\up%ld", fmt->yOffset);
sprintf(props + strlen(props), "\\up%d", fmt->yOffset);
else
sprintf(props + strlen(props), "\\dn%ld", -fmt->yOffset);
sprintf(props + strlen(props), "\\dn%d", -fmt->yOffset);
}
if (fmt->dwMask & CFM_OUTLINE && fmt->dwEffects & CFE_OUTLINE)
strcat(props, "\\outl");
......@@ -498,7 +498,7 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
if (fmt->dwMask & CFM_SHADOW && fmt->dwEffects & CFE_SHADOW)
strcat(props, "\\shad");
if (fmt->dwMask & CFM_SIZE)
sprintf(props + strlen(props), "\\fs%ld", fmt->yHeight / 10);
sprintf(props + strlen(props), "\\fs%d", fmt->yHeight / 10);
if (fmt->dwMask & CFM_SMALLCAPS && fmt->dwEffects & CFE_SMALLCAPS)
strcat(props, "\\scaps");
if (fmt->dwMask & CFM_SPACING)
......
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