Skip to content

Commit

Permalink
Re-enabled Warnings.xcconfig and fixed the compiling errors it produced
Browse files Browse the repository at this point in the history
  • Loading branch information
hjuutilainen committed Mar 12, 2015
1 parent d513cac commit 8e464fc
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 97 deletions.
4 changes: 2 additions & 2 deletions MunkiAdmin.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@
/* Begin XCBuildConfiguration section */
26FC0A850875C7B200E6366F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 22B7F4E18DC30765BD6122F8 /* Pods-MunkiAdmin.debug.xcconfig */;
baseConfigurationReference = F5A11C6C195706C6005A39AE /* Warnings.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
Expand All @@ -1163,7 +1163,7 @@
};
26FC0A860875C7B200E6366F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F1AE864A21B91D7578E28FA6 /* Pods-MunkiAdmin.release.xcconfig */;
baseConfigurationReference = F5A11C6C195706C6005A39AE /* Warnings.xcconfig */;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
Expand Down
2 changes: 1 addition & 1 deletion MunkiAdmin/NSOperation Subclasses/MAPkginfoScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ This pkginfo does not exist on disk (yet).
InstallsItemMO *aNewInstallsItem = [coreDataManager createInstallsItemFromDictionary:anInstall inManagedObjectContext:privateContext];
[aNewInstallsItem addPackagesObject:aNewPackage];
aNewInstallsItem.originalIndex = [NSNumber numberWithUnsignedInteger:idx];
[repoManager.installsKeyMappings enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
[repoManager.installsKeyMappings enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stopMappingsEnum) {
id value = [anInstall objectForKey:obj];
if (value != nil) {
DDLogVerbose(@"%@: installs item %lu --> %@: %@", self.fileName, (unsigned long)idx, key, obj);
Expand Down
12 changes: 6 additions & 6 deletions MunkiAdmin/NSOperation Subclasses/MARelationshipScanner.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ - (void)scanManifests
DDLogDebug(@"Processing %lu manifests...", [self.allManifests count]);


NSInteger count = [self.allManifests count];
NSInteger progressGranularity;
NSUInteger count = [self.allManifests count];
NSUInteger progressGranularity;
if (count < 100) {
progressGranularity = 1; // Update progress for every package
} else {
Expand Down Expand Up @@ -214,7 +214,7 @@ - (void)scanManifests
}

if (idx % progressGranularity == 0) {
float percentage = (idx / (float)[self.allManifests count]) * 100.0;
double percentage = (idx / (float)[self.allManifests count]) * 100.0;
self.currentJobDescription = [NSString stringWithFormat:@"Processing: (%1.0f%% done)", percentage];
}
if (idx % BatchSize == 0) {
Expand Down Expand Up @@ -282,8 +282,8 @@ - (void)scanPkginfos

DDLogDebug(@"Processing %lu packages...", [self.allPackages count]);

NSInteger count = [self.allPackages count];
NSInteger progressGranularity;
NSUInteger count = [self.allPackages count];
NSUInteger progressGranularity;
if (count < 100) {
progressGranularity = 1; // Update progress for every package
} else {
Expand Down Expand Up @@ -466,7 +466,7 @@ use a default icon (which is the icon for .pkg file type).
}

if (idx % progressGranularity == 0) {
float percentage = (idx / (float)[self.allPackages count]) * 100.0;
double percentage = (idx / (float)[self.allPackages count]) * 100.0;
self.currentJobDescription = [NSString stringWithFormat:@"Processing: (%1.0f%% done)", percentage];
}
if (idx % BatchSize == 0) {
Expand Down
114 changes: 45 additions & 69 deletions MunkiAdmin/Singletons/MAMunkiRepositoryManager.m

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions MunkiAdmin/UI Controllers/MAIconBatchExtractor.m
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ Create a PNG file from the image (resizing it if necessary)
DDLogDebug(@"Saved URL points to an existing image object. Need to reload the image from disk...");
IconImageMO *foundIconImage = foundIconImages[0];
foundIconImage.imageRepresentation = nil;
NSData *imageData = [NSData dataWithContentsOfURL:saveURL];
NSImage *image = [[NSImage alloc] initWithData:imageData];
foundIconImage.imageRepresentation = image;
NSData *newImageData = [NSData dataWithContentsOfURL:saveURL];
NSImage *newImage = [[NSImage alloc] initWithData:newImageData];
foundIconImage.imageRepresentation = newImage;

} else if ([foundIconImages count] > 1) {
DDLogError(@"Found multiple IconImage objects for a single URL. This shouldn't happen...");
Expand Down Expand Up @@ -307,9 +307,9 @@ - (void)extractIconForBatchItem:(MABatchItem *)batchItem
[self.remainingBatchItems removeObject:nextItem];
[self extractIconForBatchItem:nextItem];
} else if (self.cancelAllPending) {
for (MABatchItem *batchItem in self.remainingBatchItems) {
batchItem.statusDescription = @"Cancelled";
batchItem.statusImage = [NSImage imageNamed:NSImageNameStatusUnavailable];
for (MABatchItem *remainingBatchItem in self.remainingBatchItems) {
remainingBatchItem.statusDescription = @"Cancelled";
remainingBatchItem.statusImage = [NSImage imageNamed:NSImageNameStatusUnavailable];
}
self.numExtractOperationsRunning = 0;
}
Expand Down
6 changes: 3 additions & 3 deletions MunkiAdmin/UI Controllers/MAIconEditor.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ Create a PNG file from the image (resizing it if necessary)
DDLogDebug(@"Saved URL points to an existing image object. Need to reload the image from disk...");
IconImageMO *foundIconImage = foundIconImages[0];
foundIconImage.imageRepresentation = nil;
NSData *imageData = [NSData dataWithContentsOfURL:[sheet URL]];
NSImage *image = [[NSImage alloc] initWithData:imageData];
foundIconImage.imageRepresentation = image;
NSData *newImageData = [NSData dataWithContentsOfURL:[sheet URL]];
NSImage *newImage = [[NSImage alloc] initWithData:newImageData];
foundIconImage.imageRepresentation = newImage;

} else if ([foundIconImages count] > 1) {
DDLogError(@"Found multiple IconImage objects for a single URL. This shouldn't happen...");
Expand Down
20 changes: 10 additions & 10 deletions MunkiAdmin/UI Controllers/MAManifestsView.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ - (PXSourceListItem *)directoriesItem

NSImage *folderImage = [NSImage imageNamed:@"folder"];

NSString *newTitle;
[mainManifestsURL getResourceValue:&newTitle forKey:NSURLNameKey error:nil];
MAManifestsViewSourceListItem *item = [MAManifestsViewSourceListItem collectionWithTitle:newTitle identifier:newTitle type:ManifestSourceItemTypeFolder];
item.filterPredicate = [NSPredicate predicateWithFormat:@"manifestParentDirectoryURL == %@", mainManifestsURL];
item.representedFileURL = mainManifestsURL;
[newChildren addObject:[PXSourceListItem itemWithRepresentedObject:item icon:folderImage]];
[newRepresentedObjects addObject:item];
NSString *mainManifestsTitle;
[mainManifestsURL getResourceValue:&mainManifestsTitle forKey:NSURLNameKey error:nil];
MAManifestsViewSourceListItem *mainManifestsItem = [MAManifestsViewSourceListItem collectionWithTitle:mainManifestsTitle identifier:mainManifestsTitle type:ManifestSourceItemTypeFolder];
mainManifestsItem.filterPredicate = [NSPredicate predicateWithFormat:@"manifestParentDirectoryURL == %@", mainManifestsURL];
mainManifestsItem.representedFileURL = mainManifestsURL;
[newChildren addObject:[PXSourceListItem itemWithRepresentedObject:mainManifestsItem icon:folderImage]];
[newRepresentedObjects addObject:mainManifestsItem];

NSArray *keysToget = [NSArray arrayWithObjects:NSURLNameKey, NSURLLocalizedNameKey, NSURLIsDirectoryKey, nil];
NSFileManager *fm = [NSFileManager defaultManager];
Expand Down Expand Up @@ -477,7 +477,7 @@ -(BOOL)sourceList:(PXSourceList *)aSourceList shouldShowOutlineCellForItem:(id)i
# pragma mark -
# pragma mark NSSplitView delegates

- (void)toggleManifestsFindView;
- (void)toggleManifestsFindView
{
BOOL findViewCollapsed = [self.manifestsListSplitView isSubviewCollapsed:[self.manifestsListSplitView subviews][0]];
if (findViewCollapsed) {
Expand Down Expand Up @@ -525,7 +525,7 @@ - (void)uncollapseFindView
NSRect predicateEditorFrame = [predicateEditorSubView frame];

CGFloat predEditorRowHeight = [self.manifestsListPredicateEditor rowHeight];
int numRowsInPredEditor = [self.manifestsListPredicateEditor numberOfRows];
NSInteger numRowsInPredEditor = [self.manifestsListPredicateEditor numberOfRows];
int padding = 4;
CGFloat desiredHeight = numRowsInPredEditor * predEditorRowHeight + padding;
CGFloat dividerThickness = [self.manifestsListSplitView dividerThickness];
Expand All @@ -550,7 +550,7 @@ - (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview
}
}

- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex;
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex
{
if (splitView == self.manifestsListSplitView) {
return YES;
Expand Down
6 changes: 6 additions & 0 deletions Warnings.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
// http://boredzo.org/blog/archives/2009-11-07/warnings
//

//:configuration = Debug
#include "Pods/Target Support Files/Pods-MunkiAdmin/Pods-MunkiAdmin.debug.xcconfig"
//:configuration = Release
#include "Pods/Target Support Files/Pods-MunkiAdmin/Pods-MunkiAdmin.release.xcconfig"


GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
GCC_WARN_SHADOW = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
Expand Down

0 comments on commit 8e464fc

Please sign in to comment.