X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=cd_win.c;h=76ac51edec3ca461dd9db7b54e61131c4f36454c;hp=41f2a3caefd29522aa7b7db8769f2ecc3ce511dd;hb=cd5534758b5760f4bdfad1805b58145c95e743e8;hpb=6824d8ddc8a43cae0609be5bbe8bee01fa1a4225 diff --git a/cd_win.c b/cd_win.c index 41f2a3ca..76ac51ed 100644 --- a/cd_win.c +++ b/cd_win.c @@ -20,12 +20,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All // rights reserved. +#include "quakedef.h" #include +#include -#include "quakedef.h" #include "cdaudio.h" -#if _MSC_VER < 1300 +#if defined(_MSC_VER) && (_MSC_VER < 1300) typedef DWORD DWORD_PTR; #endif @@ -38,7 +39,7 @@ void CDAudio_SysEject(void) DWORD dwReturn; if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, (DWORD_PTR)NULL))) - Con_Printf("MCI_SET_DOOR_OPEN failed (%i)\n", dwReturn); + Con_Printf("MCI_SET_DOOR_OPEN failed (%x)\n", (unsigned)dwReturn); } @@ -47,7 +48,7 @@ void CDAudio_SysCloseDoor(void) DWORD dwReturn; if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, (DWORD_PTR)NULL))) - Con_Printf("MCI_SET_DOOR_CLOSED failed (%i)\n", dwReturn); + Con_Printf("MCI_SET_DOOR_CLOSED failed (%x)\n", (unsigned)dwReturn); } int CDAudio_SysGetAudioDiskInfo(void) @@ -98,7 +99,7 @@ void CDAudio_SysSetVolume (float volume) } -int CDAudio_SysPlay (unsigned char track) +int CDAudio_SysPlay (int track) { DWORD dwReturn; MCI_PLAY_PARMS mciPlayParms; @@ -110,7 +111,7 @@ int CDAudio_SysPlay (unsigned char track) dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms); if (dwReturn) { - Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn); return -1; } if (mciStatusParms.dwReturn != MCI_CDA_TRACK_AUDIO) @@ -128,7 +129,7 @@ int CDAudio_SysPlay (unsigned char track) dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK | MCI_WAIT, (DWORD_PTR) (LPVOID) &mciStatusParms); if (dwReturn) { - Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysPlay: MCI_STATUS failed (%x)\n", (unsigned)dwReturn); return -1; } @@ -138,7 +139,7 @@ int CDAudio_SysPlay (unsigned char track) dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_NOTIFY | MCI_FROM | MCI_TO, (DWORD_PTR)(LPVOID) &mciPlayParms); if (dwReturn) { - Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysPlay: MCI_PLAY failed (%x)\n", (unsigned)dwReturn); return -1; } @@ -152,7 +153,7 @@ int CDAudio_SysStop (void) if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD_PTR)NULL))) { - Con_Printf("MCI_STOP failed (%i)\n", dwReturn); + Con_Printf("MCI_STOP failed (%x)\n", (unsigned)dwReturn); return -1; } return 0; @@ -166,7 +167,7 @@ int CDAudio_SysPause (void) mciGenericParms.dwCallback = (DWORD_PTR)mainwindow; if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD_PTR)(LPVOID) &mciGenericParms))) { - Con_Printf("MCI_PAUSE failed (%i)\n", dwReturn); + Con_Printf("MCI_PAUSE failed (%x)\n", (unsigned)dwReturn); return -1; } return 0; @@ -184,7 +185,7 @@ int CDAudio_SysResume (void) dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, MCI_TO | MCI_NOTIFY, (DWORD_PTR)(LPVOID) &mciPlayParms); if (dwReturn) { - Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysResume: MCI_PLAY failed (%x)\n", (unsigned)dwReturn); return -1; } return 0; @@ -217,7 +218,7 @@ LONG CDAudio_MessageHandler (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; default: - Con_Printf("Unexpected MM_MCINOTIFY type (%i)\n", wParam); + Con_Printf("Unexpected MM_MCINOTIFY type (%i)\n", (int)wParam); return 1; } @@ -243,7 +244,7 @@ int CDAudio_SysStartup (void) mciOpenParms.lpstrDeviceType = "cdaudio"; if ((dwReturn = mciSendCommand(0, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_SHAREABLE, (DWORD_PTR) (LPVOID) &mciOpenParms))) { - Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysStartup: MCI_OPEN failed (%x)\n", (unsigned)dwReturn); return -1; } wDeviceID = mciOpenParms.wDeviceID; @@ -252,7 +253,7 @@ int CDAudio_SysStartup (void) mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF; if ((dwReturn = mciSendCommand(wDeviceID, MCI_SET, MCI_SET_TIME_FORMAT, (DWORD_PTR)(LPVOID) &mciSetParms))) { - Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%i)\n", dwReturn); + Con_Printf("CDAudio_SysStartup: MCI_SET_TIME_FORMAT failed (%x)\n", (unsigned)dwReturn); mciSendCommand(wDeviceID, MCI_CLOSE, 0, (DWORD_PTR)NULL); return -1; }