mirror of https://gitlab.com/nakst/essence
header generator: fix bitsets in odin 4
This commit is contained in:
parent
7444967ece
commit
8be749ce31
|
@ -923,6 +923,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
|
||||||
|
|
||||||
const char *initialValue = TrimPrefix(variable->variable.initialValue);
|
const char *initialValue = TrimPrefix(variable->variable.initialValue);
|
||||||
bool needLeadingDot = false;
|
bool needLeadingDot = false;
|
||||||
|
const char *leadingTypeName = "";
|
||||||
|
|
||||||
if (0 == strcmp(initialValue, "NULL")) {
|
if (0 == strcmp(initialValue, "NULL")) {
|
||||||
initialValue = "nil";
|
initialValue = "nil";
|
||||||
|
@ -947,6 +948,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
|
||||||
if (0 == memcmp(initialValue, entry->bitset.definePrefix + 3, strlen(entry->bitset.definePrefix) - 3)) {
|
if (0 == memcmp(initialValue, entry->bitset.definePrefix + 3, strlen(entry->bitset.definePrefix) - 3)) {
|
||||||
needLeadingDot = true;
|
needLeadingDot = true;
|
||||||
initialValue += strlen(entry->bitset.definePrefix) - 3;
|
initialValue += strlen(entry->bitset.definePrefix) - 3;
|
||||||
|
leadingTypeName = TrimPrefix(entry->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -954,7 +956,7 @@ void OutputOdinFunction(Entry *entry, Entry *root) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FilePrintFormat(output, " = %c%s", needLeadingDot ? '.' : ' ', initialValue);
|
FilePrintFormat(output, " = %s%c%s", leadingTypeName, needLeadingDot ? '.' : ' ', initialValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue