summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-09-23 19:30:54 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2012-09-23 19:30:54 +0000
commite81974f7ecc531f43d42180985b9cb37ffb96934 (patch)
tree6ab43adaebd01ae091df2f60bf2bb26ccbf2e092
parentbda521f3a4c42277160381ddfbfb8e42b7e87274 (diff)
downloadpcsxr-e81974f7ecc531f43d42180985b9cb37ffb96934.tar.gz
Fixing some unitialized variables caught by Clang. Also fixing a divide by zero error
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@79981 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--libpcsxcore/cdrom.c12
-rw-r--r--libpcsxcore/ix86_64/ix86_cpudetect.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index 84ec5d15..405f2a88 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -223,13 +223,21 @@ void adjustTransferIndex()
unsigned int bufSize = 0;
switch (cdr.Mode & (MODE_SIZE_2340|MODE_SIZE_2328)) {
+ //Do we need a default case in this switch?
case MODE_SIZE_2340: bufSize = 2340; break;
case MODE_SIZE_2328: bufSize = 12 + 2328; break;
case MODE_SIZE_2048: bufSize = 12 + 2048; break;
}
if (cdr.transferIndex >= bufSize)
- cdr.transferIndex %= bufSize;
+ {
+ if (bufSize == 0) {
+ //Make sure we don't divide by zero
+ //Do nothing
+ } else {
+ cdr.transferIndex %= bufSize;
+ }
+ }
}
void cdrDecodedBufferInterrupt()
@@ -518,7 +526,7 @@ static void ReadTrack( u8 *time ) {
static void CDXA_Attenuation( s16 *buf, int size, int stereo, int attenuate_type )
{
s16 *spsound;
- s32 lc = 0,rc;
+ s32 lc = 0, rc = 0;
int i;
spsound = buf;
diff --git a/libpcsxcore/ix86_64/ix86_cpudetect.c b/libpcsxcore/ix86_64/ix86_cpudetect.c
index dfbde264..6bf0bb5b 100644
--- a/libpcsxcore/ix86_64/ix86_cpudetect.c
+++ b/libpcsxcore/ix86_64/ix86_cpudetect.c
@@ -212,8 +212,8 @@ void cpudetectInit( void )
s8 AMDspeedString[10];
int cputype=0; // Cpu type
//AMD 64 STUFF
- u32 x86_64_8BITBRANDID;
- u32 x86_64_12BITBRANDID;
+ u32 x86_64_8BITBRANDID = 0;
+ u32 x86_64_12BITBRANDID = 0;
memset( cpuinfo.x86ID, 0, sizeof( cpuinfo.x86ID ) );
cpuinfo.x86Family = 0;
cpuinfo.x86Model = 0;