Skip to content

Commit

Permalink
LLVM Analyze corrections
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirix/code/osirix@10948 4e9e6e3d-4551-47eb-9dbe-a6127f9400a1
  • Loading branch information
rossetantoine committed Feb 16, 2013
1 parent eefb88c commit 5d1c3f5
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 14 deletions.
1 change: 1 addition & 0 deletions AYDicomPrint/AYDicomPrintWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ - (void) _createPrintjob: (id) object
{
[self performSelectorOnMainThread: @selector(_setProgressMessage:) withObject: NSLocalizedString( @"Can't write to temporary directory.", nil) waitUntilDone: NO];
[images release];
[dicomConverter release];
[pool release];
return;
}
Expand Down
2 changes: 1 addition & 1 deletion CPRController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ - (void) assistedCurvedPath:(NSNotification*) note
N3AffineTransform patient2VolumeDataTransform = cprVolumeData.volumeTransform;
N3AffineTransform volumeData2PatientTransform = N3AffineTransformInvert(patient2VolumeDataTransform);

CPRCurvedPath * newCP = [[CPRCurvedPath alloc] init];
CPRCurvedPath * newCP = [[[CPRCurvedPath alloc] init] autorelease];
N3Vector node;
OSIVoxel * pt;

Expand Down
2 changes: 1 addition & 1 deletion Camera.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ -(NSMutableDictionary*) exportToXML

int i = 0;
for( NSValue *v in croppingPlanes)
[xml setObject: (id) N3PlaneCreateDictionaryRepresentation( [v N3PlaneValue]) forKey: [NSString stringWithFormat: @"croppingPlanes %d", i]];
[xml setObject: [(id) N3PlaneCreateDictionaryRepresentation( [v N3PlaneValue]) autorelease] forKey: [NSString stringWithFormat: @"croppingPlanes %d", i]];

[xml setObject:[NSString stringWithFormat:@"%f",[self fusionPercentage]] forKey:@"fusionPercentage"];

Expand Down
5 changes: 5 additions & 0 deletions DCM Framework/DCMDataContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ - (id) initWithData:(NSData *)data
else
object = self;
}
else
free( ptr);
}
}

Expand All @@ -118,6 +120,9 @@ - (id) initWithData:(NSData *)data
}
}

if( object == nil)
[self autorelease];

return object;
}

Expand Down
3 changes: 1 addition & 2 deletions OSICoalescedPlanarROI.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ - (OSIFloatVolumeData *)coalescedROIMaskVolumeData

coalescedROIMaskVolumeBytes = malloc(width * height * depth * sizeof(float));
memset(coalescedROIMaskVolumeBytes, 0, width * height * depth * sizeof(float));
_coalescedROIMaskVolumeData = [[OSIFloatVolumeData alloc] initWithFloatBytesNoCopy:coalescedROIMaskVolumeBytes pixelsWide:width pixelsHigh:height pixelsDeep:depth
volumeTransform:coalescedROIMaskVolumeTransform outOfBoundsValue:0 freeWhenDone:YES];
_coalescedROIMaskVolumeData = [[OSIFloatVolumeData alloc] initWithFloatBytesNoCopy:coalescedROIMaskVolumeBytes pixelsWide:width pixelsHigh:height pixelsDeep:depth volumeTransform:coalescedROIMaskVolumeTransform outOfBoundsValue:0 freeWhenDone:YES];

for (roi in _sourceROIs) {
coalescedMask = [roi ROIMaskForFloatVolumeData:_coalescedROIMaskVolumeData];
Expand Down
3 changes: 1 addition & 2 deletions OSIPlanarBrushROI.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ - (id)initWithOsiriXROI:(ROI *)roi pixToDICOMTransfrom:(N3AffineTransform)pixToD
}
}
volumeTransform = N3AffineTransformConcat(N3AffineTransformInvert(pixToDICOMTransfrom), N3AffineTransformMakeTranslation(-roi.textureUpLeftCornerX, -roi.textureUpLeftCornerY, 0));
_brushMask = [[OSIFloatVolumeData alloc] initWithFloatBytesNoCopy:mask pixelsWide:roi.textureWidth pixelsHigh:roi.textureHeight pixelsDeep:1
volumeTransform:volumeTransform outOfBoundsValue:0 freeWhenDone:YES];
_brushMask = [[OSIFloatVolumeData alloc] initWithFloatBytesNoCopy:mask pixelsWide:roi.textureWidth pixelsHigh:roi.textureHeight pixelsDeep:1 volumeTransform:volumeTransform outOfBoundsValue:0 freeWhenDone:YES];
} else {
[self release];
self = nil;
Expand Down
2 changes: 2 additions & 0 deletions OSIROIFloatPixelData.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ - (void)getIntensityMinimum:(float *)minimum firstQuartile:(float *)firstQuartil
if (maximum) {
*maximum = sorted[floatCount - 1];
}

free( sorted);
}

