From: Chris Forbes Date: Thu, 26 May 2016 23:58:23 +0000 (+1200) Subject: layers: Fix safe struct codegen of static arrays X-Git-Tag: upstream/1.1.92~3040^2~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3e0c454a44926e72c71cc2d7425474a9abe9b7e;p=platform%2Fupstream%2FVulkan-Tools.git layers: Fix safe struct codegen of static arrays VC++ doesn't support this particular corner of C++11. Signed-off-by: Chris Forbes --- diff --git a/vk_helper.py b/vk_helper.py index a405d57..dc49b0f 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)