[Spice-commits] 3 commits - common/ring.h python_modules/ptypes.py

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Jun 21 11:53:00 UTC 2016


 common/ring.h            |    4 +---
 python_modules/ptypes.py |    3 ++-
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 15b8f28c14a34b1c0fc0d2ac1d0ed4e87e407ce6
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon Jun 20 16:21:32 2016 +0100

    Use a macro to simplify ring_get_length
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/common/ring.h b/common/ring.h
index b13bc7d..4b0e313 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -155,9 +155,7 @@ static inline unsigned int ring_get_length(Ring *ring)
     RingItem *i;
     unsigned int ret = 0;
 
-    for (i = ring_get_head(ring);
-         i != NULL;
-         i = ring_next(ring, i))
+    RING_FOREACH(i, ring)
         ret++;
 
     return ret;
commit 57570953dce2941f674190d508b4c6b7d1c5f0ab
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon May 16 16:55:27 2016 +0100

    extend a comment for type attributes
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 1f4e068..f4a09f7 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -63,7 +63,7 @@ class FixedSize:
 propagated_attributes=["ptr_array", "nonnull", "chunk"]
 
 valid_attributes=set([
-    # embedded/appended at the end of the structure
+    # embedded/appended at the end of the resulting C structure
     'end',
     # the C structure contains a pointer to data
     # for instance we want to write an array to an allocated array
commit c5a61aaa30c7e4c81eca83be3aa7245599281515
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon May 16 16:55:02 2016 +0100

    add a check for negate cases on enumerations
    
    Not supported by code so trigger an error to avoid invalid usages
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 74f3e55..1f4e068 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -686,6 +686,7 @@ class SwitchCase:
             if v == None:
                 return "1"
             elif var_type.is_enum():
+                assert v[0] == "", "Negation of enumeration in switch is not supported"
                 checks.append("%s == %s" % (var_cname, var_type.c_enumname_by_name(v[1])))
             else:
                 checks.append("%s(%s & %s)" % (v[0], var_cname, var_type.c_enumname_by_name(v[1])))


More information about the Spice-commits mailing list