[riot-notifications] [RIOT-OS/RIOT] sys: add unaligned.h (header for alignment safe value-from-pointer functions) (#10797)

Kaspar Schleiser notifications at github.com
Tue Jan 22 12:52:10 CET 2019


kaspar030 commented on this pull request.



> +extern "C" {
+#endif
+
+/** @brief Unaligned access helper struct (uint16_t version) */
+typedef struct {
+    uint16_t val;       /**< value */
+} __attribute__((packed)) uint16_una_t;
+
+/**
+ * @brief    Get uint16_t from possibly unaligned pointer
+ *
+ * @param[in]   ptr pointer to read from
+ *
+ * @returns value read from @p ptr
+ */
+static inline uint16_t get_unaligned_u16(const uint16_t *ptr)

fixed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10797#discussion_r249748615
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190122/484061b4/attachment.html>


More information about the notifications mailing list