... | ... |
@@ -61,7 +61,7 @@ static char cli_ndecode(unsigned char value) |
61 | 61 |
return -1; |
62 | 62 |
} |
63 | 63 |
|
64 |
-unsigned char *cli_decodesig(const char *sig, unsigned int plen, mp_int e, mp_int n) |
|
64 |
+static unsigned char *cli_decodesig(const char *sig, unsigned int plen, mp_int e, mp_int n) |
|
65 | 65 |
{ |
66 | 66 |
int i, slen = strlen(sig), dec; |
67 | 67 |
unsigned char *plain; |
... | ... |
@@ -1256,7 +1256,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v |
1256 | 1256 |
|
1257 | 1257 |
static int qcompare(const void *a, const void *b) |
1258 | 1258 |
{ |
1259 |
- return *(unsigned char *)a - *(unsigned char *)b; |
|
1259 |
+ return *(const unsigned char *)a - *(const unsigned char *)b; |
|
1260 | 1260 |
} |
1261 | 1261 |
|
1262 | 1262 |
/* FIXME: clean up the code */ |
... | ... |
@@ -1633,7 +1633,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex |
1633 | 1633 |
if(new->length > root->maxpatlen) |
1634 | 1634 |
root->maxpatlen = new->length; |
1635 | 1635 |
|
1636 |
- new->virname = cli_mpool_virname(root->mempool, (char *) virname, options & CL_DB_OFFICIAL); |
|
1636 |
+ new->virname = cli_mpool_virname(root->mempool, virname, options & CL_DB_OFFICIAL); |
|
1637 | 1637 |
if(!new->virname) { |
1638 | 1638 |
mpool_free(root->mempool, new->prefix ? new->prefix : new->pattern); |
1639 | 1639 |
mpool_ac_free_special(root->mempool, new); |
... | ... |
@@ -34,6 +34,7 @@ |
34 | 34 |
|
35 | 35 |
#include "platform.h" |
36 | 36 |
#include "cltypes.h" |
37 |
+#include "others.h" |
|
37 | 38 |
|
38 | 39 |
static inline char *med3(char *, char *, char *, int (*)(const void *, const void *)); |
39 | 40 |
static inline void swapfunc(char *, char *, int, int); |
... | ... |
@@ -155,11 +156,11 @@ loop: SWAPINIT(a, es); |
155 | 155 |
pn = (char *) a + n * es; |
156 | 156 |
r = MIN(pa - (char *)a, pb - pa); |
157 | 157 |
vecswap(a, pb - r, r); |
158 |
- r = MIN(pd - pc, pn - pd - es); |
|
158 |
+ r = MIN((size_t) (pd - pc), (size_t) (pn - pd - es)); |
|
159 | 159 |
vecswap(pb, pn - r, r); |
160 |
- if ((r = pb - pa) > es) |
|
160 |
+ if ((size_t) (r = pb - pa) > es) |
|
161 | 161 |
cli_qsort(a, r / es, es, cmp); |
162 |
- if ((r = pd - pc) > es) { |
|
162 |
+ if ((size_t) (r = pd - pc) > es) { |
|
163 | 163 |
/* Iterate rather than recurse to save stack space */ |
164 | 164 |
a = pn - r; |
165 | 165 |
n = r / es; |
... | ... |
@@ -1984,7 +1984,7 @@ static int cli_loadmd(FILE *fs, struct cl_engine *engine, unsigned int *signo, i |
1984 | 1984 |
|
1985 | 1985 |
/* tokens[6] - not used */ |
1986 | 1986 |
|
1987 |
- new->filepos[0] = new->filepos[1] = strcmp(tokens[7], "*") ? atoi(tokens[7]) : CLI_OFF_ANY; |
|
1987 |
+ new->filepos[0] = new->filepos[1] = strcmp(tokens[7], "*") ? atoi(tokens[7]) : (int) CLI_OFF_ANY; |
|
1988 | 1988 |
|
1989 | 1989 |
/* tokens[8] - not used */ |
1990 | 1990 |
|
... | ... |
@@ -90,7 +90,7 @@ static const enum normalize_action char_action[256] = { |
90 | 90 |
/* Normalizes the text at @buf of length @buf_len, @buf can include \0 characters. |
91 | 91 |
* Stores the normalized text in @state's buffer. |
92 | 92 |
* Returns how many bytes it consumed of the input. */ |
93 |
-ssize_t text_normalize_buffer(struct text_norm_state *state, const unsigned char *buf, const size_t buf_len) |
|
93 |
+size_t text_normalize_buffer(struct text_norm_state *state, const unsigned char *buf, const size_t buf_len) |
|
94 | 94 |
{ |
95 | 95 |
size_t i; |
96 | 96 |
const unsigned char *out_end = state->out + state->out_len; |
... | ... |
@@ -118,6 +118,6 @@ ssize_t text_normalize_buffer(struct text_norm_state *state, const unsigned char |
118 | 118 |
} |
119 | 119 |
} |
120 | 120 |
state->out_pos = p - state->out; |
121 |
- return (ssize_t)i; |
|
121 |
+ return i; |
|
122 | 122 |
} |
123 | 123 |
|
... | ... |
@@ -29,4 +29,4 @@ struct text_norm_state { |
29 | 29 |
|
30 | 30 |
int text_normalize_init(struct text_norm_state *state, unsigned char *out, size_t out_len); |
31 | 31 |
void text_normalize_reset(struct text_norm_state* state); |
32 |
-ssize_t text_normalize_buffer(struct text_norm_state *state, const unsigned char *buf, const size_t buf_len); |
|
32 |
+size_t text_normalize_buffer(struct text_norm_state *state, const unsigned char *buf, const size_t buf_len); |