@@ -69,7 +69,7 @@ @implementation GULSwizzlerTest
69
69
- (void )testOriginalImpInstanceMethod {
70
70
Method method = class_getInstanceMethod ([NSObject class ], @selector (description ));
71
71
IMP originalImp = method_getImplementation (method);
72
- NSString * (^newImplementation)() = ^NSString *() {
72
+ NSString * (^newImplementation)(void ) = ^NSString *() {
73
73
return @" nonsense" ;
74
74
};
75
75
@@ -155,7 +155,7 @@ - (void)testOriginalImpCallThrough {
155
155
- (void )testOriginalImpClassMethod {
156
156
Method method = class_getInstanceMethod ([NSObject class ], @selector (description ));
157
157
IMP originalImp = method_getImplementation (method);
158
- NSString * (^newImplementation)() = ^NSString *() {
158
+ NSString * (^newImplementation)(void ) = ^NSString *() {
159
159
return @" nonsense" ;
160
160
};
161
161
@@ -179,7 +179,7 @@ - (void)testOriginalImpInstanceAndClassImpsAreDifferent {
179
179
IMP instanceImp = method_getImplementation (instanceMethod);
180
180
IMP classImp = method_getImplementation (classMethod);
181
181
182
- NSString * (^newImplementation)() = ^NSString *() {
182
+ NSString * (^newImplementation)(void ) = ^NSString *() {
183
183
return @" nonsense" ;
184
184
};
185
185
@@ -208,7 +208,7 @@ - (void)testOriginalImpInstanceAndClassImpsAreDifferent {
208
208
/* * Tests swizzling an instance method. */
209
209
- (void )testSwizzleInstanceMethod {
210
210
NSString *swizzledDescription = @" Not what you expected!" ;
211
- NSString * (^newImplementation)() = ^NSString *() {
211
+ NSString * (^newImplementation)(void ) = ^NSString *() {
212
212
return swizzledDescription;
213
213
};
214
214
@@ -224,7 +224,7 @@ - (void)testSwizzleInstanceMethod {
224
224
/* * Tests swizzling a class method. */
225
225
- (void )testSwizzleClassMethod {
226
226
NSString *swizzledDescription = @" Swizzled class description" ;
227
- NSString * (^newImplementation)() = ^NSString *() {
227
+ NSString * (^newImplementation)(void ) = ^NSString *() {
228
228
return swizzledDescription;
229
229
};
230
230
@@ -241,7 +241,7 @@ - (void)testUnswizzleInstanceMethod {
241
241
NSObject *object = [[NSObject alloc ] init ];
242
242
NSString *originalDescription = [object description ];
243
243
NSString *swizzledDescription = @" Swizzled description" ;
244
- NSString * (^newImplementation)() = ^NSString *() {
244
+ NSString * (^newImplementation)(void ) = ^NSString *() {
245
245
return swizzledDescription;
246
246
};
247
247
@@ -260,7 +260,7 @@ - (void)testUnswizzleInstanceMethod {
260
260
- (void )testUnswizzleClassMethod {
261
261
NSString *originalDescription = [NSObject description ];
262
262
NSString *swizzledDescription = @" Swizzled class description" ;
263
- NSString * (^newImplementation)() = ^NSString *() {
263
+ NSString * (^newImplementation)(void ) = ^NSString *() {
264
264
return swizzledDescription;
265
265
};
266
266
@@ -276,7 +276,7 @@ - (void)testUnswizzleClassMethod {
276
276
/* * Tests swizzling a class method doesn't swizzle an instance method of the same name. */
277
277
- (void )testSwizzlingAClassMethodDoesntSwizzleAnInstanceMethod {
278
278
NSString *swizzledDescription = @" Swizzled class description" ;
279
- NSString * (^newImplementation)() = ^NSString *() {
279
+ NSString * (^newImplementation)(void ) = ^NSString *() {
280
280
return swizzledDescription;
281
281
};
282
282
@@ -292,7 +292,7 @@ - (void)testSwizzlingAClassMethodDoesntSwizzleAnInstanceMethod {
292
292
/* * Tests swizzling an instance method doesn't swizzle a class method of the same name. */
293
293
- (void )testSwizzlingAnInstanceMethodDoesntSwizzleAClassMethod {
294
294
NSString *swizzledDescription = @" Not what you expected!" ;
295
- NSString * (^newImplementation)() = ^NSString *() {
295
+ NSString * (^newImplementation)(void ) = ^NSString *() {
296
296
return swizzledDescription;
297
297
};
298
298
@@ -310,7 +310,7 @@ - (void)testSwizzlingAnInstanceMethodDoesntSwizzleAClassMethod {
310
310
- (void )testSwizzlingSuperclassInstanceMethod {
311
311
NSObject *generalObject = [[NSObject alloc ] init ];
312
312
BOOL generalObjectIsProxyValue = [generalObject isProxy ];
313
- BOOL (^newImplementation)() = ^BOOL () {
313
+ BOOL (^newImplementation)(void ) = ^BOOL () {
314
314
return !generalObjectIsProxyValue;
315
315
};
316
316
@@ -325,7 +325,7 @@ - (void)testSwizzlingSuperclassInstanceMethod {
325
325
/* * Tests swizzling a superclass's class method. */
326
326
- (void )testSwizzlingSuperclassClassMethod {
327
327
NSString *swizzledDescription = @" Swizzled class description" ;
328
- NSString * (^newImplementation)() = ^NSString *() {
328
+ NSString * (^newImplementation)(void ) = ^NSString *() {
329
329
return swizzledDescription;
330
330
};
331
331
@@ -344,7 +344,7 @@ - (void)testSwizzlingInstanceMethodThatCallsSuper {
344
344
TestObject *testObject = [[TestObject alloc ] init ];
345
345
NSString *originalDescription = [testObject description ];
346
346
NSString *swizzledDescription = [originalDescription stringByAppendingString: @" SWIZZLED!" ];
347
- NSString * (^newImplementation)() = ^NSString *() {
347
+ NSString * (^newImplementation)(void ) = ^NSString *() {
348
348
return swizzledDescription;
349
349
};
350
350
@@ -492,7 +492,7 @@ - (void)testSwizzlingInstanceMethodIsEffectiveOnMultipleInstancesOfSameClass {
492
492
- (void )testSwizzlingClassMethodThatCallsSuper {
493
493
NSString *originalDescription = [TestObject description ];
494
494
NSString *swizzledDescription = @" Swizzled class description" ;
495
- NSString * (^newImplementation)() = ^NSString *() {
495
+ NSString * (^newImplementation)(void ) = ^NSString *() {
496
496
return swizzledDescription;
497
497
};
498
498
@@ -513,7 +513,7 @@ - (void)testSwizzlingClassMethodThatCallsSuper {
513
513
- (void )testSwizzlingAnInheritedInstanceMethodDoesntAffectTheIMPOfItsSuperclass {
514
514
NSObject *generalObject = [[NSObject alloc ] init ];
515
515
BOOL originalGeneralObjectValue = [generalObject isProxy ];
516
- BOOL (^newImplementation)() = ^BOOL () {
516
+ BOOL (^newImplementation)(void ) = ^BOOL (void ) {
517
517
return !originalGeneralObjectValue;
518
518
};
519
519
@@ -533,7 +533,7 @@ - (void)testSwizzlingAnInheritedInstanceMethodDoesntAffectTheIMPOfItsSuperclass
533
533
- (void )testSwizzlingADeeperInheritedInstanceMethodDoesntAffectTheIMPOfItsSuperclass {
534
534
TestObject *testObject = [[TestObject alloc ] init ];
535
535
BOOL originalTestObjectValue = [testObject isProxy ];
536
- BOOL (^newImplementation)() = ^BOOL () {
536
+ BOOL (^newImplementation)(void ) = ^BOOL (void ) {
537
537
return !originalTestObjectValue;
538
538
};
539
539
@@ -556,7 +556,7 @@ - (void)testSwizzlingAnInheritedClassMethodDoesntAffectTheIMPOfItsSuperclass {
556
556
// Fun fact, this won't work on +new. Swizzling +new causes a retain to not be placed correctly.
557
557
NSString *originalDescription = [TestObject description ];
558
558
NSString *swizzledDescription = [originalDescription stringByAppendingString: @" SWIZZLED!" ];
559
- NSString * (^newImplementation)() = ^NSString *() {
559
+ NSString * (^newImplementation)(void ) = ^NSString *() {
560
560
return swizzledDescription;
561
561
};
562
562
@@ -579,7 +579,7 @@ - (void)testSwizzlingAnInheritedClassMethodDoesntAffectTheIMPOfItsSuperclass {
579
579
- (void )testSwizzlingADeeperInheritedClassMethodDoesntAffectTheIMPOfItsSuperclass {
580
580
NSString *originalDescription = [TestObjectSubclass description ];
581
581
NSString *swizzledDescription = [originalDescription stringByAppendingString: @" SWIZZLED!" ];
582
- NSString * (^newImplementation)() = ^NSString *() {
582
+ NSString * (^newImplementation)(void ) = ^NSString *() {
583
583
return swizzledDescription;
584
584
};
585
585
0 commit comments