From: Vsevolod Stakhov Date: Mon, 18 Jan 2016 18:11:11 +0000 (+0000) Subject: Fix some compiler warnings X-Git-Tag: 1.1.1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=538335a717faeed3093ebedb0066fe8fbaa0c93e;p=thirdparty%2Frspamd.git Fix some compiler warnings --- diff --git a/contrib/libucl/ucl_internal.h b/contrib/libucl/ucl_internal.h index 31d6b13613..64938592aa 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 fac5e0a45d..01d2e137cd 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