Mercurial > dovecot > core-2.2
changeset 18109:88e985e7f2b6
lib: guid - turn uint8_t * parameters into guid_128_t
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>
author | Phil Carmody <phil@dovecot.fi> |
---|---|
date | Tue, 25 Nov 2014 03:31:34 +0200 |
parents | fd43098e23d0 |
children | a45ee7e221b0 |
files | src/lib/guid.c src/lib/guid.h |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/guid.c Tue Nov 25 03:12:25 2014 +0200 +++ b/src/lib/guid.c Tue Nov 25 03:31:34 2014 +0200 @@ -114,12 +114,12 @@ 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); }
--- a/src/lib/guid.h Tue Nov 25 03:12:25 2014 +0200 +++ b/src/lib/guid.h Tue Nov 25 03:31:34 2014 +0200 @@ -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 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,