aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-05-27 11:58:23 +1200
committerChris Forbes <chrisforbes@google.com>2016-05-27 11:58:23 +1200
commita3e0c454a44926e72c71cc2d7425474a9abe9b7e (patch)
tree5f6f7f7692315346fe7318feca4da098f779de9d
parent72db2cf8ed223058623943abb345225cd80f3e89 (diff)
downloadusermoji-a3e0c454a44926e72c71cc2d7425474a9abe9b7e.tar.xz
layers: Fix safe struct codegen of static arrays
VC++ doesn't support this particular corner of C++11. Signed-off-by: Chris Forbes <chrisforbes@google.com>
-rwxr-xr-xvk_helper.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/vk_helper.py b/vk_helper.py
index a405d571..dc49b0fb 100755
--- a/vk_helper.py
+++ b/vk_helper.py
@@ -1715,14 +1715,9 @@ class StructWrapperGen:
elif self.struct_dict[s][m]['array']:
if not self.struct_dict[s][m]['dyn_array']:
# Handle static array case
- array_init_str = ''
- for i in range(int(self.struct_dict[s][m]['array_size'])):
- array_init_str += 'pInStruct->%s[%d], ' % (m_name, i)
- array_init_str = array_init_str.strip().rstrip(',')
- init_list += '\n\t%s{%s},' % (m_name, array_init_str)
- init_func_txt += ' for (uint32_t i=0; i<%s; ++i) {\n' % (self.struct_dict[s][m]['array_size'])
- init_func_txt += ' %s[i] = pInStruct->%s[i];\n' % (m_name, m_name)
- init_func_txt += ' }\n'
+ construct_txt += ' for (uint32_t i=0; i<%s; ++i) {\n' % (self.struct_dict[s][m]['array_size'])
+ construct_txt += ' %s[i] = pInStruct->%s[i];\n' % (m_name, m_name)
+ construct_txt += ' }\n'
else:
# Init array ptr to NULL
init_list += '\n\t%s(NULL),' % (m_name)