Import fixes and lint

This commit is contained in:
Stephen Ierodiaconou
2010-12-26 01:34:37 +02:00
parent 9b75e37e1f
commit b70018bd80
31 changed files with 123 additions and 93 deletions
+2 -1
View File
@@ -20,12 +20,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPArray.j"
@import "CPDictionary.j"
@import "CPException.j"
@import "CPObject.j"
@import "CPRange.j"
@import "CPString.j"
/*!
@class CPAttributedString
@ingroup foundation
+2 -3
View File
@@ -21,12 +21,11 @@
*/
@import "CPDictionary.j"
@import "CPObject.j"
@import "CPNotification.j"
@import "CPNotificationCenter.j"
@import "CPObject.j"
CPBundleDidLoadNotification = "CPBundleDidLoadNotification";
CPBundleDidLoadNotification = @"CPBundleDidLoadNotification";
/*!
@class CPBundle
-1
View File
@@ -23,7 +23,6 @@
@import "CPException.j"
@import "CPObject.j"
/*!
@class CPCoder
@ingroup foundation
+1 -1
View File
@@ -20,9 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPObject.j"
@import "CPSet.j"
/*!
@class CPCountedSet
@ingroup foundation
-1
View File
@@ -23,7 +23,6 @@
@import "CPObject.j"
@import "CPString.j"
/*!
@class CPData
@ingroup foundation
+1 -1
View File
@@ -22,7 +22,7 @@
@import "CPObject.j"
@import "CPString.j"
@import "CPException.j"
var CPDateReferenceDate = new Date(Date.UTC(2001, 1, 1, 0, 0, 0, 0));
+1 -1
View File
@@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPObject.j"
@import "CPDecimal.j"
@import "CPException.j"
@import "CPObject.j"
/* The protocol is defined as : Make sure CPDecimalNumberHandler implements these methods
@protocol CPDecimalNumberBehaviors
+1 -1
View File
@@ -23,9 +23,9 @@
@import "CPArray.j"
@import "CPEnumerator.j"
@import "CPException.j"
@import "CPNull.j"
@import "CPObject.j"
/* @ignore */
@implementation _CPDictionaryValueEnumerator : CPEnumerator
{
-1
View File
@@ -22,7 +22,6 @@
@import "CPObject.j"
/*!
@class CPEnumerator
@ingroup foundation
+10 -9
View File
@@ -24,11 +24,10 @@
@import "CPObject.j"
@import "CPString.j"
CPInvalidArgumentException = "CPInvalidArgumentException";
CPUnsupportedMethodException = "CPUnsupportedMethodException";
CPRangeException = "CPRangeException";
CPInternalInconsistencyException = "CPInternalInconsistencyException";
CPInvalidArgumentException = @"CPInvalidArgumentException";
CPUnsupportedMethodException = @"CPUnsupportedMethodException";
CPRangeException = @"CPRangeException";
CPInternalInconsistencyException = @"CPInternalInconsistencyException";
/*!
@class CPException
@@ -90,7 +89,9 @@ if (input == nil)
*/
- (id)initWithName:(CPString)aName reason:(CPString)aReason userInfo:(CPDictionary)aUserInfo
{
if (self = [super init])
self = [super init];
if (self)
{
name = aName;
message = aReason;
@@ -162,9 +163,9 @@ if (input == nil)
@end
var CPExceptionNameKey = "CPExceptionNameKey",
CPExceptionReasonKey = "CPExceptionReasonKey",
CPExceptionUserInfoKey = "CPExceptionUserInfoKey";
var CPExceptionNameKey = @"CPExceptionNameKey",
CPExceptionReasonKey = @"CPExceptionReasonKey",
CPExceptionUserInfoKey = @"CPExceptionUserInfoKey";
@implementation CPException (CPCoding)
-5
View File
@@ -36,7 +36,6 @@
@import "CPException.j"
@import "CPObject.j"
@implementation CPFormatter : CPObject
/*!
@@ -57,13 +56,11 @@
return nil;
}
/*- (CPAttributedString)attributedStringForObjectValue:(id)anObject withDefaultAttributes:(CPDictionary)attributes
{
}*/
/*!
The default implementation of this method invokes stringForObjectValue:.
@@ -80,7 +77,6 @@
return [self stringForObjectValue:anObject];
}
/*!
The default implementation of this method raises an exception.
@@ -102,7 +98,6 @@
return NO;
}
/*!
Returns a Boolean value that indicates whether a partial string is valid.
+5 -4
View File
@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPObject.j>
@import "CPArray.j"
@import "CPObject.j"
@import "CPOperation.j"
/*!
@class CPFunctionOperation
@brief Represents an operation using a JavaScript function that can be run in an CPOperationQueue
@@ -32,7 +32,6 @@
CPArray _functions;
}
- (void)main
{
if (_functions && [_functions count] > 0)
@@ -50,7 +49,9 @@
- (id)init
{
if (self = [super init])
self = [super init];
if (self)
{
_functions = [];
}
+22 -3
View File
@@ -1,10 +1,29 @@
/*
* CPIndexPath.j
* Foundation
*
* Copyright 2008, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPObject.j"
@import "CPArray.j"
@import "CPException.j"
@import "CPObject.j"
@import "CPRange.j"
@import "CPSortDescriptor.j"
@import "CPException.j"
@implementation CPIndexPath : CPObject
{
+1 -1
View File
@@ -20,10 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPArray.j"
@import "CPObject.j"
@import "CPRange.j"
#define _CPMaxRange(aRange) ((aRange).location + (aRange).length)
#define _CPMakeRange(aLocation, aLength) { location:(aLocation), length:aLength }
#define _CPMakeRangeCopy(aRange) { location:(aRange).location, length:(aRange).length }
-2
View File
@@ -20,10 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPException.j"
@import "CPObject.j"
/*!
@class CPInvocation
@ingroup foundation
-1
View File
@@ -23,7 +23,6 @@
@import "CPObject.j"
@import "CPOperation.j"
/*!
@class CPInvocationOperation
@brief Represents an operation using an invocation that can be run in an CPOperationQueue
+1 -1
View File
@@ -22,11 +22,11 @@
@import "CPArray.j"
@import "CPDictionary.j"
@import "CPException.j"
@import "CPNull.j"
@import "CPObject.j"
@import "CPSet.j"
CPUndefinedKeyException = @"CPUndefinedKeyException";
CPTargetObjectUserInfoKey = @"CPTargetObjectUserInfoKey";
CPUnknownUserInfoKey = @"CPUnknownUserInfoKey";
+7 -11
View File
@@ -207,20 +207,16 @@ var _changeKindForSetMutationKind = function(mutationKind)
{
switch (mutationKind)
{
case CPKeyValueUnionSetMutation:
return CPKeyValueChangeInsertion;
case CPKeyValueMinusSetMutation:
return CPKeyValueChangeRemoval;
case CPKeyValueIntersectSetMutation:
return CPKeyValueChangeRemoval;
case CPKeyValueSetSetMutation:
return CPKeyValueChangeReplacement;
case CPKeyValueUnionSetMutation: return CPKeyValueChangeInsertion;
case CPKeyValueMinusSetMutation: return CPKeyValueChangeRemoval;
case CPKeyValueIntersectSetMutation: return CPKeyValueChangeRemoval;
case CPKeyValueSetSetMutation: return CPKeyValueChangeReplacement;
}
}
var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld,
DependentKeysKey = "$KVODEPENDENT",
KVOProxyKey = "$KVOPROXY";
var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOptionOld,
DependentKeysKey = "$KVODEPENDENT",
KVOProxyKey = "$KVOPROXY";
//rule of thumb: _ methods are called on the real proxy object, others are called on the "fake" proxy object (aka the real object)
-1
View File
@@ -28,7 +28,6 @@
@import "CPString.j"
@import "CPValue.j"
var CPArchiverReplacementClassNames = nil;
var _CPKeyedArchiverDidEncodeObjectSelector = 1,
+2 -2
View File
@@ -21,15 +21,15 @@
*/
@import "CPArray.j"
@import "CPCoder.j"
@import "CPData.j"
@import "CPDictionary.j"
@import "CPCoder.j"
@import "CPException.j"
@import "CPKeyedArchiver.j"
@import "CPNull.j"
@import "CPNumber.j"
@import "CPString.j"
CPInvalidUnarchiveOperationException = @"CPInvalidUnarchiveOperationException";
var _CPKeyedUnarchiverCannotDecodeObjectOfClassNameOriginalClassesSelector = 1 << 0,
-1
View File
@@ -23,7 +23,6 @@
@import "CPException.j"
@import "CPObject.j"
/*!
@class CPNotification
@ingroup foundation
-1
View File
@@ -26,7 +26,6 @@
@import "CPNotification.j"
@import "CPNull.j"
var CPNotificationDefaultCenter = nil;
/*!
-1
View File
@@ -22,7 +22,6 @@
@import "CPObject.j"
var CPNullSharedNull = nil;
/*!
-1
View File
@@ -23,7 +23,6 @@
@import "CPObject.j"
@import "CPObjJRuntime.j"
var CPNumberUIDs = new CFMutableDictionary();
/*!
-2
View File
@@ -61,8 +61,6 @@ CPLog(@"Got some class: %@", inst);
@todo document KVC usage.
*/
@implementation CPObject
{
Class isa;
+9 -7
View File
@@ -19,43 +19,43 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPObject.j"
@import "CPArray.j"
@import "CPObject.j"
/*!
Operations receive very low priority for execution.
@global
@group CPOperationQueuePriority
*/
CPOperationQueuePriorityVeryLow = -8;
CPOperationQueuePriorityVeryLow = -8;
/*!
Operations receive low priority for execution.
@global
@group CPOperationQueuePriority
*/
CPOperationQueuePriorityLow = -4;
CPOperationQueuePriorityLow = -4;
/*!
Operations receive normal priority for execution.
@global
@group CPOperationQueuePriority
*/
CPOperationQueuePriorityNormal = 0;
CPOperationQueuePriorityNormal = 0;
/*!
Operations receive high priority for execution.
@global
@group CPOperationQueuePriority
*/
CPOperationQueuePriorityHigh = 4;
CPOperationQueuePriorityHigh = 4;
/*!
Operations receive very high priority for execution.
@global
@group CPOperationQueuePriority
*/
CPOperationQueuePriorityVeryHigh = 8;
CPOperationQueuePriorityVeryHigh = 8;
/*!
@@ -83,7 +83,9 @@ CPOperationQueuePriorityVeryHigh = 8;
- (id)init
{
if (self = [super init])
self = [super init];
if (self)
{
_cancelled = NO;
_executing = NO;
+5 -1
View File
@@ -19,10 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import "CPArray.j"
@import "CPFunctionOperation.j"
@import "CPInvocationOperation.j"
@import "CPObject.j"
@import "CPOperation.j"
@import "CPString.j"
@import "CPTimer.j"
// the global queue (mainQueue)
@@ -42,7 +44,9 @@ var cpOperationMainQueue = nil;
- (id)init
{
if (self = [super init])
self = [super init];
if (self)
{
_operations = [[CPArray alloc] init];
_suspended = NO;
-1
View File
@@ -22,7 +22,6 @@
@import "CPObject.j"
CPPropertyListUnknownFormat = 0;
CPPropertyListOpenStepFormat = kCFPropertyListOpenStepFormat;
CPPropertyListXMLFormat_v1_0 = kCFPropertyListXMLFormat_v1_0;
+1 -1
View File
@@ -22,9 +22,9 @@
@import "CPException.j"
@import "CPInvocation.j"
@import "CPObject.j"
@import "CPString.j"
@implementation CPProxy
{
}
+1
View File
@@ -21,6 +21,7 @@
*/
@import "CPArray.j"
@import "CPDate.j"
@import "CPObject.j"
@import "CPString.j"
+51 -26
View File
@@ -1,11 +1,27 @@
// CPScanner.j
// © Emanuele Vulcano, 2008.
//
// Licensed under the terms of Cappuccino's license
// (the GNU Lesser General Public License, version 2.1).
// Please see Cappuccino's LICENSE file for details.
/*
* CPScanner.j
* Foundation
*
* © Emanuele Vulcano, 2008.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@import <Foundation/CPCharacterSet.j>
@import "CPCharacterSet.j"
@import "CPDictionary.j"
@import "CPString.j"
@implementation CPScanner : CPObject
{
@@ -180,8 +196,8 @@
if ([self isAtEnd])
return nil;
var current = [self scanLocation];
var str = nil;
var current = [self scanLocation],
str = nil;
while (current < _string.length)
{
@@ -212,9 +228,9 @@
- (void)_movePastCharactersToBeSkipped
{
var current = [self scanLocation];
var string = [self string];
var toSkip = [self charactersToBeSkipped];
var current = [self scanLocation],
string = [self string],
toSkip = [self charactersToBeSkipped];
while (current < string.length)
{
@@ -258,8 +274,10 @@
- (CPString)scanUpToString:(CPString)s
{
var current = [self scanLocation], str = [self string];
var captured = nil;
var current = [self scanLocation],
str = [self string],
captured = nil;
while (current < str.length)
{
var currentStr = str.substr(current, s.length);
@@ -291,16 +309,19 @@
- (float)scanFloat
{
[self _movePastCharactersToBeSkipped];
var str = [self string], current = [self scanLocation];
var str = [self string],
current = [self scanLocation];
if ([self isAtEnd])
return 0;
var s = str.substring(current, str.length);
var f = parseFloat(s); // wont work with non . decimal separator !!
var s = str.substring(current, str.length),
f = parseFloat(s); // wont work with non . decimal separator !!
if (f)
{
var pos, foundDash = NO;
var pos = current,
foundDash = NO;
/*
var decimalSeparatorString;
if (_locale != nil)
@@ -312,7 +333,7 @@
*/
var separatorCode = 45;
for (pos = current; pos < current + str.length; pos++)
for (; pos < current + str.length; pos++)
{
var charCode = str.charCodeAt(pos);
if (charCode == separatorCode)
@@ -335,17 +356,21 @@
- (int)scanInt
{
[self _movePastCharactersToBeSkipped];
var str = [self string], current = [self scanLocation];
var str = [self string],
current = [self scanLocation];
if ([self isAtEnd])
return 0;
var s = str.substring(current, str.length);
var i = parseInt(s);
var s = str.substring(current, str.length),
i = parseInt(s);
if (i)
{
var pos, foundDash = NO;
for (pos = current; pos < current + str.length; pos++)
var pos = current,
foundDash = NO;
for (; pos < current + str.length; pos++)
{
var charCode = str.charCodeAt(pos);
if (charCode == 46)
@@ -384,9 +409,9 @@
/* = Debug = */
/* ========= */
- (void) description
- (void)description
{
return [super description] + " {" + CPStringFromClass([self class]) + ", state = '" + ([self string].substr(0, _scanLocation) + "{{ SCAN LOCATION ->}}" + [self string].substr(_scanLocation)) + "'; }";
}
@end
@end