Fix NCC bug with union members (#1755)

This commit is contained in:
foxtacles 2026-05-15 15:20:30 -07:00 committed by GitHub
parent 41f8fca9c2
commit 2614373c8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -155,7 +155,7 @@ def get_scope_prefix(self, node, scope=None):
return self.scope_prefix_rule.global_prefix return self.scope_prefix_rule.global_prefix
elif (scope is CursorKind.CLASS_DECL) or (scope is CursorKind.CLASS_TEMPLATE): elif (scope is CursorKind.CLASS_DECL) or (scope is CursorKind.CLASS_TEMPLATE):
return self.scope_prefix_rule.class_member_prefix return self.scope_prefix_rule.class_member_prefix
elif (scope is CursorKind.STRUCT_DECL): elif (scope is CursorKind.STRUCT_DECL) or (scope is CursorKind.UNION_DECL):
return self.scope_prefix_rule.struct_member_prefix return self.scope_prefix_rule.struct_member_prefix
return "" return ""
@ -617,7 +617,7 @@ def do_validate(options, filename):
if __name__ == "__main__": if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s',
filename='log.txt', filemode='w') filemode='w')
""" Parse all command line arguments and validate """ """ Parse all command line arguments and validate """
op = Options() op = Options()

View File

@ -15,8 +15,6 @@ p_HELDesc: 'Allow this variable name'
e_RAMStream: 'Allow this enum constant' e_RAMStream: 'Allow this enum constant'
p_RLE: 'Allow this parameter name' p_RLE: 'Allow this parameter name'
p_milliseconds: 'Probably a bug with function call' p_milliseconds: 'Probably a bug with function call'
m_increaseAmount: "Can't currently detect member in union"
m_increaseFactor: "Can't currently detect member in union"
delta_rad: "Allow original naming from 1996" delta_rad: "Allow original naming from 1996"
delta_pos: "Allow original naming from 1996" delta_pos: "Allow original naming from 1996"
rot_mat: "Allow original naming from 1996" rot_mat: "Allow original naming from 1996"