[Spice-commits] 3 commits - python_modules/demarshal.py spice_codegen.py tests/test-marshallers.h tests/test-marshallers.proto

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 13 17:12:49 UTC 2019


 python_modules/demarshal.py  |    2 +-
 spice_codegen.py             |    1 +
 tests/test-marshallers.h     |    2 +-
 tests/test-marshallers.proto |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 60e045369863043a8a5f2eb36566447df63f6277
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Aug 13 17:13:28 2019 +0100

    codegen: Exit with error on error generating C structures
    
    This was some left-over during development of C structure
    generations (the single structure generation was skipped).
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/spice_codegen.py b/spice_codegen.py
index 0532d6f..d3a1bf5 100755
--- a/spice_codegen.py
+++ b/spice_codegen.py
@@ -283,6 +283,7 @@ current:
         print >> sys.stderr, 'type %s' % t
         print >> sys.stderr, writer.getvalue()
         traceback.print_exc(sys.stderr)
+        sys.exit(1)
 
 def generate_declarations():
     writer = codegen.CodeWriter()
commit 7abd2b36d9b897bc6c8b85749e0f7e2aede3d703
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Aug 13 17:07:44 2019 +0100

    codegen: Use has_end_attr instead of has_attr("end")
    
    Just style, they do the same thing, but is more coherent
    with the rest of the code.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/python_modules/demarshal.py b/python_modules/demarshal.py
index d3147b7..6d8dbdd 100644
--- a/python_modules/demarshal.py
+++ b/python_modules/demarshal.py
@@ -804,7 +804,7 @@ def write_array_parser(writer, member, nelements, array, dest, scope):
     element_type = array.element_type
     if member:
         array_start = dest.get_ref(member.name)
-        at_end = member.has_attr("end")
+        at_end = member.has_end_attr()
     else:
         array_start = "end"
         at_end = True
commit 01417b7533f5e0a933e2cd4ff8895cf89a2f8040
Author: Uri Lublin <uril at redhat.com>
Date:   Tue Aug 13 19:45:12 2019 +0300

    test-marshallers.proto: ArrayMessage: make space for name
    
    Do it by adding @end tag.
    Without it the allocated memory has no space for 'name'.
    
    Also fix SpiceMsgMainArrayMessage tests/test-marshallers.h,
    replacing int8_t* name with int8_t name[0].
    This makes name an "in-structure" array with no pre-defined size
    instead of a pointer.
    The size is defined by the message size.
    
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/tests/test-marshallers.h b/tests/test-marshallers.h
index 7686067..8ca736e 100644
--- a/tests/test-marshallers.h
+++ b/tests/test-marshallers.h
@@ -10,7 +10,7 @@ typedef struct {
 } SpiceMsgMainShortDataSubMarshall;
 
 typedef struct {
-    int8_t *name;
+    int8_t name[0];
 } SpiceMsgMainArrayMessage;
 
 typedef struct {
diff --git a/tests/test-marshallers.proto b/tests/test-marshallers.proto
index 34cc892..eabd487 100644
--- a/tests/test-marshallers.proto
+++ b/tests/test-marshallers.proto
@@ -6,7 +6,7 @@ channel TestChannel {
    } ShortDataSubMarshall;
 
    message {
-      int8 name[];
+      int8 name[] @end;
    } ArrayMessage;
 
     message {


More information about the Spice-commits mailing list