X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cd_linux.c;h=bc07b849f9febd274d719cdf36a2d3e7ca7699a5;hb=e24277377e64376fe6a8bbbdfad73f614f3909bf;hp=05bf5c7e6d5a4a7a3b8219ff02698f7d9e2d70ae;hpb=5bdc0879026939f551a3ff217064732d59731be2;p=xonotic%2Fdarkplaces.git diff --git a/cd_linux.c b/cd_linux.c index 05bf5c7e..bc07b849 100644 --- a/cd_linux.c +++ b/cd_linux.c @@ -20,6 +20,9 @@ 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. +// suggested by Zero_Dogg to fix a compile problem on Mandriva Linux +#include "quakedef.h" + #include #include @@ -28,7 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include "quakedef.h" #include "cdaudio.h" @@ -102,7 +104,7 @@ void CDAudio_SysSetVolume (float volume) if (cdfile == -1) return; - vol.channel0 = vol.channel1 = volume * 255; + vol.channel0 = vol.channel1 = (__u8)(volume * 255); vol.channel2 = vol.channel3 = 0; if (ioctl (cdfile, CDROMVOLCTRL, &vol) == -1) @@ -110,7 +112,7 @@ void CDAudio_SysSetVolume (float volume) } -int CDAudio_SysPlay (qbyte track) +int CDAudio_SysPlay (int track) { struct cdrom_tocentry entry; struct cdrom_ti ti; @@ -201,7 +203,7 @@ int CDAudio_SysUpdate (void) struct cdrom_subchnl subchnl; static time_t lastchk = 0; - if (cdPlaying && lastchk < time(NULL)) + if (cdPlaying && lastchk < time(NULL) && cdfile != -1) { lastchk = time(NULL) + 2; //two seconds between chks subchnl.cdsc_format = CDROM_MSF;