diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2020-04-06 16:27:41 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2020-04-11 14:16:25 +0200 |
commit | 765813e908e0f23e98ec6224b0408a152a9d3ec0 (patch) | |
tree | 1e4140aa1a097fe081b05d74334f95973a309e28 /contrib/kann | |
parent | d6da3282ea865b8c39fab3e7026296fa922e1a64 (diff) | |
download | rspamd-765813e908e0f23e98ec6224b0408a152a9d3ec0.tar.gz rspamd-765813e908e0f23e98ec6224b0408a152a9d3ec0.zip |
[Minor] silence warnings about unused function results
GCC does not respect `(void) func()`
Diffstat (limited to 'contrib/kann')
-rw-r--r-- | contrib/kann/kann.c | 6 | ||||
-rw-r--r-- | contrib/kann/kautodiff.c | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/contrib/kann/kann.c b/contrib/kann/kann.c index 76ade6a52..72fb0c061 100644 --- a/contrib/kann/kann.c +++ b/contrib/kann/kann.c @@ -496,7 +496,7 @@ kann_t *kann_load_fp(FILE *fp) kann_t *ann; int n_var, n_const; - fread(magic, 1, 4, fp); + (void) !fread(magic, 1, 4, fp); if (strncmp(magic, KANN_MAGIC, 4) != 0) { fclose(fp); return 0; @@ -508,8 +508,8 @@ kann_t *kann_load_fp(FILE *fp) ann->x = (float*)malloc(n_var * sizeof(float)); ann->g = (float*)calloc(n_var, sizeof(float)); ann->c = (float*)malloc(n_const * sizeof(float)); - fread(ann->x, sizeof(float), n_var, fp); - fread(ann->c, sizeof(float), n_const, fp); + (void) !fread(ann->x, sizeof(float), n_var, fp); + (void) !fread(ann->c, sizeof(float), n_const, fp); kad_ext_sync(ann->n, ann->v, ann->x, ann->g, ann->c); return ann; } diff --git a/contrib/kann/kautodiff.c b/contrib/kann/kautodiff.c index bc9458f42..47a86a71e 100644 --- a/contrib/kann/kautodiff.c +++ b/contrib/kann/kautodiff.c @@ -617,28 +617,28 @@ static kad_node_t *kad_load1(FILE *fp, kad_node_t **node) { kad_node_t *p; p = (kad_node_t*)calloc(1, sizeof(kad_node_t)); - fread(&p->ext_label, 4, 1, fp); - fread(&p->ext_flag, 4, 1, fp); - fread(&p->flag, 1, 1, fp); - fread(&p->n_child, 4, 1, fp); + (void) !fread(&p->ext_label, 4, 1, fp); + (void) !fread(&p->ext_flag, 4, 1, fp); + (void) !fread(&p->flag, 1, 1, fp); + (void) !fread(&p->n_child, 4, 1, fp); if (p->n_child) { int32_t j, k; p->child = (kad_node_t**)calloc(p->n_child, sizeof(kad_node_t*)); - fread(&p->op, 2, 1, fp); + (void) !fread(&p->op, 2, 1, fp); for (j = 0; j < p->n_child; ++j) { - fread(&k, 4, 1, fp); + (void) !fread(&k, 4, 1, fp); p->child[j] = node? node[k] : 0; } - fread(&k, 4, 1, fp); + (void) !fread(&k, 4, 1, fp); if (k >= 0) p->pre = node[k]; - fread(&p->ptr_size, 4, 1, fp); + (void) !fread(&p->ptr_size, 4, 1, fp); if (p->ptr_size > 0) { p->ptr = malloc(p->ptr_size); - fread(p->ptr, p->ptr_size, 1, fp); + (void) !fread(p->ptr, p->ptr_size, 1, fp); } } else { - fread(&p->n_d, 1, 1, fp); - if (p->n_d) fread(p->d, 4, p->n_d, fp); + (void) !fread(&p->n_d, 1, 1, fp); + if (p->n_d) (void) !fread(p->d, 4, p->n_d, fp); } return p; } @@ -657,7 +657,7 @@ kad_node_t **kad_load(FILE *fp, int *_n_node) { int32_t i, n_node; kad_node_t **node; - fread(&n_node, 4, 1, fp); + (void) !fread(&n_node, 4, 1, fp); node = (kad_node_t**)malloc(n_node * sizeof(kad_node_t*)); for (i = 0; i < n_node; ++i) { kad_node_t *p; |