Differences From Artifact [e9f2e9fced]:
- File
src/runtime/static-instances.m
— part of check-in
[ef6d69931e]
at
2019-02-07 00:46:41
on branch trunk
— Make style consistent between ObjFW and ObjFW_RT
ObjFW_RT used to be a separate project that followed the BSD style, as
it was written in pure C, while ObjFW's style is based on the BSD style
with changes to make it a better fit for Objective-C. This commit
changes ObjFW_RT to use the same style as ObjFW. (user: js, size: 2836) [annotate] [blame] [check-ins using]
To Artifact [ca4604a232]:
- File src/runtime/static-instances.m — part of check-in [754bf24742] at 2019-02-07 21:31:16 on branch trunk — More style improvements (user: js, size: 2848) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
29 30 31 32 33 34 35 | void objc_init_static_instances(struct objc_abi_symtab *symtab) { struct objc_abi_static_instances **staticInstances; /* Check if the class for a static instance became available */ for (size_t i = 0; i < staticInstancesCount; i++) { | | | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | void objc_init_static_instances(struct objc_abi_symtab *symtab) { struct objc_abi_static_instances **staticInstances; /* Check if the class for a static instance became available */ for (size_t i = 0; i < staticInstancesCount; i++) { Class class = objc_lookUpClass( staticInstancesList[i]->className); if (class != Nil) { for (id *instances = staticInstancesList[i]->instances; *instances != nil; instances++) object_setClass(*instances, class); staticInstancesCount--; if (staticInstancesCount == 0) { free(staticInstancesList); staticInstancesList = NULL; break; |
︙ | ︙ | |||
71 72 73 74 75 76 77 | staticInstances = (struct objc_abi_static_instances **) symtab->defs[symtab->classDefsCount + symtab->categoryDefsCount]; if (staticInstances == NULL) return; for (; *staticInstances != NULL; staticInstances++) { | | | | | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | staticInstances = (struct objc_abi_static_instances **) symtab->defs[symtab->classDefsCount + symtab->categoryDefsCount]; if (staticInstances == NULL) return; for (; *staticInstances != NULL; staticInstances++) { Class class = objc_lookUpClass((*staticInstances)->className); if (class != Nil) { for (id *instances = (*staticInstances)->instances; *instances != nil; instances++) object_setClass(*instances, class); } else { staticInstancesList = realloc(staticInstancesList, sizeof(struct objc_abi_static_instances *) * (staticInstancesCount + 1)); if (staticInstancesList == NULL) OBJC_ERROR("Not enough memory for list of " |
︙ | ︙ |