Skip to content
This repository was archived by the owner on Feb 6, 2021. It is now read-only.

Commit 1dcf189

Browse files
author
Jonas Gessner
committed
Merge pull request #2 from megastep/master
A couple of small fixes
2 parents 0110ee6 + 4df5092 commit 1dcf189

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

JGMethodSwizzler/JGMethodSwizzler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ typedef id (^JGMethodReplacementProvider)(JG_IMP original, __unsafe_unretained C
3232
@return \c YES if any methods have been deswizzled successfully.
3333
*/
3434

35-
OBJC_EXTERN BOOL deswizzleGlobal();
35+
OBJC_EXTERN BOOL deswizzleGlobal(void);
3636

3737

3838
/**
@@ -41,7 +41,7 @@ OBJC_EXTERN BOOL deswizzleGlobal();
4141
@return \c YES if any methods have been deswizzled successfully.
4242
*/
4343

44-
OBJC_EXTERN BOOL deswizzleInstances();
44+
OBJC_EXTERN BOOL deswizzleInstances(void);
4545

4646

4747
/**
@@ -50,7 +50,7 @@ OBJC_EXTERN BOOL deswizzleInstances();
5050
@return \c YES if any methods have been deswizzled successfully.
5151
*/
5252

53-
OBJC_EXTERN BOOL deswizzleAll();
53+
OBJC_EXTERN BOOL deswizzleAll(void);
5454

5555

5656
//-----------------

JGMethodSwizzler/JGMethodSwizzler.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ - (BOOL)deswizzle {
704704

705705
#pragma mark - Public functions
706706

707-
BOOL deswizzleGlobal() {
707+
BOOL deswizzleGlobal(void)
708+
{
708709
BOOL success = NO;
709710
OSSpinLockLock(&lock);
710711
NSDictionary *d = originalClassMethods.copy;
@@ -735,7 +736,8 @@ BOOL deswizzleGlobal() {
735736
}
736737

737738

738-
BOOL deswizzleInstances() {
739+
BOOL deswizzleInstances(void)
740+
{
739741
OSSpinLockLock(&lock);
740742
BOOL success = NO;
741743
NSDictionary *d = dynamicSubclassesByObject.copy;
@@ -755,7 +757,8 @@ BOOL deswizzleInstances() {
755757
return success;
756758
}
757759

758-
BOOL deswizzleAll() {
760+
BOOL deswizzleAll(void)
761+
{
759762
BOOL a = deswizzleGlobal();
760763
BOOL b = deswizzleInstances();
761764

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Swizzling the method `+(int)[TestClass test:(int)]`
2323
//return a replacement block
2424
return JGMethodReplacement(int, const Class *, int arg) {
2525
//get the original value
26-
int orig = JGCastOriginal(int, arg);
26+
int orig = JGOriginalImplementation(int, arg);
2727
//return the modified value
2828
return orig+2;
2929
};
@@ -40,7 +40,7 @@ Swizzling the method `-(int)[TestClass test:(int)]`
4040
//return a replacement block
4141
return JGMethodReplacement(int, TestClass *, int arg) {
4242
//get the original value
43-
int orig = JGCastOriginal(int, arg);
43+
int orig = JGOriginalImplementation(int, arg);
4444
//return the modified value
4545
return orig+2;
4646
};
@@ -58,7 +58,7 @@ NSObject *object = [NSObject new];
5858

5959
[object swizzleMethod:@selector(description) withReplacement:JGMethodReplacementProviderBlock {
6060
return JGMethodReplacement(NSString *, NSObject *) {
61-
NSString *orig = JGCastOriginal(NSString *);
61+
NSString *orig = JGOriginalImplementation(NSString *);
6262

6363
return [orig stringByAppendingString:@" Swizzled!!"];
6464
};

0 commit comments

Comments
 (0)