Update test file to be more compliant

This commit is contained in:
Doyle 2019-02-23 14:22:09 +11:00
parent a44603d3ca
commit 13ed8b71c9
2 changed files with 14 additions and 7 deletions

View File

@ -95,6 +95,13 @@ struct DqnInspect_StructMemberMetadata
int key_len;
char const *val_str; // Metadata value is always inspected to a string
int val_str_len;
// TODO(doyle): Implement
union
{
int int_val;
float flt_val;
};
};
struct DqnInspect_StructMember
@ -899,10 +906,10 @@ void ParseCPPStruct(CPPTokeniser *tokeniser)
CPPTokeniser_SprintfToFile(tokeniser, "DqnInspect_StructMemberMetadataType::String,\n");
// metadata->key
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.key.len, entry.key.str);
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"), ", entry.key.len, entry.key.str);
// metadata->value
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.value.len, entry.value.str);
CPPTokeniser_SprintfToFileNoIndenting(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.value.len, entry.value.str);
tokeniser->indent_level--;
CPPTokeniser_SprintfToFile(tokeniser, "},\n");
@ -924,8 +931,8 @@ void ParseCPPStruct(CPPTokeniser *tokeniser)
CPPTokeniser_SprintfToFile(tokeniser, "{\n");
tokeniser->indent_level++;
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->type.len, decl->type.str);
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->name.len, decl->name.str);
CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"), ", decl->type.len, decl->type.str);
CPPTokeniser_SprintfToFileNoIndenting(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->name.len, decl->name.str);
CPPTokeniser_SprintfToFile(tokeniser, "%d, // array_dimensions\n", decl->array_dimensions);
if (member->metadata_array.len <= 0) CPPTokeniser_SprintfToFile(tokeniser, "nullptr, // metadata\n");

View File

@ -33,16 +33,16 @@ DQN_INSPECT struct OpenGLState
// u32 shaders[(int)OpenGLShader::Count];
V4 draw_color DQN_INSPECT_META(DisplayName = "HelloWorld");
V3 lighting_ambient_coeff;
// u8 **bitmaps;
char **bitmaps;
// FixedArray<RendererLight, 32> lights;
// FixedArray<Mat4, 32> camera_matrixes;
int draw_call_count;
const int *const a;
int const *const b, c, const *const d, *const e;
int const *const b, c, *d, *e;
const int f;
int const g;
int *const h;
int const* i;
int *********const j, k, ******l, const *m;
int *********const j, k, ******l, *m;
};