]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commitdiff
curve25519: squelch warnings on clang
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 7 Feb 2020 14:46:59 +0000 (15:46 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 7 Feb 2020 14:46:59 +0000 (15:46 +0100)
These are generic helper functions we don't want to move into the actual
implementations, so that it's easy to keep parity with the kernel code.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/curve25519.c

index 7d3fd155590e614a0c73633a3f0bc9604dec34dd..1739a9eb5713b94e3b1bf67fdbd6a069fe0b98d1 100644 (file)
@@ -39,35 +39,39 @@ typedef int64_t s64;
 #define le32_to_cpup(a) (*(a))
 #define cpu_to_le64(a) (a)
 #endif
-static inline __le32 get_unaligned_le32(const u8 *a)
+#ifndef __unused
+#define __unused  __attribute__((unused))
+#endif
+#ifndef __always_inline
+#define __always_inline __inline __attribute__((__always_inline__))
+#endif
+#ifndef noinline
+#define noinline __attribute__((noinline))
+#endif
+#ifndef __aligned
+#define __aligned(x) __attribute__((aligned(x)))
+#endif
+#ifndef __force
+#define __force
+#endif
+
+static __always_inline __unused __le32 get_unaligned_le32(const u8 *a)
 {
        __le32 l;
        __builtin_memcpy(&l, a, sizeof(l));
        return le32_to_cpup(&l);
 }
-static inline __le64 get_unaligned_le64(const u8 *a)
+static __always_inline __unused __le64 get_unaligned_le64(const u8 *a)
 {
        __le64 l;
        __builtin_memcpy(&l, a, sizeof(l));
        return le64_to_cpup(&l);
 }
-static inline void put_unaligned_le64(u64 s, u8 *d)
+static __always_inline __unused void put_unaligned_le64(u64 s, u8 *d)
 {
        __le64 l = cpu_to_le64(s);
        __builtin_memcpy(d, &l, sizeof(l));
 }
-#ifndef __always_inline
-#define __always_inline __inline __attribute__((__always_inline__))
-#endif
-#ifndef noinline
-#define noinline __attribute__((noinline))
-#endif
-#ifndef __aligned
-#define __aligned(x) __attribute__((aligned(x)))
-#endif
-#ifndef __force
-#define __force
-#endif
 
 static noinline void memzero_explicit(void *s, size_t count)
 {