dovecot-2.2: lib: guid - turn uint8_t * parameters into guid_128_t

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 25 01:36:12 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/88e985e7f2b6
changeset: 18109:88e985e7f2b6
user:      Phil Carmody <phil at dovecot.fi>
date:      Tue Nov 25 03:31:34 2014 +0200
description:
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 at dovecot.fi>

diffstat:

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

diffs (32 lines):

diff -r fd43098e23d0 -r 88e985e7f2b6 src/lib/guid.c
--- 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);
 }
diff -r fd43098e23d0 -r 88e985e7f2b6 src/lib/guid.h
--- 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,


More information about the dovecot-cvs mailing list