From 84ff3a3c1b1958435578b85c225edcee5ee64231 Mon Sep 17 00:00:00 2001 From: Marcus Sundberg Date: Sun, 21 May 2000 00:08:27 +0000 Subject: [PATCH] Fixed mingw32 warnings. --- source/cd_win.c | 26 +++++++++++++++++--------- source/snd_dma.c | 4 +++- source/snd_mix.c | 12 ++++++------ source/snd_win.c | 7 ++++--- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/source/cd_win.c b/source/cd_win.c index c31f195..8ac5cc8 100644 --- a/source/cd_win.c +++ b/source/cd_win.c @@ -45,7 +45,6 @@ static qboolean enabled = false; static qboolean playLooping = false; static float cdvolume; static byte remap[100]; -static byte cdrom; static byte playTrack; static byte maxTrack; @@ -56,8 +55,11 @@ static void CDAudio_Eject(void) { DWORD dwReturn; - if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD)NULL)) + dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, + (DWORD)NULL); + if (dwReturn) { Con_DPrintf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn); + } } @@ -65,8 +67,10 @@ static void CDAudio_CloseDoor(void) { DWORD dwReturn; - if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL)) + dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD)NULL); + if (dwReturn) { Con_DPrintf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn); + } } @@ -196,8 +200,10 @@ void CDAudio_Stop(void) if (!playing) return; - if (dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL)) + dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL); + if (dwReturn) { Con_DPrintf("MCI_STOP failed (%i)", dwReturn); + } wasPlaying = false; playing = false; @@ -216,8 +222,10 @@ void CDAudio_Pause(void) return; mciGenericParms.dwCallback = (DWORD)mainwindow; - if (dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms)) + dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms); + if (dwReturn) { Con_DPrintf("MCI_PAUSE failed (%i)", dwReturn); + } wasPlaying = playing; playing = false; @@ -450,8 +458,8 @@ int CDAudio_Init(void) return -1; mciOpenParms.lpstrDeviceType = "cdaudio"; - if (dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms)) - { + dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD) (LPVOID) &mciOpenParms); + if (dwReturn) { Con_Printf("CDAudio_Init: MCI_OPEN failed (%i)\n", dwReturn); return -1; } @@ -459,8 +467,8 @@ int CDAudio_Init(void) // Set the time format to track/minute/second/frame (TMSF). mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF; - if (dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms)) - { + dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD)(LPVOID) &mciSetParms); + if (dwReturn) { Con_Printf("MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn); mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD)NULL); return -1; diff --git a/source/snd_dma.c b/source/snd_dma.c index 5892718..10a41f1 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -626,7 +626,9 @@ void S_ClearBuffer (void) reps = 0; - while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pData, &dwSize, NULL, NULL, 0)) != DS_OK) + while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, + (LPVOID *)&pData, &dwSize, + NULL, NULL, 0)) != DS_OK) { if (hresult != DSERR_BUFFERLOST) { diff --git a/source/snd_mix.c b/source/snd_mix.c index cc9ef94..8905d67 100644 --- a/source/snd_mix.c +++ b/source/snd_mix.c @@ -97,9 +97,9 @@ void S_TransferStereo16 (int endtime) { reps = 0; - while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pbuf, &dwSize, - &pbuf2, &dwSize2, 0)) != DS_OK) - { + while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, + (LPVOID *)&pbuf, &dwSize, + (LPVOID *)&pbuf2, &dwSize2, 0)) != DS_OK) { if (hresult != DSERR_BUFFERLOST) { Con_Printf ("S_TransferStereo16: DS::Lock Sound Buffer Failed\n"); @@ -186,9 +186,9 @@ void S_TransferPaintBuffer(int endtime) { reps = 0; - while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &pbuf, &dwSize, - &pbuf2,&dwSize2, 0)) != DS_OK) - { + while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, + (LPVOID *)&pbuf, &dwSize, + (LPVOID *)&pbuf2, &dwSize2, 0)) != DS_OK) { if (hresult != DSERR_BUFFERLOST) { Con_Printf ("S_TransferPaintBuffer: DS::Lock Sound Buffer Failed\n"); diff --git a/source/snd_win.c b/source/snd_win.c index 3a8d858..4b61279 100644 --- a/source/snd_win.c +++ b/source/snd_win.c @@ -378,8 +378,9 @@ sndinitstat SNDDMA_InitDirect (void) // initialize the buffer reps = 0; - while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, &lpData, &dwSize, NULL, NULL, 0)) != DS_OK) - { + while ((hresult = pDSBuf->lpVtbl->Lock(pDSBuf, 0, gSndBufSize, + (LPVOID *)&lpData, &dwSize, NULL, + NULL, 0)) != DS_OK) { if (hresult != DSERR_BUFFERLOST) { Con_SafePrintf ("SNDDMA_InitDirect: DS::Lock Sound Buffer Failed\n"); @@ -645,7 +646,7 @@ how many sample are required to fill it up. int SNDDMA_GetDMAPos(void) { MMTIME mmtime; - int s; + int s = 0; DWORD dwWrite; if (dsound_init)