]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
util.h: Shut up splint.
authorErik Rozendaal <erik@NLnetLabs.nl>
Thu, 16 Dec 2004 09:07:43 +0000 (09:07 +0000)
committerErik Rozendaal <erik@NLnetLabs.nl>
Thu, 16 Dec 2004 09:07:43 +0000 (09:07 +0000)
util.h

diff --git a/util.h b/util.h
index 49585e2ec689f9f9f36c168493b856c60961ba3a..6a1f4cdb99a09690dd402b55c18cdadae4872dfa 100644 (file)
--- a/util.h
+++ b/util.h
 
 #define DEP     printf("DEPRICATED FUNCTION!\n");
 
-/* TODO: is this a good way? */
 /*
  * Copy data allowing for unaligned accesses in network byte order
  * (big endian).
  */
+#ifdef S_SPLINT_S
+
+uint16_t read_uint16(const void *src);
+uint32_t read_uint32(const void *src);
+
+#else /* S_SPLINT_S */
+
 static inline uint16_t
 read_uint16(const void *src)
 {
@@ -55,13 +61,15 @@ read_uint32(const void *src)
        return ntohl(*(uint32_t *) src);
 #else
        uint8_t *p = (uint8_t *) src;
-       return (((uint32_t) p[0] << 24)
+       return (  ((uint32_t) p[0] << 24)
                | ((uint32_t) p[1] << 16)
                | ((uint32_t) p[2] << 8)
-               | (uint32_t) p[3]);
+               |  (uint32_t) p[3]);
 #endif
 }
 
+#endif /* !S_SPLINT_S */
+
 /* prototypes */
 void    xprintf_rd_field(t_rdata_field *);
 void    xprintf_rr(ldns_rr_type *);