From: Arnaud Giersch Date: Tue, 17 Oct 2017 13:09:45 +0000 (+0200) Subject: Mark unused parameters in C code. X-Git-Tag: v3.18~420^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6ccb42bd405aa3588930073b79d7c469fa49579f Mark unused parameters in C code. --- diff --git a/examples/msg/process-startkilltime/process-startkilltime.c b/examples/msg/process-startkilltime/process-startkilltime.c index 6e12c39670..1c69571cd0 100644 --- a/examples/msg/process-startkilltime/process-startkilltime.c +++ b/examples/msg/process-startkilltime/process-startkilltime.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -8,7 +8,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); /* Executed on process termination*/ -static int my_onexit(void* ignored1, void *ignored2) { +static int my_onexit(void* XBT_ATTRIB_UNUSED ignored1, void* XBT_ATTRIB_UNUSED ignored2) +{ XBT_INFO("Exiting now (done sleeping or got killed)."); /* - Just display an informative message (see tesh file) */ return 0; } diff --git a/src/xbt/automaton/automaton.c b/src/xbt/automaton/automaton.c index eb1e879f74..ee8be8e002 100644 --- a/src/xbt/automaton/automaton.c +++ b/src/xbt/automaton/automaton.c @@ -95,7 +95,9 @@ xbt_dynar_t xbt_automaton_get_transitions(xbt_automaton_t a){ return a->transitions; } -xbt_automaton_transition_t xbt_automaton_get_transition(xbt_automaton_t a, xbt_automaton_state_t src, xbt_automaton_state_t dst){ +xbt_automaton_transition_t xbt_automaton_get_transition(xbt_automaton_t XBT_ATTRIB_UNUSED a, xbt_automaton_state_t src, + xbt_automaton_state_t dst) +{ xbt_automaton_transition_t transition; unsigned int cursor; xbt_dynar_foreach(src->out, cursor, transition){ diff --git a/src/xbt/mmalloc/mm_legacy.c b/src/xbt/mmalloc/mm_legacy.c index 6b96776633..b02719cb00 100644 --- a/src/xbt/mmalloc/mm_legacy.c +++ b/src/xbt/mmalloc/mm_legacy.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2015. The SimGrid Team. +/* Copyright (c) 2010-2017. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -92,12 +92,12 @@ static void* mm_fake_calloc(size_t nmemb, size_t size) return mm_fake_malloc(n); } -static void* mm_fake_realloc(void *p, size_t s) +static void* mm_fake_realloc(void* XBT_ATTRIB_UNUSED p, size_t s) { return mm_fake_malloc(s); } -static void mm_fake_free(void *p) +static void mm_fake_free(void* XBT_ATTRIB_UNUSED p) { // Nothing to do } diff --git a/src/xbt/xbt_log_layout_simple.c b/src/xbt/xbt_log_layout_simple.c index b890b1591d..57069fd8e5 100644 --- a/src/xbt/xbt_log_layout_simple.c +++ b/src/xbt/xbt_log_layout_simple.c @@ -23,7 +23,7 @@ static double simple_begin_of_time = -1; } else \ return 0 -static int xbt_log_layout_simple_doit(xbt_log_layout_t l, xbt_log_event_t ev, const char *fmt) +static int xbt_log_layout_simple_doit(xbt_log_layout_t XBT_ATTRIB_UNUSED l, xbt_log_event_t ev, const char* fmt) { char *p = ev->buffer; int rem_size = ev->buffer_size; @@ -70,7 +70,7 @@ static int xbt_log_layout_simple_doit(xbt_log_layout_t l, xbt_log_event_t ev, co return 1; } -xbt_log_layout_t xbt_log_layout_simple_new(char *arg) +xbt_log_layout_t xbt_log_layout_simple_new(char* XBT_ATTRIB_UNUSED arg) { xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1); res->do_layout = &xbt_log_layout_simple_doit; diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 2652bc952e..8690348936 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -162,7 +162,8 @@ xbt_os_thread_t xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_ro * * If pthread_setaffinity_np is not usable on that (non-gnu) platform, this function does nothing. */ -int xbt_os_thread_bind(xbt_os_thread_t thread, int cpu){ +int xbt_os_thread_bind(xbt_os_thread_t XBT_ATTRIB_UNUSED thread, int XBT_ATTRIB_UNUSED cpu) +{ int errcode = 0; #if HAVE_PTHREAD_SETAFFINITY pthread_t pthread = thread->t;