1
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:33:46 +01:00

cleanup: Silence compilation warnings on MinGW-w64

Some of the code, especially the dshow and windows codec loader parts,
are extremely hacky and likely full of bugs. The goal is merely getting
rid of warnings that could obscure more important warnings and actual
bugs, instead of fixing actual problems. This reduces the number of
warnings from over 500 to almost the same as when compiling on Linux.

Note that many problems stem from using the ancient wine-derived
windows headers. There are some differences to the "proper" windows
header. Changing the code to compile with the proper headers would be
too much trouble, and it still has to work on Unix.

Some of the changes might actually break compilation on legacy MinGW,
but we don't support that anymore. Always use MinGW-w64, even when
compiling to 32 bit.

Fixes some warnings in the win32 loader code on Linux too.
This commit is contained in:
wm4 2012-02-27 19:15:13 +01:00 committed by Uoti Urpala
parent 25417a626d
commit 24be34f1e9
28 changed files with 101 additions and 108 deletions

View File

@ -1579,7 +1579,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
{
struct MPOpts *opts = &mpctx->opts;
demux_stream_t *const d_sub = mpctx->d_sub;
int source = -1, reset_spu = 0;
int source = -1, reset_spu av_unused = 0; // used under CONFIG_DVDREAD
int source_pos = -1;
update_global_sub_size(mpctx);

View File

@ -81,12 +81,14 @@ static const GUID KSDATAFORMAT_SUBTYPE_PCM = {0x1,0x0000,0x0010, {0x80,0x00,0x00
#define SPEAKER_TOP_BACK_RIGHT 0x20000
#define SPEAKER_RESERVED 0x80000000
#if 0
#define DSSPEAKER_HEADPHONE 0x00000001
#define DSSPEAKER_MONO 0x00000002
#define DSSPEAKER_QUAD 0x00000003
#define DSSPEAKER_STEREO 0x00000004
#define DSSPEAKER_SURROUND 0x00000005
#define DSSPEAKER_5POINT1 0x00000006
#endif
#ifndef _WAVEFORMATEXTENSIBLE_
typedef struct {
@ -337,14 +339,14 @@ static int write_buffer(unsigned char *data, int len)
numsamp = dwBytes1 / (ao_data.channels * sampsize); // number of samples for each channel in this buffer
for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) {
memcpy(lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize);
memcpy((char*)lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize);
}
if (NULL != lpvPtr2 )
{
numsamp = dwBytes2 / (ao_data.channels * sampsize);
for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) {
memcpy(lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize);
memcpy((char*)lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize);
}
}

View File

@ -300,7 +300,6 @@ static void uninit(sh_audio_t *sh){
}
static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){
int error;
unsigned long FramesToGet=0; //how many frames the demuxer has to get
unsigned long InputBufferSize=0; //size of the input buffer
unsigned long ConvertedFrames=0;
@ -331,7 +330,7 @@ static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen)
// printf("\nSoundConverterConvertBuffer(myConv=%p,inbuf=%p,frames=%d,outbuf=%p,&convframes=%p,&convbytes=%p)\n",
// myConverter,sh->a_in_buffer,FramesToGet,buf,&ConvertedFrames,&ConvertedBytes);
error = SoundConverterConvertBuffer(myConverter,sh->a_in_buffer,
SoundConverterConvertBuffer(myConverter,sh->a_in_buffer,
FramesToGet,buf,&ConvertedFrames,&ConvertedBytes);
// printf("SoundConverterConvertBuffer:%i\n",error);
// printf("ConvertedFrames = %li\n",ConvertedFrames);

View File

@ -54,8 +54,8 @@ static void (*TvqUpdateVectorInfo)(int varbits, int *ndiv, int bits0[], int bits
static int (*TvqCheckVersion)(char *versionID);
static void (*TvqGetConfInfo)(tvqConfInfo *cf);
static int (*TvqGetFrameSize)();
static int (*TvqGetNumFixedBitsPerFrame)();
static int (*TvqGetFrameSize)(void);
static int (*TvqGetNumFixedBitsPerFrame)(void);
#define BYTE_BIT 8
#define BBUFSIZ 1024 /* Bit buffer size (bytes) */

View File

@ -129,7 +129,7 @@ static int init(sh_video_t *sh){
DecompressSequenceFrameS = (OSErr (*)(ImageSequence,Ptr,long,CodecFlags,CodecFlags*,ICMCompletionProcRecordPtr))GetProcAddress(handler, "DecompressSequenceFrameS");
GetGWorldPixMap = (PixMapHandle (*)(GWorldPtr))GetProcAddress(handler, "GetGWorldPixMap");
QTNewGWorldFromPtr = (OSErr(*)(GWorldPtr *,OSType,const Rect *,CTabHandle,void*,GWorldFlags,void *,long))GetProcAddress(handler, "QTNewGWorldFromPtr");
NewHandleClear = (OSErr(*)(Size))GetProcAddress(handler, "NewHandleClear");
NewHandleClear = (Handle(*)(Size))GetProcAddress(handler, "NewHandleClear");
DisposeHandle = (void (*)(Handle))GetProcAddress(handler, "DisposeHandle");
DisposeGWorld = (void (*)(GWorldPtr))GetProcAddress(handler, "DisposeGWorld");
CDSequenceEnd = (OSErr (*)(ImageSequence))GetProcAddress(handler, "CDSequenceEnd");

View File

@ -153,7 +153,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
static int init(sh_video_t *sh){
HRESULT ret;
// unsigned int outfmt=sh->codec->outfmt[sh->outfmtidx];
int i, o_bih_len;
int o_bih_len;
vd_vfw_ctx *priv;
/* Hack for VSSH codec: new dll can't decode old files
@ -198,7 +198,7 @@ static int init(sh_video_t *sh){
ret = ICDecompressGetFormat(priv->handle, sh->bih, priv->o_bih);
if(ret < 0){
mp_msg(MSGT_WIN32,MSGL_ERR,"ICDecompressGetFormat failed: Error %d\n", (int)ret);
for (i=0; i < o_bih_len; i++) mp_msg(MSGT_WIN32, MSGL_DBG2, "%02x ", priv->o_bih[i]);
//for (i=0; i < o_bih_len; i++) mp_msg(MSGT_WIN32, MSGL_DBG2, "%02x ", priv->o_bih[i]);
return 0;
}
mp_msg(MSGT_WIN32,MSGL_V,"ICDecompressGetFormat OK\n");

View File

@ -128,8 +128,10 @@ typedef struct {
#define AVIIF_NOTIME 0x00000100L // this frame doesn't take any time
#define AVIIF_COMPUSE 0x0FFF0000L // these bits are for compressor use
#ifndef FOURCC_RIFF
#define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F')
#define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T')
#endif
typedef struct
{

View File

@ -276,7 +276,7 @@ static uint32_t Directx_CreateOverlay(uint32_t imgfmt)
case DDERR_OUTOFVIDEOMEMORY:
{mp_msg(MSGT_VO, MSGL_ERR,"not enough video memory\n");break;}
default:
mp_msg(MSGT_VO, MSGL_ERR,"create surface failed with 0x%x\n",ddrval);
mp_msg(MSGT_VO, MSGL_ERR,"create surface failed with 0x%xu\n",(unsigned)ddrval);
}
return 1;
}
@ -588,7 +588,7 @@ static uint32_t Directx_ManageDisplay(void)
// we should try upping the destination size a bit, or
// perhaps shrinking the source size
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>UpdateOverlay failed\n" );
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>Overlay:x1:%i,y1:%i,x2:%i,y2:%i,w:%i,h:%i\n",rd.left,rd.top,rd.right,rd.bottom,rd.right - rd.left,rd.bottom - rd.top );
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>Overlay:x1:%li,y1:%li,x2:%li,y2:%li,w:%li,h:%li\n",rd.left,rd.top,rd.right,rd.bottom,rd.right - rd.left,rd.bottom - rd.top );
mp_msg(MSGT_VO, MSGL_ERR ,"<vo_directx><ERROR>");
switch (ddrval)
{
@ -618,7 +618,7 @@ static uint32_t Directx_ManageDisplay(void)
break;
}
default:
mp_msg(MSGT_VO, MSGL_ERR ," 0x%x\n",ddrval);
mp_msg(MSGT_VO, MSGL_ERR ," 0x%xu\n",(unsigned)ddrval);
}
/*ok we can't do anything about it -> hide overlay*/
if(ddrval != DD_OK)

View File

@ -41,6 +41,8 @@
#define MONITOR_DEFAULTTOPRIMARY 1
#endif
#define WIN_ID_TO_HWND(x) ((HWND)(uint32_t)(x))
static const char classname[] = "MPlayer - The Movie Player";
int vo_vm = 0;
@ -116,7 +118,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
break;
case WM_WINDOWPOSCHANGING:
if (vo_keepaspect && !vo_fs && WinID < 0) {
WINDOWPOS *wpos = lParam;
WINDOWPOS *wpos = (WINDOWPOS*)lParam;
int xborder, yborder;
r.left = r.top = 0;
r.right = wpos->cx;
@ -232,10 +234,10 @@ int vo_w32_check_events(void) {
vo_dx = p.x; vo_dy = p.y;
event_flags |= VO_EVENT_MOVE;
}
res = GetClientRect(WinID, &r);
res = GetClientRect(WIN_ID_TO_HWND(WinID), &r);
if (res && (r.right != vo_dwidth || r.bottom != vo_dheight))
MoveWindow(vo_window, 0, 0, r.right, r.bottom, FALSE);
if (!IsWindow(WinID))
if (!IsWindow(WIN_ID_TO_HWND(WinID)))
// Window has probably been closed, e.g. due to program crash
mplayer_put_key(KEY_CLOSE_WIN);
}
@ -514,11 +516,11 @@ int vo_w32_init(void) {
if (WinID >= 0)
{
RECT r;
GetClientRect(WinID, &r);
GetClientRect(WIN_ID_TO_HWND(WinID), &r);
vo_dwidth = r.right; vo_dheight = r.bottom;
vo_window = CreateWindowEx(WS_EX_NOPARENTNOTIFY, classname, classname,
WS_CHILD | WS_VISIBLE,
0, 0, vo_dwidth, vo_dheight, WinID, 0, hInstance, 0);
WS_CHILD | WS_VISIBLE, 0, 0, vo_dwidth, vo_dheight,
WIN_ID_TO_HWND(WinID), 0, hInstance, 0);
EnableWindow(vo_window, 0);
} else
vo_window = CreateWindowEx(0, classname, classname,

View File

@ -227,7 +227,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
return MMSYSERR_ERROR;
}
pad->pfnDriverProc = GetProcAddress(pad->hDrvr, "DriverProc");
pad->pfnDriverProc = (DRIVERPROC)GetProcAddress(pad->hDrvr, "DriverProc");
/* insert new pad at beg of list */
pad->pNextACMDriver = padid->pACMDriverList;

View File

@ -361,7 +361,7 @@ int DMO_VideoDecoder_DecodeInternal(DMO_VideoDecoder *this, const void* src, int
int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int csp)
{
HRESULT result;
int should_test=1;
//int should_test=1;
Debug printf("DMO_VideoDecoder_SetDestFmt (%p, %d, %d)\n",this,bits,(int)csp);
@ -467,7 +467,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c
else
this->m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER);
#if 0
switch(csp)
{
case fccYUY2:
@ -499,6 +499,7 @@ int DMO_VideoDecoder_SetDestFmt(DMO_VideoDecoder *this, int bits, unsigned int c
should_test=false;
break;
}
#endif
#ifdef WIN32_LOADER
Setup_FS_Segment();

View File

@ -216,7 +216,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
enum_pins->vt->Reset(enum_pins);
result = enum_pins->vt->Next(enum_pins, (ULONG)256, (IPin**)array, &fetched);
enum_pins->vt->Release(enum_pins);
enum_pins->vt->Release((IUnknown*)enum_pins);
Debug printf("Pins enumeration returned %ld pins, error is %x\n", fetched, (int)result);
for (i = 0; i < fetched; i++)
@ -306,7 +306,7 @@ DS_Filter* DS_FilterCreate(const char* dllname, const GUID* id,
init++;
break;
}
tempAll->vt->Release(tempAll);
tempAll->vt->Release((IUnknown*)tempAll);
if (!init)
{

View File

@ -600,8 +600,8 @@ int DS_VideoDecoder_SetDestFmt(DS_VideoDecoder *this, int bits, unsigned int csp
}
if(this->m_pDS_Filter->m_pAll)
this->m_pDS_Filter->m_pAll->vt->Release(this->m_pDS_Filter->m_pAll);
this->m_pDS_Filter->m_pAll=MemAllocatorCreate();
this->m_pDS_Filter->m_pAll->vt->Release((IUnknown*)this->m_pDS_Filter->m_pAll);
this->m_pDS_Filter->m_pAll=(IMemAllocator*)MemAllocatorCreate();
if (!this->m_pDS_Filter->m_pAll)
{
printf("Call to MemAllocatorCreate failed\n");

View File

@ -114,6 +114,7 @@ static inline avm_list_t* avm_list_find(avm_list_t* head, void* member)
return NULL;
}
#ifdef WIN32_LOADER
static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@ -130,6 +131,7 @@ static long MemAllocator_CreateAllocator(GUID* clsid, const GUID* iid, void** pp
return result;
}
#endif
static HRESULT STDCALL MemAllocator_SetProperties(IMemAllocator * This,
/* [in] */ ALLOCATOR_PROPERTIES *pRequest,

View File

@ -34,6 +34,7 @@
// Used for knowing when to register and unregister the class in COM.
static int GraphKeeper = 0;
#ifdef WIN32_LOADER
static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
{
IUnknown* p;
@ -50,6 +51,7 @@ static long FilterGraph_CreateGraph(GUID* clsid, const GUID* iid, void** ppv)
return result;
}
#endif
static void FilterGraph_Destroy(FilterGraph* This)
{
@ -62,56 +64,56 @@ static void FilterGraph_Destroy(FilterGraph* This)
free(This);
}
HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
IBaseFilter* pFilter,
unsigned short* pName)
static HRESULT STDCALL FilterGraph_AddFilter(IFilterGraph* This,
IBaseFilter* pFilter,
unsigned short* pName)
{
Debug printf("FilterGraph_AddFilter(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This, IBaseFilter* pFilter)
static HRESULT STDCALL FilterGraph_RemoveFilter(IFilterGraph* This, IBaseFilter* pFilter)
{
Debug printf("FilterGraph_RemoveFilter(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This, IEnumFilters** ppEnum)
static HRESULT STDCALL FilterGraph_EnumFilters(IFilterGraph* This, IEnumFilters** ppEnum)
{
Debug printf("FilterGraph_EnumFilters(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
unsigned short* pName,
IBaseFilter** ppFilter)
static HRESULT STDCALL FilterGraph_FindFilterByName(IFilterGraph* This,
unsigned short* pName,
IBaseFilter** ppFilter)
{
Debug printf("FilterGraph_FindFilterByName(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
IPin* ppinOut,
IPin* ppinIn,
const AM_MEDIA_TYPE* pmt)
static HRESULT STDCALL FilterGraph_ConnectDirect(IFilterGraph* This,
IPin* ppinOut,
IPin* ppinIn,
const AM_MEDIA_TYPE* pmt)
{
Debug printf("FilterGraph_ConnectDirect(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin)
static HRESULT STDCALL FilterGraph_Reconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Reconnect(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin)
static HRESULT STDCALL FilterGraph_Disconnect(IFilterGraph* This, IPin* ppin)
{
Debug printf("FilterGraph_Disconnect(%p) called\n", This);
return E_NOTIMPL;
}
HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This)
static HRESULT STDCALL FilterGraph_SetDefaultSyncSource(IFilterGraph* This)
{
Debug printf("FilterGraph_SetDefaultSyncSource(%p) called\n", This);
return E_NOTIMPL;

View File

@ -52,25 +52,6 @@ struct FilterGraph {
HRESULT STDCALL (*SetDefaultSyncSource)(FilterGraph* This);
};
HRESULT STDCALL FilterGraph_AddFilter(FilterGraph* This,
IBaseFilter* pFilter,
unsigned short* pName);
HRESULT STDCALL FilterGraph_RemoveFilter(FilterGraph* This,
IBaseFilter* pFilter);
HRESULT STDCALL FilterGraph_EnumFilters(FilterGraph* This,
IEnumFilters** ppEnum);
HRESULT STDCALL FilterGraph_FindFilterByName(FilterGraph* This,
unsigned short* pName,
IBaseFilter** ppFilter);
HRESULT STDCALL FilterGraph_ConnectDirect(FilterGraph* This,
IPin* ppinOut,
IPin* ppinIn,
const AM_MEDIA_TYPE* pmt);
HRESULT STDCALL FilterGraph_Reconnect(FilterGraph* This, IPin* ppin);
HRESULT STDCALL FilterGraph_Disconnect(FilterGraph* This, IPin* ppin);
HRESULT STDCALL FilterGraph_SetDefaultSyncSource(FilterGraph* This);
FilterGraph* FilterGraphCreate(void);
#endif /* MPLAYER_GRAPH_H */

View File

@ -552,8 +552,8 @@ static HRESULT STDCALL COutputPin_NewSegment(IPin * This,
/* [in] */ REFERENCE_TIME tStop,
/* [in] */ double dRate)
{
Debug printf("COutputPin_NewSegment(%Ld,%Ld,%f) called\n",
tStart, tStop, dRate);
Debug printf("COutputPin_NewSegment(%d,%d,%f) called\n",
(int)tStart, (int)tStop, dRate);
return 0;
}
@ -749,7 +749,7 @@ static HRESULT STDCALL COutputMemPin_ReceiveMultiple(IMemInputPin * This,
/* [in] */ long nSamples,
/* [out] */ long *nSamplesProcessed)
{
HRESULT hr;
HRESULT hr = 0;
Debug printf("COutputMemPin_ReceiveMultiple(%p) %ld\n", This,nSamples);
for(*nSamplesProcessed=0; *nSamplesProcessed < nSamples; *nSamplesProcessed++) {
hr = This->vt->Receive(This,pSamples[*nSamplesProcessed]);

View File

@ -443,12 +443,12 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protec
if (type&MEM_RESERVE && (unsigned)address&0xffff) {
size += (unsigned)address&0xffff;
address = (unsigned)address&~0xffff;
address = (void*)((unsigned)address&~0xffff);
}
pgsz = sysconf(_SC_PAGESIZE);
if (type&MEM_COMMIT && (unsigned)address%pgsz) {
size += (unsigned)address%pgsz;
address -= (unsigned)address%pgsz;
address = (void*)((unsigned)address - (unsigned)address%pgsz);
}
if (type&MEM_RESERVE && size<0x10000) size = 0x10000;
@ -531,7 +531,6 @@ LPVOID WINAPI VirtualAlloc(LPVOID address, DWORD size, DWORD type, DWORD protec
WIN_BOOL WINAPI VirtualFree(LPVOID address, SIZE_T dwSize, DWORD dwFreeType)//not sure
{
virt_alloc* str=vm;
int answer;
//printf("VirtualFree(0x%08X, %d, 0x%08X)\n", (unsigned)address, dwSize, dwFreeType);
while(str)
@ -542,7 +541,7 @@ WIN_BOOL WINAPI VirtualFree(LPVOID address, SIZE_T dwSize, DWORD dwFreeType)//n
continue;
}
//printf(" VirtualFree(...) munmap(0x%08X, %d)\n", (unsigned)str->address, str->mapping_size);
answer=munmap(str->address, str->mapping_size);
munmap(str->address, str->mapping_size);
if(str->next)str->next->prev=str->prev;
if(str->prev)str->prev->next=str->next;
if(vm==str)vm=str->prev;

View File

@ -440,7 +440,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
int i;
// sse hack moved from patch dll into runtime patching
if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x1000)) {
if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x1000)) {
fprintf(stderr, "VP3 DLL found\n");
for (i=0;i<18;i++) RVA(0x4bd6)[i]=0x90;
}
@ -450,7 +450,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
if (strstr(libname,"vp5vfw.dll") && wm)
{
int i;
if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3930)) {
if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3930)) {
for (i=0;i<3;i++) RVA(0x4e86)[i]=0x90;
for (i=0;i<3;i++) RVA(0x5a23)[i]=0x90;
for (i=0;i<3;i++) RVA(0x5bff)[i]=0x90;
@ -463,12 +463,12 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
if (strstr(libname,"vp6vfw.dll") && wm)
{
int i;
if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3ef0)) {
if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3ef0)) {
// looks like VP 6.1.0.2
for (i=0;i<6;i++) RVA(0x7268)[i]=0x90;
for (i=0;i<6;i++) RVA(0x7e83)[i]=0x90;
for (i=0;i<6;i++) RVA(0x806a)[i]=0x90;
} else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x4120)) {
} else if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x4120)) {
// looks like VP 6.2.0.10
for (i=0;i<6;i++) RVA(0x7688)[i]=0x90;
for (i=0;i<6;i++) RVA(0x82c3)[i]=0x90;
@ -476,7 +476,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<6;i++) RVA(0x1d2cc)[i]=0x90;
for (i=0;i<6;i++) RVA(0x2179d)[i]=0x90;
for (i=0;i<6;i++) RVA(0x1977f)[i]=0x90;
} else if (PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3e70)) {
} else if ((char*)PE_FindExportedFunction(wm, "DriverProc", TRUE)==RVA(0x3e70)) {
// looks like VP 6.0.7.3
for (i=0;i<6;i++) RVA(0x7559)[i]=0x90;
for (i=0;i<6;i++) RVA(0x81c3)[i]=0x90;
@ -492,7 +492,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
{
// The codec calls IsRectEmpty with coords 0,0,0,0 => result is 0
// but it really wants the rectangle to be not empty
if (PE_FindExportedFunction(wm, "CreateInstance", TRUE)==RVA(0xb812)) {
if ((char*)PE_FindExportedFunction(wm, "CreateInstance", TRUE)==RVA(0xb812)) {
// Dll version is 10.0.0.3645
*RVA(0x8b0f)=0xeb; // Jump always, ignoring IsRectEmpty result
} else {
@ -509,7 +509,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
// dispatch_addr = GetProcAddress(wm->module, "theQuickTimeDispatcher", TRUE);
dispatch_addr = PE_FindExportedFunction(wm, "theQuickTimeDispatcher", TRUE);
if (dispatch_addr == RVA(0x124c30))
if ((char*)dispatch_addr == RVA(0x124c30))
{
fprintf(stderr, "QuickTime5 DLLs found\n");
ptr = (void **)RVA(0x375ca4); // dispatch_ptr
@ -537,7 +537,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
RVA(0x08e0ae)[0] = 0xc3; // font/dc remover
for (i=0;i<24;i++) RVA(0x07a1ad)[i]=0x90; // destroy window
#endif
} else if (dispatch_addr == RVA(0x13b330))
} else if ((char*)dispatch_addr == RVA(0x13b330))
{
fprintf(stderr, "QuickTime6 DLLs found\n");
ptr = (void **)RVA(0x3b9524); // dispatcher_ptr
@ -546,7 +546,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
for (i=0;i<5;i++) RVA(0x273122)[i]=0x90; // jmp_to_call_loadbitmap
for (i=0;i<9;i++) RVA(0x273131)[i]=0x90; // call__calls_OLE_shit
for (i=0;i<96;i++) RVA(0x2ac852)[i]=0x90; // disable threads
} else if (dispatch_addr == RVA(0x13c3e0))
} else if ((char*)dispatch_addr == RVA(0x13c3e0))
{
fprintf(stderr, "QuickTime6.3 DLLs found\n");
ptr = (void **)RVA(0x3ca01c); // dispatcher_ptr
@ -825,7 +825,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
// memory management:
case 0x150011: //NewPtrClear
case 0x150012: //NewPtrSysClear
reg->eax = malloc(((uint32_t *)stack_base)[1]);
reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
memset((void *)reg->eax,0,((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
@ -833,7 +833,7 @@ static int report_func(void *stack_base, int stack_size, reg386_t *reg, uint32_t
return 1;
case 0x15000F: //NewPtr
case 0x150010: //NewPtrSys
reg->eax = malloc(((uint32_t *)stack_base)[1]);
reg->eax = (uint32_t)malloc(((uint32_t *)stack_base)[1]);
#ifdef DEBUG_QTX_API
printf("%*sLEAVE(%d): EMULATED! 0x%X\n",ret_i*2,"",ret_i, reg->eax);
#endif

View File

@ -73,7 +73,7 @@ static void dump_exports( HMODULE hModule )
char *Module;
unsigned int i, j;
unsigned short *ordinal;
unsigned long *function,*functions;
unsigned long *function;
unsigned char **name;
unsigned int load_addr = hModule;
@ -84,14 +84,17 @@ static void dump_exports( HMODULE hModule )
IMAGE_EXPORT_DIRECTORY *pe_exports = (IMAGE_EXPORT_DIRECTORY*)RVA(rva_start);
Module = (char*)RVA(pe_exports->Name);
(void)Module; //silence compiler warning
TRACE("*******EXPORT DATA*******\n");
TRACE("Module name is %s, %ld functions, %ld names\n",
Module, pe_exports->NumberOfFunctions, pe_exports->NumberOfNames);
ordinal=(unsigned short*) RVA(pe_exports->AddressOfNameOrdinals);
functions=function=(unsigned long*) RVA(pe_exports->AddressOfFunctions);
function=(unsigned long*) RVA(pe_exports->AddressOfFunctions);
name=(unsigned char**) RVA(pe_exports->AddressOfNames);
(void)name; //silence compiler warning
TRACE(" Ord RVA Addr Name\n" );
for (i=0;i<pe_exports->NumberOfFunctions;i++, function++)
{
@ -135,7 +138,6 @@ FARPROC PE_FindExportedFunction(
IMAGE_EXPORT_DIRECTORY *exports = pem->pe_export;
unsigned int load_addr = wm->module;
unsigned long rva_start, rva_end, addr;
char * forward;
if (HIWORD(funcName))
TRACE("(%s)\n",funcName);
@ -152,7 +154,6 @@ FARPROC PE_FindExportedFunction(
ordinals= (unsigned short*) RVA(exports->AddressOfNameOrdinals);
function= (unsigned long*) RVA(exports->AddressOfFunctions);
name = (unsigned char **) RVA(exports->AddressOfNames);
forward = NULL;
rva_start = PE_HEADER(wm->module)->OptionalHeader
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
rva_end = rva_start + PE_HEADER(wm->module)->OptionalHeader
@ -247,14 +248,9 @@ static DWORD fixup_imports( WINE_MODREF *wm )
PE_MODREF *pem;
unsigned int load_addr = wm->module;
int i,characteristics_detection=1;
char *modname;
assert(wm->type==MODULE32_PE);
pem = &(wm->binfmt.pe);
if (pem->pe_export)
modname = (char*) RVA(pem->pe_export->Name);
else
modname = "<unknown>";
TRACE("Dumping imports list\n");

View File

@ -339,7 +339,6 @@ long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long a
{
char* full_name;
reg_handle_t* t;
struct reg_value* v;
TRACE("Opening key %s\n", subkey);
if(!regs)
@ -357,7 +356,7 @@ long __stdcall RegOpenKeyExA(long key, const char* subkey, long reserved, long a
if(!full_name)
return -1;
TRACE("Opening key Fullname %s\n", full_name);
v=find_value_by_name(full_name);
find_value_by_name(full_name);
t=insert_handle(generate_handle(), full_name);
*newkey=t->handle;

View File

@ -597,7 +597,7 @@ static HMODULE WINAPI expGetModuleHandleW(const uint16_t* name)
int pos = 0;
while (*name) {
if (*name > 256 || pos >= sizeof(aname) - 1)
return NULL;
return 0;
aname[pos++] = *name++;
}
aname[pos] = 0;
@ -2015,15 +2015,15 @@ static DWORD WINAPI expSignalObjectAndWait(HANDLE hObjectToSignal,
expSetEvent(mlist);
break;
case 1: // Semaphore
expReleaseSemaphore(mlist, 1, NULL);
expReleaseSemaphore((long)mlist, 1, NULL);
break;
case 2: // Mutex
expReleaseMutex(mlist);
expReleaseMutex((long)mlist);
break;
default:
dbgprintf("Signalling unknown object type %d!\n", hObjectToSignal);
}
return expWaitForSingleObject(hObjectToWaitOn, dwMilliseconds);
return (DWORD)expWaitForSingleObject((void*)hObjectToWaitOn, dwMilliseconds);
}
static long WINAPI expRegOpenKeyExA(long key, const char* subkey, long reserved, long access, int* newkey)
@ -2747,7 +2747,7 @@ static int WINAPI expEnumDisplayMonitors(void *dc, RECT *r,
{
dbgprintf("EnumDisplayMonitors(0x%x, 0x%x, 0x%x, 0x%x) => ?\n",
dc, r, callback_proc, callback_param);
return callback_proc(0, dc, r, callback_param);
return callback_proc(0, (HDC)dc, r, (LPARAM)callback_param);
}
#if 0
@ -2847,8 +2847,8 @@ static int WINAPI expEnumWindows(int (*callback_func)(HWND, LPARAM), void *callb
{
int i, i2;
dbgprintf("EnumWindows(0x%x, 0x%x) => 1\n", callback_func, callback_param);
i = callback_func(0, callback_param);
i2 = callback_func(1, callback_param);
i = callback_func(0, (LPARAM)callback_param);
i2 = callback_func(1, (LPARAM)callback_param);
return i && i2;
}
@ -4223,7 +4223,7 @@ static int exp_initterm(int v1, int v2)
}
#else
/* merged from wine - 2002.04.21 */
typedef void (*INITTERMFUNC)();
typedef void (*INITTERMFUNC)(void);
static int exp_initterm(INITTERMFUNC *start, INITTERMFUNC *end)
{
dbgprintf("_initterm(0x%x, 0x%x) %p\n", start, end, *start);
@ -4900,7 +4900,7 @@ static HPALETTE WINAPI expCreatePalette(CONST LOGPALETTE *lpgpl)
dbgprintf("CreatePalette(%x) => NULL\n", lpgpl);
i = sizeof(LOGPALETTE)+((lpgpl->palNumEntries-1)*sizeof(PALETTEENTRY));
test = malloc(i);
test = (HPALETTE)malloc(i);
memcpy((void *)test, lpgpl, i);
return test;

View File

@ -786,8 +786,8 @@ typedef struct tagSYSTEM_INFO
struct {
WORD wProcessorArchitecture;
WORD wReserved;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
} s;
} u;
DWORD dwPageSize;
LPVOID lpMinimumApplicationAddress;
LPVOID lpMaximumApplicationAddress;

View File

@ -47,6 +47,8 @@
# define NONAMELESSUNION
#endif /* !defined(NONAMELESSUNION) */
#if 0
#ifndef NONAMELESSSTRUCT
#define DUMMYSTRUCTNAME
#define DUMMYSTRUCTNAME1
@ -79,6 +81,8 @@
#define DUMMYUNIONNAME5 u5
#endif /* !defined(NONAMELESSUNION) */
#endif
/* Calling conventions definitions */
#ifdef __i386__
@ -301,8 +305,8 @@ typedef LRESULT CALLBACK (*DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
typedef INT CALLBACK (*EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
typedef INT CALLBACK (*EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
typedef LRESULT CALLBACK (*FARPROC)();
typedef INT CALLBACK (*PROC)();
typedef LRESULT CALLBACK (*FARPROC)(void);
typedef INT CALLBACK (*PROC)(void);
typedef WIN_BOOL CALLBACK (*GRAYSTRINGPROC)(HDC,LPARAM,INT);
typedef LRESULT CALLBACK (*HOOKPROC)(INT,WPARAM,LPARAM);
typedef WIN_BOOL CALLBACK (*PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
@ -434,8 +438,8 @@ typedef struct
typedef LRESULT CALLBACK (*DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
typedef WIN_BOOL16 CALLBACK (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef INT16 CALLBACK (*EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
typedef LRESULT CALLBACK (*FARPROC16)();
typedef INT16 CALLBACK (*PROC16)();
typedef LRESULT CALLBACK (*FARPROC16)(void);
typedef INT16 CALLBACK (*PROC16)(void);
typedef WIN_BOOL16 CALLBACK (*GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
typedef LRESULT CALLBACK (*HOOKPROC16)(INT16,WPARAM16,LPARAM);
typedef WIN_BOOL16 CALLBACK (*PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);

View File

@ -77,7 +77,7 @@ static int getch2_internal(void)
/*check if there are input events*/
if(!GetNumberOfConsoleInputEvents(in,&retval))
{
printf("getch2: can't get number of input events: %i\n",GetLastError());
printf("getch2: can't get number of input events: %i\n",(int)GetLastError());
return -1;
}
if(retval<=0)return -1;
@ -165,7 +165,7 @@ void getch2_enable(void)
in = GetStdHandle(STD_INPUT_HANDLE);
if(!GetNumberOfConsoleInputEvents(in,&retval))
{
printf("getch2: %i can't get number of input events [disabling console input]\n",GetLastError());
printf("getch2: %i can't get number of input events [disabling console input]\n",(int)GetLastError());
getch2_status = 0;
}
else getch2_status=1;

View File

@ -24,6 +24,8 @@
#include <string.h>
#include <assert.h>
int setenv(const char *name, const char *val, int overwrite);
int setenv(const char *name, const char *val, int overwrite)
{
int len = strlen(name) + strlen(val) + 2;

View File

@ -367,6 +367,7 @@ void cache_uninit(stream_t *s) {
s->cache_data = NULL;
}
#if FORKED_CACHE
static void exit_sighandler(int x){
// close stream
exit(0);
@ -374,6 +375,7 @@ static void exit_sighandler(int x){
static void dummy_sighandler(int x) {
}
#endif
/**
* Main loop of the cache process or thread.

View File

@ -695,8 +695,8 @@ static int vobsub_parse_id(vobsub_t *vob, const char *line)
static int vobsub_parse_timestamp(vobsub_t *vob, const char *line)
{
int h, m, s, ms;
off_t filepos;
if (sscanf(line, " %02d:%02d:%02d:%03d, filepos: %09lx",
int64_t filepos;
if (sscanf(line, " %02d:%02d:%02d:%03d, filepos: %09"SCNx64,
&h, &m, &s, &ms, &filepos) != 5)
return -1;
return vobsub_add_timestamp(vob, filepos, vob->delay + ms + 1000 * (s + 60 * (m + 60 * h)));