Branch: Tag:

2012-12-30

2012-12-30 15:37:27 by 0

Wrap unused parameters in UNUSED(), and debug-only parameters in DEBUGUSED(), to cut
down on compiler warnings. The macro also renames parameters to catch accidental use.
(There are more places to clean up but I don't want to modify code that isn't compiling
on my machine.)

5181:    int name_length,    size_t offset,    const char *type, -  int type_length, +  int UNUSED(type_length),    INT32 run_time_type,    INT32 flags)   {
6490:   /* NOTE: O(n²)! */   int store_constant(const struct svalue *foo,    int equal, -  struct pike_string *constant_name) +  struct pike_string *UNUSED(constant_name))   {    struct program_constant tmp;    volatile unsigned int e;
9724:      #define THIS_PROGRAM_STATE ((struct program_state *)(Pike_fp->current_storage))    - static void program_state_event_handler(int event) + static void program_state_event_handler(int UNUSED(event))   {   #if 0    struct program_state *c = THIS_PROGRAM_STATE;
10152:    int name_length,    void (*cfun)(INT32),    const char *type, -  int type_length, +  int UNUSED(type_length),    unsigned flags,    unsigned opt_flags)   {
10218:   #define THIS ((struct pike_trampoline *)(CURRENT_STORAGE))   struct program *pike_trampoline_program=0;    - static void apply_trampoline(INT32 args) + static void apply_trampoline(INT32 UNUSED(args))   {    Pike_error("Internal error: Trampoline magic failed!\n");   }
10256:    free (str.str);   }    - static void init_trampoline(struct object *o) + static void init_trampoline(struct object *UNUSED(o))   {    THIS->frame=0;   }    - static void exit_trampoline(struct object *o) + static void exit_trampoline(struct object *UNUSED(o))   {    if(THIS->frame)    {
10284:    }   }    - static void gc_check_trampoline(struct object *o) + static void gc_check_trampoline(struct object *UNUSED(o))   {    if (THIS->frame &&    !debug_gc_check (THIS->frame, " as trampoline frame"))
10300:    if(f->scope) gc_recurse_frame(f->scope);   }    - static void gc_recurse_trampoline(struct object *o) + static void gc_recurse_trampoline(struct object *UNUSED(o))   {    if (THIS->frame) gc_recurse_frame(THIS->frame);   }