if self.helper_file_type == 'enum_string_header':
value_set = set()
for elem in groupElem.findall('enum'):
- if elem.get('supported') != 'disabled' and elem.get('alias') == None:
+ if elem.get('supported') != 'disabled' and elem.get('alias') is None:
value_set.add(elem.get('name'))
self.enum_output += self.GenerateEnumStringConversion(groupName, value_set)
elif self.helper_file_type == 'object_types_header':
for item in self.structMembers:
if self.NeedSafeStruct(item) == True:
safe_struct_header += '\n'
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
safe_struct_header += '#ifdef %s\n' % item.ifdef_protect
safe_struct_header += 'struct safe_%s {\n' % (item.name)
for member in item.members:
safe_struct_header += ' %s *ptr() { return reinterpret_cast<%s *>(this); }\n' % (item.name, item.name)
safe_struct_header += ' %s const *ptr() const { return reinterpret_cast<%s const *>(this); }\n' % (item.name, item.name)
safe_struct_header += '};\n'
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
safe_struct_header += '#endif // %s\n' % item.ifdef_protect
return safe_struct_header
#
continue
if item.name in wsi_structs:
continue
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
safe_struct_body.append("#ifdef %s\n" % item.ifdef_protect)
ss_name = "safe_%s" % item.name
init_list = '' # list of members in struct constructor initializer
init_copy = copy_construct_init.replace('src.', 'src->')
init_construct = copy_construct_txt.replace('src.', 'src->')
safe_struct_body.append("\nvoid %s::initialize(const %s* src)\n{\n%s%s}" % (ss_name, ss_name, init_copy, init_construct))
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
safe_struct_body.append("#endif // %s\n" % item.ifdef_protect)
return "\n".join(safe_struct_body)
#
if not info:
continue
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
code.append('#ifdef %s' % item.ifdef_protect)
code.append('// Map type {} to id {}'.format(typename, info.value))
id_decl=id_decl, id_member=id_member))
code.append(idmap_format.format(template=idmap, typename=typename, id_value=info.value, typedef=type_member))
- if item.ifdef_protect != None:
+ if item.ifdef_protect is not None:
code.append('#endif // %s' % item.ifdef_protect)
# Generate utilities for all types
handle = self.registry.tree.find("types/type/[name='" + handle_type + "'][@category='handle']")
return_type = cmdinfo.elem.find('proto/type')
- if (return_type != None and return_type.text == 'void'):
+ if (return_type is not None and return_type.text == 'void'):
return_type = None
cmd_params = []
cmd_params.append(self.CommandParam(type=param_type, name=param_name,
cdecl=param_cdecl))
- if handle != None and handle_type != 'VkInstance' and handle_type != 'VkPhysicalDevice':
+ if handle is not None and handle_type != 'VkInstance' and handle_type != 'VkPhysicalDevice':
# The Core Vulkan code will be wrapped in a feature called VK_VERSION_#_#
# For example: VK_VERSION_1_0 wraps the core 1.0 Vulkan functionality
if 'VK_VERSION_' in extension_name:
if cur_cmd.name in PRE_INSTANCE_FUNCTIONS:
mod_string = mod_string.replace(cur_cmd.name[2:] + '(\n', cur_cmd.name[2:] + '(\n const Vk' + cur_cmd.name[2:] + 'Chain* chain,\n')
- if (cur_cmd.protect != None):
+ if (cur_cmd.protect is not None):
terminators += '#ifdef %s\n' % cur_cmd.protect
terminators += mod_string
terminators += '\n'
- if (cur_cmd.protect != None):
+ if (cur_cmd.protect is not None):
terminators += '#endif // %s\n' % cur_cmd.protect
terminators += '\n'
physdev_type_to_replace = 'VkPhysicalDevice'
physdev_name_replacement = 'phys_dev_term->phys_dev'
- if (ext_cmd.return_type != None):
+ if (ext_cmd.return_type is not None):
return_prefix += 'return '
has_return_type = True
count += 1
funcs += ');\n'
if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES:
- if ext_cmd.return_type != None:
+ if ext_cmd.return_type is not None:
funcs += ' } else {\n'
funcs += ' return VK_SUCCESS;\n'
funcs += ' }\n'
count += 1
funcs += ');\n'
if ext_cmd.ext_name in NULL_CHECK_EXT_NAMES:
- if ext_cmd.return_type != None:
+ if ext_cmd.return_type is not None:
funcs += ' } else {\n'
funcs += ' return VK_SUCCESS;\n'
funcs += ' }\n'