summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <victortoso@redhat.com>2015-08-14 18:07:31 +0200
committerVictor Toso <victortoso@redhat.com>2015-10-09 08:25:07 +0200
commite751b02f91ab34f1f9ee0cd4c5b9b688619cf39d (patch)
treee24c42cbfd69a52210a72aaa273eb06ab9a71ffc
parent95b5617874a17f13c3419f4de87dfd88a8eb832d (diff)
macros: add macros to help deal with aligment warningsfix-clang-warnings
-rw-r--r--spice/macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/spice/macros.h b/spice/macros.h
index cd63528..08c692f 100644
--- a/spice/macros.h
+++ b/spice/macros.h
@@ -428,4 +428,10 @@
((uint32_t)((s[3]&0xffu)|((s[2]&0xffu)<<8)|((s[1]&0xffu)<<16)|((s[0]&0xffu)<<24)))
#endif
+/* Compiler may complain about alignment which could be a false-posive
+ * or could be true and problematic depending on the architecture. The
+ * defines below intend to help track such situations */
+#define SPICE_ALIGNED_CAST(type, ptr) ((type*)(void*)(ptr))
+#define SPICE_UNALIGNED_CAST SPICE_ALIGNED_CAST
+
#endif /* _H_SPICE_MACROS */