Skip to content

Commit

Permalink
lib: fix compiler warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre committed Nov 30, 2011
1 parent 76990c0 commit 9f83061
Showing 3 changed files with 6 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/backrefs.h
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@
#define SAVE_KEY_STRING(l) \
do { \
state->max_keys_ref_value++; \
strncpy(state->keys_tables[state->max_keys_ref_value], next, l); \
state->keys_tables[state->max_keys_ref_value][l] = '\0'; \
/* Cast here is safe enough (dump copy) */ \
strncat((char*) state->keys_tables[state->max_keys_ref_value], (char*) next, l); \
} while(0)

/*
@@ -39,8 +39,8 @@
#define SAVE_VALUE_STRING(l) \
do { \
state->max_values_ref_value++; \
strncpy(state->values_tables[state->max_values_ref_value], next, l); \
state->values_tables[state->max_values_ref_value][l] = '\0'; \
/* Cast here is safe enough (dumb copy) */ \
strncat((char*) state->values_tables[state->max_values_ref_value], (char*) next, l); \
} while(0)

/*
3 changes: 2 additions & 1 deletion lib/copy.h
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@
if (left < copy_string_length) { \
goto out; \
} \
strncpy(put, s, copy_string_length); \
/* Cast here is safe enough (dump copy) */ \
strncat((char*) put, (char*) (s), copy_string_length); \
/* Update pointer to output buffer */ \
put += copy_string_length; \
/* Update total number of bytes written */ \
6 changes: 0 additions & 6 deletions lib/decode.c
Original file line number Diff line number Diff line change
@@ -42,28 +42,22 @@

int smile_decode(s_stream *strm)
{
unsigned char *curr;
struct decode_state *state;
const unsigned char *next; /* next input */
unsigned char *put; /* next output */
unsigned int have, left; /* available input and output */
unsigned long hold; /* bit buffer */
unsigned int bits; /* bits in bit buffer */
unsigned int bytes;
#ifdef DEBUG
unsigned int debug_bytes_output; /* local variable for DEBUG_OUTPUT macro */
#endif
unsigned int in, out; /* save starting available input and output */
unsigned int copy; /* number of stored or match bytes to copy */
unsigned char *from; /* where to copy match bytes from */
unsigned int len; /* length to copy for repeats, bits to drop */
int ret = 0; /* return code */

int copy_string_length; /* local variable for COPY_STRING macro */
char copy_nb_buf[21]; /* local variable for COPY_NB macro (21 for up to 20 digits) */
int smile_key_length;
int smile_value_length;
short smile_value_lookup;
unsigned long smile_zzvarint_decode;/* local variable for VARINT_DECODE macro */
int quote_idx;

0 comments on commit 9f83061

Please sign in to comment.