Skip to content

Commit

Permalink
gnu11-c++ syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rossetantoine committed Feb 24, 2014
1 parent d91740f commit 141e5bd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DicomDatabase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ -(NSArray*)albums {
return [[a name] caseInsensitiveCompare:[b name]];
} @catch (...) {
}
return nil;
return (NSComparisonResult) NSOrderedSame;
}];
} @catch (NSException* e) {
N2LogException(e);
Expand Down
9 changes: 9 additions & 0 deletions OsiriX_Lion.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32778,6 +32778,7 @@
7E76BEC7085757B70073649A /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN_EMPTY_BODY = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
Expand Down Expand Up @@ -32824,6 +32825,7 @@
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-Wno-deprecated",
"-no-pedantic",
);
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -32839,6 +32841,7 @@
);
PRODUCT_NAME = OsiriX;
USER_HEADER_SEARCH_PATHS = "ITK180/Modules/Core/Common/include ITK180/Modules/ThirdParty/VNL/src/vxl/core ITK180/Modules/ThirdParty/VNL/src/vxl/vcl ITK180/Modules/Core/Common ITK180/Modules/Core/Mesh/include ITK180/Modules/Segmentation/RegionGrowing/include ITK180/Modules/Filtering/CurvatureFlow/include ITK180/Modules/Core/ImageFunction/include ITK180/Modules/Core/FiniteDifference/include ITK180/Modules/Filtering/ImageFilterBase/include ITK180/Modules/Segmentation/LevelSets/include ITK180/Modules/Filtering/FastMarching/include ITK180/Modules/Filtering/ImageIntensity/include ITK180/Modules/Bridge/VTK/include ITK180/Modules/Filtering/MathematicalMorphology/include ITK180/Modules/Core/Transform/include ITK180/Modules/Filtering/ImageGrid/include ITK180/Modules/Filtering/BinaryMathematicalMorphology/include ITK180/Modules/ThirdParty/NrrdIO/src/NrrdIO";
WARNING_CFLAGS = "-no-pedantic";
};
name = Development;
};
Expand Down Expand Up @@ -33324,6 +33327,7 @@
CE5314AB0C717C3000A2B75F /* Deployment 32-bit */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN_EMPTY_BODY = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
Expand Down Expand Up @@ -33374,6 +33378,7 @@
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-Wno-deprecated",
"-no-pedantic",
);
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -33388,6 +33393,7 @@
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = debugging;
USER_HEADER_SEARCH_PATHS = "ITK180/Modules/Core/Common/include ITK180/Modules/ThirdParty/VNL/src/vxl/core ITK180/Modules/ThirdParty/VNL/src/vxl/vcl ITK180/Modules/Core/Common ITK180/Modules/Core/Mesh/include ITK180/Modules/Segmentation/RegionGrowing/include ITK180/Modules/Filtering/CurvatureFlow/include ITK180/Modules/Core/ImageFunction/include ITK180/Modules/Core/FiniteDifference/include ITK180/Modules/Filtering/ImageFilterBase/include ITK180/Modules/Segmentation/LevelSets/include ITK180/Modules/Filtering/FastMarching/include ITK180/Modules/Filtering/ImageIntensity/include ITK180/Modules/Bridge/VTK/include ITK180/Modules/Filtering/MathematicalMorphology/include ITK180/Modules/Core/Transform/include ITK180/Modules/Filtering/ImageGrid/include ITK180/Modules/Filtering/BinaryMathematicalMorphology/include ITK180/Modules/ThirdParty/NrrdIO/src/NrrdIO";
WARNING_CFLAGS = "-no-pedantic";
};
name = "Deployment 32-bit";
};
Expand Down Expand Up @@ -33613,6 +33619,7 @@
CE5314B60C717C3000A2B75F /* Deployment 64-bit */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_WARN_EMPTY_BODY = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
Expand Down Expand Up @@ -33665,6 +33672,7 @@
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-Wno-deprecated",
"-no-pedantic",
);
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -33683,6 +33691,7 @@
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = debugging;
USER_HEADER_SEARCH_PATHS = "ITK180/Modules/Core/Common/include ITK180/Modules/ThirdParty/VNL/src/vxl/core ITK180/Modules/ThirdParty/VNL/src/vxl/vcl ITK180/Modules/Core/Common ITK180/Modules/Core/Mesh/include ITK180/Modules/Segmentation/RegionGrowing/include ITK180/Modules/Filtering/CurvatureFlow/include ITK180/Modules/Core/ImageFunction/include ITK180/Modules/Core/FiniteDifference/include ITK180/Modules/Filtering/ImageFilterBase/include ITK180/Modules/Segmentation/LevelSets/include ITK180/Modules/Filtering/FastMarching/include ITK180/Modules/Filtering/ImageIntensity/include ITK180/Modules/Bridge/VTK/include ITK180/Modules/Filtering/MathematicalMorphology/include ITK180/Modules/Core/Transform/include ITK180/Modules/Filtering/ImageGrid/include ITK180/Modules/Filtering/BinaryMathematicalMorphology/include ITK180/Modules/ThirdParty/NrrdIO/src/NrrdIO";
WARNING_CFLAGS = "-no-pedantic";
};
name = "Deployment 64-bit";
};
Expand Down
2 changes: 1 addition & 1 deletion RemoteDicomDatabase.mm
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ -(NSInteger)_connection:(N2Connection*)connection handleData_fetchDataForImage:(
-(NSData*)sendMessage:(NSDictionary*)message { // ------------------------------------ this seems to be unused
NSMutableData* request = [NSMutableData dataWithBytes:"NEWMS" length:6];

NSData* data = [NSPropertyListSerialization dataFromPropertyList:message format:kCFPropertyListBinaryFormat_v1_0 errorDescription:nil];
NSData* data = [NSPropertyListSerialization dataFromPropertyList:message format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil];
[RemoteDicomDatabase _data:request appendInt:data.length];
[request appendData:data];

Expand Down
8 changes: 4 additions & 4 deletions WebPortalConnection.mm
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ - (BOOL) checkEOF:(NSData*) postDataChunk range: (NSRange*) r
{
if (x >= 0)
{
NSRange searchRange = {x, l};
NSRange searchRange = {static_cast<NSUInteger>(x), static_cast<NSUInteger>(l)};

// If MacOS 10.6 : we should use - (NSRange)rangeOfData:(NSData *)dataToFind options:(NSDataSearchOptions)mask range:(NSRange)searchRange

Expand Down Expand Up @@ -872,13 +872,13 @@ - (void)processDataChunk:(NSData *)postDataChunk

for (int i = 0; i < [postDataChunk length] - l; i++)
{
NSRange searchRange = {i, l};
NSRange searchRange = {static_cast<NSUInteger>(i), static_cast<NSUInteger>(l)};

// If MacOS 10.6 : we should use - (NSRange)rangeOfData:(NSData *)dataToFind options:(NSDataSearchOptions)mask range:(NSRange)searchRange

if ([[postDataChunk subdataWithRange:searchRange] isEqualToData:separatorData])
{
NSRange newDataRange = {dataStartIndex, i - dataStartIndex};
NSRange newDataRange = {static_cast<NSUInteger>(dataStartIndex), static_cast<NSUInteger>(i - dataStartIndex)};
if( i >= dataStartIndex)
{
dataStartIndex = i + l;
Expand Down Expand Up @@ -924,7 +924,7 @@ - (void)processDataChunk:(NSData *)postDataChunk

[POSTfilename retain];

NSRange fileDataRange = {dataStartIndex, [postDataChunk length] - dataStartIndex};
NSRange fileDataRange = {static_cast<NSUInteger>(dataStartIndex), [postDataChunk length] - dataStartIndex};

BOOL eof = [self checkEOF: postDataChunk range: &fileDataRange];

Expand Down
4 changes: 2 additions & 2 deletions nitrogen/Sources/NSBitmapImageRep+N2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ -(NSBitmapImageRep*)smoothen:(NSUInteger)kernelSize {
assert(kernelSize%2 == 1 && [self bitsPerSample] == 8 && [self samplesPerPixel] == 4);

NSSize selfSize = [self size];
vImage_Buffer selfBuff = {[self bitmapData], (unsigned long)selfSize.width, (unsigned long)selfSize.height, [self bytesPerRow]};
vImage_Buffer selfBuff = {[self bitmapData], (unsigned long)selfSize.width, (unsigned long)selfSize.height, static_cast<size_t>([self bytesPerRow])};

NSSize outputSize = selfSize;
NSBitmapImageRep* outputBitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:outputSize.width pixelsHigh:outputSize.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:outputSize.width*4 bitsPerPixel:32];
vImage_Buffer outputBuff = {[outputBitmap bitmapData], (unsigned long)outputSize.width, (unsigned long)outputSize.height, [outputBitmap bytesPerRow]};
vImage_Buffer outputBuff = {[outputBitmap bitmapData], (unsigned long)outputSize.width, (unsigned long)outputSize.height, static_cast<size_t>([outputBitmap bytesPerRow])};

Pixel_8888 backgroundColor = {0,0,0,0};
vImageBoxConvolve_ARGB8888(&selfBuff, &outputBuff, NULL, 0, 0, kernelSize, kernelSize, backgroundColor, kvImageBackgroundColorFill);
Expand Down

0 comments on commit 141e5bd

Please sign in to comment.