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

[Xen-changelog] [xen staging] tools/libxl: gentypes.py: Prefer init_val to init_fn



commit 3afbd233c98e055310d50793f173b47454f0ad04
Author:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
AuthorDate: Tue Oct 29 15:00:35 2019 +0000
Commit:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CommitDate: Tue Nov 19 16:33:43 2019 +0000

    tools/libxl: gentypes.py: Prefer init_val to init_fn
    
    When both are provided, init_val is likely to be more direct.
    
    No functional change with existing types: C output is identical.
    
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libxl/gentypes.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index 6417c9dd8c..1769121468 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -311,10 +311,10 @@ def libxl_C_type_copy_deprecated(field, v, indent = "    
", vparent = None):
                                    field.type.pass_arg(v, vparent is None))
 
         s+= "    "
-        if field.type.init_fn is not None:
-            s+= "%s(%s);\n" % (field.type.init_fn, field_ptr)
-        elif field.type.init_val is not None:
+        if field.type.init_val is not None:
             s+= "%s = %s;\n" % (field_val, field.type.init_val)
+        elif field.type.init_fn is not None:
+            s+= "%s(%s);\n" % (field.type.init_fn, field_ptr)
         else:
             s+= "memset(%s, 0, sizeof(*%s));\n" % (field_ptr, field_ptr)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.