diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-11-25 17:56:00 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-11-25 17:57:50 +0100 |
commit | 75d8ad7320477593655f1ecd0842ed0ef52ed51c (patch) | |
tree | b4af372b8d46c2ed849e002ce54fc792408af977 /src/common/compat.h | |
parent | 11221d0f17bf3ea6039249ad8b06b3a1afd6291d (diff) | |
download | tor-75d8ad7320477593655f1ecd0842ed0ef52ed51c.tar.gz tor-75d8ad7320477593655f1ecd0842ed0ef52ed51c.zip |
Purge ATTR_PURE from the code
We're using it incorrectly in many cases, and it doesn't help as far as
we know.
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/common/compat.h b/src/common/compat.h index b005dd2974..e08b0d70df 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -135,7 +135,6 @@ extern INLINE double U64_TO_DBL(uint64_t x) { /* GCC has several useful attributes. */ #if defined(__GNUC__) && __GNUC__ >= 3 #define ATTR_NORETURN __attribute__((noreturn)) -#define ATTR_PURE __attribute__((pure)) #define ATTR_CONST __attribute__((const)) #define ATTR_MALLOC __attribute__((malloc)) #define ATTR_NORETURN __attribute__((noreturn)) @@ -168,7 +167,6 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define PREDICT_UNLIKELY(exp) __builtin_expect(!!(exp), 0) #else #define ATTR_NORETURN -#define ATTR_PURE #define ATTR_CONST #define ATTR_MALLOC #define ATTR_NORETURN @@ -271,9 +269,9 @@ int tor_asprintf(char **strp, const char *fmt, ...) int tor_vasprintf(char **strp, const char *fmt, va_list args); const void *tor_memmem(const void *haystack, size_t hlen, const void *needle, - size_t nlen) ATTR_PURE ATTR_NONNULL((1,3)); + size_t nlen) ATTR_NONNULL((1,3)); static const void *tor_memstr(const void *haystack, size_t hlen, - const char *needle) ATTR_PURE ATTR_NONNULL((1,3)); + const char *needle) ATTR_NONNULL((1,3)); static INLINE const void * tor_memstr(const void *haystack, size_t hlen, const char *needle) { @@ -546,9 +544,9 @@ long tor_weak_random(void); /* ===== OS compatibility */ const char *get_uname(void); -uint16_t get_uint16(const void *cp) ATTR_PURE ATTR_NONNULL((1)); -uint32_t get_uint32(const void *cp) ATTR_PURE ATTR_NONNULL((1)); -uint64_t get_uint64(const void *cp) ATTR_PURE ATTR_NONNULL((1)); +uint16_t get_uint16(const void *cp) ATTR_NONNULL((1)); +uint32_t get_uint32(const void *cp) ATTR_NONNULL((1)); +uint64_t get_uint64(const void *cp) ATTR_NONNULL((1)); void set_uint16(void *cp, uint16_t v) ATTR_NONNULL((1)); void set_uint32(void *cp, uint32_t v) ATTR_NONNULL((1)); void set_uint64(void *cp, uint64_t v) ATTR_NONNULL((1)); |