Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/intern/makesdna.c
| Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | if (types_len >= max_array_len) { | ||||
| return types_len - 1; | return types_len - 1; | ||||
| } | } | ||||
| types_len++; | types_len++; | ||||
| return types_len - 1; | return types_len - 1; | ||||
| } | } | ||||
| /** | /** | ||||
| * | |||||
| * Because of the weird way of tokenizing, we have to 'cast' function | * Because of the weird way of tokenizing, we have to 'cast' function | ||||
| * pointers to ... (*f)(), whatever the original signature. In fact, | * pointers to ... (*f)(), whatever the original signature. In fact, | ||||
| * we add name and type at the same time... There are two special | * we add name and type at the same time... There are two special | ||||
| * cases, unfortunately. These are explicitly checked. | * cases, unfortunately. These are explicitly checked. | ||||
| * | */ | ||||
| * */ | |||||
| static int add_name(const char *str) | static int add_name(const char *str) | ||||
| { | { | ||||
| char buf[255]; /* stupid limit, change it :) */ | char buf[255]; /* stupid limit, change it :) */ | ||||
| const char *name; | const char *name; | ||||
| additional_slen_offset = 0; | additional_slen_offset = 0; | ||||
| if (str[0] == 0 /* || (str[1] == 0) */) { | if (str[0] == 0 /* || (str[1] == 0) */) { | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | else if (str[j] == ')') { | ||||
| DEBUG_PRINTF(3, "offsetting for brace\n"); | DEBUG_PRINTF(3, "offsetting for brace\n"); | ||||
| /* don't get extra offset */ | /* don't get extra offset */ | ||||
| } | } | ||||
| else { | else { | ||||
| printf("Error during tokening function pointer argument list\n"); | printf("Error during tokening function pointer argument list\n"); | ||||
| } | } | ||||
| /* | /* | ||||
| * Put )(void) at the end? Maybe )(). Should check this with | * Put `)(void)` at the end? Maybe `)()`. Should check this with | ||||
| * old sdna. Actually, sometimes )(), sometimes )(void...) | * old `sdna`. Actually, sometimes `)()`, sometimes `)(void...)` | ||||
| * Alas.. such is the nature of brain-damage :( | * Alas.. such is the nature of brain-damage :( | ||||
| * | * | ||||
| * Sorted it out: always do )(), except for headdraw and | * Sorted it out: always do )(), except for `headdraw` and | ||||
| * windraw, part of ScrArea. This is important, because some | * `windraw`, part of #ScrArea. This is important, because some | ||||
| * linkers will treat different fp's differently when called | * linkers will treat different fp's differently when called | ||||
| * !!! This has to do with interference in byte-alignment and | * !!! This has to do with interference in byte-alignment and | ||||
| * the way args are pushed on the stack. | * the way arguments are pushed on the stack. | ||||
| * | */ | ||||
| * */ | |||||
| buf[i] = 0; | buf[i] = 0; | ||||
| DEBUG_PRINTF(3, "Name before chomping: %s\n", buf); | DEBUG_PRINTF(3, "Name before chomping: %s\n", buf); | ||||
| if ((strncmp(buf, "(*headdraw", 10) == 0) || (strncmp(buf, "(*windraw", 9) == 0)) { | if ((strncmp(buf, "(*headdraw", 10) == 0) || (strncmp(buf, "(*windraw", 9) == 0)) { | ||||
| buf[i] = ')'; | buf[i] = ')'; | ||||
| buf[i + 1] = '('; | buf[i + 1] = '('; | ||||
| buf[i + 2] = 'v'; | buf[i + 2] = 'v'; | ||||
| buf[i + 3] = 'o'; | buf[i + 3] = 'o'; | ||||
| buf[i + 4] = 'i'; | buf[i + 4] = 'i'; | ||||
| ▲ Show 20 Lines • Show All 1,129 Lines • Show Last 20 Lines | |||||