Skip to content

Commit

Permalink
Fix verify-docstrings to handle rdcfixedarray tuples
Browse files Browse the repository at this point in the history
* Removes a couple of exceptions from functions it can't verify.
  • Loading branch information
baldurk committed Nov 18, 2024
1 parent 630d13a commit 91c935f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions docs/verify-docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,14 @@ def make_c_type(ret: str, pattern: bool, typelist: List[str]):
inner = ',\s*'.join(inners)
else:
inner = ', '.join(inners)
ret = '(const )?rdcpair<{}> ?[&*]?'.format(inner) if pattern else 'rdcpair<{}>'.format(inner)

tuple_len = len(inners)

if tuple_len > 2 and len(list(set(inners))) == 1:
inner = inners[0]
ret = '(const )?rdcfixedarray<{}, {}> ?[&*]?'.format(inner, tuple_len) if pattern else 'rdcfixedarray<{}, {}>'.format(inner, tuple_len)
else:
ret = '(const )?rdcpair<{}> ?[&*]?'.format(inner) if pattern else 'rdcpair<{}>'.format(inner)
elif pattern:
if ret[-8:] == 'Callback':
ret = '(RENDERDOC_)?{}'.format(ret)
Expand Down Expand Up @@ -291,11 +298,15 @@ def check_used_types(objname, module, used_types):
member = obj.__dict__[member_name]

# Skip some known functions that cannot be easily matched this way
if '{}.{}'.format(objname, member_name) in ['RemoteHost.Connect',
if '{}.{}'.format(objname, member_name) in [
# pointer output remapped to tuple return
'RemoteHost.Connect',
# class-local callbacks
'CaptureContext.EditShader',
'ReplayController.DebugThread',
'ReplayController.GetHistogram',
# Renamed in the interface from DuplicateAndAddChild
'SDObject.AddChild',
# not defined in the actual code since we have typed AsInt32 etc.
# Instead defined in the swig interface
'SDObject.AsInt',
'SDObject.AsFloat',
'SDObject.AsString']:
Expand Down

0 comments on commit 91c935f

Please sign in to comment.