- (float)intensityInterQuartileRange
Expand Down
4 changes: 3 additions & 1 deletion OpenGLScreenReader.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ -(CGImageRef)createRGBImageFromBufferData
NSAssert( bitmap != NULL, @"CGBitmapContextCreate failure");

// Get rid of color space
CFRelease(cSpace);
// CFRelease(cSpace);

// Make an image out of our bitmap; does a cheap vm_copy of the
// bitmap
Expand Down Expand Up @@ -176,6 +176,8 @@ -(id) init
NSOpenGLPixelFormat *glPixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
if (!glPixelFormat)
{
[self autorelease];

return nil;
}

Expand Down
2 changes: 1 addition & 1 deletion SRController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ - (void) add2DPoint: (float) x : (float) y : (float) z
if (sliceNumber>=0 && sliceNumber<[[viewer2D pixList] count])
{
// Create the new 2D Point ROI
ROI *new2DPointROI = [[ROI alloc] initWithType: t2DPoint :[firstDCMPix pixelSpacingX] :[firstDCMPix pixelSpacingY] :[DCMPix originCorrectedAccordingToOrientation: firstDCMPix]];
ROI *new2DPointROI = [[[ROI alloc] initWithType: t2DPoint :[firstDCMPix pixelSpacingX] :[firstDCMPix pixelSpacingY] :[DCMPix originCorrectedAccordingToOrientation: firstDCMPix]] autorelease];
NSRect irect;
irect.origin.x = sc[0];
irect.origin.y = sc[1];
Expand Down
4 changes: 2 additions & 2 deletions SeriesView.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@

- (id)initWithFrame:(NSRect)frame seriesRows:(int)rows seriesColumns:(int)columns;

- (long)tag;
- (void)setTag:(long)theTag;
- (NSInteger)tag;
- (void)setTag:(NSInteger)theTag;
- (NSMutableArray *)imageViews;
- (DCMView *)firstView;
- (void)setImageViewMatrixForRows:(int)rows columns:(int)columns;
Expand Down
4 changes: 2 additions & 2 deletions SeriesView.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ - (BOOL)acceptsFirstResponder {
return NO;
}

- (long)tag{
- (NSInteger)tag{
return tag;
}

- (void)setTag:(long)theTag{
- (void)setTag:(NSInteger)theTag{
tag = theTag;
}

Expand Down
2 changes: 1 addition & 1 deletion VRController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ - (void) add2DPoint: (float) x : (float) y : (float) z :(float*) mm :(RGBColor)
if (sliceNumber>=0 && sliceNumber<[[viewer2D pixList] count])
{
// Create the new 2D Point ROI
ROI *new2DPointROI = [[ROI alloc] initWithType: t2DPoint :[firstDCMPix pixelSpacingX] :[firstDCMPix pixelSpacingY] :[DCMPix originCorrectedAccordingToOrientation: firstDCMPix]];
ROI *new2DPointROI = [[[ROI alloc] initWithType: t2DPoint :[firstDCMPix pixelSpacingX] :[firstDCMPix pixelSpacingY] :[DCMPix originCorrectedAccordingToOrientation: firstDCMPix]] autorelease];

if( rgb.red != 0 && rgb.green != 1 && rgb.blue != 2)
new2DPointROI.rgbcolor = rgb;
Expand Down
2 changes: 1 addition & 1 deletion Window3DController.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ - (IBAction) updateSetWLWW:(id) sender

- (IBAction) SetWLWW: (id) sender
{
float iwl, iww;
float iwl = 2, iww = 2;

[self getWLWW:&iwl :&iww];

Expand Down
4 changes: 4 additions & 0 deletions XMLRPCMethods.mm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ +(NSError*)errorWithCode:(NSInteger)code {
Method: KillOsiriX
*/
-(void)KillOsiriX:(NSDictionary*)params error:(NSError**)error {

if( error)
*error = nil;

[[AppController sharedAppController] performSelectorOnMainThread:@selector(terminate:) withObject:self waitUntilDone:NO];
}

Expand Down

0 comments on commit 5d1c3f5

Please sign in to comment.