From 9ad2e0bdec306d80357a642271fbde1f8f02ec45 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 23 Apr 2011 21:27:52 +0000 Subject: Improve node struct alignment git-svn-id: http://svn.drobilla.net/sord/trunk@84 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sordmm.hpp | 2 +- src/sord_internal.h | 8 ++++---- src/sordi.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sord/sordmm.hpp b/sord/sordmm.hpp index e643207..e56cce3 100644 --- a/sord/sordmm.hpp +++ b/sord/sordmm.hpp @@ -58,7 +58,7 @@ public: static inline SerdNode string_to_node(SerdType type, const std::string& s) { SerdNode ret = { - type, s.length() + 1, s.length(), (const uint8_t*)s.c_str() }; + (const uint8_t*)s.c_str(), s.length() + 1, s.length(), type }; return ret; } diff --git a/src/sord_internal.h b/src/sord_internal.h index 4e8892e..7d62e54 100644 --- a/src/sord_internal.h +++ b/src/sord_internal.h @@ -26,12 +26,12 @@ typedef intptr_t SordCount; ///< Count of nodes or triples /** Node */ struct _SordNode { - SordNodeType type; ///< SordNodeType + uint8_t* buf; ///< Value (string) + const char* lang; ///< Literal language (interned string) + SordNode datatype; ///< Literal data type (ID of a URI node, or 0) size_t n_bytes; ///< Length of data in bytes (including terminator) SordCount refs; ///< Reference count (i.e. number of containing quads) - SordNode datatype; ///< Literal data type (ID of a URI node, or 0) - const char* lang; ///< Literal language (interned string) - uint8_t* buf; ///< Value (string) + SordNodeType type; ///< SordNodeType }; #endif /* SORD_SORD_INTERNAL_H_ */ diff --git a/src/sordi.c b/src/sordi.c index 3382cda..6f4539a 100644 --- a/src/sordi.c +++ b/src/sordi.c @@ -65,7 +65,7 @@ serd_node_from_sord_node(const SordNode n) { size_t n_bytes = 0; const uint8_t* buf = sord_node_get_string_counted(n, &n_bytes); - SerdNode sn = { SERD_NOTHING, n_bytes, n_bytes - 1, (const uint8_t*)buf }; + SerdNode sn = { (const uint8_t*)buf, n_bytes, n_bytes - 1, SERD_NOTHING }; // FIXME: UTF-8 switch (sord_node_get_type(n)) { case SORD_URI: -- cgit v1.2.1