return SIS_FAILURE;
}
- pDirectSoundCreate = (void *)GetProcAddress(hInstDS,"DirectSoundCreate");
+ pDirectSoundCreate = (HRESULT (__stdcall *)(GUID *, LPDIRECTSOUND *,IUnknown *))GetProcAddress(hInstDS,"DirectSoundCreate");
if (!pDirectSoundCreate)
{
SndSys_Shutdown ();
return false;
}
- lpData = GlobalLock(hData);
+ lpData = (HPSTR)GlobalLock(hData);
if (!lpData)
{
Con_Print("Sound: Failed to lock.\n");
if ((hClipboardData = GetClipboardData (CF_TEXT)) != 0)
{
- if ((cliptext = GlobalLock (hClipboardData)) != 0)
+ if ((cliptext = (char *)GlobalLock (hClipboardData)) != 0)
{
size_t allocsize;
allocsize = GlobalSize (hClipboardData) + 1;
- data = Z_Malloc (allocsize);
+ data = (char *)Z_Malloc (allocsize);
strlcpy (data, cliptext, allocsize);
GlobalUnlock (hClipboardData);
}
{
static qboolean sound_active = false; // initially blocked by Sys_InitConsole()
- vid_activewindow = fActive;
- vid_hidden = minimize;
+ vid_activewindow = fActive != FALSE;
+ vid_hidden = minimize != FALSE;
// enable/disable sound on focus gain/loss
if ((!vid_hidden && vid_activewindow) || !snd_mutewhenidle.integer)
if (gl_videosyncavailable)
{
- vid_usevsync = vid_vsync.integer;
- vid_usingvsync = vid_vsync.integer;
+ vid_usevsync = vid_vsync.integer != 0;
+ vid_usingvsync = vid_vsync.integer != 0;
qwglSwapIntervalEXT (vid_usevsync);
}
newmouseparms[0] = 0; // threshold to double movement (only if accel level is >= 1)
newmouseparms[1] = 0; // threshold to quadruple movement (only if accel level is >= 2)
newmouseparms[2] = 0; // maximum level of acceleration (0 = off)
- restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0);
+ restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0) != FALSE;
}
else
restore_spi = false;
if (!pDirectInputCreate)
{
- pDirectInputCreate = (void *)GetProcAddress(hInstDI,"DirectInputCreateA");
+ pDirectInputCreate = (HRESULT (__stdcall *)(HINSTANCE,DWORD,LPDIRECTINPUT *,LPUNKNOWN))GetProcAddress(hInstDI,"DirectInputCreateA");
if (!pDirectInputCreate)
{
}
// obtain an interface to the system mouse device.
+#ifdef __cplusplus
+ hr = IDirectInput_CreateDevice(g_pdi, GUID_SysMouse, &g_pMouse, NULL);
+#else
hr = IDirectInput_CreateDevice(g_pdi, &GUID_SysMouse, &g_pMouse, NULL);
+#endif
if (FAILED(hr))
{
// save the joystick's number of buttons and POV status
joy_numbuttons = jc.wNumButtons;
- joy_haspov = jc.wCaps & JOYCAPS_HASPOV;
+ joy_haspov = (jc.wCaps & JOYCAPS_HASPOV) != 0;
// old button and POV states default to no buttons pressed
joy_oldbuttonstate = joy_oldpovstate = 0;