[Spice-devel] [PATCH] use more portable SPICE_OFFSETOF instead of offsetof

Frediano Ziglio fziglio at redhat.com
Mon May 16 16:13:29 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/reds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/reds.c b/server/reds.c
index 9898fe5..1909e6e 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -442,7 +442,7 @@ uint64_t *stat_add_counter(RedsState *reds, StatNodeRef parent, const char *name
 
 void stat_remove_counter(RedsState *reds, uint64_t *counter)
 {
-    reds_stat_remove(reds, (SpiceStatNode *)(counter - offsetof(SpiceStatNode, value)));
+    reds_stat_remove(reds, (SpiceStatNode *)(counter - SPICE_OFFSETOF(SpiceStatNode, value)));
 }
 
 void stat_update_value(RedsState *reds, uint32_t value)
-- 
2.7.4



More information about the Spice-devel mailing list