[PATCH 3/6] Move calculate_string_hash into DC_FIELD_STRING

Anton Lundin glance at acc.umu.se
Sat Nov 8 05:11:08 PST 2014


The calculate_string_hash is only used if DC_FIELD_STRING is defined, so
this removes a warning for everybody who doesn't build against a
libdivecomputer with DC_FIELD_STRING support.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 libdivecomputer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdivecomputer.c b/libdivecomputer.c
index 6974bcc..67d291c 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -397,12 +397,12 @@ static uint32_t calculate_diveid(const unsigned char *fingerprint, unsigned int
 	return csum[0];
 }
 
+#ifdef DC_FIELD_STRING
 static uint32_t calculate_string_hash(const char *str)
 {
 	return calculate_diveid(str, strlen(str));
 }
 
-#ifdef DC_FIELD_STRING
 static void parse_string_field(struct dive *dive, dc_field_string_t *str)
 {
 	// Our dive ID is the string hash of the "Dive ID" string
-- 
1.9.1



More information about the subsurface mailing list