dovecot-2.2: lib: guid - declare some functions as pure

dovecot at dovecot.org dovecot at dovecot.org
Mon Jan 5 20:20:50 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/4f0f1e10cb53
changeset: 18135:4f0f1e10cb53
user:      Phil Carmody <phil at dovecot.fi>
date:      Mon Jan 05 22:15:31 2015 +0200
description:
lib: guid - declare some functions as pure
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 at dovecot.fi>

diffstat:

 src/lib/guid.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 17ec2a11cf44 -r 4f0f1e10cb53 src/lib/guid.h
--- a/src/lib/guid.h	Mon Jan 05 22:15:07 2015 +0200
+++ b/src/lib/guid.h	Mon Jan 05 22:15:31 2015 +0200
@@ -11,9 +11,9 @@
 /* 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 @@
 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,


More information about the dovecot-cvs mailing list