@@ -490,8 +490,7 @@ - (BOOL)registerPushNSHelper:(pushNSHelperFunction)helperFN forClass:(const char
490
490
[self logAtLevel: LS_LOG_WARN
491
491
withMessage: [NSString stringWithFormat: @" registerPushNSHelper:forClass:%s already defined at %@ " ,
492
492
className,
493
- self .registeredNSHelperLocations[@(className)]]
494
- fromStackPos: level] ;
493
+ self .registeredNSHelperLocations[@(className)]]] ;
495
494
} else {
496
495
luaL_where (self.L , level) ;
497
496
NSString *locationString = @(lua_tostring (self.L , -1 )) ;
@@ -502,8 +501,7 @@ - (BOOL)registerPushNSHelper:(pushNSHelperFunction)helperFN forClass:(const char
502
501
}
503
502
} else {
504
503
[self logAtLevel: LS_LOG_WARN
505
- withMessage: @" registerPushNSHelper:forClass: requires both helperFN and className"
506
- fromStackPos: level] ;
504
+ withMessage: @" registerPushNSHelper:forClass: requires both helperFN and className" ] ;
507
505
}
508
506
return allGood ;
509
507
}
@@ -572,8 +570,7 @@ - (BOOL)registerLuaObjectHelper:(luaObjectHelperFunction)helperFN forClass:(cons
572
570
[self logAtLevel: LS_LOG_WARN
573
571
withMessage: [NSString stringWithFormat: @" registerLuaObjectHelper:forClass:%s already defined at %@ " ,
574
572
className,
575
- self .registeredLuaObjectHelperFunctions[@(className)]]
576
- fromStackPos: level] ;
573
+ self .registeredLuaObjectHelperFunctions[@(className)]]] ;
577
574
} else {
578
575
luaL_where (self.L , level) ;
579
576
NSString *locationString = @(lua_tostring (self.L , -1 )) ;
@@ -584,8 +581,7 @@ - (BOOL)registerLuaObjectHelper:(luaObjectHelperFunction)helperFN forClass:(cons
584
581
}
585
582
} else {
586
583
[self logAtLevel: LS_LOG_WARN
587
- withMessage: @" registerLuaObjectHelper:forClass: requires both helperFN and className"
588
- fromStackPos: level] ;
584
+ withMessage: @" registerLuaObjectHelper:forClass: requires both helperFN and className" ] ;
589
585
}
590
586
return allGood ;
591
587
}
@@ -624,8 +620,7 @@ - (NSRect)tableToRectAtIndex:(int)idx {
624
620
return NSMakeRect (x, y, w, h) ;
625
621
} else {
626
622
[self logAtLevel: LS_LOG_WARN
627
- withMessage: [NSString stringWithFormat: @" returning NSZeroRect: can't make NSRect from %s ." , lua_typename (self .L, lua_type (self .L, idx))]
628
- fromStackPos: 1 ] ;
623
+ withMessage: [NSString stringWithFormat: @" returning NSZeroRect: can't make NSRect from %s ." , lua_typename (self .L, lua_type (self .L, idx))]] ;
629
624
return NSZeroRect ;
630
625
}
631
626
}
@@ -639,8 +634,7 @@ - (NSPoint)tableToPointAtIndex:(int)idx {
639
634
return NSMakePoint (x, y);
640
635
} else {
641
636
[self logAtLevel: LS_LOG_WARN
642
- withMessage: [NSString stringWithFormat: @" returning NSZeroPoint: can't make NSPoint from %s ." , lua_typename (self .L, lua_type (self .L, idx))]
643
- fromStackPos: 1 ] ;
637
+ withMessage: [NSString stringWithFormat: @" returning NSZeroPoint: can't make NSPoint from %s ." , lua_typename (self .L, lua_type (self .L, idx))]] ;
644
638
return NSZeroPoint ;
645
639
}
646
640
}
@@ -654,8 +648,7 @@ - (NSSize)tableToSizeAtIndex:(int)idx {
654
648
return NSMakeSize (w, h);
655
649
} else {
656
650
[self logAtLevel: LS_LOG_WARN
657
- withMessage: [NSString stringWithFormat: @" returning NSZeroSize: can't make NSSize from %s ." , lua_typename (self .L, lua_type (self .L, idx))]
658
- fromStackPos: 1 ] ;
651
+ withMessage: [NSString stringWithFormat: @" returning NSZeroSize: can't make NSSize from %s ." , lua_typename (self .L, lua_type (self .L, idx))]] ;
659
652
return NSZeroSize ;
660
653
}
661
654
}
@@ -677,8 +670,7 @@ - (lua_Integer)maxNatIndex:(int)idx {
677
670
}
678
671
} else {
679
672
[self logAtLevel: LS_LOG_ERROR
680
- withMessage: [NSString stringWithFormat: @" table expected (found %s )" , lua_typename (self .L, lua_type (self .L, idx))]
681
- fromStackPos: 0 ] ;
673
+ withMessage: [NSString stringWithFormat: @" table expected (found %s )" , lua_typename (self .L, lua_type (self .L, idx))]] ;
682
674
}
683
675
return max ;
684
676
}
@@ -695,8 +687,7 @@ - (lua_Integer)countNatIndex:(int)idx {
695
687
}
696
688
} else {
697
689
[self logAtLevel: LS_LOG_ERROR
698
- withMessage: [NSString stringWithFormat: @" table expected (found %s )" , lua_typename (self .L, lua_type (self .L, idx))]
699
- fromStackPos: 0 ] ;
690
+ withMessage: [NSString stringWithFormat: @" table expected (found %s )" , lua_typename (self .L, lua_type (self .L, idx))]] ;
700
691
}
701
692
return max ;
702
693
}
@@ -1026,8 +1017,7 @@ - (id)toNSObjectAtIndex:(int)idx withOptions:(NSUInteger)options alreadySeenObje
1026
1017
if (seenObject) {
1027
1018
if ([[seenObject lastObject ] isEqualToNumber: @(NO )] && ((options & LS_NSAllowsSelfReference) != LS_NSAllowsSelfReference)) {
1028
1019
[self logAtLevel: LS_LOG_WARN
1029
- withMessage: @" lua table cannot contain self-references"
1030
- fromStackPos: 1 ] ;
1020
+ withMessage: @" lua table cannot contain self-references" ] ;
1031
1021
// return [NSNull null] ;
1032
1022
return nil ;
1033
1023
} else {
@@ -1060,8 +1050,7 @@ - (id)toNSObjectAtIndex:(int)idx withOptions:(NSUInteger)options alreadySeenObje
1060
1050
} else {
1061
1051
if (stringOptions != LS_NSNone) {
1062
1052
[self logAtLevel: LS_LOG_DEBUG
1063
- withMessage: @" only one of LS_NSPreserveLuaStringExactly or LS_NSLuaStringAsDataOnly can be specified: using default behavior"
1064
- fromStackPos: 0 ] ;
1053
+ withMessage: @" only one of LS_NSPreserveLuaStringExactly or LS_NSLuaStringAsDataOnly can be specified: using default behavior" ] ;
1065
1054
}
1066
1055
return [self getValidUTF8AtIndex: idx] ;
1067
1056
}
@@ -1190,8 +1179,7 @@ - (id)tableAtIndex:(int)idx withOptions:(NSUInteger)options alreadySeenObjects:(
1190
1179
} else {
1191
1180
[self logAtLevel: LS_LOG_ERROR
1192
1181
withMessage: [NSString stringWithFormat: @" array element (%s ) cannot be converted into a proper NSObject" ,
1193
- luaL_tolstring (self .L, -1 , NULL )]
1194
- fromStackPos: 1 ] ;
1182
+ luaL_tolstring (self .L, -1 , NULL )]] ;
1195
1183
result = nil ;
1196
1184
lua_pop (self.L , 2 ) ; // luaL_tolstring result and lua_geti result
1197
1185
return nil ;
@@ -1209,8 +1197,7 @@ - (id)tableAtIndex:(int)idx withOptions:(NSUInteger)options alreadySeenObjects:(
1209
1197
[self logAtLevel: LS_LOG_ERROR
1210
1198
withMessage: [NSString stringWithFormat: @" dictionary %@ (%s ) cannot be converted into a proper NSObject" ,
1211
1199
(key) ? @" key" : @" value" ,
1212
- luaL_tolstring (self .L, (key) ? -2 : lua_gettop (self .L), NULL )]
1213
- fromStackPos: 1 ] ;
1200
+ luaL_tolstring (self .L, (key) ? -2 : lua_gettop (self .L), NULL )]] ;
1214
1201
result = nil ;
1215
1202
lua_pop (self.L , 3 ) ; // luaL_tolstring result, lua_next value, and lua_next key
1216
1203
return nil ;
@@ -1236,17 +1223,6 @@ - (void) logAtLevel:(int)level withMessage:(NSString *)theMessage {
1236
1223
}
1237
1224
}
1238
1225
1239
- // Testing for: chunkname:currentline:theMessage
1240
- - (void ) logAtLevel : (int )level withMessage : (NSString *)theMessage fromStackPos : (int )pos {
1241
- luaL_where (self.L , pos) ;
1242
- NSString *locationInfo = @(lua_tostring (self.L , -1 )) ;
1243
- lua_pop (self.L , 1 ) ;
1244
- if (!locationInfo || [locationInfo isEqualToString: @" " ])
1245
- locationInfo = [NSString stringWithFormat: @" (no lua location info at depth %d )" , pos] ;
1246
-
1247
- [self logAtLevel: level withMessage: [NSString stringWithFormat: @" %@ :%@ " , locationInfo, theMessage]] ;
1248
- }
1249
-
1250
1226
// shorthand
1251
1227
- (void )logVerbose : (NSString *)theMessage { [self logAtLevel: LS_LOG_VERBOSE withMessage: theMessage] ; }
1252
1228
- (void )logDebug : (NSString *)theMessage { [self logAtLevel: LS_LOG_DEBUG withMessage: theMessage] ; }
0 commit comments