summaryrefslogtreecommitdiff
path: root/babeld/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'babeld/util.h')
-rw-r--r--babeld/util.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/babeld/util.h b/babeld/util.h
index d653b613..4e7635f6 100644
--- a/babeld/util.h
+++ b/babeld/util.h
@@ -42,10 +42,10 @@ THE SOFTWARE.
#include "log.h"
#if defined(i386) || defined(__mc68020__) || defined(__x86_64__)
-#define DO_NTOHS(_d, _s) do { _d = ntohs(*(unsigned short*)(_s)); } while(0)
-#define DO_NTOHL(_d, _s) do { _d = ntohl(*(unsigned*)(_s)); } while(0)
-#define DO_HTONS(_d, _s) do { *(unsigned short*)(_d) = htons(_s); } while(0)
-#define DO_HTONL(_d, _s) do { *(unsigned*)(_d) = htonl(_s); } while(0)
+#define DO_NTOHS(_d, _s) do{ _d = ntohs(*(const unsigned short*)(_s)); }while(0)
+#define DO_NTOHL(_d, _s) do{ _d = ntohl(*(const unsigned*)(_s)); } while(0)
+#define DO_HTONS(_d, _s) do{ *(unsigned short*)(_d) = htons(_s); } while(0)
+#define DO_HTONL(_d, _s) do{ *(unsigned*)(_d) = htonl(_s); } while(0)
/* Some versions of gcc seem to be buggy, and ignore the packed attribute.
Disable this code until the issue is clarified. */
/* #elif defined __GNUC__*/