cdvdgigaherz: Fix value truncation warnings

Fixes warning C4244: conversion to smaller data type, possible loss of
data.
This commit is contained in:
Jonathan Li 2016-09-20 00:40:45 +01:00
parent a61aa8ff0b
commit 0ca36e8943
3 changed files with 9 additions and 10 deletions

View File

@ -30,8 +30,8 @@ DWORD pidThreadKeepAlive = 0;
///////////////////////////////////////////////////////////////////////////////
// State Information //
int strack;
int etrack;
u8 strack;
u8 etrack;
track tracks[100];
int curDiskType;
@ -357,7 +357,6 @@ int CALLBACK CDVDgetBuffer2(u8 *dest)
s32 CALLBACK CDVDreadSubQ(u32 lsn, cdvdSubQ *subq)
{
int i;
// the formatted subq command returns: control/adr, track, index, trk min, trk sec, trk frm, 0x00, abs min, abs sec, abs frm
if (lsn > tracks[0].length) // track 0 is total disc.
@ -367,7 +366,7 @@ s32 CALLBACK CDVDreadSubQ(u32 lsn, cdvdSubQ *subq)
lsn_to_msf(&subq->discM, &subq->discS, &subq->discF, lsn + 150);
i = strack;
u8 i = strack;
while (i <= etrack) {
if (lsn <= tracks[i].length)
break;

View File

@ -23,15 +23,15 @@
#define CDVDdefs
#include <PS2Edefs.h>
typedef struct _track
struct track
{
u32 start_lba;
u32 length;
u32 type;
} track;
u8 type;
};
extern int strack;
extern int etrack;
extern u8 strack;
extern u8 etrack;
extern track tracks[100];
extern int curDiskType;

View File

@ -209,7 +209,7 @@ void IOCtlSrc::SetSpindleSpeed(bool restore_defaults)
{
DWORD dontcare;
int speed = 0;
USHORT speed = 0;
if (GetMediaType() < 0)
speed = 4800; // CD-ROM to ~32x (PS2 has 24x (3600 KB/s))