Revision: 7195
http://skim-app.svn.sourceforge.net/skim-app/?rev=7195&view=rev
Author: hofman
Date: 2011-03-30 11:41:26 +0000 (Wed, 30 Mar 2011)
Log Message:
-----------
remove class method swizzling functions as we never use them
Modified Paths:
--------------
trunk/SKRuntime.h
trunk/SKRuntime.m
Modified: trunk/SKRuntime.h
===================================================================
--- trunk/SKRuntime.h 2011-03-30 11:31:11 UTC (rev 7194)
+++ trunk/SKRuntime.h 2011-03-30 11:41:26 UTC (rev 7195)
@@ -41,15 +41,11 @@
enum { SKAddOrReplace, SKReplaceOnly, SKAddOnly };
-extern IMP SKSetMethodImplementation(Class aClass, SEL aSelector, IMP anImp,
const char *types, BOOL isInstance, NSInteger options);
-extern IMP SKSetMethodImplementationFromSelector(Class aClass, SEL aSelector,
SEL impSelector, BOOL isInstance, NSInteger options);
+extern IMP SKSetMethodImplementation(Class aClass, SEL aSelector, IMP anImp,
const char *types, NSInteger options);
+extern IMP SKSetMethodImplementationFromSelector(Class aClass, SEL aSelector,
SEL impSelector, NSInteger options);
extern IMP SKReplaceInstanceMethodImplementation(Class aClass, SEL aSelector,
IMP anImp);
-extern IMP SKReplaceClassMethodImplementation(Class aClass, SEL aSelector, IMP
anImp);
extern void SKAddInstanceMethodImplementation(Class aClass, SEL aSelector, IMP
anImp, const char *types);
-extern void SKAddClassMethodImplementation(Class aClass, SEL aSelector, IMP
anImp, const char *types);
extern IMP SKReplaceInstanceMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector);
-extern IMP SKReplaceClassMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector);
extern void SKAddInstanceMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector);
-extern void SKAddClassMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector);
Modified: trunk/SKRuntime.m
===================================================================
--- trunk/SKRuntime.m 2011-03-30 11:31:11 UTC (rev 7194)
+++ trunk/SKRuntime.m 2011-03-30 11:41:26 UTC (rev 7195)
@@ -40,55 +40,39 @@
#import <objc/objc-runtime.h>
-// this is essentially class_replaceMethod, but handles instance/class
methods, returns any inherited implementation, and can get the types from an
inherited implementation
-IMP SKSetMethodImplementation(Class aClass, SEL aSelector, IMP anImp, const
char *types, BOOL isInstance, NSInteger options) {
+// this is essentially class_replaceMethod, but returns any inherited
implementation, and can get the types from an inherited implementation
+IMP SKSetMethodImplementation(Class aClass, SEL aSelector, IMP anImp, const
char *types, NSInteger options) {
IMP imp = NULL;
if (anImp) {
- Method method = isInstance ? class_getInstanceMethod(aClass,
aSelector) : class_getClassMethod(aClass, aSelector);
+ Method method = class_getInstanceMethod(aClass, aSelector);
if (method) {
imp = method_getImplementation(method);
if (types == NULL)
types = method_getTypeEncoding(method);
}
if (types != NULL && (options != SKAddOnly || imp == NULL) && (options
!= SKReplaceOnly || imp != NULL))
- class_replaceMethod(isInstance ? aClass : object_getClass(aClass),
aSelector, anImp, types);
+ class_replaceMethod(aClass, aSelector, anImp, types);
}
return imp;
}
-IMP SKSetMethodImplementationFromSelector(Class aClass, SEL aSelector, SEL
impSelector, BOOL isInstance, NSInteger options) {
- Method method = isInstance ? class_getInstanceMethod(aClass, impSelector)
: class_getClassMethod(aClass, impSelector);
- return method ? SKSetMethodImplementation(aClass, aSelector,
method_getImplementation(method), method_getTypeEncoding(method), isInstance,
options) : NULL;
+IMP SKSetMethodImplementationFromSelector(Class aClass, SEL aSelector, SEL
impSelector, NSInteger options) {
+ Method method = class_getInstanceMethod(aClass, impSelector);
+ return method ? SKSetMethodImplementation(aClass, aSelector,
method_getImplementation(method), method_getTypeEncoding(method), options) :
NULL;
}
IMP SKReplaceInstanceMethodImplementation(Class aClass, SEL aSelector, IMP
anImp) {
- return SKSetMethodImplementation(aClass, aSelector, anImp, NULL, YES,
SKReplaceOnly);
+ return SKSetMethodImplementation(aClass, aSelector, anImp, NULL,
SKReplaceOnly);
}
-IMP SKReplaceClassMethodImplementation(Class aClass, SEL aSelector, IMP anImp)
{
- return SKSetMethodImplementation(aClass, aSelector, anImp, NULL, NO,
SKReplaceOnly);
-}
-
void SKAddInstanceMethodImplementation(Class aClass, SEL aSelector, IMP anImp,
const char *types) {
- SKSetMethodImplementation(aClass, aSelector, anImp, types, YES, SKAddOnly);
+ SKSetMethodImplementation(aClass, aSelector, anImp, types, SKAddOnly);
}
-void SKAddClassMethodImplementation(Class aClass, SEL aSelector, IMP anImp,
const char *types) {
- SKSetMethodImplementation(aClass, aSelector, anImp, types, NO, SKAddOnly);
-}
-
IMP SKReplaceInstanceMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector) {
- return SKSetMethodImplementationFromSelector(aClass, aSelector,
impSelector, YES, SKReplaceOnly);
+ return SKSetMethodImplementationFromSelector(aClass, aSelector,
impSelector, SKReplaceOnly);
}
-IMP SKReplaceClassMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector) {
- return SKSetMethodImplementationFromSelector(aClass, aSelector,
impSelector, NO, SKReplaceOnly);
-}
-
void SKAddInstanceMethodImplementationFromSelector(Class aClass, SEL
aSelector, SEL impSelector) {
- SKSetMethodImplementationFromSelector(aClass, aSelector, impSelector, YES,
SKAddOnly);
+ SKSetMethodImplementationFromSelector(aClass, aSelector, impSelector,
SKAddOnly);
}
-
-void SKAddClassMethodImplementationFromSelector(Class aClass, SEL aSelector,
SEL impSelector) {
- SKSetMethodImplementationFromSelector(aClass, aSelector, impSelector, NO,
SKAddOnly);
-}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit