Skip to content

Commit

Permalink
qapi: Drop dead genlist parameter
Browse files Browse the repository at this point in the history
Defaulting a parameter to True, then having all callers omit or
pass an explicit True for that parameter, is pointless. Looks
like it has been dead since introduction in commit 06d64c6, more
than 4 years ago.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
  • Loading branch information
ebblake authored and Luiz Capitulino committed Apr 24, 2015
1 parent 46abb81 commit 6540e9f
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions scripts/qapi-visit.py
Expand Up @@ -2,7 +2,7 @@
# QAPI visitor generator
#
# Copyright IBM, Corp. 2011
# Copyright (C) 2014 Red Hat, Inc.
# Copyright (C) 2014-2015 Red Hat, Inc.
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
Expand Down Expand Up @@ -401,34 +401,31 @@ def generate_visit_union(expr):

return ret

def generate_declaration(name, members, genlist=True, builtin_type=False):
def generate_declaration(name, members, builtin_type=False):
ret = ""
if not builtin_type:
ret += mcgen('''
void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **errp);
''',
name=name)
name=name)

if genlist:
ret += mcgen('''
ret += mcgen('''
void visit_type_%(name)sList(Visitor *m, %(name)sList **obj, const char *name, Error **errp);
''',
name=name)

return ret

def generate_enum_declaration(name, members, genlist=True):
ret = ""
if genlist:
ret += mcgen('''
def generate_enum_declaration(name, members):
ret = mcgen('''
void visit_type_%(name)sList(Visitor *m, %(name)sList **obj, const char *name, Error **errp);
''',
name=name)
name=name)

return ret

def generate_decl_enum(name, members, genlist=True):
def generate_decl_enum(name, members):
return mcgen('''
void visit_type_%(name)s(Visitor *m, %(name)s *obj, const char *name, Error **errp);
Expand Down Expand Up @@ -542,8 +539,7 @@ def maybe_open(really, name, opt):
# for built-in types in our header files and simply guard them
fdecl.write(guardstart("QAPI_VISIT_BUILTIN_VISITOR_DECL"))
for typename in builtin_types:
fdecl.write(generate_declaration(typename, None, genlist=True,
builtin_type=True))
fdecl.write(generate_declaration(typename, None, builtin_type=True))
fdecl.write(guardend("QAPI_VISIT_BUILTIN_VISITOR_DECL"))

# ...this doesn't work for cases where we link in multiple objects that
Expand Down

0 comments on commit 6540e9f

Please sign in to comment.