Fixed gcc 4.0 warnings.

oldstable
Alexandre Julliard 2005-09-12 20:30:37 +00:00
parent 5224f74be5
commit d559fbd803
4 changed files with 37 additions and 34 deletions

View File

@ -93,14 +93,17 @@ typedef struct _IAVIStreamImpl {
/***********************************************************************/ /***********************************************************************/
#define CONVERT_STREAM_to_THIS(a) { \ #define CONVERT_STREAM_to_THIS(a) do { \
acmStreamSize(This->has,(a)*This->lpInFormat->nBlockAlign,\ DWORD __bytes; \
&(a), ACM_STREAMSIZEF_SOURCE); \ acmStreamSize(This->has,*(a) * This->lpInFormat->nBlockAlign,\
(a) /= This->lpOutFormat->nBlockAlign; } &__bytes, ACM_STREAMSIZEF_SOURCE); \
#define CONVERT_THIS_to_STREAM(a) { \ *(a) = __bytes / This->lpOutFormat->nBlockAlign; } while(0)
acmStreamSize(This->has,(a)*This->lpOutFormat->nBlockAlign,\
&(a), ACM_STREAMSIZEF_DESTINATION); \ #define CONVERT_THIS_to_STREAM(a) do { \
(a) /= This->lpInFormat->nBlockAlign; } DWORD __bytes; \
acmStreamSize(This->has,*(a) * This->lpOutFormat->nBlockAlign,\
&__bytes, ACM_STREAMSIZEF_DESTINATION); \
*(a) = __bytes / This->lpInFormat->nBlockAlign; } while(0)
static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This); static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This);
@ -304,7 +307,7 @@ static LONG WINAPI ACMStream_fnFindSample(IAVIStream *iface, LONG pos,
} }
/* convert pos from our 'space' to This->pStream's one */ /* convert pos from our 'space' to This->pStream's one */
CONVERT_THIS_to_STREAM(pos); CONVERT_THIS_to_STREAM(&pos);
/* ask stream */ /* ask stream */
pos = IAVIStream_FindSample(This->pStream, pos, flags); pos = IAVIStream_FindSample(This->pStream, pos, flags);
@ -312,7 +315,7 @@ static LONG WINAPI ACMStream_fnFindSample(IAVIStream *iface, LONG pos,
if (pos != -1) { if (pos != -1) {
/* convert pos back to our 'space' if it's no size or physical pos */ /* convert pos back to our 'space' if it's no size or physical pos */
if ((flags & FIND_RET) == 0) if ((flags & FIND_RET) == 0)
CONVERT_STREAM_to_THIS(pos); CONVERT_STREAM_to_THIS(&pos);
} }
return pos; return pos;
@ -391,7 +394,7 @@ static HRESULT WINAPI ACMStream_fnSetFormat(IAVIStream *iface, LONG pos,
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
CONVERT_THIS_to_STREAM(pos); CONVERT_THIS_to_STREAM(&pos);
/* tell the nested stream the new format */ /* tell the nested stream the new format */
return IAVIStream_SetFormat(This->pStream, pos, This->lpOutFormat, return IAVIStream_SetFormat(This->pStream, pos, This->lpOutFormat,
@ -453,7 +456,7 @@ static HRESULT WINAPI ACMStream_fnRead(IAVIStream *iface, LONG start,
} }
/* map our positions to pStream positions */ /* map our positions to pStream positions */
CONVERT_THIS_to_STREAM(start); CONVERT_THIS_to_STREAM(&start);
/* our needed internal buffersize */ /* our needed internal buffersize */
size = samples * This->lpInFormat->nBlockAlign; size = samples * This->lpInFormat->nBlockAlign;
@ -486,7 +489,7 @@ static HRESULT WINAPI ACMStream_fnRead(IAVIStream *iface, LONG start,
/* read source data */ /* read source data */
hr = IAVIStream_Read(This->pStream, start, -1, This->acmStreamHdr.pbSrc, hr = IAVIStream_Read(This->pStream, start, -1, This->acmStreamHdr.pbSrc,
This->acmStreamHdr.cbSrcLength, This->acmStreamHdr.cbSrcLength,
&This->acmStreamHdr.cbSrcLength, NULL); (LONG *)&This->acmStreamHdr.cbSrcLength, NULL);
if (FAILED(hr) || This->acmStreamHdr.cbSrcLength == 0) if (FAILED(hr) || This->acmStreamHdr.cbSrcLength == 0)
return hr; return hr;
@ -553,8 +556,8 @@ static HRESULT WINAPI ACMStream_fnWrite(IAVIStream *iface, LONG start,
/* map our sizes to pStream sizes */ /* map our sizes to pStream sizes */
size = buffersize; size = buffersize;
CONVERT_THIS_to_STREAM(size); CONVERT_THIS_to_STREAM(&size);
CONVERT_THIS_to_STREAM(start); CONVERT_THIS_to_STREAM(&start);
/* no bytes to write? -- short circuit */ /* no bytes to write? -- short circuit */
if (size == 0) { if (size == 0) {
@ -644,8 +647,8 @@ static HRESULT WINAPI ACMStream_fnDelete(IAVIStream *iface, LONG start,
return AVIERR_NOCOMPRESSOR; return AVIERR_NOCOMPRESSOR;
/* map our positions to pStream positions */ /* map our positions to pStream positions */
CONVERT_THIS_to_STREAM(start); CONVERT_THIS_to_STREAM(&start);
CONVERT_THIS_to_STREAM(samples); CONVERT_THIS_to_STREAM(&samples);
return IAVIStream_Delete(This->pStream, start, samples); return IAVIStream_Delete(This->pStream, start, samples);
} }
@ -736,9 +739,9 @@ static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This)
SetRectEmpty(&This->sInfo.rcFrame); SetRectEmpty(&This->sInfo.rcFrame);
/* convert positions ansd sizes to output format */ /* convert positions ansd sizes to output format */
CONVERT_STREAM_to_THIS(This->sInfo.dwStart); CONVERT_STREAM_to_THIS(&This->sInfo.dwStart);
CONVERT_STREAM_to_THIS(This->sInfo.dwLength); CONVERT_STREAM_to_THIS(&This->sInfo.dwLength);
CONVERT_STREAM_to_THIS(This->sInfo.dwSuggestedBufferSize); CONVERT_STREAM_to_THIS(&This->sInfo.dwSuggestedBufferSize);
return AVIERR_OK; return AVIERR_OK;
} }

View File

@ -515,9 +515,9 @@ void
ME_StreamInFill(ME_InStream *stream) ME_StreamInFill(ME_InStream *stream)
{ {
stream->editstream->dwError = stream->editstream->pfnCallback(stream->editstream->dwCookie, stream->editstream->dwError = stream->editstream->pfnCallback(stream->editstream->dwCookie,
stream->buffer, (BYTE *)stream->buffer,
sizeof(stream->buffer), sizeof(stream->buffer),
&stream->dwSize); (LONG *)&stream->dwSize);
stream->dwUsed = 0; stream->dwUsed = 0;
} }
@ -1188,7 +1188,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
UINT from, to; UINT from, to;
PUINT pfrom = wParam ? (PUINT)wParam : &from; PUINT pfrom = wParam ? (PUINT)wParam : &from;
PUINT pto = lParam ? (PUINT)lParam : &to; PUINT pto = lParam ? (PUINT)lParam : &to;
ME_GetSelection(editor, pfrom, pto); ME_GetSelection(editor, (int *)pfrom, (int *)pto);
if ((*pfrom|*pto) & 0xFFFF0000) if ((*pfrom|*pto) & 0xFFFF0000)
return -1; return -1;
return MAKELONG(*pfrom,*pto); return MAKELONG(*pfrom,*pto);

View File

@ -212,7 +212,7 @@ struct tagME_InStream {
EDITSTREAM *editstream; EDITSTREAM *editstream;
DWORD dwSize; DWORD dwSize;
DWORD dwUsed; DWORD dwUsed;
BYTE buffer[STREAMIN_BUFFER_SIZE]; char buffer[STREAMIN_BUFFER_SIZE];
}; };
typedef struct tagME_InStream ME_InStream; typedef struct tagME_InStream ME_InStream;

View File

@ -55,7 +55,7 @@ ME_StreamOutFlush(ME_TextEditor *editor)
on initial random nWritten value, which is usually >STREAMOUT_BUFFER_SIZE */ on initial random nWritten value, which is usually >STREAMOUT_BUFFER_SIZE */
nRemaining = editor->pStream->pos - nStart; nRemaining = editor->pStream->pos - nStart;
nWritten = 0xDEADBEEF; nWritten = 0xDEADBEEF;
stream->dwError = stream->pfnCallback(stream->dwCookie, editor->pStream->buffer + nStart, stream->dwError = stream->pfnCallback(stream->dwCookie, (LPBYTE)editor->pStream->buffer + nStart,
editor->pStream->pos - nStart, &nWritten); editor->pStream->pos - nStart, &nWritten);
TRACE("error=%lu written=%lu\n", stream->dwError, nWritten); TRACE("error=%lu written=%lu\n", stream->dwError, nWritten);
if (nWritten > (editor->pStream->pos - nStart) || nWritten<0) { if (nWritten > (editor->pStream->pos - nStart) || nWritten<0) {
@ -86,7 +86,7 @@ ME_StreamOutFree(ME_TextEditor *editor)
static BOOL static BOOL
ME_StreamOutMove(ME_TextEditor *editor, BYTE *buffer, int len) ME_StreamOutMove(ME_TextEditor *editor, const char *buffer, int len)
{ {
ME_OutStream *pStream = editor->pStream; ME_OutStream *pStream = editor->pStream;
@ -599,8 +599,8 @@ ME_StreamOutRTFText(ME_TextEditor *editor, WCHAR *text, LONG nChars)
nChars--; nChars--;
} else { } else {
BOOL unknown = FALSE; BOOL unknown = FALSE;
BYTE letter[3]; char letter[3];
/* FIXME: In the MS docs for WideCharToMultiByte there is a big list of /* FIXME: In the MS docs for WideCharToMultiByte there is a big list of
* codepages including CP_SYMBOL for which the last parameter must be set * codepages including CP_SYMBOL for which the last parameter must be set
* to NULL for the function to succeed. But in Wine we need to care only * to NULL for the function to succeed. But in Wine we need to care only
@ -610,7 +610,7 @@ ME_StreamOutRTFText(ME_TextEditor *editor, WCHAR *text, LONG nChars)
(editor->pStream->nCodePage == CP_SYMBOL) ? NULL : &unknown); (editor->pStream->nCodePage == CP_SYMBOL) ? NULL : &unknown);
if (unknown) if (unknown)
pos += sprintf(buffer + pos, "\\u%d?", (short)*text); pos += sprintf(buffer + pos, "\\u%d?", (short)*text);
else if (*letter < 128) { else if ((BYTE)*letter < 128) {
if (*letter == '{' || *letter == '}' || *letter == '\\') if (*letter == '{' || *letter == '}' || *letter == '\\')
buffer[pos++] = '\\'; buffer[pos++] = '\\';
buffer[pos++] = *letter; buffer[pos++] = *letter;
@ -720,7 +720,7 @@ ME_StreamOutText(ME_TextEditor *editor, int nStart, int nChars, DWORD dwFormat)
ME_DisplayItem *item = ME_FindItemAtOffset(editor, diRun, nStart, &nStart); ME_DisplayItem *item = ME_FindItemAtOffset(editor, diRun, nStart, &nStart);
int nLen; int nLen;
UINT nCodePage = CP_ACP; UINT nCodePage = CP_ACP;
BYTE *buffer = NULL; char *buffer = NULL;
int nBufLen = 0; int nBufLen = 0;
BOOL success = TRUE; BOOL success = TRUE;
@ -738,15 +738,15 @@ ME_StreamOutText(ME_TextEditor *editor, int nStart, int nChars, DWORD dwFormat)
nLen = nChars; nLen = nChars;
if (item->member.run.nFlags & MERF_ENDPARA) { if (item->member.run.nFlags & MERF_ENDPARA) {
WCHAR szEOL[] = { '\r', '\n' }; static const WCHAR szEOL[2] = { '\r', '\n' };
if (dwFormat & SF_UNICODE) if (dwFormat & SF_UNICODE)
success = ME_StreamOutMove(editor, (BYTE *)szEOL, 4); success = ME_StreamOutMove(editor, (const char *)szEOL, sizeof(szEOL));
else else
success = ME_StreamOutMove(editor, "\r\n", 2); success = ME_StreamOutMove(editor, "\r\n", 2);
} else { } else {
if (dwFormat & SF_UNICODE) if (dwFormat & SF_UNICODE)
success = ME_StreamOutMove(editor, (BYTE *)(item->member.run.strText->szData + nStart), success = ME_StreamOutMove(editor, (const char *)(item->member.run.strText->szData + nStart),
sizeof(WCHAR) * nLen); sizeof(WCHAR) * nLen);
else { else {
int nSize; int nSize;
@ -756,7 +756,7 @@ ME_StreamOutText(ME_TextEditor *editor, int nStart, int nChars, DWORD dwFormat)
if (nSize > nBufLen) { if (nSize > nBufLen) {
if (buffer) if (buffer)
FREE_OBJ(buffer); FREE_OBJ(buffer);
buffer = ALLOC_N_OBJ(BYTE, nSize); buffer = ALLOC_N_OBJ(char, nSize);
nBufLen = nSize; nBufLen = nSize;
} }
WideCharToMultiByte(nCodePage, 0, item->member.run.strText->szData + nStart, WideCharToMultiByte(nCodePage, 0, item->member.run.strText->szData + nStart,