diff options
| author | Chris Forbes <chrisforbes@google.com> | 2017-05-02 18:35:12 -0700 |
|---|---|---|
| committer | Chris Forbes <chrisf@ijw.co.nz> | 2017-05-03 11:38:06 -0700 |
| commit | 33dd5555aa33fb81f731468314e9f40d662b145f (patch) | |
| tree | 3184bf56823f3eacf9d09c8daa4ccce2534cd6dd /scripts/unique_objects_generator.py | |
| parent | 44148ddacddbe9995b01f3949899942088d755fe (diff) | |
| download | usermoji-33dd5555aa33fb81f731468314e9f40d662b145f.tar.xz | |
layers: use Unwrap in UO codegen
Diffstat (limited to 'scripts/unique_objects_generator.py')
| -rw-r--r-- | scripts/unique_objects_generator.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/unique_objects_generator.py b/scripts/unique_objects_generator.py index 3a408486..e48c0ad2 100644 --- a/scripts/unique_objects_generator.py +++ b/scripts/unique_objects_generator.py @@ -626,11 +626,11 @@ class UniqueObjectsOutputGenerator(OutputGenerator): pre_call_code += '%s local_%s%s = new %s[%s];\n' % (indent, prefix, ndo_name, ndo_type, ndo_count) pre_call_code += '%s for (uint32_t %s = 0; %s < %s; ++%s) {\n' % (indent, index, index, ndo_count, index) indent = self.incIndent(indent) - pre_call_code += '%s local_%s%s[%s] = (%s)dev_data->unique_id_mapping[reinterpret_cast<const uint64_t &>(%s[%s])];\n' % (indent, prefix, ndo_name, index, ndo_type, ndo_name, index) + pre_call_code += '%s local_%s%s[%s] = Unwrap(dev_data, %s[%s]);\n' % (indent, prefix, ndo_name, index, ndo_name, index) else: pre_call_code += '%s for (uint32_t %s = 0; %s < %s; ++%s) {\n' % (indent, index, index, ndo_count, index) indent = self.incIndent(indent) - pre_call_code += '%s %s%s[%s] = (%s)dev_data->unique_id_mapping[reinterpret_cast<const uint64_t &>(%s%s[%s])];\n' % (indent, prefix, ndo_name, index, ndo_type, prefix, ndo_name, index) + pre_call_code += '%s %s%s[%s] = Unwrap(dev_data, %s%s[%s]);\n' % (indent, prefix, ndo_name, index, prefix, ndo_name, index) indent = self.decIndent(indent) pre_call_code += '%s }\n' % indent indent = self.decIndent(indent) @@ -642,14 +642,14 @@ class UniqueObjectsOutputGenerator(OutputGenerator): else: if top_level == True: if (destroy_func == False) or (destroy_array == True): - pre_call_code += '%s %s = (%s)dev_data->unique_id_mapping[reinterpret_cast<uint64_t &>(%s)];\n' % (indent, ndo_name, ndo_type, ndo_name) + pre_call_code += '%s %s = Unwrap(dev_data, %s);\n' % (indent, ndo_name, ndo_name) else: # Make temp copy of this var with the 'local' removed. It may be better to not pass in 'local_' # as part of the string and explicitly print it fix = str(prefix).strip('local_'); pre_call_code += '%s if (%s%s) {\n' % (indent, fix, ndo_name) indent = self.incIndent(indent) - pre_call_code += '%s %s%s = (%s)dev_data->unique_id_mapping[reinterpret_cast<const uint64_t &>(%s%s)];\n' % (indent, prefix, ndo_name, ndo_type, fix, ndo_name) + pre_call_code += '%s %s%s = Unwrap(dev_data, %s%s);\n' % (indent, prefix, ndo_name, fix, ndo_name) indent = self.decIndent(indent) pre_call_code += '%s }\n' % indent return decl_code, pre_call_code, post_call_code |
