qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH RFC v5 17/32] Revert "qapi: Generate comments to sim


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH RFC v5 17/32] Revert "qapi: Generate comments to simplify splitting for review"
Date: Mon, 7 Sep 2015 12:16:28 +0200

This reverts commit ebce6e3cd3fdf3c1d507a060c80822d98b034ba5.

Signed-off-by: Markus Armbruster <address@hidden>
---
 scripts/qapi-commands.py | 7 -------
 scripts/qapi-event.py    | 9 ---------
 scripts/qapi-types.py    | 8 --------
 scripts/qapi-visit.py    | 9 ---------
 scripts/qapi.py          | 8 --------
 5 files changed, 41 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 72b34d3..a68517a 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -24,7 +24,6 @@ def generate_command_decl(name, args, ret_type):
                 arglist += "bool has_%s, " % c_name(memb.name)
             arglist += "%s %s, " % (argtype, c_name(memb.name))
     return mcgen('''
-// decl qmp_%(name)s
 %(ret_type)s qmp_%(name)s(%(args)sError **errp);
 ''',
                  ret_type=(ret_type and ret_type.c_type()) or 'void',
@@ -169,7 +168,6 @@ def gen_marshal_output(name, ret_type):
 
     ret = mcgen('''
 
-// def qmp_marshal_output_%(c_name)s
 static void qmp_marshal_output_%(c_name)s(%(c_ret_type)s ret_in, QObject 
**ret_out, Error **errp)
 {
     Error *local_err = NULL;
@@ -209,12 +207,10 @@ def gen_marshal_input(name, args, ret_type, middle_mode):
 
     ret = mcgen('''
 
-// def qmp_marshal_input_%(name)s
 %(header)s
 {
     Error *local_err = NULL;
 ''',
-                name=name,
                 header=hdr)
 
     if ret_type:
@@ -267,7 +263,6 @@ qmp_register_command("%(name)s", 
qmp_marshal_input_%(c_name)s, %(opts)s);
 def gen_registry(registry):
     ret = mcgen('''
 
-// def qmp_init_marshal
 static void qmp_init_marshal(void)
 {
 ''')
@@ -275,7 +270,6 @@ static void qmp_init_marshal(void)
     ret += mcgen('''
 }
 
-// decl qapi_init
 qapi_init(qmp_init_marshal);
 ''')
     return ret
@@ -305,7 +299,6 @@ class QAPISchemaGenCommandVisitor(QAPISchemaVisitor):
         if ret_type:
             self.defn += gen_marshal_output(name, ret_type)
         if middle_mode:
-            self.decl += '// decl gen_marshal_input_%s\n' % name
             self.decl += gen_marshal_input_decl(name, middle_mode) + ';\n'
         self.defn += gen_marshal_input(name, arg_type, ret_type, middle_mode)
         if not middle_mode:
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 199a779..d19acda 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -11,7 +11,6 @@
 # This work is licensed under the terms of the GNU GPL, version 2.
 # See the COPYING file in the top-level directory.
 
-import re;
 from qapi import *
 
 def _generate_event_api_name(event_name, params):
@@ -35,30 +34,22 @@ def _generate_event_api_name(event_name, params):
 # Following are the core functions that generate C APIs to emit event.
 
 def generate_event_declaration(api_name):
-    match = re.match(r'void ([A-Za-z0-9_]+)', api_name)
-    name = match.group(1)
     return mcgen('''
 
-// decl %(name)s
 %(api_name)s;
 ''',
-                 name=name,
                  api_name = api_name)
 
 def generate_event_implement(api_name, event_name, params):
-    match = re.match(r'void ([A-Za-z0-9_]+)', api_name)
-    name = match.group(1)
     # step 1: declare any variables
     ret = mcgen("""
 
-// def %(name)s
 %(api_name)s
 {
     QDict *qmp;
     Error *local_err = NULL;
     QMPEventFuncEmit emit;
 """,
-                name=name,
                 api_name = api_name)
 
     if params and params.members:
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 26c045a..bc20136 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -16,7 +16,6 @@ from qapi import *
 def gen_fwd_object_or_array(name):
     return mcgen('''
 
-// typedef %(name)s
 typedef struct %(name)s %(name)s;
 ''',
                  name=c_name(name))
@@ -24,7 +23,6 @@ typedef struct %(name)s %(name)s;
 def gen_array(name, element_type):
     return mcgen('''
 
-// struct %(name)s
 struct %(name)s {
     union {
         %(c_type)s value;
@@ -59,7 +57,6 @@ def generate_struct_fields(members):
 def gen_struct(name, base, members):
     ret = mcgen('''
 
-// struct %(name)s
 struct %(name)s {
 ''',
                 name=c_name(name))
@@ -86,7 +83,6 @@ struct %(name)s {
 def gen_alternate_qtypes_decl(name):
     return mcgen('''
 
-// decl %(c_name)s_qtypes
 extern const int %(c_name)s_qtypes[];
 ''',
                  c_name=c_name(name))
@@ -94,7 +90,6 @@ extern const int %(c_name)s_qtypes[];
 def gen_alternate_qtypes(name, variants):
     ret = mcgen('''
 
-// def %(name)s_qtypes
 const int %(name)s_qtypes[QTYPE_MAX] = {
 ''',
                 name=c_name(name))
@@ -120,7 +115,6 @@ def gen_union(name, base, variants):
 
     ret = mcgen('''
 
-// struct %(name)s
 struct %(name)s {
 ''',
                 name=name)
@@ -175,7 +169,6 @@ struct %(name)s {
 def generate_type_cleanup_decl(name):
     ret = mcgen('''
 
-// decl qapi_free_%(name)s
 void qapi_free_%(name)s(%(name)s *obj);
 ''',
                 name=c_name(name))
@@ -184,7 +177,6 @@ void qapi_free_%(name)s(%(name)s *obj);
 def generate_type_cleanup(name):
     ret = mcgen('''
 
-// def qapi_free_%(name)s
 void qapi_free_%(name)s(%(name)s *obj)
 {
     QapiDeallocVisitor *md;
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index bec1664..cfebcb7 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -27,14 +27,12 @@ def generate_visit_implicit_struct(type):
         # Need a forward declaration
         ret += mcgen('''
 
-// decl visit_type_%(c_type)s_fields
 static void visit_type_%(c_type)s_fields(Visitor *m, %(c_type)s **obj, Error 
**errp);
 ''',
                      c_type=type.c_name())
 
     ret += mcgen('''
 
-// def visit_type_implicit_%(c_type)s
 static void visit_type_implicit_%(c_type)s(Visitor *m, %(c_type)s **obj, Error 
**errp)
 {
     Error *err = NULL;
@@ -60,7 +58,6 @@ def generate_visit_struct_fields(name, members, base = None):
 
     ret += mcgen('''
 
-// def visit_type_%(name)s_fields
 static void visit_type_%(name)s_fields(Visitor *m, %(name)s **obj, Error 
**errp)
 {
     Error *err = NULL;
@@ -143,7 +140,6 @@ def gen_visit_struct(name, base, members):
 
     ret += mcgen('''
 
-// def visit_type_%(name)s
 void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error 
**errp)
 {
 ''',
@@ -159,7 +155,6 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const 
char *name, Error **e
 def gen_visit_list(name, element_type):
     return mcgen('''
 
-// def visit_type_%(name)s
 void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error 
**errp)
 {
     Error *err = NULL;
@@ -190,7 +185,6 @@ out:
 def generate_visit_enum(name):
     return mcgen('''
 
-// def visit_type_%(c_name)s
 void visit_type_%(c_name)s(Visitor *m, %(c_name)s *obj, const char *name, 
Error **errp)
 {
     visit_type_enum(m, (int *)obj, %(c_name)s_lookup, "%(name)s", name, errp);
@@ -201,7 +195,6 @@ void visit_type_%(c_name)s(Visitor *m, %(c_name)s *obj, 
const char *name, Error
 def gen_visit_alternate(name, variants):
     ret = mcgen('''
 
-// def visit_type_%(name)s
 void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error 
**errp)
 {
     Error *err = NULL;
@@ -259,7 +252,6 @@ def gen_visit_union(name, base, variants):
 
     ret += mcgen('''
 
-// def visit_type_%(c_name)s
 void visit_type_%(c_name)s(Visitor *m, %(c_name)s **obj, const char *name, 
Error **errp)
 {
     Error *err = NULL;
@@ -344,7 +336,6 @@ def gen_visit_decl(name, scalar=False):
     if not scalar:
         c_type += '*'
     return mcgen('''
-// decl visit_type_%(c_name)s
 void visit_type_%(c_name)s(Visitor *m, %(c_type)sobj, const char *name, Error 
**errp);
 ''',
                  c_name=c_name(name), c_type=c_type)
diff --git a/scripts/qapi.py b/scripts/qapi.py
index debeade..e1268f4 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1471,7 +1471,6 @@ def guardname(filename):
 def guardstart(name):
     return mcgen('''
 
-// guardstart %(name)s
 #ifndef %(name)s
 #define %(name)s
 
@@ -1481,7 +1480,6 @@ def guardstart(name):
 def guardend(name):
     return mcgen('''
 
-// guardend %(name)s
 #endif /* %(name)s */
 
 ''',
@@ -1490,7 +1488,6 @@ def guardend(name):
 def generate_enum_lookup(name, values):
     ret = mcgen('''
 
-// def %(name)s_lookup
 const char *const %(name)s_lookup[] = {
 ''',
                 name=c_name(name))
@@ -1513,14 +1510,12 @@ def generate_enum(name, values):
     name = c_name(name)
     lookup_decl = mcgen('''
 
-// decl %(name)s_lookup
 extern const char *const %(name)s_lookup[];
 ''',
                 name=name)
 
     enum_decl = mcgen('''
 
-// typedef %(name)s
 typedef enum %(name)s {
 ''',
                 name=name)
@@ -1624,14 +1619,12 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, 
h_file,
     fdecl = maybe_open(do_h, h_file, 'w')
 
     fdef.write(mcgen('''
-// prologue
 /* AUTOMATICALLY GENERATED, DO NOT MODIFY */
 %(comment)s
 ''',
                      comment = c_comment))
 
     fdecl.write(mcgen('''
-// prologue
 /* AUTOMATICALLY GENERATED, DO NOT MODIFY */
 %(comment)s
 #ifndef %(guard)s
@@ -1644,7 +1637,6 @@ def open_output(output_dir, do_c, do_h, prefix, c_file, 
h_file,
 
 def close_output(fdef, fdecl):
     fdecl.write('''
-// epilogue
 #endif
 ''')
     fdecl.close()
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]