summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-03 05:09:40 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2011-12-03 05:09:40 +0000
commitc9acd48b30eddf152325a9c0091e46d49439ae12 (patch)
treeed6b5f53b6d155549c3e666e7329520f09065845
parent4273fdfc90a1e1eedb1a425925a589b8e231ed64 (diff)
downloadpcsxr-c9acd48b30eddf152325a9c0091e46d49439ae12.tar.gz
Fixes for some problems found with Xcode's static analyzer. There are more, but I don't know how to approach them.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@72824 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rw-r--r--libpcsxcore/cdrom.c4
-rw-r--r--libpcsxcore/socket.c2
-rw-r--r--macosx/EmuThread.m1
-rw-r--r--macosx/PcsxrMemCardController.m9
4 files changed, 5 insertions, 11 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c
index 055a15a0..d1605804 100644
--- a/libpcsxcore/cdrom.c
+++ b/libpcsxcore/cdrom.c
@@ -220,7 +220,7 @@ extern SPUregisterCallback SPU_registerCallback;
void adjustTransferIndex()
{
- unsigned int bufSize;
+ unsigned int bufSize = 0;
switch (cdr.Mode & (MODE_SIZE_2340|MODE_SIZE_2328)) {
case MODE_SIZE_2340: bufSize = 2340; break;
@@ -518,7 +518,7 @@ static void ReadTrack( u8 *time ) {
static void CDXA_Attenuation( s16 *buf, int size, int stereo, int attenuate_type )
{
s16 *spsound;
- s32 lc,rc;
+ s32 lc = 0,rc;
int i;
spsound = buf;
diff --git a/libpcsxcore/socket.c b/libpcsxcore/socket.c
index 4edf7f0c..450aefd9 100644
--- a/libpcsxcore/socket.c
+++ b/libpcsxcore/socket.c
@@ -190,7 +190,7 @@ int ReadSocket(char * buffer, int len) {
}
int RawReadSocket(char * buffer, int len) {
- int r;
+ int r = 0;
int mlen = len < ptr ? len : ptr;
if (!client_socket)
diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m
index 0b47e514..ca77d160 100644
--- a/macosx/EmuThread.m
+++ b/macosx/EmuThread.m
@@ -163,6 +163,7 @@ done:
SysClose();
//[[NSThread currentThread] autorelease];
+ [pool drain];
[NSThread exit];
return;
}
diff --git a/macosx/PcsxrMemCardController.m b/macosx/PcsxrMemCardController.m
index 0fc44a90..c842c4ea 100644
--- a/macosx/PcsxrMemCardController.m
+++ b/macosx/PcsxrMemCardController.m
@@ -118,8 +118,6 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
self = [super initWithWindow:window];
if (self) {
LoadMcds(Config.Mcd1, Config.Mcd2);
- [self setMemCard1Array:[[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]];
- [self setMemCard2Array:[[NSMutableArray alloc] initWithCapacity:MAX_MEMCARD_BLOCKS]];
}
return self;
@@ -219,7 +217,7 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
NSInteger memCardSelect = [sender tag];
NSCollectionView *cardView;
NSIndexSet *selection;
- int toCard, fromCard, freeSlot;
+ int toCard, freeSlot;
char *str, *source, *destination;
if (memCardSelect == 1) {
str = Config.Mcd1;
@@ -227,14 +225,12 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
destination = Mcd1Data;
cardView = memCard2view;
toCard = 1;
- fromCard = 2;
} else {
str = Config.Mcd2;
source = Mcd1Data;
destination = Mcd2Data;
cardView = memCard1view;
toCard = 2;
- fromCard = 1;
}
selection = [cardView selectionIndexes];
if (!selection || [selection count] == 0) {
@@ -318,13 +314,10 @@ static inline void CopyMemcardData(char *from, char *to, int *i, char *str, int
if (deleteOkay == NSAlertAlternateReturn) {
NSInteger memCardSelect = [sender tag];
NSIndexSet *selected;
- NSArray *cardArray;
if (memCardSelect == 1) {
selected = [memCard1view selectionIndexes];
- cardArray = [self memCard1Array];
} else {
selected = [memCard2view selectionIndexes];
- cardArray = [self memCard2Array];
}
if (!selected || [selected count] == 0) {