From 538335a717faeed3093ebedb0066fe8fbaa0c93e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 18 Jan 2016 18:11:11 +0000 Subject: [PATCH] Fix some compiler warnings --- contrib/libucl/ucl_internal.h | 28 ++++++++++++++++++++++++++++ src/rspamadm/fuzzy_merge.c | 4 +++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/contrib/libucl/ucl_internal.h b/contrib/libucl/ucl_internal.h index 31d6b1361..64938592a 100644 --- a/contrib/libucl/ucl_internal.h +++ b/contrib/libucl/ucl_internal.h @@ -523,6 +523,34 @@ void ucl_emitter_print_key_msgpack (bool print_key, struct ucl_emitter_context *ctx, const ucl_object_t *obj); +/** + * Fetch URL into a buffer + * @param url url to fetch + * @param buf pointer to buffer (must be freed by callee) + * @param buflen pointer to buffer length + * @param err pointer to error argument + * @param must_exist fail if cannot find a url + */ +bool ucl_fetch_url (const unsigned char *url, + unsigned char **buf, + size_t *buflen, + UT_string **err, + bool must_exist); + +/** + * Fetch a file and save results to the memory buffer + * @param filename filename to fetch + * @param len length of filename + * @param buf target buffer + * @param buflen target length + * @return + */ +bool ucl_fetch_file (const unsigned char *filename, + unsigned char **buf, + size_t *buflen, + UT_string **err, + bool must_exist); + /** * Add new element to an object using the current merge strategy and priority * @param parser diff --git a/src/rspamadm/fuzzy_merge.c b/src/rspamadm/fuzzy_merge.c index fac5e0a45..01d2e137c 100644 --- a/src/rspamadm/fuzzy_merge.c +++ b/src/rspamadm/fuzzy_merge.c @@ -210,9 +210,11 @@ static guint rspamadm_op_hash (gconstpointer p) { const struct fuzzy_merge_op *op = p; + guint res; /* Uniformly distributed */ - return *(guint *)op->digest; + memcpy (&res, op->digest, sizeof (res)); + return res; } static gboolean -- 2.39.5