diff options
| author | Tobin Ehlis <tobin@lunarg.com> | 2014-11-20 06:38:50 -0700 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2014-11-26 10:03:12 -0700 |
| commit | 9dcca8e3786b5b6f73851bbf8b299cf703619fef (patch) | |
| tree | bd1c63894c21fefe43ca765384ac5e6d77f32bb9 | |
| parent | 98e933320558a972671364b6420d0ee872cb5679 (diff) | |
| download | usermoji-9dcca8e3786b5b6f73851bbf8b299cf703619fef.tar.xz | |
layers: Struct printing improvements for "pNext" struct chains
| -rwxr-xr-x | xgl-helper.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xgl-helper.py b/xgl-helper.py index 448dbc84..a5944625 100755 --- a/xgl-helper.py +++ b/xgl-helper.py @@ -496,7 +496,10 @@ class StructWrapperGen: if (stp_list[index]['ptr']): sh_funcs.append(' if (pStruct->%s) {\n' % stp_list[index]['name']) if 'pNext' == stp_list[index]['name']: - sh_funcs.append(' stp_strs[%i] = dynamic_display((XGL_VOID*)pStruct->pNext, prefix);\n' % index) + sh_funcs.append(' tmpStr = dynamic_display((XGL_VOID*)pStruct->pNext, prefix);\n') + sh_funcs.append(' stp_strs[%i] = (char*)malloc(256+strlen(tmpStr));\n' % index) + sh_funcs.append(' sprintf(stp_strs[%i], " %%spNext (%%p)\\n%%s", prefix, (void*)pStruct->pNext, tmpStr);\n' % index) + sh_funcs.append(' free(tmpStr);\n') else: sh_funcs.append(' tmpStr = %s(pStruct->%s, extra_indent);\n' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name'])) sh_funcs.append(' stp_strs[%i] = (char*)malloc(256+strlen(tmpStr)+strlen(prefix));\n' % (index)) @@ -523,7 +526,7 @@ class StructWrapperGen: sh_funcs.append(p_out) sh_funcs.append(p_args) if 0 != num_stps: - sh_funcs.append(' for (uint32_t stp_index = 0; stp_index < %i; stp_index++) {\n' % num_stps) + sh_funcs.append(' for (int32_t stp_index = %i; stp_index >= 0; stp_index--) {\n' % (num_stps-1)) sh_funcs.append(' if (0 < strlen(stp_strs[stp_index])) {\n') sh_funcs.append(' strncat(str, stp_strs[stp_index], strlen(stp_strs[stp_index]));\n') sh_funcs.append(' free(stp_strs[stp_index]);\n') |
