]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: guid - turn uint8_t * parameters into guid_128_t
authorPhil Carmody <phil@dovecot.fi>
Tue, 25 Nov 2014 01:31:34 +0000 (03:31 +0200)
committerPhil Carmody <phil@dovecot.fi>
Tue, 25 Nov 2014 01:31:34 +0000 (03:31 +0200)
As we expose the type's internals, there's no concrete difference between
the two, but it might help static code checkers to detect misuse of the
library, or sloppy typing.

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

index 7aae2c6540931357c3a0dce685b13b02929430b8..1d3fda8b1ff72ff5e77da9f4dc8aa019676f6193 100644 (file)
@@ -114,12 +114,12 @@ const char *guid_128_to_string(const guid_128_t guid)
        return binary_to_hex(guid, GUID_128_SIZE);
 }
 
-unsigned int guid_128_hash(const uint8_t *guid)
+unsigned int guid_128_hash(const guid_128_t guid)
 {
        return mem_hash(guid, GUID_128_SIZE);
 }
 
-int guid_128_cmp(const uint8_t *guid1, const uint8_t *guid2)
+int guid_128_cmp(const guid_128_t guid1, const guid_128_t guid2)
 {
        return memcmp(guid1, guid2, GUID_128_SIZE);
 }
index 94fa7d1ff219e3f4e84f6e4a40a56a96f71b666a..33ea18eda119ba9fb57cb09101468a9e40eaf873 100644 (file)
@@ -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 uint8_t *guid);
-int guid_128_cmp(const uint8_t *guid1, const uint8_t *guid2);
+unsigned int guid_128_hash(const guid_128_t guid);
+int guid_128_cmp(const guid_128_t guid1, const guid_128_t guid2);
 
 /* Return the hash of host used by guid_128_generate(). */
 void guid_128_host_hash_get(const char *host,