summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-10-06 21:08:21 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2010-10-06 21:08:21 -0700
commit3c216e5ece97fb293ef6ebc0ad38e0513d736c22 (patch)
treee5aaf42a42e2f2eb06758d10773877dcfdd635c4
parentf4b1c57fed1d8620d0bb9caeee9f55ececcad4d1 (diff)
Use a category for [WebScriptObject -countByEnumeratingWithState:objects:count:].
-rw-r--r--Cydia.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Cydia.mm b/Cydia.mm
index 6c029d1..7531f89 100644
--- a/Cydia.mm
+++ b/Cydia.mm
@@ -618,7 +618,9 @@ void CFArrayInsertionSortValues(CFMutableArrayRef array, CFRange range, CFCompar
@end
/* }}} */
-NSUInteger WebScriptObject$countByEnumeratingWithState$objects$count$(WebScriptObject *self, SEL sel, NSFastEnumerationState *state, id *objects, NSUInteger count) {
+@implementation WebScriptObject (NSFastEnumeration)
+
+- (NSUInteger) countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)objects count:(NSUInteger)count {
size_t length([self count] - state->state);
if (length <= 0)
return 0;
@@ -631,6 +633,8 @@ NSUInteger WebScriptObject$countByEnumeratingWithState$objects$count$(WebScriptO
return length;
}
+@end
+
NSUInteger DOMNodeList$countByEnumeratingWithState$objects$count$(DOMNodeList *self, SEL sel, NSFastEnumerationState *state, id *objects, NSUInteger count) {
size_t length([self length] - state->state);
if (length <= 0)
@@ -8713,7 +8717,6 @@ int main(int argc, char *argv[]) { _pooled
PackageName = reinterpret_cast<CYString &(*)(Package *, SEL)>(method_getImplementation(class_getInstanceMethod([Package class], @selector(cyname))));
/* Library Hacks {{{ */
- class_addMethod(objc_getClass("WebScriptObject"), @selector(countByEnumeratingWithState:objects:count:), (IMP) &WebScriptObject$countByEnumeratingWithState$objects$count$, "I20@0:4^{NSFastEnumerationState}8^@12I16");
class_addMethod(objc_getClass("DOMNodeList"), @selector(countByEnumeratingWithState:objects:count:), (IMP) &DOMNodeList$countByEnumeratingWithState$objects$count$, "I20@0:4^{NSFastEnumerationState}8^@12I16");
$WebDefaultUIKitDelegate = objc_getClass("WebDefaultUIKitDelegate");