Skip to content

Commit

Permalink
Merge pull request #4125 from yebblies/traitstable
Browse files Browse the repository at this point in the history
[DDMD] Change traits table back to using a sentinel value
  • Loading branch information
MartinNowak committed Nov 10, 2014
2 parents 452cfcc + 7fd7147 commit ca4a50d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/traits.c
Expand Up @@ -253,19 +253,20 @@ const char* traits[] = {
"getAttributes",
"getFunctionAttributes",
"getUnitTests",
"getVirtualIndex"
"getVirtualIndex",
NULL
};

StringTable traitsStringTable;

void initTraitsStringTable()
{
const size_t ntraits = sizeof(traits) / sizeof(traits[0]);
traitsStringTable._init(ntraits);
traitsStringTable._init(40);

for (size_t idx = 0; idx < ntraits; idx++)
for (size_t idx = 0;; idx++)
{
const char *s = traits[idx];
if (!s) break;
StringValue *sv = traitsStringTable.insert(s, strlen(s));
sv->ptrvalue = (void *)traits[idx];
}
Expand Down

0 comments on commit ca4a50d

Please sign in to comment.