Commit fee5e490 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #2076 from jdemeyer/voidproto

C functions without args should be declared as f(void)
parents 5d3a1346 176b1cc4
...@@ -3190,7 +3190,10 @@ class DefNode(FuncDefNode): ...@@ -3190,7 +3190,10 @@ class DefNode(FuncDefNode):
arg_code_list.append(arg_decl_code(self.star_arg)) arg_code_list.append(arg_decl_code(self.star_arg))
if self.starstar_arg: if self.starstar_arg:
arg_code_list.append(arg_decl_code(self.starstar_arg)) arg_code_list.append(arg_decl_code(self.starstar_arg))
if arg_code_list:
arg_code = ', '.join(arg_code_list) arg_code = ', '.join(arg_code_list)
else:
arg_code = 'void' # No arguments
dc = self.return_type.declaration_code(self.entry.pyfunc_cname) dc = self.return_type.declaration_code(self.entry.pyfunc_cname)
decls_code = code.globalstate['decls'] decls_code = code.globalstate['decls']
......
...@@ -139,6 +139,14 @@ cdef class ArgsKwargs(object): ...@@ -139,6 +139,14 @@ cdef class ArgsKwargs(object):
""" """
return args + tuple(sorted(kwargs.items())) return args + tuple(sorted(kwargs.items()))
@staticmethod
def no_args():
"""
>>> ArgsKwargs().no_args()
OK!
"""
print("OK!")
class StaticmethodSubclass(staticmethod): class StaticmethodSubclass(staticmethod):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment