From 61017f22c9f20531acfead6cd5ae78272e9b7ece Mon Sep 17 00:00:00 2001 From: Per Hedbor <ph@opera.com> Date: Tue, 25 Feb 2014 14:20:46 +0100 Subject: [PATCH] Tagged some more arguments UNUSED --- src/builtin_functions.c | 5 +++-- src/error.c | 2 +- src/gc.c | 9 ++++++--- src/interpret.c | 2 +- src/modules/DVB/dvb.c | 18 +++++++++--------- src/modules/_Image_JPEG/transupp.c | 8 ++++++-- src/pike_embed.c | 2 +- src/post_modules/CritBit/bignumtree.cmod | 3 ++- src/post_modules/CritBit/critbit/key_float.h | 2 +- src/post_modules/CritBit/critbit/key_int.h | 2 +- src/post_modules/CritBit/tree_high.c | 6 ++++-- src/post_modules/CritBit/tree_low.c | 7 ++++--- src/post_modules/Nettle/cipher.cmod | 2 +- 13 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index defaba5a7b..bb26e890a7 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -842,6 +842,7 @@ PMOD_EXPORT void f_random_seed(INT32 args) { INT_TYPE i; check_all_args("random_seed",args,BIT_INT | BIT_OBJECT, 0); + if(TYPEOF(Pike_sp[-args]) == T_INT) { i=Pike_sp[-args].u.integer; @@ -5256,7 +5257,7 @@ PMOD_EXPORT void f_rows(INT32 args) *! @seealso *! @[next_object()] */ -static void f_map_all_objects( INT32 args ) +static void f_map_all_objects( INT32 UNUSED(args) ) { struct object *o = first_object; INT32 total = 0; @@ -7789,7 +7790,7 @@ unsigned int rec_size_svalue( struct svalue *s, struct mapping **m ) *! @seealso *! @[lfun::_size_object()], @[sizeof()] */ -static void f__size_object( INT32 args ) +static void f__size_object( INT32 UNUSED(args) ) { size_t sum; unsigned int i; diff --git a/src/error.c b/src/error.c index 4b8199c92f..f617cedf7f 100644 --- a/src/error.c +++ b/src/error.c @@ -1089,7 +1089,7 @@ PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expe } #ifdef PIKE_DEBUG -static void gc_check_throw_value(struct callback *foo, void *bar, void *gazonk) +static void gc_check_throw_value(struct callback *UNUSED(foo), void *UNUSED(bar), void *UNUSED(gazonk)) { gc_mark_external_svalues(&throw_value,1," in the throw value"); } diff --git a/src/gc.c b/src/gc.c index 6fab1cbbff..8a4a86a234 100644 --- a/src/gc.c +++ b/src/gc.c @@ -1075,9 +1075,12 @@ static void dloc_gc_fatal (const char *file, INT_TYPE line, va_end (args); } -static void rec_stack_fatal (struct gc_rec_frame *err, const char *err_name, - struct gc_rec_frame *p1, const char *p1n, - struct gc_rec_frame *p2, const char *p2n, +static void rec_stack_fatal (struct gc_rec_frame *DEBUGUSED(err), + const char *DEBUGUSED(err_name), + struct gc_rec_frame *DEBUGUSED(p1), + const char *DEBUGUSED(p1n), + struct gc_rec_frame *DEBUGUSED(p2), + const char *DEBUGUSED(p2n), const char *file, INT_TYPE line, const char *fmt, ...) { diff --git a/src/interpret.c b/src/interpret.c index b5e3f7e511..97fa76b8f6 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -172,7 +172,7 @@ void gc_mark_stack_external (struct pike_frame *f, gc_mark_external_svalues (stack, stack_p - stack, " on svalue stack"); } -static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk) +static void gc_check_stack_callback(struct callback *UNUSED(foo), void *UNUSED(bar), void *UNUSED(gazonk)) { if (Pike_interpreter.evaluator_stack #ifdef PIKE_DEBUG diff --git a/src/modules/DVB/dvb.c b/src/modules/DVB/dvb.c index 36a7f98e8c..25efea341e 100644 --- a/src/modules/DVB/dvb.c +++ b/src/modules/DVB/dvb.c @@ -801,7 +801,7 @@ static int read_t(int fd,unsigned char *buffer,int length,int cks) return -1; } - if (cks && crc32(buffer+1,n) != 0) + if (cks && crc32((char *)buffer+1,n) != 0) { fprintf(stderr,"crc error\n"); /* FIXME: ??? */ continue; @@ -1093,7 +1093,7 @@ static void f_parse_pmt(INT32 args) case 0x0a: if (buffer[index]==3 || buffer[index]==4) { push_text("lang"); - push_string(make_shared_binary_string(&buffer[i+2], 3)); cnt++; + push_string(make_shared_binary_string((char *)&buffer[i+2], 3)); cnt++; } break; case 0x09: @@ -1366,7 +1366,7 @@ static void f_stream_read(INT32 args) { dvb_stream_data *dvb_stream = DVBStream; int all = 1, ret, e, cnt, ix = 0; - char buf[MAX_DVB_READ_SIZE], *bufptr; + unsigned char buf[MAX_DVB_READ_SIZE], *bufptr; if(dvb_stream->fd < 0) Pike_error("Object destroyed!\n"); @@ -1664,7 +1664,7 @@ static void f_audio_mixer(INT32 args) { /*! @endmodule */ -static void init_dvb_data(struct object *obj) { +static void init_dvb_data(struct object *UNUSED(obj)) { unsigned int i; @@ -1674,7 +1674,7 @@ static void init_dvb_data(struct object *obj) { } static void exit_dvb_stream(struct object *obj); -static void exit_dvb_data(struct object *obj) { +static void exit_dvb_data(struct object *UNUSED(obj)) { dvb_stream_data *s; @@ -1688,17 +1688,17 @@ static void exit_dvb_data(struct object *obj) { } } -static void init_dvb_audio(struct object *obj) { +static void init_dvb_audio(struct object *UNUSED(obj)) { DVBAudio->fd = -1; memset(&DVBAudio->low_errmsg, '\0', sizeof(DVBAudio->low_errmsg)); } -static void exit_dvb_audio(struct object *obj) { +static void exit_dvb_audio(struct object *UNUSED(obj)) { if(DVBAudio->fd != -1) close(DVBAudio->fd); } -static void init_dvb_stream(struct object *obj) { +static void init_dvb_stream(struct object *UNUSED(obj)) { DVBStream->parent = NULL; DVBStream->next = NULL; @@ -1711,7 +1711,7 @@ static void init_dvb_stream(struct object *obj) { } -static void exit_dvb_stream(struct object *obj) { +static void exit_dvb_stream(struct object *UNUSED(obj)) { struct ECMINFO *e; unsigned int i; diff --git a/src/modules/_Image_JPEG/transupp.c b/src/modules/_Image_JPEG/transupp.c index 0510eece64..f0f8b83af4 100644 --- a/src/modules/_Image_JPEG/transupp.c +++ b/src/modules/_Image_JPEG/transupp.c @@ -1589,10 +1589,11 @@ jtransform_execute_transform (j_decompress_ptr srcinfo, */ #ifndef TRANSFORMS_NOT_SUPPORTED + +#ifdef SAVE_MARKERS_SUPPORTED GLOBAL(void) jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option) { -#ifdef SAVE_MARKERS_SUPPORTED int m; /* Save comments except under NONE option */ @@ -1604,8 +1605,11 @@ jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option) for (m = 0; m < 16; m++) jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF); } -#endif /* SAVE_MARKERS_SUPPORTED */ } +#else +GLOBAL(void) +jcopy_markers_setup (j_decompress_ptr UNUSED(srcinfo), JCOPY_OPTION UNUSED(option)) {} +#endif /* SAVE_MARKERS_SUPPORTED */ /* Copy markers saved in the given source object to the destination object. * This should be called just after jpeg_start_compress() or diff --git a/src/pike_embed.c b/src/pike_embed.c index 1875a6a3c5..f6dae9aad5 100644 --- a/src/pike_embed.c +++ b/src/pike_embed.c @@ -458,7 +458,7 @@ void gdb_break_on_pike_stack_record(long stack_size) static unsigned int samples[8200]; long record; -static void sample_stack(struct callback *cb,void *tmp,void *ignored) +static void sample_stack(struct callback *cb,void *UNUSED(tmp),void *UNUSED(ignored)) { long stack_size=( ((char *)&cb) - Pike_interpreter.stack_bottom) * STACK_DIRECTION; stack_size>>=10; diff --git a/src/post_modules/CritBit/bignumtree.cmod b/src/post_modules/CritBit/bignumtree.cmod index 1784671c18..82e382b461 100644 --- a/src/post_modules/CritBit/bignumtree.cmod +++ b/src/post_modules/CritBit/bignumtree.cmod @@ -1,7 +1,8 @@ /* vim:syntax=c */ +#ifdef PIKE_DEBUG #define DEBUG_CHECKS - +#endif #include "common.h" #include "critbit/bignum2svalue.h" diff --git a/src/post_modules/CritBit/critbit/key_float.h b/src/post_modules/CritBit/critbit/key_float.h index 4217b5a24d..300c2ae4fc 100644 --- a/src/post_modules/CritBit/critbit/key_float.h +++ b/src/post_modules/CritBit/critbit/key_float.h @@ -88,7 +88,7 @@ static inline FLOAT_TYPE cb_decode_float(cb_char s) { static inline cb_size cb_prefix_count_float(const cb_string s1, const cb_string s2, const cb_size len, - const cb_size start) { + const cb_size UNUSED(start)) { cb_size ret; if (s1 == s2) return len; diff --git a/src/post_modules/CritBit/critbit/key_int.h b/src/post_modules/CritBit/critbit/key_int.h index efd6950cc3..6317385c26 100644 --- a/src/post_modules/CritBit/critbit/key_int.h +++ b/src/post_modules/CritBit/critbit/key_int.h @@ -56,7 +56,7 @@ typedef unsigned INT64 CB_NAME(char); static inline cb_size cb_prefix_count_integer(const cb_string s1, const cb_string s2, const cb_size len, - const cb_size start) { + const cb_size UNUSED(start)) { cb_size ret; if (s1 == s2) return len; diff --git a/src/post_modules/CritBit/tree_high.c b/src/post_modules/CritBit/tree_high.c index 7d3e11172a..9c21e1b0c2 100644 --- a/src/post_modules/CritBit/tree_high.c +++ b/src/post_modules/CritBit/tree_high.c @@ -142,7 +142,9 @@ static inline int cb_print_path(struct string_builder *buf, cb_node_t node, return 0; } -static inline void cb_check(cb_node_t node, cb_node_t last, char *issue) { +static inline void cb_check(cb_node_t node, + cb_node_t DEBUGUSED(last), + char *issue) { #ifdef DEBUG_CHECKS if (CB_LT(node->key.len, last->key.len)) { struct string_builder buf; @@ -186,7 +188,7 @@ static inline int cb_rec_check_parents(cb_node_t node) { static inline void cb_aggregate_values(cb_node_t node, struct array * a, size_t start, - size_t len) { + size_t UNUSED(len)) { if (CB_HAS_VALUE(node)) CB_GET_VALUE(node, ITEM(a)+start++); WALK_FORWARD(node, { diff --git a/src/post_modules/CritBit/tree_low.c b/src/post_modules/CritBit/tree_low.c index 060b846ccf..3755961519 100644 --- a/src/post_modules/CritBit/tree_low.c +++ b/src/post_modules/CritBit/tree_low.c @@ -144,7 +144,7 @@ CB_STATIC CB_INLINE void cb_get_range(const struct cb_tree * src, } } -static inline cb_node_t cb_node_from_string(const struct cb_tree * tree, +static inline cb_node_t cb_node_from_string(const struct cb_tree * UNUSED(tree), const cb_key s, const cb_value * val) { cb_node_t node = node_init(); @@ -160,7 +160,7 @@ static inline cb_node_t cb_node_from_string(const struct cb_tree * tree, return node; } -static inline cb_node_t cb_clone_node(const struct cb_tree * tree, +static inline cb_node_t cb_clone_node(const struct cb_tree * UNUSED(tree), const cb_node_t node) { cb_node_t nnode = CB_NODE_ALLOC(); @@ -212,7 +212,8 @@ static void cb_free_node(const struct cb_tree * tree, cb_node_t node) { cb_zap_node(tree, node); } -static inline void cb_zap_node(const struct cb_tree * tree, cb_node_t node) { +static inline void cb_zap_node(const struct cb_tree * UNUSED(tree), + cb_node_t node) { CB_FREE_KEY(node->key); CB_RM_VALUE(node); CB_NODE_FREE(node); diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod index efb7b4fddb..153a6a2e8f 100644 --- a/src/post_modules/Nettle/cipher.cmod +++ b/src/post_modules/Nettle/cipher.cmod @@ -659,7 +659,7 @@ pike_camellia_set_encrypt_key(void *ctx, static void pike_camellia_set_decrypt_key(void *ctx, ptrdiff_t length, const char *key, - int force) + int UNUSED(force)) { if (length < CAMELLIA_MIN_KEY_SIZE || length > CAMELLIA_MAX_KEY_SIZE) Pike_error("CAMELLIA: Bad keysize for CAMELLIA.\n"); -- GitLab