Branch: Tag:

2014-12-04

2014-12-04 19:23:02 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.)

910:    *! gc. (This advice applies to mutex locks in general, for that    *! matter.)    */ - void init_threads_disable(struct object *o) + void init_threads_disable(struct object *UNUSED(o))   {    low_init_threads_disable();   
928:    }   }    - void exit_threads_disable(struct object *o) + void exit_threads_disable(struct object *UNUSED(o))   {    THREADS_FPRINTF(0, (stderr, "exit_threads_disable(): threads_disabled:%d\n",    threads_disabled));
1291:    return num_pike_threads;   }    - static void check_threads(struct callback *cb, void *arg, void * arg2) + static void check_threads(struct callback *UNUSED(cb), void *UNUSED(arg), void *UNUSED(arg2))   {   #ifdef PROFILE_CHECK_THREADS    static unsigned long calls = 0, yields = 0;
2258:    push_int(0);   }    - void init_mutex_obj(struct object *o) + void init_mutex_obj(struct object *UNUSED(o))   {    co_init(& THIS_MUTEX->condition);    THIS_MUTEX->key=0;    THIS_MUTEX->num_waiting = 0;   }    - void exit_mutex_obj(struct object *o) + void exit_mutex_obj(struct object *UNUSED(o))   {    struct mutex_storage *m = THIS_MUTEX;    struct object *key = m->key;
2303:   #endif   }    - void exit_mutex_obj_compat_7_4(struct object *o) + void exit_mutex_obj_compat_7_4(struct object *UNUSED(o))   {    struct mutex_storage *m = THIS_MUTEX;    struct object *key = m->key;
2341:    *! @[Mutex], @[Condition]    */   #define THIS_KEY ((struct key_storage *)(CURRENT_STORAGE)) - void init_mutex_key_obj(struct object *o) + void init_mutex_key_obj(struct object *UNUSED(o))   {    THREADS_FPRINTF(1, (stderr, "KEY k:%p, t:%p\n",    THIS_KEY, Pike_interpreter.thread_state));
2352:    THIS_KEY->initialized=1;   }    - void exit_mutex_key_obj(struct object *o) + void exit_mutex_key_obj(struct object *DEBUGUSED(o))   {    THREADS_FPRINTF(1, (stderr, "UNLOCK k:%p m:(%p) t:%p o:%p\n",    THIS_KEY, THIS_KEY->mut,
2574:    co_broadcast(&(THIS_COND->cond));   }    - void init_cond_obj(struct object *o) + void init_cond_obj(struct object *UNUSED(o))   {    co_init(&(THIS_COND->cond));    THIS_COND->wait_count = 0;   }    - void exit_cond_obj(struct object *o) + void exit_cond_obj(struct object *UNUSED(o))   {    /* Wake up any threads that might be waiting on this cond.    *
2698:    *! Waits for the thread to complete, and then returns    *! the value returned from the thread function.    */ - static void f_thread_id_result(INT32 args) + static void f_thread_id_result(INT32 UNUSED(args))   {    struct thread_state *th=THIS_THREAD;   
2735:   static struct callback *thread_interrupt_callback = NULL;      static void check_thread_interrupt(struct callback *foo, -  void *bar, void *gazonk) +  void *UNUSED(bar), void *UNUSED(gazonk))   {    if (Pike_interpreter.thread_state->flags & THREAD_FLAG_SIGNAL_MASK) {    if (Pike_interpreter.thread_state->flags & THREAD_FLAG_TERM) {
2813:    push_int(0);   }    - void init_thread_obj(struct object *o) + void init_thread_obj(struct object *UNUSED(o))   {    MEMSET(&THIS_THREAD->state, 0, sizeof(struct Pike_interpreter_struct));    THIS_THREAD->thread_obj = Pike_fp->current_object;
2852:    th_destroy(& THIS_THREAD->id);   }    - void exit_thread_obj(struct object *o) + void exit_thread_obj(struct object *UNUSED(o))   {    THIS_THREAD->thread_obj = NULL;   
2867:   /*! @endclass    */    - static void thread_was_recursed(struct object *o) + static void thread_was_recursed(struct object *UNUSED(o))   {    struct thread_state *tmp=THIS_THREAD;    if(tmp->thread_local != NULL)    gc_recurse_mapping(tmp->thread_local);   }    - static void thread_was_checked(struct object *o) + static void thread_was_checked(struct object *UNUSED(o))   {    struct thread_state *tmp=THIS_THREAD;    if(tmp->thread_local != NULL)