Permalink
Browse files

Enable support for arm64. Fix build errors. Integrate latest Dropbox …

…SDK.
  • Loading branch information...
sprang committed Oct 23, 2013
1 parent bf16d79 commit f6f5284736a2a484a01f7336408426dda83d4f5d
@@ -101,7 +101,7 @@ - (void)viewDidLoad
self.view.backgroundColor = nil;
self.view.opaque = NO;
- [self setColorSpace:[[NSUserDefaults standardUserDefaults] integerForKey:WDColorSpaceDefault]];
+ [self setColorSpace:(WDColorSpace)[[NSUserDefaults standardUserDefaults] integerForKey:WDColorSpaceDefault]];
alphaSlider_.mode = WDColorSliderModeAlpha;
// set up connections
@@ -123,12 +123,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSString *defaultsKey = (mode_ == kWDExportViaEmailMode) ? WDEmailFormatDefault : WDDropboxFormatDefault;
NSString *oldValue = [defaults objectForKey:defaultsKey];
- int oldRow = [self indexForFormatName:oldValue];
+ NSUInteger oldRow = [self indexForFormatName:oldValue];
oldIndexPath = [NSIndexPath indexPathForRow:oldRow inSection:indexPath.section];
oldCell = [tableView cellForRowAtIndexPath:oldIndexPath];
- [defaults setObject:[self stringForExportFormat:indexPath.row] forKey:defaultsKey];
+ [defaults setObject:[self stringForExportFormat:(WDExportFormat)indexPath.row] forKey:defaultsKey];
// deselect old cell
if (oldCell.accessoryType == UITableViewCellAccessoryCheckmark) {
@@ -153,7 +153,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
- NSString *name = [self stringForExportFormat:indexPath.row];
+ NSString *name = [self stringForExportFormat:(WDExportFormat)indexPath.row];
cell.textLabel.text = name;
if (mode_ == kWDExportViaEmailMode && [name isEqualToString:[defaults objectForKey:WDEmailFormatDefault]]) {
@@ -76,7 +76,7 @@ - (void) setDrawingController:(WDDrawingController *)drawingController
- (void) modeChanged:(id)sender
{
- fillMode_ = [modeSegment_ selectedSegmentIndex];
+ fillMode_ = (int) [modeSegment_ selectedSegmentIndex];
if (fillMode_ == kFillNone) {
[drawingController_ setValue:[NSNull null] forProperty:WDFillProperty];
@@ -98,7 +98,8 @@ - (void)viewDidLoad
- (void) scrollToSelectedFont
{
- int fontIndex = [[[WDFontManager sharedInstance] supportedFonts] indexOfObject:[drawingController_.propertyManager defaultValueForProperty:WDFontNameProperty]];
+ NSString *defaultFontName = [drawingController_.propertyManager defaultValueForProperty:WDFontNameProperty];
+ NSUInteger fontIndex = [[[WDFontManager sharedInstance] supportedFonts] indexOfObject:defaultFontName];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:fontIndex inSection:0];
[table_ scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionMiddle animated:NO];
}
@@ -183,7 +184,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
NSIndexPath *oldIndexPath = nil;
// find old cell
- int oldRow = [[[WDFontManager sharedInstance] supportedFonts] indexOfObject:self.selectedFontName];
+ NSUInteger oldRow = [[[WDFontManager sharedInstance] supportedFonts] indexOfObject:self.selectedFontName];
oldIndexPath = [NSIndexPath indexPathForRow:oldRow inSection:indexPath.section];
oldCell = [tableView cellForRowAtIndexPath:oldIndexPath];
self.selectedFontName = nil;
@@ -131,7 +131,7 @@ - (void) takeJoinFrom:(id)sender
return;
}
- [self setJoin:button.tag];
+ [self setJoin:(CGLineJoin)button.tag];
[self sendActionsForControlEvents:UIControlEventValueChanged];
}
@@ -143,7 +143,7 @@ - (void) takeCapFrom:(id)sender
return;
}
- [self setCap:button.tag];
+ [self setCap:(CGLineCap)button.tag];
[self sendActionsForControlEvents:UIControlEventValueChanged];
}
View
@@ -98,7 +98,7 @@ - (void) handlePoint:(CGPoint)pt
for (NSValue *rect in rects_) {
if (CGRectContainsPoint([rect CGRectValue], pt)) {
WDMenuItem *item = items_[ix];
- selectedIndex_ = (item.separator || !item.enabled) ? -1 : [rects_ indexOfObject:rect];
+ selectedIndex_ = (item.separator || !item.enabled) ? -1 : (int) [rects_ indexOfObject:rect];
break;
}
ix++;
@@ -169,7 +169,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (indexPath.section == kSizeSection) {
// find old cell
- int oldRow = [self indexOfPageSizeInConfiguration:[defaults objectForKey:WDPageSize]];
+ NSUInteger oldRow = [self indexOfPageSizeInConfiguration:[defaults objectForKey:WDPageSize]];
oldIndexPath = [NSIndexPath indexPathForRow:oldRow inSection:indexPath.section];
oldCell = [tableView cellForRowAtIndexPath:oldIndexPath];
@@ -200,7 +200,7 @@ - (IBAction) decrement:(id)sender
- (void) modeChanged:(id)sender
{
- mode_ = [modeSegment_ selectedSegmentIndex];
+ mode_ = (int) [modeSegment_ selectedSegmentIndex];
if (mode_ == kStrokeNone) {
[drawingController_ setValue:@NO forProperty:WDStrokeVisibleProperty];
@@ -156,9 +156,9 @@ - (void) createNewSwatch:(id)sender
- (CGSize) preferredContentSize
{
- float width = kSwatchesPerRow * (kSwatchDimension + kSwatchSpacing) + kSwatchSpacing;
- int numRows = (self.swatches.count / kSwatchesPerRow) + 2;
- float height = numRows * (kSwatchDimension + kSwatchSpacing) + kSwatchSpacing;
+ float width = kSwatchesPerRow * (kSwatchDimension + kSwatchSpacing) + kSwatchSpacing;
+ NSUInteger numRows = (self.swatches.count / kSwatchesPerRow) + 2;
+ float height = numRows * (kSwatchDimension + kSwatchSpacing) + kSwatchSpacing;
return CGSizeMake(width, height);
}
Binary file not shown.
@@ -58,7 +58,7 @@ - (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode bounds:(
break;
default:
- [NSException raise:NSInvalidArgumentException format:@"Unsupported content mode: %d", contentMode];
+ [NSException raise:NSInvalidArgumentException format:@"Unsupported content mode: %d", (int) contentMode];
}
CGSize newSize = CGSizeMake(self.size.width * ratio, self.size.height * ratio);
@@ -224,7 +224,7 @@ - (id)initWithCoder:(NSCoder *)coder
undoManager_ = [[NSUndoManager alloc] init];
#ifdef WD_DEBUG
-NSLog(@"Elements in drawing: %u", [self allElements].count);
+NSLog(@"Elements in drawing: %lu", (unsigned long)[self allElements].count);
#endif
return self;
@@ -466,7 +466,7 @@ - (void) setFontSize:(float)size
{
[self cacheDirtyBounds];
- [[self.undoManager prepareWithInvocationTarget:self] setFontSize:fontSize_];
+ [(WDText *)[self.undoManager prepareWithInvocationTarget:self] setFontSize:fontSize_];
[self setFontSizeQuiet:size];
@@ -40,7 +40,7 @@
#define kMaxOutwardKernAdjustment (-0.25f)
@interface WDTextPath (WDPrivate)
-- (int) segmentCount;
+- (NSInteger) segmentCount;
- (void) layout;
- (void) getStartKnobBase:(CGPoint *)base andTop:(CGPoint *)top;
@end
@@ -276,7 +276,7 @@ - (void) setFontSize:(float)size
{
[self cacheDirtyBounds];
- [[self.undoManager prepareWithInvocationTarget:self] setFontSize:fontSize_];
+ [(WDTextPath *)[self.undoManager prepareWithInvocationTarget:self] setFontSize:fontSize_];
fontSize_ = size;
@@ -388,15 +388,15 @@ - (float) getSegments:(WDBezierSegment *)segments andLengths:(float *)lengths na
- (float) length:(BOOL)naturalSpace
{
- int numSegments = [self segmentCount];
+ NSInteger numSegments = [self segmentCount];
WDBezierSegment segments[numSegments];
float lengths[numSegments];
// precalculate the segments and their arc lengths
return [self getSegments:segments andLengths:lengths naturalSpace:naturalSpace];
}
-- (BOOL) cornerAtEndOfSegment:(int)ix segments:(WDBezierSegment *)segments count:(int)numSegments
+- (BOOL) cornerAtEndOfSegment:(int)ix segments:(WDBezierSegment *)segments count:(NSInteger)numSegments
{
if (!closed_ && (ix < 0 || ix >= numSegments)) {
return NO;
@@ -440,7 +440,7 @@ - (void) layout
return;
}
- int numSegments = [self segmentCount];
+ NSInteger numSegments = [self segmentCount];
WDBezierSegment segments[numSegments];
float lengths[numSegments];
float totalLength = 0;
@@ -912,7 +912,7 @@ - (void) registerUndoWithCachedStartOffset
- (void) moveStartKnobToNearestPoint:(CGPoint)pt
{
- int numSegments = [self segmentCount];
+ NSInteger numSegments = [self segmentCount];
WDBezierSegment segments[numSegments];
float lengths[numSegments];
float lowestError = MAXFLOAT;
@@ -103,7 +103,7 @@ - (void) endWithEvent:(WDEvent *)theEvent inCanvas:(WDCanvas *)canvas
- (void) updateOptionsSettings
{
- optionsValue_.text = [NSString stringWithFormat:@"%d", eraserSize_];
+ optionsValue_.text = [NSString stringWithFormat:@"%lu", (unsigned long)eraserSize_];
optionsSlider_.value = eraserSize_;
}
@@ -165,7 +165,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event inCanvas:(WDCan
if (!self.primaryTouchEnded) {
// reflect the modifier touch immediately
- int remainingTouchCount = [event allTouches].count - touches.count;
+ NSInteger remainingTouchCount = [event allTouches].count - touches.count;
WDToolFlags newFlags = (remainingTouchCount > 1 ? WDToolSecondaryTouch : WDToolDefault);
[self setFlags:newFlags inCanvas:canvas];
@@ -300,7 +300,7 @@ void WDGLDrawLineStrip(GLfloat *vertices, NSUInteger count)
{
#if TARGET_OS_IPHONE
glVertexPointer(2, GL_FLOAT, 0, vertices);
- glDrawArrays(GL_LINE_STRIP, 0, count / 2);
+ glDrawArrays(GL_LINE_STRIP, 0, (int) count / 2);
#else
glBegin(GL_LINE_STRIP);
for (int i = 0; i < count; i+=2) {
@@ -2109,7 +2109,7 @@
6B87CE4A1313D6ED0027A482 /* Distribution */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
+ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Steve Sprang";
@@ -2161,7 +2161,7 @@
6BF7476D1311C351000D9344 /* Ad Hoc */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
+ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
@@ -2213,7 +2213,7 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
+ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -2237,7 +2237,7 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD)";
+ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";

0 comments on commit f6f5284

Please sign in to comment.