[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[619] trunk/fuse
Brought to you by:
fredm
From: <fr...@us...> - 2009-09-04 22:58:56
|
Revision: 619 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=619&view=rev Author: fredm Date: 2009-09-04 22:58:49 +0000 (Fri, 04 Sep 2009) Log Message: ----------- Tidy up issues from the XCode 3.2 static analyser. Modified Paths: -------------- trunk/fuse/fusepb/controllers/FuseController.m trunk/fuse/fusepb/controllers/PokeFinderController.m trunk/fuse/fusepb/controllers/PreferencesController.m trunk/fuse/fusepb/controllers/SaveBinaryController.m trunk/fuse/fusepb/transformers/MachineScalerIsEnabled.m trunk/fuse/fusepb/views/DisplayOpenGLView.m trunk/fuse/fusepb/views/Texture.m trunk/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.c trunk/fuse/ui/cocoa/cocoadisplay.m trunk/fuse/ui/cocoa/cocoascreenshot.m Modified: trunk/fuse/fusepb/controllers/FuseController.m =================================================================== --- trunk/fuse/fusepb/controllers/FuseController.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/controllers/FuseController.m 2009-09-04 22:58:49 UTC (rev 619) @@ -1975,8 +1975,6 @@ if( ui_mouse_grabbed ) ui_mouse_grabbed = ui_mouse_release( 1 ); - confirm = UI_CONFIRM_SAVE_CANCEL; - result = NSRunAlertPanel(@"Confirm", theMessage, @"Save", @"Don't Save", @"Cancel"); Modified: trunk/fuse/fusepb/controllers/PokeFinderController.m =================================================================== --- trunk/fuse/fusepb/controllers/PokeFinderController.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/controllers/PokeFinderController.m 2009-09-04 22:58:49 UTC (rev 619) @@ -59,7 +59,7 @@ - (void)awakeFromNib { - NumberFormatter *searchForFormatter = [[NumberFormatter alloc] init]; + NumberFormatter *searchForFormatter = [[[NumberFormatter alloc] init] autorelease]; [searchForFormatter setMinimum:[NSDecimalNumber zero]]; [searchForFormatter setMaximum:[NSDecimalNumber decimalNumberWithString:@"255"]]; @@ -72,7 +72,7 @@ - (void)matchListDoubleAction:(id)sender { - int error, row; + int row; id record, value; unsigned long page, offset; @@ -86,10 +86,9 @@ value = [record valueForKey:@"offset_number"]; offset = [value unsignedLongValue]; - error = - debugger_breakpoint_add_address( DEBUGGER_BREAKPOINT_TYPE_WRITE, - page, offset, 0, - DEBUGGER_BREAKPOINT_LIFE_PERMANENT, NULL); + (void)debugger_breakpoint_add_address( DEBUGGER_BREAKPOINT_TYPE_WRITE, + page, offset, 0, + DEBUGGER_BREAKPOINT_LIFE_PERMANENT, NULL); } - (void) dealloc Modified: trunk/fuse/fusepb/controllers/PreferencesController.m =================================================================== --- trunk/fuse/fusepb/controllers/PreferencesController.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/controllers/PreferencesController.m 2009-09-04 22:58:49 UTC (rev 619) @@ -69,16 +69,14 @@ [NSValueTransformer setValueTransformer:sNToITransformer forName:@"ScalerNameToIdTransformer"]; - machineScalerIsEnabled = [[MachineScalerIsEnabled - machineScalerIsEnabledWithInt:1] - autorelease]; + machineScalerIsEnabled = [MachineScalerIsEnabled + machineScalerIsEnabledWithInt:1]; [NSValueTransformer setValueTransformer:machineScalerIsEnabled forName:@"MachineTimexIsEnabled"]; - machineScalerIsEnabled = [[MachineScalerIsEnabled - machineScalerIsEnabledWithInt:0] - autorelease]; + machineScalerIsEnabled = [MachineScalerIsEnabled + machineScalerIsEnabledWithInt:0]; [NSValueTransformer setValueTransformer:machineScalerIsEnabled forName:@"MachineTimexIsDisabled"]; Modified: trunk/fuse/fusepb/controllers/SaveBinaryController.m =================================================================== --- trunk/fuse/fusepb/controllers/SaveBinaryController.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/controllers/SaveBinaryController.m 2009-09-04 22:58:49 UTC (rev 619) @@ -68,7 +68,7 @@ - (IBAction)apply:(id)sender { libspectrum_word s, l; size_t i; - char *buffer; + libspectrum_byte *buffer; int error; Modified: trunk/fuse/fusepb/transformers/MachineScalerIsEnabled.m =================================================================== --- trunk/fuse/fusepb/transformers/MachineScalerIsEnabled.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/transformers/MachineScalerIsEnabled.m 2009-09-04 22:58:49 UTC (rev 619) @@ -32,8 +32,8 @@ @implementation MachineScalerIsEnabled + (MachineScalerIsEnabled *)machineScalerIsEnabledWithInt:(int)value -{ - return [[MachineScalerIsEnabled alloc] initWithInt:value]; +{ + return [[[MachineScalerIsEnabled alloc] initWithInt:value] autorelease]; } - (id)initWithInt:(int)value Modified: trunk/fuse/fusepb/views/DisplayOpenGLView.m =================================================================== --- trunk/fuse/fusepb/views/DisplayOpenGLView.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/views/DisplayOpenGLView.m 2009-09-04 22:58:49 UTC (rev 619) @@ -333,13 +333,13 @@ filename = [NSString stringWithFormat:@"%@_green", name]; /* Colour first image green */ - greenTexture = [greenTexture initWithImageFile:filename withXOrigin:x + (void)[greenTexture initWithImageFile:filename withXOrigin:x withYOrigin:y]; filename = [NSString stringWithFormat:@"%@_red", name]; /* Colour second image red */ - redTexture = [redTexture initWithImageFile:filename withXOrigin:x + (void)[redTexture initWithImageFile:filename withXOrigin:x withYOrigin:y]; } @@ -514,32 +514,6 @@ } } -/* scrolled, moved or resized */ --(void) reshape -{ - [view_lock lock]; - NSRect rect; - - [super reshape]; - - [[self openGLContext] makeCurrentContext]; - [[self openGLContext] update]; - - rect = [self bounds]; - - [self setViewPort:rect]; - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - statusbar_updated = YES; - - [view_lock unlock]; -} - -(void) destroyTexture { GLuint i; Modified: trunk/fuse/fusepb/views/Texture.m =================================================================== --- trunk/fuse/fusepb/views/Texture.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/fusepb/views/Texture.m 2009-09-04 22:58:49 UTC (rev 619) @@ -40,6 +40,9 @@ CGImageRef image = CGImageSourceCreateImageAtIndex( image_source, 0, nil ); + + CFRelease( image_source ); + texture.image_width = CGImageGetWidth( image ); texture.image_height = CGImageGetHeight( image ); @@ -60,6 +63,10 @@ CGRectMake(0, 0, texture.image_width, texture.image_height), image ); + CGColorSpaceRelease( color_space ); + + CGImageRelease( image ); + CGContextRelease( context ); texture.image_xoffset = x; Modified: trunk/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.c =================================================================== --- trunk/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.c 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.c 2009-09-04 22:58:49 UTC (rev 619) @@ -110,7 +110,7 @@ static void HIDReportErrorNum(char *strError, long numError) { - ui_error( UI_ERROR_ERROR, strError); + ui_error( UI_ERROR_ERROR, "%s", strError); } static void HIDGetCollectionElements(CFMutableDictionaryRef deviceProperties, Modified: trunk/fuse/ui/cocoa/cocoadisplay.m =================================================================== --- trunk/fuse/ui/cocoa/cocoadisplay.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/ui/cocoa/cocoadisplay.m 2009-09-04 22:58:49 UTC (rev 619) @@ -207,7 +207,7 @@ return 0; } -static int +static void cocoadisplay_allocate_colours( int numColours, uint16_t *colour_values, uint16_t *bw_values ) { @@ -224,16 +224,13 @@ bw_values[i] = (grey << 10) | (grey << 5) | grey; } - - return 0; } int uidisplay_init( int width, int height ) { - int error; - error = cocoadisplay_allocate_colours( sizeof(colour_values) / sizeof(uint16_t), - colour_values, bw_values ); + cocoadisplay_allocate_colours( sizeof(colour_values) / sizeof(uint16_t), + colour_values, bw_values ); image_width = width; image_height = height; @@ -292,10 +289,10 @@ (y+unscaled_screen.image_yoffset) * unscaled_screen.pitch ); *(dest++) = palette_colour; - *(dest++) = palette_colour; + *(dest ) = palette_colour; dest = (uint16_t*)( (uint8_t*)dest_base + unscaled_screen.pitch ); *(dest++) = palette_colour; - *(dest++) = palette_colour; + *(dest ) = palette_colour; } else { dest = (uint16_t*)( (uint8_t*)unscaled_screen.pixels + (x+unscaled_screen.image_xoffset) * sizeof(uint16_t) + Modified: trunk/fuse/ui/cocoa/cocoascreenshot.m =================================================================== --- trunk/fuse/ui/cocoa/cocoascreenshot.m 2009-09-04 22:50:16 UTC (rev 618) +++ trunk/fuse/ui/cocoa/cocoascreenshot.m 2009-09-04 22:58:49 UTC (rev 619) @@ -158,10 +158,11 @@ NSData *data = [ bits representationUsingType:type properties:nil ]; [ data writeToFile:[NSString stringWithUTF8String:filename] atomically:NO ]; +freePool: + [ bits release ]; -freePool: - [pool release]; + [ pool release ]; return error; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |