Closed leptos-null closed 4 years ago
Second commit is also for type decoder (version 1) and fixes a bug where the ivT
pointer would get incremented in the id
(@
) parse subroutine no matter if the second character indicating the encoding represented a block was present or not
I just happened to look at 9d4eb19816212bc3547ab68dfa06d7ddeb4c5b4d, and realized something had gone wrong, because f7a7f91abf6eab82c1217e214f59303d1bbaba6d undid it.
BOOL isBlock = *ivT == '?';
if(isBlock && [[NSUserDefaults standardUserDefaults] boolForKey:@"RTBAddCommentsForBlocks"]) {
// first increment was here (0), and it moved back here (2)
typeS = (spaceAfter ? @"id /* block */ " : @"id /* block */");
} else {
typeS = (spaceAfter ? @"id " : @"id");
}
// then it was here (1)
The problem is that the logic gate has two components: isBlock
and we'll call [[NSUserDefaults standardUserDefaults] boolForKey:@"RTBAddCommentsForBlocks"]
shouldAddComments
.
The way that typeS
should be set is the same for !isBlock || !shouldAddComments
, so that logic makes sense. In contrast, ivT
should only be incremented if isBlock
, which there wasn't a branch for.
Sorry for the long delay to merge, and thank you for your valuable contribution!
Adds support for the
byref
,_Atomic
, and_Complex
type specifiers to the type decoder (version 1)