]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: guid - declare some functions as pure
authorPhil Carmody <phil@dovecot.fi>
Mon, 5 Jan 2015 20:15:31 +0000 (22:15 +0200)
committerPhil Carmody <phil@dovecot.fi>
Mon, 5 Jan 2015 20:15:31 +0000 (22:15 +0200)
As the functions aren't inline, the compiler can't know if they
can be optimised away, so give it a helping hand.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
src/lib/guid.h

index 33ea18eda119ba9fb57cb09101468a9e40eaf873..6f0f6efc71c0dff7388a6cddd885ab36c85bf036 100644 (file)
@@ -11,9 +11,9 @@ const char *guid_generate(void);
 /* Generate 128 bit GUID */
 void guid_128_generate(guid_128_t guid_r);
 /* Returns TRUE if GUID is empty (not set / unknown). */
-bool guid_128_is_empty(const guid_128_t guid);
+bool guid_128_is_empty(const guid_128_t guid) ATTR_PURE;
 /* Returns TRUE if two GUIDs are equal. */
-bool guid_128_equals(const guid_128_t guid1, const guid_128_t guid2);
+bool guid_128_equals(const guid_128_t guid1, const guid_128_t guid2) ATTR_PURE;
 /* Copy GUID */
 static inline void guid_128_copy(guid_128_t dest, const guid_128_t src)
 {
@@ -26,8 +26,8 @@ const char *guid_128_to_string(const guid_128_t guid);
 int guid_128_from_string(const char *str, guid_128_t guid_r);
 
 /* guid_128 hash/cmp functions for hash.h */
-unsigned int guid_128_hash(const guid_128_t guid);
-int guid_128_cmp(const guid_128_t guid1, const guid_128_t guid2);
+unsigned int guid_128_hash(const guid_128_t guid) ATTR_PURE;
+int guid_128_cmp(const guid_128_t guid1, const guid_128_t guid2) ATTR_PURE;
 
 /* Return the hash of host used by guid_128_generate(). */
 void guid_128_host_hash_get(const char *host,