From bb58a206a8405978cd2eb3c708e12e4774d719e2 Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Mon, 12 Aug 2013 16:46:14 +0200 Subject: [PATCH] Fixed: Removed all warnings of conflicting return and parameter types caused by the new compiler --- AppKit/CPAlert.j | 2 +- AppKit/CPBox.j | 2 +- AppKit/CPBrowser.j | 8 +++---- AppKit/CPButton.j | 2 +- AppKit/CPButtonBar.j | 2 +- AppKit/CPCollectionView.j | 6 ++--- AppKit/CPColorPanel.j | 4 ++-- AppKit/CPColorWell.j | 2 +- AppKit/CPComboBox.j | 10 ++++---- AppKit/CPControl.j | 6 ++--- AppKit/CPDatePicker/CPDatePicker.j | 6 ++--- AppKit/CPDatePicker/_CPDatePickerCalendar.j | 4 ++-- AppKit/CPDatePicker/_CPDatePickerTextField.j | 4 ++-- AppKit/CPFlashView.j | 2 +- AppKit/CPImageView.j | 4 ++-- AppKit/CPLevelIndicator.j | 2 +- AppKit/CPMenu/CPMenu.j | 8 +++---- AppKit/CPMenu/_CPMenuWindow.j | 2 +- AppKit/CPMenuItem/_CPMenuItemMenuBarView.j | 2 +- AppKit/CPMenuItem/_CPMenuItemStandardView.j | 2 +- AppKit/CPMenuItem/_CPMenuItemView.j | 2 +- AppKit/CPObjectController.j | 10 ++++---- AppKit/CPOutlineView.j | 6 ++--- AppKit/CPPopUpButton.j | 10 ++++---- AppKit/CPRadio.j | 2 +- AppKit/CPRuleEditor/CPPredicateEditor.j | 8 +++---- AppKit/CPRuleEditor/CPRuleEditor.j | 24 +++++++++---------- .../CPRuleEditor/_CPRuleEditorPopUpButton.j | 8 +++---- .../CPRuleEditor/_CPRuleEditorViewSliceRow.j | 2 +- AppKit/CPScroller.j | 2 +- AppKit/CPSearchField.j | 2 +- AppKit/CPSegmentedControl.j | 2 +- AppKit/CPShadowView.j | 2 +- AppKit/CPSlider.j | 2 +- AppKit/CPSplitView.j | 4 ++-- AppKit/CPStepper.j | 4 ++-- AppKit/CPTabView.j | 6 ++--- AppKit/CPTableColumn.j | 2 +- AppKit/CPTableHeaderView.j | 6 ++--- AppKit/CPTableView.j | 12 +++++----- AppKit/CPTextField.j | 4 ++-- AppKit/CPTokenField.j | 10 ++++---- AppKit/CPToolbar.j | 4 ++-- AppKit/CPViewAnimation.j | 2 +- AppKit/CPWindow/CPWindow.j | 2 +- .../CPWindow/_CPBorderlessBridgeWindowView.j | 2 +- AppKit/CPWindow/_CPDocModalWindowView.j | 2 +- AppKit/CPWindow/_CPPopoverWindowView.j | 2 +- AppKit/CPWindow/_CPShadowWindowView.j | 2 +- AppKit/CPWindow/_CPStandardWindowView.j | 4 ++-- AppKit/CPWindow/_CPToolTipWindowView.j | 2 +- AppKit/CPWindow/_CPWindowView.j | 2 +- AppKit/CoreAnimation/CALayer.j | 2 +- AppKit/CoreAnimation/CAMediaTimingFunction.j | 2 +- AppKit/Platform/DOM/CPDOMWindowLayer.j | 2 +- AppKit/_CPAutocompleteMenu.j | 2 +- AppKit/_CPCornerView.j | 2 +- AppKit/_CPImageAndTextView.j | 2 +- AppKit/_CPPopUpList.j | 2 +- AppKit/_CPPopoverWindow.j | 2 +- CONTRIBUTING.md | 2 +- Foundation/CPArray+KVO.j | 20 ++++++++-------- Foundation/CPArray/CPMutableArray.j | 14 +++++------ Foundation/CPArray/_CPArray.j | 10 ++++---- Foundation/CPArray/_CPJavaScriptArray.j | 12 +++++----- Foundation/CPAttributedString.j | 10 ++++---- Foundation/CPByteCountFormatter.j | 2 +- Foundation/CPDateFormatter.j | 2 +- Foundation/CPDecimalNumber.j | 15 +++++++++++- Foundation/CPError.j | 2 +- Foundation/CPIndexSet.j | 2 +- Foundation/CPInvocation.j | 4 ++-- Foundation/CPKeyValueObserving.j | 4 ++-- Foundation/CPNumberFormatter.j | 2 +- Foundation/CPScanner.j | 2 +- Foundation/CPSet+KVO.j | 2 +- Foundation/CPString.j | 6 ++--- Tests/AppKit/CPArrayControllerTest.j | 8 +++---- Tests/Foundation/CPAttributedStringTest.j | 6 ++--- Tests/Foundation/CPKVOTest.j | 6 ++--- Tests/Manual/ArrayController1/AppController.j | 8 +++---- Tools/nib2cib/NSCustomView.j | 2 +- 82 files changed, 202 insertions(+), 189 deletions(-) diff --git a/AppKit/CPAlert.j b/AppKit/CPAlert.j index 5f8db4129..28edbe53d 100644 --- a/AppKit/CPAlert.j +++ b/AppKit/CPAlert.j @@ -757,7 +757,7 @@ var bottomHeight = 71; return @"alert"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"size": CGSizeMake(400.0, 110.0), diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index 0a9240d7b..dc10564ff 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -76,7 +76,7 @@ CPBelowBottom = 6; return @"box"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"background-color": [CPNull null], diff --git a/AppKit/CPBrowser.j b/AppKit/CPBrowser.j index 094bb6a5b..0c764943b 100644 --- a/AppKit/CPBrowser.j +++ b/AppKit/CPBrowser.j @@ -71,7 +71,7 @@ return "browser"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"image-control-resize": [CPNull null], @@ -771,7 +771,7 @@ CPBrowser _browser @accessors; } -- (void)initWithFrame:(CGRect)aFrame +- (id)initWithFrame:(CGRect)aFrame { if (self = [super initWithFrame:aFrame]) { @@ -902,7 +902,7 @@ [_browser selectRowIndexes:selectedIndexes inColumn:_index]; } -- (id)childAtIndex:(unsigned)index +- (id)childAtIndex:(CPUInteger)index { return [_delegate browser:_browser child:index ofItem:_item]; } @@ -995,7 +995,7 @@ [aCoder encodeObject:_highlightedBranchImage forKey:"_CPBrowserLeafViewHighlightedBranchImageKey"]; } -- (void)initWithCoder:(CPCoder)aCoder +- (id)initWithCoder:(CPCoder)aCoder { if (self = [super initWithCoder:aCoder]) { diff --git a/AppKit/CPButton.j b/AppKit/CPButton.j index 25f1424ff..86ac3b33e 100644 --- a/AppKit/CPButton.j +++ b/AppKit/CPButton.j @@ -149,7 +149,7 @@ CPButtonImageOffset = 3.0; return @"button"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"image": [CPNull null], diff --git a/AppKit/CPButtonBar.j b/AppKit/CPButtonBar.j index c96a01d76..8efe075b4 100644 --- a/AppKit/CPButtonBar.j +++ b/AppKit/CPButtonBar.j @@ -79,7 +79,7 @@ return @"button-bar"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"resize-control-inset": CGInsetMake(0.0, 0.0, 0.0, 0.0), diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j index 1412cf40e..725cafe13 100644 --- a/AppKit/CPCollectionView.j +++ b/AppKit/CPCollectionView.j @@ -892,12 +892,12 @@ var HORIZONTAL_MARGIN = 2; return CPNotFound; } -- (CPCollectionViewItem)itemAtIndex:(unsigned)anIndex +- (CPCollectionViewItem)itemAtIndex:(CPUInteger)anIndex { return [_items objectAtIndex:anIndex]; } -- (CGRect)frameForItemAtIndex:(unsigned)anIndex +- (CGRect)frameForItemAtIndex:(CPUInteger)anIndex { return [[[self itemAtIndex:anIndex] view] frame]; } @@ -1322,7 +1322,7 @@ Not supported. Use -collectionView:dataForItemsAtIndexes:fortype: [self interpretKeyEvents:[anEvent]]; } -- (void)setAutoresizingMask:(int)aMask +- (void)setAutoresizingMask:(unsigned)aMask { [super setAutoresizingMask:0]; } diff --git a/AppKit/CPColorPanel.j b/AppKit/CPColorPanel.j index 0a3f6ba88..af6bf3e1d 100644 --- a/AppKit/CPColorPanel.j +++ b/AppKit/CPColorPanel.j @@ -576,7 +576,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; [aPasteboard setData:[CPKeyedArchiver archivedDataWithRootObject:_dragColor] forType:aType]; } -- (void)performDragOperation:(id )aSender +- (void)performDragOperation:(id /**/)aSender { var location = [self convertPoint:[aSender draggingLocation] fromView:nil], pasteboard = [aSender draggingPasteboard], @@ -615,7 +615,7 @@ var CPColorPanelSwatchesCookie = "CPColorPanelSwatchesCookie"; return _colorPanel; } -- (void)performDragOperation:(id )aSender +- (void)performDragOperation:(id /**/)aSender { var pasteboard = [aSender draggingPasteboard]; diff --git a/AppKit/CPColorWell.j b/AppKit/CPColorWell.j index 8ebe88ce9..8d8132f3a 100644 --- a/AppKit/CPColorWell.j +++ b/AppKit/CPColorWell.j @@ -58,7 +58,7 @@ var _CPColorWellDidBecomeExclusiveNotification = @"_CPColorWellDidBecomeExclusiv return @"colorwell"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-inset": CGInsetMakeZero(), diff --git a/AppKit/CPComboBox.j b/AppKit/CPComboBox.j index 0651d53ee..272292fe3 100644 --- a/AppKit/CPComboBox.j +++ b/AppKit/CPComboBox.j @@ -58,7 +58,7 @@ var CPComboBoxTextSubview = @"text", return "combobox"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"popup-button-size": CGSizeMake(21.0, 29.0), @@ -171,7 +171,7 @@ var CPComboBoxTextSubview = @"text", #pragma mark Setting a Delegate -- (id < CPComboBoxDelegate >)delegate +- (id /*< CPComboBoxDelegate >*/)delegate { return [super delegate]; } @@ -182,7 +182,7 @@ var CPComboBoxTextSubview = @"text", protocol, in actual fact it doesn't. Also note that the same delegate may conform to the NSTextFieldDelegate protocol. */ -- (void)setDelegate:(id < CPComboBoxDelegate >)aDelegate +- (void)setDelegate:(id /*< CPComboBoxDelegate >*/)aDelegate { var delegate = [self delegate]; @@ -231,7 +231,7 @@ var CPComboBoxTextSubview = @"text", #pragma mark Setting a Data Source -- (id < CPComboBoxDataSource >)dataSource +- (id /*< CPComboBoxDataSource >*/)dataSource { if (!_usesDataSource) [self _dataSourceWarningForMethod:_cmd condition:NO]; @@ -239,7 +239,7 @@ var CPComboBoxTextSubview = @"text", return _dataSource; } -- (void)setDataSource:(id < CPComboBoxDataSource >)aSource +- (void)setDataSource:(id /*< CPComboBoxDataSource >*/)aSource { if (!_usesDataSource) [self _dataSourceWarningForMethod:_cmd condition:NO]; diff --git a/AppKit/CPControl.j b/AppKit/CPControl.j index 5460748e5..a8f61fa4f 100644 --- a/AppKit/CPControl.j +++ b/AppKit/CPControl.j @@ -322,11 +322,11 @@ var CPControlBlackColor = [CPColor blackColor]; _previousTrackingLocation = currentLocation; } -- (void)setState:(int)state +- (void)setState:(CPInteger)state { } -- (int)nextState +- (CPInteger)nextState { return 0; } @@ -813,7 +813,7 @@ var CPControlBlackColor = [CPColor blackColor]; /*! Returns the image scaling of the control. */ -- (CPImageScaling)imageScaling +- (CPUInteger)imageScaling { return [self valueForThemeAttribute:@"image-scaling"]; } diff --git a/AppKit/CPDatePicker/CPDatePicker.j b/AppKit/CPDatePicker/CPDatePicker.j index 0c9b26633..a96b75ccc 100644 --- a/AppKit/CPDatePicker/CPDatePicker.j +++ b/AppKit/CPDatePicker/CPDatePicker.j @@ -90,7 +90,7 @@ CPEraDatePickerElementFlag = 0x0100; return @"datePicker"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-color": [CPColor clearColor], @@ -159,7 +159,7 @@ CPEraDatePickerElementFlag = 0x0100; return [super _binderClassForBinding:theBinding]; } -- (id)_replacementKeyPathForBinding:(CPString)aBinding +- (CPString)_replacementKeyPathForBinding:(CPString)aBinding { if (aBinding == CPValueBinding) return @"dateValue"; @@ -269,7 +269,7 @@ CPEraDatePickerElementFlag = 0x0100; /*! Return the objectValue of the datePicker. The objectValue should take the timeZoneEffect */ -- (void)objectValue +- (id)objectValue { // TODO : add timeZone effect. How to do it because js ??? return _dateValue diff --git a/AppKit/CPDatePicker/_CPDatePickerCalendar.j b/AppKit/CPDatePicker/_CPDatePickerCalendar.j index 474d29665..a7d713585 100644 --- a/AppKit/CPDatePicker/_CPDatePickerCalendar.j +++ b/AppKit/CPDatePicker/_CPDatePickerCalendar.j @@ -1059,7 +1059,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" /*! Set a theme */ -- (void)setThemeState:(CPThemeState)aState +- (BOOL)setThemeState:(CPThemeState)aState { [_textField setThemeState:aState]; [super setThemeState:aState]; @@ -1067,7 +1067,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" /*! Unset a theme */ -- (void)unsetThemeState:(CPThemeState)aState +- (BOOL)unsetThemeState:(CPThemeState)aState { [_textField unsetThemeState:aState]; [super unsetThemeState:aState]; diff --git a/AppKit/CPDatePicker/_CPDatePickerTextField.j b/AppKit/CPDatePicker/_CPDatePickerTextField.j index 897dc14d0..59033f99e 100644 --- a/AppKit/CPDatePicker/_CPDatePickerTextField.j +++ b/AppKit/CPDatePicker/_CPDatePickerTextField.j @@ -1356,7 +1356,7 @@ var CPMonthDateType = 0, /*! Set the stringValue of the TextField. Add some zeros of there isn't 2/4 letters in the value. It's called at the end of the editing process @param aStringValue a CPString */ -- (void)setStringValue:(id)aStringValue +- (void)setStringValue:(CPString)aStringValue { if (_dateType == CPYearDateType) { @@ -1437,7 +1437,7 @@ var CPMonthDateType = 0, /*! Return the objectValue of the textField. Needed for the binding. This returns the objectValue relative to the dateValue */ -- (void)objectValue +- (id)objectValue { var dateValue = [[_datePicker dateValue] copy]; diff --git a/AppKit/CPFlashView.j b/AppKit/CPFlashView.j index 071ad0ee2..13cc481a2 100644 --- a/AppKit/CPFlashView.j +++ b/AppKit/CPFlashView.j @@ -189,7 +189,7 @@ var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; return @"CPFV_" + [self UID]; } -- (void)mouseMoved:(id)sommit +- (void)mouseMoved:(CPEvent)sommit { [[[self window] platformWindow] _propagateCurrentDOMEvent:YES]; } diff --git a/AppKit/CPImageView.j b/AppKit/CPImageView.j index 1cac97d16..5f92e0fe9 100644 --- a/AppKit/CPImageView.j +++ b/AppKit/CPImageView.j @@ -267,7 +267,7 @@ var CPImageViewEmptyPlaceholderImage = nil; [self setNeedsDisplay:YES]; } -- (unsigned)imageScaling +- (CPUInteger)imageScaling { return [self currentValueForThemeAttribute:@"image-scaling"]; } @@ -502,7 +502,7 @@ var CPImageViewEmptyPlaceholderImage = nil; [_source setImage:image]; } -- (void)valueForBinding:(CPString)aBinding +- (id)valueForBinding:(CPString)aBinding { var image = [_source image]; diff --git a/AppKit/CPLevelIndicator.j b/AppKit/CPLevelIndicator.j index 92a631c42..042b17e84 100644 --- a/AppKit/CPLevelIndicator.j +++ b/AppKit/CPLevelIndicator.j @@ -62,7 +62,7 @@ CPRatingLevelIndicatorStyle = 3; return "level-indicator"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-color": [CPNull null], diff --git a/AppKit/CPMenu/CPMenu.j b/AppKit/CPMenu/CPMenu.j index 1940827ee..d38f8b067 100644 --- a/AppKit/CPMenu/CPMenu.j +++ b/AppKit/CPMenu/CPMenu.j @@ -278,7 +278,7 @@ var _CPMenuBarVisible = NO, @param aMenuItem the item to insert @param anIndex the index in the menu to insert the item. */ -- (void)insertItem:(CPMenuItem)aMenuItem atIndex:(unsigned)anIndex +- (void)insertItem:(CPMenuItem)aMenuItem atIndex:(CPUInteger)anIndex { [self insertObject:aMenuItem inItemsAtIndex:anIndex]; } @@ -291,7 +291,7 @@ var _CPMenuBarVisible = NO, @param anIndex the index location in the menu for the new item @return the new menu item */ -- (CPMenuItem)insertItemWithTitle:(CPString)aTitle action:(SEL)anAction keyEquivalent:(CPString)aKeyEquivalent atIndex:(unsigned)anIndex +- (CPMenuItem)insertItemWithTitle:(CPString)aTitle action:(SEL)anAction keyEquivalent:(CPString)aKeyEquivalent atIndex:(CPUInteger)anIndex { var item = [[CPMenuItem alloc] initWithTitle:aTitle action:anAction keyEquivalent:aKeyEquivalent]; @@ -335,7 +335,7 @@ var _CPMenuBarVisible = NO, Removes the item at the specified index from the menu @param anIndex the index of the item to remove */ -- (void)removeItemAtIndex:(unsigned)anIndex +- (void)removeItemAtIndex:(CPUInteger)anIndex { [self removeObjectFromItemsAtIndex:anIndex]; } @@ -1060,7 +1060,7 @@ var _CPMenuBarVisible = NO, Sends the action of the menu item at the specified index. @param anIndex the index of the item */ -- (void)performActionForItemAtIndex:(unsigned)anIndex +- (void)performActionForItemAtIndex:(CPUInteger)anIndex { var item = _items[anIndex]; diff --git a/AppKit/CPMenu/_CPMenuWindow.j b/AppKit/CPMenu/_CPMenuWindow.j index 19cf4d6f7..61c065e43 100644 --- a/AppKit/CPMenu/_CPMenuWindow.j +++ b/AppKit/CPMenu/_CPMenuWindow.j @@ -434,7 +434,7 @@ _CPMenuWindowAttachedMenuBackgroundStyle = 2; return "menu-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"menu-window-more-above-image": [CPNull null], diff --git a/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j b/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j index 8d213511d..07e80745b 100644 --- a/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j +++ b/AppKit/CPMenuItem/_CPMenuItemMenuBarView.j @@ -49,7 +49,7 @@ return "menu-item-bar-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"horizontal-margin": 9.0, diff --git a/AppKit/CPMenuItem/_CPMenuItemStandardView.j b/AppKit/CPMenuItem/_CPMenuItemStandardView.j index 4eaca118d..2fc534b24 100644 --- a/AppKit/CPMenuItem/_CPMenuItemStandardView.j +++ b/AppKit/CPMenuItem/_CPMenuItemStandardView.j @@ -45,7 +45,7 @@ return "menu-item-standard-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"submenu-indicator-color": [CPNull null], diff --git a/AppKit/CPMenuItem/_CPMenuItemView.j b/AppKit/CPMenuItem/_CPMenuItemView.j index 568ba9d77..7156db2ed 100644 --- a/AppKit/CPMenuItem/_CPMenuItemView.j +++ b/AppKit/CPMenuItem/_CPMenuItemView.j @@ -53,7 +53,7 @@ return "menu-item-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{}; } diff --git a/AppKit/CPObjectController.j b/AppKit/CPObjectController.j index 497d35aed..ebdfcb43e 100644 --- a/AppKit/CPObjectController.j +++ b/AppKit/CPObjectController.j @@ -51,7 +51,7 @@ CPCountedSet _observedKeys; } -+ (id)initialize ++ (void)initialize { if (self !== [CPObjectController class]) return; @@ -572,7 +572,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo } } -- (void)insertObject:(id)anObject atIndex:(unsigned)anIndex +- (void)insertObject:(id)anObject atIndex:(CPUInteger)anIndex { for (var i = 0, count = [_observationProxies count]; i < count; i++) { @@ -592,7 +592,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo [super insertObject:anObject atIndex:anIndex]; } -- (void)removeObjectAtIndex:(unsigned)anIndex +- (void)removeObjectAtIndex:(CPUInteger)anIndex { var currentObject = [self objectAtIndex:anIndex]; @@ -614,7 +614,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo [super removeObjectAtIndex:anIndex]; } -- (_CPObservableArray)objectsAtIndexes:(CPIndexSet)theIndexes +- (CPArray)objectsAtIndexes:(CPIndexSet)theIndexes { return [_CPObservableArray arrayWithArray:[super objectsAtIndexes:theIndexes]]; } @@ -629,7 +629,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo [self removeObjectAtIndex:[self count]]; } -- (void)replaceObjectAtIndex:(unsigned)anIndex withObject:(id)anObject +- (void)replaceObjectAtIndex:(CPUInteger)anIndex withObject:(id)anObject { var currentObject = [self objectAtIndex:anIndex]; diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index efbf19d09..e0d7f1c3a 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -1803,7 +1803,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt return [_outlineView itemAtRow:theRow]; } -- (CPDragOperation)tableView:(CPTableView)aTableView validateDrop:(id < CPDraggingInfo >)theInfo +- (CPDragOperation)tableView:(CPTableView)aTableView validateDrop:(id /*< CPDraggingInfo >*/)theInfo proposedRow:(int)theRow proposedDropOperation:(CPTableViewDropOperation)theOperation { if (!(_outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_validateDrop_proposedItem_proposedChildIndex_)) @@ -1823,7 +1823,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt return [_outlineView._outlineViewDataSource outlineView:_outlineView validateDrop:theInfo proposedItem:parentItem proposedChildIndex:childIndex]; } -- (BOOL)tableView:(CPTableView)aTableView acceptDrop:(id )theInfo row:(int)theRow dropOperation:(CPTableViewDropOperation)theOperation +- (BOOL)tableView:(CPTableView)aTableView acceptDrop:(id /**/)theInfo row:(int)theRow dropOperation:(CPTableViewDropOperation)theOperation { if (!(_outlineView._implementedOutlineViewDataSourceMethods & CPOutlineViewDataSource_outlineView_acceptDrop_item_childIndex_)) return NO; @@ -1940,7 +1940,7 @@ var _loadItemInfoForItem = function(/*CPOutlineView*/ anOutlineView, /*id*/ anIt return self; } -- (void)setState:(CPState)aState +- (void)setState:(CPInteger)aState { [super setState:aState]; diff --git a/AppKit/CPPopUpButton.j b/AppKit/CPPopUpButton.j index 08800bf1b..01b1d7532 100644 --- a/AppKit/CPPopUpButton.j +++ b/AppKit/CPPopUpButton.j @@ -279,7 +279,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); Selects the item at the specified index @param anIndex the index of the item to select */ -- (void)setObjectValue:(int)anIndex +- (void)setObjectValue:(id)anIndex { var indexOfSelectedItem = [self objectValue]; @@ -344,7 +344,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); Returns the item at the specified index or \c nil if the item does not exist. @param anIndex the index of the item to obtain */ -- (CPMenuItem)itemAtIndex:(unsigned)anIndex +- (CPMenuItem)itemAtIndex:(CPUInteger)anIndex { return [[self menu] itemAtIndex:anIndex]; } @@ -353,7 +353,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); Returns the title of the item at the specified index or \c nil if no item exists. @param anIndex the index of the item */ -- (CPString)itemTitleAtIndex:(unsigned)anIndex +- (CPString)itemTitleAtIndex:(CPUInteger)anIndex { return [[[self menu] itemAtIndex:anIndex] title]; } @@ -838,7 +838,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); [self _setContentValuesIfNeeded:contentArray]; } -- (void)valueForBinding:(CPString)aBinding +- (id)valueForBinding:(CPString)aBinding { return [self _content]; } @@ -910,7 +910,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); { } -- (void)setValue:(id)aValue forBinding:(CPString)aBinding +- (void)setValue:(CPArray)aValue forBinding:(CPString)aBinding { [super _setContent:aValue]; } diff --git a/AppKit/CPRadio.j b/AppKit/CPRadio.j index 3953b790d..446578c7c 100644 --- a/AppKit/CPRadio.j +++ b/AppKit/CPRadio.j @@ -152,7 +152,7 @@ CPRadioImageOffset = 4.0; [_radioGroup _setSelectedRadio:self]; } -- (void)sendAction:(SEL)anAction to:(id)anObject +- (BOOL)sendAction:(SEL)anAction to:(id)anObject { [super sendAction:anAction to:anObject]; diff --git a/AppKit/CPRuleEditor/CPPredicateEditor.j b/AppKit/CPRuleEditor/CPPredicateEditor.j index 097d4f1b1..989268203 100644 --- a/AppKit/CPRuleEditor/CPPredicateEditor.j +++ b/AppKit/CPRuleEditor/CPPredicateEditor.j @@ -484,7 +484,7 @@ #pragma mark RuleEditor delegate methods -- (int)_queryNumberOfChildrenOfItem:(id)rowItem withRowType:(int)type +- (int)_queryNumberOfChildrenOfItem:(id)rowItem withRowType:(CPRuleEditorRowType)type { if (rowItem == nil) { @@ -494,7 +494,7 @@ return [[rowItem children] count]; } -- (id)_queryChild:(int)childIndex ofItem:(id)rowItem withRowType:(int)type +- (id)_queryChild:(int)childIndex ofItem:(id)rowItem withRowType:(CPRuleEditorRowType)type { if (rowItem == nil) { @@ -516,7 +516,7 @@ var CPPredicateTemplatesKey = @"CPPredicateTemplates"; @implementation CPPredicateEditor (CPCoding) -- (id)initWithCoder:(id)aCoder +- (id)initWithCoder:(CPCoder)aCoder { self = [super initWithCoder:aCoder]; @@ -531,7 +531,7 @@ var CPPredicateTemplatesKey = @"CPPredicateTemplates"; return self; } -- (void)encodeWithCoder:(id)aCoder +- (void)encodeWithCoder:(CPCoder)aCoder { [super encodeWithCoder:aCoder]; [aCoder encodeObject:_allTemplates forKey:CPPredicateTemplatesKey]; diff --git a/AppKit/CPRuleEditor/CPRuleEditor.j b/AppKit/CPRuleEditor/CPRuleEditor.j index 738af0e2d..df5733536 100644 --- a/AppKit/CPRuleEditor/CPRuleEditor.j +++ b/AppKit/CPRuleEditor/CPRuleEditor.j @@ -122,7 +122,7 @@ var CPRuleEditorItemPBoardType = @"CPRuleEditorItemPBoardType", return @"rule-editor"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"alternating-row-colors": [CPNull null], @@ -1684,7 +1684,7 @@ TODO: implement [super bind:aBinding toObject:observableController withKeyPath:aKeyPath options:options]; } -- (void)unbind:(id)object +- (void)unbind:(CPString)object { _rowClass = [_CPRuleEditorRowObject class]; [super unbind:object]; @@ -2128,7 +2128,7 @@ TODO: implement return YES; } -- (CPDragOperation)draggingEntered:(id < CPDraggingInfo >)sender +- (CPDragOperation)draggingEntered:(id /*< CPDraggingInfo >*/)sender { if ([sender draggingSource] === self) { @@ -2158,7 +2158,7 @@ TODO: implement _subviewIndexOfDropLine = CPNotFound; } -- (CPDragOperation)draggingUpdated:(id )sender +- (CPDragOperation)draggingUpdated:(id /**/)sender { var point = [self convertPoint:[sender draggingLocation] fromView:nil], y = point.y + _sliceHeight / 2, @@ -2195,12 +2195,12 @@ TODO: implement return CPDragOperationMove; } -- (BOOL)prepareForDragOperation:(id < CPDraggingInfo >)sender +- (BOOL)prepareForDragOperation:(id /*< CPDraggingInfo >*/)sender { return (_subviewIndexOfDropLine !== CPNotFound); } -- (BOOL)performDragOperation:(id < CPDraggingInfo >)info +- (BOOL)performDragOperation:(id /*< CPDraggingInfo >*/)info { var aboveInsertIndexCount = 0, object, @@ -2262,7 +2262,7 @@ TODO: implement { } -- (void)_setWindow:(id)window +- (void)_setWindow:(CPWindow)window { [super _setWindow:window]; } @@ -2426,7 +2426,7 @@ var CPRuleEditorAlignmentGridWidthKey = @"CPRuleEditorAlignmentGridWidth", return self; } -- (void)encodeWithCoder:(id)coder +- (void)encodeWithCoder:(CPCoder)coder { [super encodeWithCoder:coder]; @@ -2481,7 +2481,7 @@ var CriteriaKey = @"criteria", return "<" + [self className] + ">\nsubrows = " + [subrows description] + "\ncriteria = " + [criteria description] + "\ndisplayValues = " + [displayValues description]; } -- (id)initWithCoder:(id)coder +- (id)initWithCoder:(CPCoder)coder { self = [super init]; if (self !== nil) @@ -2495,7 +2495,7 @@ var CriteriaKey = @"criteria", return self; } -- (void)encodeWithCoder:(id)coder +- (void)encodeWithCoder:(CPCoder)coder { [coder encodeObject:subrows forKey:SubrowsKey]; [coder encodeObject:criteria forKey:CriteriaKey]; @@ -2534,7 +2534,7 @@ var CPBoundArrayKey = @"CPBoundArray"; return self; } -- (id)initWithCoder:(id)coder +- (id)initWithCoder:(CPCoder)coder { if (self = [super init]) boundArray = [coder decodeObjectForKey:CPBoundArrayKey]; @@ -2542,7 +2542,7 @@ var CPBoundArrayKey = @"CPBoundArray"; return self; } -- (void)encodeWithCoder:(id)coder +- (void)encodeWithCoder:(CPCoder)coder { [coder encodeObject:boundArray forKey:CPBoundArrayKey]; } diff --git a/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j b/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j index 3b48eff50..d70c6d6f3 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorPopUpButton.j @@ -86,7 +86,7 @@ else if (CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) return self; } -- (id)hitTest:(CGPoint)point +- (CPView)hitTest:(CGPoint)point { if (!CGRectContainsPoint([self frame], point) || ![self sliceIsEditable]) return nil; @@ -100,12 +100,12 @@ else if (CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) return ![superview isKindOfClass:[_CPRuleEditorViewSlice]] || [superview isEditable]; } -- (BOOL)trackMouse:(CPEvent)theEvent +- (void)trackMouse:(CPEvent)theEvent { if (![self sliceIsEditable]) - return NO; + return; - return [super trackMouse:theEvent]; + [super trackMouse:theEvent]; } - (CGRect)contentRectForBounds:(CGRect)bounds diff --git a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j index bb00c8e21..20b573790 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j @@ -522,7 +522,7 @@ var CONTROL_HEIGHT = 16., return self; } -- (id)hitTest:(CGPoint)point +- (CPView)hitTest:(CGPoint)point { if (!CGRectContainsPoint([self frame], point)) return nil; diff --git a/AppKit/CPScroller.j b/AppKit/CPScroller.j index e0dcdc97c..6561af112 100644 --- a/AppKit/CPScroller.j +++ b/AppKit/CPScroller.j @@ -108,7 +108,7 @@ CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark"); return "scroller"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"scroller-width": 7.0, diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index 4fea175d5..d7346f9ed 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -458,7 +458,7 @@ var RECENT_SEARCH_PREFIX = @" "; [self sendAction:[self action] to:[self target]]; } -- (void)sendAction:(SEL)anAction to:(id)anObject +- (BOOL)sendAction:(SEL)anAction to:(id)anObject { [super sendAction:anAction to:anObject]; diff --git a/AppKit/CPSegmentedControl.j b/AppKit/CPSegmentedControl.j index 28f8bdc95..3bf94a0c2 100644 --- a/AppKit/CPSegmentedControl.j +++ b/AppKit/CPSegmentedControl.j @@ -56,7 +56,7 @@ CPSegmentSwitchTrackingMomentary = 2; return "segmented-control"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"alignment": CPCenterTextAlignment, diff --git a/AppKit/CPShadowView.j b/AppKit/CPShadowView.j index 942477ecf..5fcc5c26c 100644 --- a/AppKit/CPShadowView.j +++ b/AppKit/CPShadowView.j @@ -47,7 +47,7 @@ CPThemeStateShadowViewHeavy = CPThemeState("shadowview-style-heavy"); return "shadow-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-color": [CPNull null], diff --git a/AppKit/CPSlider.j b/AppKit/CPSlider.j index b9b7e92da..2190118d2 100644 --- a/AppKit/CPSlider.j +++ b/AppKit/CPSlider.j @@ -49,7 +49,7 @@ CPCircularSlider = 1; return "slider"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"knob-color": [CPNull null], diff --git a/AppKit/CPSplitView.j b/AppKit/CPSplitView.j index 7e62a4d5d..15201a59a 100644 --- a/AppKit/CPSplitView.j +++ b/AppKit/CPSplitView.j @@ -103,7 +103,7 @@ var ShouldSuppressResizeNotifications = 1, return @"splitview"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"divider-thickness": 1.0, @@ -995,7 +995,7 @@ The sum of the views and the sum of the dividers should be equal to the size of @param unsigned int - The divider index the button bar will be assigned to. */ // FIXME Should be renamed to setButtonBar:ofDividerAtIndex:. -- (void)setButtonBar:(CPButtonBar)aButtonBar forDividerAtIndex:(unsigned)dividerIndex +- (void)setButtonBar:(CPButtonBar)aButtonBar forDividerAtIndex:(CPUInteger)dividerIndex { if (!aButtonBar) { diff --git a/AppKit/CPStepper.j b/AppKit/CPStepper.j index 0e7fc7586..ba5da1462 100644 --- a/AppKit/CPStepper.j +++ b/AppKit/CPStepper.j @@ -213,7 +213,7 @@ Set the current value of the stepper. @param aValue a float containing the value */ -- (void)setDoubleValue:(float)aValue +- (void)setDoubleValue:(double)aValue { if (aValue > _maxValue) [super setDoubleValue:_valueWraps ? _minValue : _maxValue]; @@ -267,7 +267,7 @@ return @"stepper"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-color-up-button": [CPNull null], diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index b6874a01b..06f216b8c 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -107,7 +107,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1, @param aTabViewItem the item to insert @param anIndex the index for the item */ -- (void)insertTabViewItem:(CPTabViewItem)aTabViewItem atIndex:(unsigned)anIndex +- (void)insertTabViewItem:(CPTabViewItem)aTabViewItem atIndex:(CPUInteger)anIndex { [_items insertObject:aTabViewItem atIndex:anIndex]; @@ -183,7 +183,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1, Returns the CPTabViewItem at the specified index. @return a tab view item, or nil */ -- (CPTabViewItem)tabViewItemAtIndex:(unsigned)anIndex +- (CPTabViewItem)tabViewItemAtIndex:(CPUInteger)anIndex { return [_items objectAtIndex:anIndex]; } @@ -270,7 +270,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1, Selects the item at the specified index. @param anIndex the index of the item to display. */ -- (BOOL)selectTabViewItemAtIndex:(unsigned)anIndex +- (BOOL)selectTabViewItemAtIndex:(CPUInteger)anIndex { if (anIndex === _selectedIndex) return; diff --git a/AppKit/CPTableColumn.j b/AppKit/CPTableColumn.j index 823fdc73a..01c156b90 100644 --- a/AppKit/CPTableColumn.j +++ b/AppKit/CPTableColumn.j @@ -595,7 +595,7 @@ CPTableColumnUserResizingMask = 1 << 1; @implementation CPTableColumn (Bindings) -+ (id)_binderClassForBinding:(CPString)aBinding ++ (Class)_binderClassForBinding:(CPString)aBinding { if (aBinding == CPValueBinding) return [CPTableColumnValueBinder class]; diff --git a/AppKit/CPTableHeaderView.j b/AppKit/CPTableHeaderView.j index c98fab98b..9db2b6c06 100644 --- a/AppKit/CPTableHeaderView.j +++ b/AppKit/CPTableHeaderView.j @@ -43,7 +43,7 @@ return @"columnHeader"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"background-color": [CPNull null], @@ -57,7 +57,7 @@ }; } -- (void)initWithFrame:(CGRect)frame +- (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; @@ -246,7 +246,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal return @"tableHeaderRow"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"background-color": [CPNull null], diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index e6e4928db..ebb0fefca 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -286,7 +286,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5; /*! @ignore */ -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"alternating-row-colors": [CPNull null], @@ -5142,7 +5142,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad /*! @ignore */ -- (id)hitTest:(CGPoint)aPoint +- (CPView)hitTest:(CGPoint)aPoint { var hit = [super hitTest:aPoint]; @@ -5368,7 +5368,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad @implementation CPTableView (Bindings) -+ (id)_binderClassForBinding:(CPString)aBinding ++ (Class)_binderClassForBinding:(CPString)aBinding { if (aBinding == @"content") return [CPTableContentBinder class]; @@ -5425,7 +5425,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad id _content @accessors(property=content); } -- (void)setValueFor:(id)aBinding +- (void)setValueFor:(CPString)aBinding { var destination = [_info objectForKey:CPObservedObjectKey], keyPath = [_info objectForKey:CPObservedKeyPathKey]; @@ -5738,13 +5738,13 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey", [self setThemeState:CPThemeStateTableDataView]; } -- (void)setThemeState:(CPThemeState)aState +- (BOOL)setThemeState:(CPThemeState)aState { [super setThemeState:aState]; [self recursivelyPerformSelector:@selector(setThemeState:) withObject:aState startingFrom:self]; } -- (void)unsetThemeState:(CPThemeState)aState +- (BOOL)unsetThemeState:(CPThemeState)aState { [super unsetThemeState:aState]; [self recursivelyPerformSelector:@selector(unsetThemeState:) withObject:aState startingFrom:self]; diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 3e8a48739..3bf585ec9 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -209,7 +209,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); return "textfield"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"bezel-inset": CGInsetMakeZero(), @@ -1719,7 +1719,7 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey", @implementation _CPTextFieldValueBinder : CPBinder -- (void)_updatePlaceholdersWithOptions:(CPDictionary)options forBinding:(CPBinder)aBinding +- (void)_updatePlaceholdersWithOptions:(CPDictionary)options forBinding:(CPString)aBinding { [super _updatePlaceholdersWithOptions:options]; diff --git a/AppKit/CPTokenField.j b/AppKit/CPTokenField.j index 004459a65..40a76526d 100644 --- a/AppKit/CPTokenField.j +++ b/AppKit/CPTokenField.j @@ -98,7 +98,7 @@ CPTokenFieldDeleteButtonType = 1; return "tokenfield"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"editor-inset": CGInsetMakeZero() }; } @@ -645,7 +645,7 @@ CPTokenFieldDeleteButtonType = 1; [[self _tokens] makeObjectsPerformSelector:@selector(setEditable:) withObject:shouldBeEditable]; } -- (void)sendAction:(SEL)anAction to:(id)anObject +- (BOOL)sendAction:(SEL)anAction to:(id)anObject { _shouldNotifyTarget = NO; [super sendAction:anAction to:anObject]; @@ -653,7 +653,7 @@ CPTokenFieldDeleteButtonType = 1; // Incredible hack to disable supers implementation // so it cannot change our object value and break the tokenfield -- (void)_setStringValue:(id)aValue +- (BOOL)_setStringValue:(CPString)aValue { } @@ -1541,7 +1541,7 @@ CPTokenFieldDeleteButtonType = 1; { } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { var attributes = [CPButton themeAttributes]; @@ -1571,7 +1571,7 @@ CPTokenFieldDeleteButtonType = 1; { } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { var attributes = [CPButton themeAttributes]; diff --git a/AppKit/CPToolbar.j b/AppKit/CPToolbar.j index ae1857926..86ee9d721 100644 --- a/AppKit/CPToolbar.j +++ b/AppKit/CPToolbar.j @@ -594,7 +594,7 @@ var _CPToolbarItemInfoMake = function(anIndex, aView, aLabel, aMinWidth) return @"toolbar-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"item-margin": 10.0, @@ -1216,7 +1216,7 @@ var LABEL_MARGIN = 2.0; [_labelField setTextShadowColor:[self FIXME_labelShadowColor]]; } -- (void)sendAction:(SEL)anAction to:(id)aSender +- (BOOL)sendAction:(SEL)anAction to:(id)aSender { [CPApp sendAction:anAction to:aSender from:_toolbarItem]; } diff --git a/AppKit/CPViewAnimation.j b/AppKit/CPViewAnimation.j index 85f76e2a2..f90ca2f99 100644 --- a/AppKit/CPViewAnimation.j +++ b/AppKit/CPViewAnimation.j @@ -105,7 +105,7 @@ CPViewAnimationFadeOutEffect = @"CPViewAnimationFadeOutEffect"; [super startAnimation]; } -- (void)setCurrentProgress:(CPAnimationProgress)progress +- (void)setCurrentProgress:(float)progress { [super setCurrentProgress:progress]; diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 51abbf76a..40713f70f 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -248,7 +248,7 @@ CPTexturedBackgroundWindowMask @param aStyleMask a style mask @return the initialized window */ -- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned int)aStyleMask +- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned)aStyleMask { self = [super init]; diff --git a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j index b726343bb..26fe1fe6f 100644 --- a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j +++ b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j @@ -32,7 +32,7 @@ return @"bordeless-bridge-window-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"toolbar-background-color": [CPColor grayColor], diff --git a/AppKit/CPWindow/_CPDocModalWindowView.j b/AppKit/CPWindow/_CPDocModalWindowView.j index 775b9542d..c1219c22c 100644 --- a/AppKit/CPWindow/_CPDocModalWindowView.j +++ b/AppKit/CPWindow/_CPDocModalWindowView.j @@ -33,7 +33,7 @@ return @"doc-modal-window-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"body-color": [CPColor whiteColor], diff --git a/AppKit/CPWindow/_CPPopoverWindowView.j b/AppKit/CPWindow/_CPPopoverWindowView.j index 554f362e2..b337be625 100644 --- a/AppKit/CPWindow/_CPPopoverWindowView.j +++ b/AppKit/CPWindow/_CPPopoverWindowView.j @@ -50,7 +50,7 @@ var _CPPopoverWindowViewDefaultCursorSize = CGSizeMake(16, 10); return @"popover-window-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"background-gradient": [CPNull null], diff --git a/AppKit/CPWindow/_CPShadowWindowView.j b/AppKit/CPWindow/_CPShadowWindowView.j index d7095a750..cd0cec03c 100644 --- a/AppKit/CPWindow/_CPShadowWindowView.j +++ b/AppKit/CPWindow/_CPShadowWindowView.j @@ -41,7 +41,7 @@ return @"shadow-window-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{}; } diff --git a/AppKit/CPWindow/_CPStandardWindowView.j b/AppKit/CPWindow/_CPStandardWindowView.j index b7aedf1ce..d8ea56ceb 100644 --- a/AppKit/CPWindow/_CPStandardWindowView.j +++ b/AppKit/CPWindow/_CPStandardWindowView.j @@ -41,7 +41,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; return @"textured-window-head-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{}; } @@ -108,7 +108,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0; return @"standard-window-view"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"gradient-height": [CPNull null], diff --git a/AppKit/CPWindow/_CPToolTipWindowView.j b/AppKit/CPWindow/_CPToolTipWindowView.j index 423725fb7..b06c77863 100644 --- a/AppKit/CPWindow/_CPToolTipWindowView.j +++ b/AppKit/CPWindow/_CPToolTipWindowView.j @@ -38,7 +38,7 @@ return @"tooltip"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"stroke-color": [CPColor colorWithHexString:@"E3E3E3"], diff --git a/AppKit/CPWindow/_CPWindowView.j b/AppKit/CPWindow/_CPWindowView.j index c874ec409..0ffd01121 100644 --- a/AppKit/CPWindow/_CPWindowView.j +++ b/AppKit/CPWindow/_CPWindowView.j @@ -81,7 +81,7 @@ _CPWindowViewResizeSlop = 3; return "window"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"title-bar-height": 25, diff --git a/AppKit/CoreAnimation/CALayer.j b/AppKit/CoreAnimation/CALayer.j index 066ff8437..dbe2c3dee 100644 --- a/AppKit/CoreAnimation/CALayer.j +++ b/AppKit/CoreAnimation/CALayer.j @@ -687,7 +687,7 @@ if (_DOMContentsElement && aLayer._zPosition > _DOMContentsElement.style.zIndex) @param aLayer the layer to insert @param anIndex the index to insert the layer at */ -- (void)insertSublayer:(CALayer)aLayer atIndex:(unsigned)anIndex +- (void)insertSublayer:(CALayer)aLayer atIndex:(CPUInteger)anIndex { if (!aLayer) return; diff --git a/AppKit/CoreAnimation/CAMediaTimingFunction.j b/AppKit/CoreAnimation/CAMediaTimingFunction.j index 77d953921..a80306b42 100644 --- a/AppKit/CoreAnimation/CAMediaTimingFunction.j +++ b/AppKit/CoreAnimation/CAMediaTimingFunction.j @@ -75,7 +75,7 @@ var CAMediaNamedTimingFunctions = nil; return self; } -- (void)getControlPointAtIndex:(unsigned)anIndex values:(float/*[2]*/)reference +- (void)getControlPointAtIndex:(CPUInteger)anIndex values:(float/*[2]*/)reference { if (anIndex == 0) { diff --git a/AppKit/Platform/DOM/CPDOMWindowLayer.j b/AppKit/Platform/DOM/CPDOMWindowLayer.j index 5ef90849d..144b8f84a 100644 --- a/AppKit/Platform/DOM/CPDOMWindowLayer.j +++ b/AppKit/Platform/DOM/CPDOMWindowLayer.j @@ -78,7 +78,7 @@ aWindow._isVisible = NO; } -- (void)insertWindow:(CPWindow)aWindow atIndex:(unsigned)anIndex +- (void)insertWindow:(CPWindow)aWindow atIndex:(CPUInteger)anIndex { // We will have to adjust the z-index of all windows starting at this index. var count = [_windows count], diff --git a/AppKit/_CPAutocompleteMenu.j b/AppKit/_CPAutocompleteMenu.j index 2d2d2f01a..5947ead97 100644 --- a/AppKit/_CPAutocompleteMenu.j +++ b/AppKit/_CPAutocompleteMenu.j @@ -280,7 +280,7 @@ var _CPAutocompleteMenuMaximumHeight = 307; @implementation _CPAutocompleteWindow : CPPanel -- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned int)aStyleMask +- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned)aStyleMask { if (self = [super initWithContentRect:aContentRect styleMask:aStyleMask]) _constrainsToUsableScreen = NO; diff --git a/AppKit/_CPCornerView.j b/AppKit/_CPCornerView.j index 02371b3c5..8f777f1bb 100644 --- a/AppKit/_CPCornerView.j +++ b/AppKit/_CPCornerView.j @@ -31,7 +31,7 @@ return @"cornerview"; } -+ (id)themeAttributes ++ (CPDictionary)themeAttributes { return @{ @"background-color": [CPNull null], diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index c5582c129..892bd20f2 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -218,7 +218,7 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, [self setNeedsLayout]; } -- (void)imageScaling +- (CPUInteger)imageScaling { return _imageScaling; } diff --git a/AppKit/_CPPopUpList.j b/AppKit/_CPPopUpList.j index dc8a74227..d17684e4b 100644 --- a/AppKit/_CPPopUpList.j +++ b/AppKit/_CPPopUpList.j @@ -853,7 +853,7 @@ var _CPPopUpListDataSourceKey = @"_CPPopUpListDataSourceKey", @implementation _CPPopUpPanel : CPPanel -- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned int)aStyleMask +- (id)initWithContentRect:(CGRect)aContentRect styleMask:(unsigned)aStyleMask { if (self = [super initWithContentRect:aContentRect styleMask:aStyleMask]) _constrainsToUsableScreen = NO; diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index 8e24bdee0..2f7f5b4e4 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -399,7 +399,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 0, @param sender the sender of the action */ -- (IBAction)orderFront:(is)aSender +- (IBAction)orderFront:(id)aSender { if (![self isKeyWindow]) { diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1bde4969b..b32c82d6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -598,7 +598,7 @@ Use descriptive parameter types, despite not being fully supported in JavaScript ##### Right: - - (char)characterAtIndex:(unsigned)anIndex; + - (char)characterAtIndex:(CPUInteger)anIndex; - (void)insertObject:(id)anObject; ##### Wrong: diff --git a/Foundation/CPArray+KVO.j b/Foundation/CPArray+KVO.j index 18a71a031..33fc4791f 100644 --- a/Foundation/CPArray+KVO.j +++ b/Foundation/CPArray+KVO.j @@ -197,7 +197,7 @@ [_proxyObject setValue:anObject forKey:_key]; } -- (unsigned)count +- (CPUInteger)count { if (_count) return _count(_proxyObject, _countSEL); @@ -205,7 +205,7 @@ return [[self _representedObject] count]; } -- (int)indexOfObject:(CPObject)anObject inRange:(CPRange)aRange +- (CPUInteger)indexOfObject:(id)anObject inRange:(CPRange)aRange { var index = aRange.location, count = aRange.length, @@ -222,12 +222,12 @@ return CPNotFound; } -- (int)indexOfObject:(CPObject)anObject +- (CPUInteger)indexOfObject:(id)anObject { return [self indexOfObject:anObject inRange:CPMakeRange(0, [self count])]; } -- (int)indexOfObjectIdenticalTo:(CPObject)anObject inRange:(CPRange)aRange +- (CPUInteger)indexOfObjectIdenticalTo:(id)anObject inRange:(CPRange)aRange { var index = aRange.location, count = aRange.length; @@ -239,12 +239,12 @@ return CPNotFound; } -- (int)indexOfObjectIdenticalTo:(CPObject)anObject +- (CPUInteger)indexOfObjectIdenticalTo:(id)anObject { return [self indexOfObjectIdenticalTo:anObject inRange:CPMakeRange(0, [self count])]; } -- (id)objectAtIndex:(unsigned)anIndex +- (id)objectAtIndex:(CPUInteger)anIndex { return [[self objectsAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]] firstObject]; } @@ -281,7 +281,7 @@ [self insertObjects:anArray atIndexes:[CPIndexSet indexSetWithIndexesInRange:CPMakeRange([self count], count)]]; } -- (void)insertObject:(id)anObject atIndex:(unsigned)anIndex +- (void)insertObject:(id)anObject atIndex:(CPUInteger)anIndex { [self insertObjects:[anObject] atIndexes:[CPIndexSet indexSetWithIndex:anIndex]]; } @@ -378,7 +378,7 @@ [self removeObjectsAtIndexes:[CPIndexSet indexSetWithIndex:[self count] - 1]]; } -- (void)removeObjectAtIndex:(unsigned)anIndex +- (void)removeObjectAtIndex:(CPUInteger)anIndex { [self removeObjectsAtIndexes:[CPIndexSet indexSetWithIndex:anIndex]]; } @@ -405,7 +405,7 @@ } } -- (void)replaceObjectAtIndex:(unsigned)anIndex withObject:(id)anObject +- (void)replaceObjectAtIndex:(CPUInteger)anIndex withObject:(id)anObject { [self replaceObjectsAtIndexes:[CPIndexSet indexSetWithIndex:anIndex] withObjects:[anObject]] } @@ -564,7 +564,7 @@ /*! Registers an observer to receive key value observer notifications for the specified key-path relative to the objects at the indexes. */ -- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(unsigned)options context:(id)context +- (void)addObserver:(id)anObserver toObjectsAtIndexes:(CPIndexSet)indexes forKeyPath:(CPString)aKeyPath options:(CPKeyValueObservingOptions)options context:(id)context { var index = [indexes firstIndex]; diff --git a/Foundation/CPArray/CPMutableArray.j b/Foundation/CPArray/CPMutableArray.j index e15ccb138..ec4a7769c 100644 --- a/Foundation/CPArray/CPMutableArray.j +++ b/Foundation/CPArray/CPMutableArray.j @@ -21,7 +21,7 @@ items. Because CPArray is backed by JavaScript arrays, this method ends up simply returning a regular array. */ -+ (CPArray)arrayWithCapacity:(unsigned)aCapacity ++ (CPArray)arrayWithCapacity:(CPUInteger)aCapacity { return [[self alloc] initWithCapacity:aCapacity]; } @@ -30,7 +30,7 @@ Initializes an array able to store at least \c aCapacity items. Because CPArray is backed by JavaScript arrays, this method ends up simply returning a regular array. */ -/*- (id)initWithCapacity:(unsigned)aCapacity +/*- (id)initWithCapacity:(CPUInteger)aCapacity { return self; }*/ @@ -63,7 +63,7 @@ @param anObject the object to insert into the array @param anIndex the location to insert \c anObject at */ -- (void)insertObject:(id)anObject atIndex:(int)anIndex +- (void)insertObject:(id)anObject atIndex:(CPUInteger)anIndex { _CPRaiseInvalidAbstractInvocation(self, _cmd); } @@ -93,7 +93,7 @@ [self insertObject:[objects objectAtIndex:index] atIndex:currentIndex]; } -- (unsigned)insertObject:(id)anObject inArraySortedByDescriptors:(CPArray)descriptors +- (CPUInteger)insertObject:(id)anObject inArraySortedByDescriptors:(CPArray)descriptors { var index, count = [descriptors count]; @@ -126,7 +126,7 @@ The current element at position \c anIndex will be removed from the array. @param anIndex the position in the array to place \c anObject */ -- (void)replaceObjectAtIndex:(int)anIndex withObject:(id)anObject +- (void)replaceObjectAtIndex:(CPUInteger)anIndex withObject:(id)anObject { _CPRaiseInvalidAbstractInvocation(self, _cmd); } @@ -241,7 +241,7 @@ Removes the object at \c anIndex. @param anIndex the location of the element to be removed */ -- (void)removeObjectAtIndex:(int)anIndex +- (void)removeObjectAtIndex:(CPUInteger)anIndex { _CPRaiseInvalidAbstractInvocation(self, _cmd); } @@ -322,7 +322,7 @@ @param anIndex the first index to swap from @param otherIndex the second index to swap from */ -- (void)exchangeObjectAtIndex:(unsigned)anIndex withObjectAtIndex:(unsigned)otherIndex +- (void)exchangeObjectAtIndex:(CPUInteger)anIndex withObjectAtIndex:(CPUInteger)otherIndex { if (anIndex === otherIndex) return; diff --git a/Foundation/CPArray/_CPArray.j b/Foundation/CPArray/_CPArray.j index 5ecb8a6cb..093023904 100755 --- a/Foundation/CPArray/_CPArray.j +++ b/Foundation/CPArray/_CPArray.j @@ -122,7 +122,7 @@ var concat = Array.prototype.concat, @param aCount the number of objects in the JS Array @return a new CPArray containing the specified objects */ -+ (id)arrayWithObjects:(id)objects count:(unsigned)aCount ++ (id)arrayWithObjects:(id)objects count:(CPUInteger)aCount { return [[self alloc] initWithObjects:objects count:aCount]; } @@ -174,13 +174,13 @@ var concat = Array.prototype.concat, @param aCount the number of objects in \c objects @return the initialized CPArray */ -- (id)initWithObjects:(id)objects count:(unsigned)aCount +- (id)initWithObjects:(CPArray)objects count:(CPUInteger)aCount { FORWARD_TO_CONCRETE_CLASS(); } // FIXME: This should be defined in CPMutableArray, not here. -- (id)initWithCapacity:(unsigned)aCapacity +- (id)initWithCapacity:(CPUInteger)aCapacity { FORWARD_TO_CONCRETE_CLASS(); } @@ -203,7 +203,7 @@ var concat = Array.prototype.concat, /*! Returns the number of elements in the array */ -- (int)count +- (CPUInteger)count { _CPRaiseInvalidAbstractInvocation(self, _cmd); } @@ -238,7 +238,7 @@ var concat = Array.prototype.concat, Returns the object at index \c anIndex. @throws CPRangeException if \c anIndex is out of bounds */ -- (id)objectAtIndex:(int)anIndex +- (id)objectAtIndex:(CPUInteger)anIndex { _CPRaiseInvalidAbstractInvocation(self, _cmd); } diff --git a/Foundation/CPArray/_CPJavaScriptArray.j b/Foundation/CPArray/_CPJavaScriptArray.j index b11c78767..c3765ad2e 100644 --- a/Foundation/CPArray/_CPJavaScriptArray.j +++ b/Foundation/CPArray/_CPJavaScriptArray.j @@ -19,7 +19,7 @@ var concat = Array.prototype.concat, return []; } -+ (CPArray)array ++ (id)array { return []; } @@ -107,7 +107,7 @@ var concat = Array.prototype.concat, return self; } -- (BOOL)count +- (CPUInteger)count { return self.length; } @@ -230,7 +230,7 @@ var concat = Array.prototype.concat, return join.call(self, aString); } -- (void)insertObject:(id)anObject atIndex:(int)anIndex +- (void)insertObject:(id)anObject atIndex:(CPUInteger)anIndex { if (anIndex > self.length || anIndex < 0) _CPRaiseRangeException(self, _cmd, anIndex, self.length); @@ -238,7 +238,7 @@ var concat = Array.prototype.concat, splice.call(self, anIndex, 0, anObject); } -- (void)removeObjectAtIndex:(int)anIndex +- (void)removeObjectAtIndex:(CPUInteger)anIndex { if (anIndex >= self.length || anIndex < 0) _CPRaiseRangeException(self, _cmd, anIndex, self.length); @@ -289,7 +289,7 @@ var concat = Array.prototype.concat, splice.call(self, aRange.location, aRange.length); } -- (void)replaceObjectAtIndex:(int)anIndex withObject:(id)anObject +- (void)replaceObjectAtIndex:(CPUInteger)anIndex withObject:(id)anObject { if (anIndex >= self.length || anIndex < 0) _CPRaiseRangeException(self, _cmd, anIndex, self.length); @@ -333,7 +333,7 @@ var concat = Array.prototype.concat, } -- (void)copy +- (id)copy { return slice.call(self, 0); } diff --git a/Foundation/CPAttributedString.j b/Foundation/CPAttributedString.j index 337ccc722..beee46e8d 100644 --- a/Foundation/CPAttributedString.j +++ b/Foundation/CPAttributedString.j @@ -179,7 +179,7 @@ character at index \c anIndex. Returns an empty dictionary if index is out of bounds. */ -- (CPDictionary)attributesAtIndex:(unsigned)anIndex effectiveRange:(CPRangePointer)aRange +- (CPDictionary)attributesAtIndex:(CPUInteger)anIndex effectiveRange:(CPRangePointer)aRange { // find the range entry that contains anIndex. var entryIndex = [self _indexOfEntryWithIndex:anIndex]; @@ -219,7 +219,7 @@ character at index \c anIndex. Returns an empty dictionary if index is out of bounds. */ -- (CPDictionary)attributesAtIndex:(unsigned)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit +- (CPDictionary)attributesAtIndex:(CPUInteger)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit { var startingEntryIndex = [self _indexOfEntryWithIndex:anIndex]; @@ -295,7 +295,7 @@ @return the named attribute or \c nil is the attribute does not exist. */ -- (id)attribute:(CPString)attribute atIndex:(unsigned)index effectiveRange:(CPRangePointer)aRange +- (id)attribute:(CPString)attribute atIndex:(CPUInteger)index effectiveRange:(CPRangePointer)aRange { if (!attribute) { @@ -332,7 +332,7 @@ @return the named attribute or \c nil is the attribute does not exist. */ -- (id)attribute:(CPString)attribute atIndex:(unsigned)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit +- (id)attribute:(CPString)attribute atIndex:(CPUInteger)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit { var startingEntryIndex = [self _indexOfEntryWithIndex:anIndex]; @@ -690,7 +690,7 @@ @param anIndex the index at which the insert is to occur. @exception CPRangeException If the index is out of bounds. */ -- (void)insertAttributedString:(CPAttributedString)aString atIndex:(unsigned)anIndex +- (void)insertAttributedString:(CPAttributedString)aString atIndex:(CPUInteger)anIndex { if (anIndex < 0 || anIndex > [self length]) [CPException raise:CPRangeException reason:"tried to insert attributed string at an invalid index: "+anIndex]; diff --git a/Foundation/CPByteCountFormatter.j b/Foundation/CPByteCountFormatter.j index 0d04b4c34..c04baaa8d 100644 --- a/Foundation/CPByteCountFormatter.j +++ b/Foundation/CPByteCountFormatter.j @@ -214,7 +214,7 @@ var CPByteCountFormatterUnits = [ @"bytes", @"KB", @"MB", @"GB", @"TB", @"PB" ]; return nil; } -- (BOOL)getObjectValue:(id)anObject forString:(CPString)aString errorDescription:(CPString)anError +- (BOOL)getObjectValue:(idRef)anObject forString:(CPString)aString errorDescription:(CPStringRef)anError { // Not implemented return NO; diff --git a/Foundation/CPDateFormatter.j b/Foundation/CPDateFormatter.j index aa5138786..3743e62b3 100644 --- a/Foundation/CPDateFormatter.j +++ b/Foundation/CPDateFormatter.j @@ -1201,7 +1201,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4, @param anError, if it returns NO the describe error will be in anError (use of ref) @return aBoolean for the success or fail of the method */ -- (BOOL)getObjectValue:(id)anObject forString:(CPString)aString errorDescription:(CPString)anError +- (BOOL)getObjectValue:(idRef)anObject forString:(CPString)aString errorDescription:(CPStringRef)anError { var value = [self dateFromString:aString]; @deref(anObject) = value; diff --git a/Foundation/CPDecimalNumber.j b/Foundation/CPDecimalNumber.j index c7b78d218..7221cd2e5 100644 --- a/Foundation/CPDecimalNumber.j +++ b/Foundation/CPDecimalNumber.j @@ -130,7 +130,20 @@ var CPDefaultDcmHandler = nil; @end // CPDecimalNumberBehaviors protocol -@implementation CPDecimalNumberHandler (CPDecimalNumberBehaviors) + +@protocol CPDecimalNumberBehaviors + +- (CPRoundingMode)roundingMode; + +- (short)scale; + // The scale could return NO_SCALE for no defined scale. + +- (CPDecimalNumber)exceptionDuringOperation:(SEL)operation error:(CPCalculationError)error leftOperand:(CPDecimalNumber)leftOperand rightOperand:(CPDecimalNumber)rightOperand; + // Receiver can raise, return a new value, or return nil to ignore the exception. + +@end + +@implementation CPDecimalNumberHandler (CPDecimalNumberBehaviors) /*! Returns the current rounding mode. One of \e CPRoundingMode enum: diff --git a/Foundation/CPError.j b/Foundation/CPError.j index 34a53bee5..4acafe2ce 100644 --- a/Foundation/CPError.j +++ b/Foundation/CPError.j @@ -91,7 +91,7 @@ CPFilePathErrorKey = @"CPFilePathErrorKey"; return [_userInfo objectForKey:CPRecoveryAttempterErrorKey]; } -- (id)description +- (CPString)description { return [CPString stringWithFormat:@"Error Domain=%@ Code=%d UserInfo=%p %@", _domain, _code, _userInfo, [self localizedDescription]]; } diff --git a/Foundation/CPIndexSet.j b/Foundation/CPIndexSet.j index b2a362300..c9f94fddb 100644 --- a/Foundation/CPIndexSet.j +++ b/Foundation/CPIndexSet.j @@ -1187,5 +1187,5 @@ X - (void)addIndex:(unsigned int)value; X - (void)removeIndex:(unsigned int)value; X - (void)addIndexesInRange:(NSRange)range; X - (void)removeIndexesInRange:(NSRange)range; - - (void)shiftIndexesStartingAtIndex:(unsigned int)index by:(int)delta; + - (void)shiftIndexesStartingAtIndex:(CPUInteger)index by:(int)delta; */ diff --git a/Foundation/CPInvocation.j b/Foundation/CPInvocation.j index 7cc5fbe32..a07b48952 100644 --- a/Foundation/CPInvocation.j +++ b/Foundation/CPInvocation.j @@ -105,7 +105,7 @@ @param anArgument the argument to add @param anIndex the index of the argument in the method */ -- (void)setArgument:(id)anArgument atIndex:(unsigned)anIndex +- (void)setArgument:(id)anArgument atIndex:(CPUInteger)anIndex { _arguments[anIndex] = anArgument; } @@ -116,7 +116,7 @@ @param anIndex the index of the argument to return @throws CPInvalidArgumentException if anIndex is greater than or equal to the invocation's number of arguments. */ -- (id)argumentAtIndex:(unsigned)anIndex +- (id)argumentAtIndex:(CPUInteger)anIndex { return _arguments[anIndex]; } diff --git a/Foundation/CPKeyValueObserving.j b/Foundation/CPKeyValueObserving.j index 308cb0f6e..5dc1257a0 100644 --- a/Foundation/CPKeyValueObserving.j +++ b/Foundation/CPKeyValueObserving.j @@ -135,7 +135,7 @@ } } -- (void)addObserver:(id)anObserver forKeyPath:(CPString)aPath options:(unsigned)options context:(id)aContext +- (void)addObserver:(id)anObserver forKeyPath:(CPString)aPath options:(CPKeyValueObservingOptions)options context:(id)aContext { if (!anObserver || !aPath) return; @@ -742,7 +742,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti } } -- (void)_addObserver:(id)anObserver forKeyPath:(CPString)aPath options:(unsigned)options context:(id)aContext +- (void)_addObserver:(id)anObserver forKeyPath:(CPString)aPath options:(CPKeyValueObservingOptions)options context:(id)aContext { if (!anObserver) return; diff --git a/Foundation/CPNumberFormatter.j b/Foundation/CPNumberFormatter.j index 8b485ef13..4057aedce 100644 --- a/Foundation/CPNumberFormatter.j +++ b/Foundation/CPNumberFormatter.j @@ -189,7 +189,7 @@ var NumberRegex = new RegExp('(-)?(\\d*)(\\.(\\d*))?'); return [self stringForObjectValue:anObject]; } -- (BOOL)getObjectValue:(id)anObjectRef forString:(CPString)aString errorDescription:(CPString)anErrorRef +- (BOOL)getObjectValue:(idRef)anObjectRef forString:(CPString)aString errorDescription:(CPStringRef)anErrorRef { // Interpret an empty string as nil, like in Cocoa. if (aString === @"") diff --git a/Foundation/CPScanner.j b/Foundation/CPScanner.j index ea2ffb3dc..f4c01c9df 100644 --- a/Foundation/CPScanner.j +++ b/Foundation/CPScanner.j @@ -329,7 +329,7 @@ /* = Debug = */ /* ========= */ -- (void)description +- (CPString)description { return [super description] + " {" + CPStringFromClass([self class]) + ", state = '" + ([self string].substr(0, _scanLocation) + "{{ SCAN LOCATION ->}}" + [self string].substr(_scanLocation)) + "'; }"; } diff --git a/Foundation/CPSet+KVO.j b/Foundation/CPSet+KVO.j index 2bc3560d0..d4648fe10 100644 --- a/Foundation/CPSet+KVO.j +++ b/Foundation/CPSet+KVO.j @@ -168,7 +168,7 @@ [_proxyObject setValue:anObject forKey:_key]; } -- (unsigned)count +- (CPUInteger)count { if (_count) return _count(_proxyObject, _countSEL); diff --git a/Foundation/CPString.j b/Foundation/CPString.j index b5e076a2d..d9992ed8f 100644 --- a/Foundation/CPString.j +++ b/Foundation/CPString.j @@ -206,7 +206,7 @@ var CPStringUIDs = new CFMutableDictionary(), Returns the character at the specified index. @param anIndex the index of the desired character */ -- (CPString)characterAtIndex:(unsigned)anIndex +- (CPString)characterAtIndex:(CPUInteger)anIndex { return self.charAt(anIndex); } @@ -249,7 +249,7 @@ var CPStringUIDs = new CFMutableDictionary(), @param anIndex the index of the padding string to start from (if necessary to use) @return the new padded string */ -- (CPString)stringByPaddingToLength:(unsigned)aLength withString:(CPString)aString startingAtIndex:(unsigned)anIndex +- (CPString)stringByPaddingToLength:(unsigned)aLength withString:(CPString)aString startingAtIndex:(CPUInteger)anIndex { if (self.length == aLength) return self; @@ -596,7 +596,7 @@ var CPStringNull = [CPNull null]; /*! Returns a hash of the string instance. */ -- (unsigned)UID +- (CPString)UID { var UID = CPStringUIDs.valueForKey(self); diff --git a/Tests/AppKit/CPArrayControllerTest.j b/Tests/AppKit/CPArrayControllerTest.j index 3590f9f61..5e7f8f982 100644 --- a/Tests/AppKit/CPArrayControllerTest.j +++ b/Tests/AppKit/CPArrayControllerTest.j @@ -1079,22 +1079,22 @@ return [_contentArray count]; } -- (id)objectInItemsArrayAtIndex:(unsigned int)index +- (id)objectInItemsArrayAtIndex:(CPUInteger)index { return [_contentArray objectAtIndex:index]; } -- (void)insertObject:(id)anObject inItemsArrayAtIndex:(unsigned int)index +- (void)insertObject:(id)anObject inItemsArrayAtIndex:(CPUInteger)index { [_contentArray insertObject:anObject atIndex:index]; } -- (void)removeObjectFromItemsArrayAtIndex:(unsigned int)index +- (void)removeObjectFromItemsArrayAtIndex:(CPUInteger)index { [_contentArray removeObjectAtIndex:index]; } -- (void)replaceObjectInItemsArrayAtIndex:(unsigned int)index withObject:(id)anObject +- (void)replaceObjectInItemsArrayAtIndex:(CPUInteger)index withObject:(id)anObject { [_contentArray replaceObjectAtIndex:index withObject:anObject]; } diff --git a/Tests/Foundation/CPAttributedStringTest.j b/Tests/Foundation/CPAttributedStringTest.j index 64bb4d4de..7980124a8 100644 --- a/Tests/Foundation/CPAttributedStringTest.j +++ b/Tests/Foundation/CPAttributedStringTest.j @@ -116,7 +116,7 @@ var sharedObject = [CPObject new]; testAttributesAtIndexWithValues(string, 33, expectedValues, self); } -//- (CPDictionary)attributesAtIndex:(unsigned)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit +//- (CPDictionary)attributesAtIndex:(CPUInteger)anIndex longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit - (void)testAttributesAtIndexLongestEffectiveRangeInRange { var string = [self stringForTesting]; @@ -135,7 +135,7 @@ var sharedObject = [CPObject new]; [self assertTrue:[attributes objectForKey:"f"] === 43 message:@"expecting 'f' to be 43, was: " + [attributes objectForKey:"f"]]; } -//- (id)attribute:(CPString)attribute atIndex:(unsigned)index effectiveRange:(CPRangePointer)aRange +//- (id)attribute:(CPString)attribute atIndex:(CPUInteger)index effectiveRange:(CPRangePointer)aRange - (void)testAttributeAtIndexEffectiveRange { var string = [self stringForTesting]; @@ -144,7 +144,7 @@ var sharedObject = [CPObject new]; testAttributeAtIndexWithValue(string, 20, "d", [CPNull null], self); } -//- (id)attribute:(CPString)attribute atIndex:(unsigned)index longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit +//- (id)attribute:(CPString)attribute atIndex:(CPUInteger)index longestEffectiveRange:(CPRangePointer)aRange inRange:(CPRange)rangeLimit - (void)testAttributeAtIndexLongestEffectiveRangeInRange { var string = [self stringForTesting]; diff --git a/Tests/Foundation/CPKVOTest.j b/Tests/Foundation/CPKVOTest.j index 57ba2dd8c..0a4bccba5 100644 --- a/Tests/Foundation/CPKVOTest.j +++ b/Tests/Foundation/CPKVOTest.j @@ -833,17 +833,17 @@ return [managedObjects count]; } -- (id)objectInManagedObjectsAtIndex:(unsigned)anIndex +- (id)objectInManagedObjectsAtIndex:(CPUInteger)anIndex { return [managedObjects objectAtIndex:anIndex]; } -- (void)removeObjectFromManagedObjectsAtIndex:(unsigned)anIndex +- (void)removeObjectFromManagedObjectsAtIndex:(CPUInteger)anIndex { [managedObjects removeObjectAtIndex:anIndex]; } -- (void)insertObject:(id)anObject inManagedObjectsAtIndex:(unsigned)anIndex +- (void)insertObject:(id)anObject inManagedObjectsAtIndex:(CPUInteger)anIndex { [managedObjects insertObject:anObject atIndex:anIndex]; } diff --git a/Tests/Manual/ArrayController1/AppController.j b/Tests/Manual/ArrayController1/AppController.j index 056641151..ff54b1544 100644 --- a/Tests/Manual/ArrayController1/AppController.j +++ b/Tests/Manual/ArrayController1/AppController.j @@ -134,22 +134,22 @@ CPLogRegister(CPLogConsole); return [itemsArray count]; } -- (id)objectInItemsArrayAtIndex:(unsigned int)index +- (id)objectInItemsArrayAtIndex:(CPUInteger)index { return [itemsArray objectAtIndex:index]; } -- (void)insertObject:(id)anObject inItemsArrayAtIndex:(unsigned int)index +- (void)insertObject:(id)anObject inItemsArrayAtIndex:(CPUInteger)index { [itemsArray insertObject:anObject atIndex:index]; } -- (void)removeObjectFromItemsArrayAtIndex:(unsigned int)index +- (void)removeObjectFromItemsArrayAtIndex:(CPUInteger)index { [itemsArray removeObjectAtIndex:index]; } -- (void)replaceObjectInItemsArrayAtIndex:(unsigned int)index withObject:(id)anObject +- (void)replaceObjectInItemsArrayAtIndex:(CPUInteger)index withObject:(id)anObject { [itemsArray replaceObjectAtIndex:index withObject:anObject]; } diff --git a/Tools/nib2cib/NSCustomView.j b/Tools/nib2cib/NSCustomView.j index a7cc7270c..f5526c5d6 100644 --- a/Tools/nib2cib/NSCustomView.j +++ b/Tools/nib2cib/NSCustomView.j @@ -51,7 +51,7 @@ var _CPCibCustomViewClassNameKey = @"_CPCibCustomViewClassNameKey"; [aCoder encodeObject:CP_NSMapClassName(_className) forKey:_CPCibCustomViewClassNameKey]; } -- (CPString)classForKeyedArchiver +- (Class)classForKeyedArchiver { return [_CPCibCustomView class]; }