layers: Fix unique_objects_wrappers.h
authorMark Young <marky@lunarg.com>
Tue, 9 May 2017 19:19:04 +0000 (13:19 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Thu, 11 May 2017 14:19:54 +0000 (08:19 -0600)
The unique_objects_wrappers.h header was generated with code that
caused several compilation warnings.  This resolves those warnings.

Change-Id: I5ed3bdb6bbe7df48b3fe6fb6679916161b32fdfd

scripts/unique_objects_generator.py

index baf30c19a421ead21b613e2474a52841003cf5e7..8ad30530bf72a913c361bda746212d704f66b7d4 100644 (file)
@@ -599,7 +599,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
     #
     # Clean up local declarations
     def cleanUpLocalDeclarations(self, indent, prefix, name, len, index, process_pnext):
-        cleanup = '%sif (local_%s%s)\n' % (indent, prefix, name)
+        cleanup = '%sif (local_%s%s) {\n' % (indent, prefix, name)
         if len is not None:
             if process_pnext:
                 cleanup += '%s    for (uint32_t %s = 0; %s < %s%s; ++%s) {\n' % (indent, index, index, prefix, len, index)
@@ -610,6 +610,7 @@ class UniqueObjectsOutputGenerator(OutputGenerator):
             if process_pnext:
                 cleanup += '%s    FreeUnwrappedExtensionStructs(const_cast<void *>(local_%s%s->pNext));\n' % (indent, prefix, name)
             cleanup += '%s    delete local_%s%s;\n' % (indent, prefix, name)
+        cleanup += "%s}\n" % (indent)
         return cleanup
     #
     # Output UO code for a single NDO (ndo_count is NULL) or a counted list of NDOs