Skip to content

Commit

Permalink
Fix return value
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Aug 27, 2023
1 parent 9929e4d commit 23779df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions robotpy_build/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,19 +811,15 @@ def _function_hook(
# - gensig is not computable here
#
fn_retval: typing.Optional[str] = None
if True:
retval = []
if fn.get("returns_const"):
retval.append("const")
if "returns_enum" in fn:
retval.append(fn["rtnType"])
else:
retval.append(fn["returns"])
if fn["returns_pointer"]:
retval.append("*")
if fn["returns_reference"]:
retval.append("&")
fn_retval = " ".join(retval)
retval = []
if fn.get("returns_const"):
retval.append("const")
retval.append(fn["rtnType"])
if fn["returns_pointer"]:
retval.append("*")
if fn["returns_reference"]:
retval.append("&")
fn_retval = " ".join(retval)

return FunctionContext(
cpp_name=fn["name"],
Expand Down
2 changes: 1 addition & 1 deletion robotpy_build/j2_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class FunctionContext:
#: Name in python
py_name: str

#: Return value
#: Return value as fully qualified C++ type with const/*
retval: typing.Optional[str]

#: every parameter
Expand Down

0 comments on commit 23779df

Please sign in to comment.