From 7cf68ae88d84d10a4afde2c9a564856fecda7666 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 8 Jul 2017 23:50:11 +0200 Subject: [PATCH] codacy --- src/mc/compare.cpp | 1 - src/xbt/automaton/automaton.c | 6 ++---- .../msg/host_on_off_processes/host_on_off_processes.c | 8 +++----- teshsuite/surf/surf_usage/surf_usage.cpp | 3 +-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index a5845c804f..e5a873b8f9 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -1642,7 +1642,6 @@ int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc: XBT_DEBUG("(%d - %d) Different local variables between stacks %d", num1, num2, cursor + 1); errors++; - is_diff = 1; #else #ifdef MC_VERBOSE diff --git a/src/xbt/automaton/automaton.c b/src/xbt/automaton/automaton.c index 015444104c..7f3c7463d5 100644 --- a/src/xbt/automaton/automaton.c +++ b/src/xbt/automaton/automaton.c @@ -1,7 +1,6 @@ /* automaton - representation of büchi automaton */ -/* Copyright (c) 2011-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2011-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. */ @@ -227,8 +226,7 @@ XBT_PUBLIC(xbt_automaton_propositional_symbol_t) xbt_automaton_propositional_sym xbt_automaton_propositional_symbol_callback_type callback, void* data, xbt_automaton_propositional_symbol_free_function_type free_function) { - xbt_automaton_propositional_symbol_t prop_symb = NULL; - prop_symb = xbt_new0(struct xbt_automaton_propositional_symbol, 1); + xbt_automaton_propositional_symbol_t prop_symb = xbt_new0(struct xbt_automaton_propositional_symbol, 1); prop_symb->pred = xbt_strdup(id); prop_symb->callback = callback; prop_symb->data = data; diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c index a76bd53074..754264b097 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c @@ -1,10 +1,9 @@ -/* Copyright (c) 2010-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-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. */ -#include "simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid/msg.h */ +#include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -37,10 +36,9 @@ static int process_sleep(int argc, char *argv[]) static int commTX(int argc, char *argv[]) { - msg_task_t task = NULL; const char * mailbox = "comm"; XBT_INFO(" Start TX"); - task = MSG_task_create("COMM", 0, 100000000, NULL); + msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL); MSG_task_isend(task, mailbox); // We should wait a bit (if not the process will end before the communication, hence an exception on the other side). MSG_process_sleep(30); diff --git a/teshsuite/surf/surf_usage/surf_usage.cpp b/teshsuite/surf/surf_usage/surf_usage.cpp index 1c92988db9..90914d6477 100644 --- a/teshsuite/surf/surf_usage/surf_usage.cpp +++ b/teshsuite/surf/surf_usage/surf_usage.cpp @@ -63,11 +63,10 @@ int main(int argc, char **argv) surf_solve(-1.0); do { - simgrid::surf::ActionList *action_list = nullptr; XBT_INFO("Next Event : %g", surf_get_clock()); XBT_DEBUG("\t CPU actions"); - action_list = surf_cpu_model_pm->getFailedActionSet(); + simgrid::surf::ActionList* action_list = surf_cpu_model_pm->getFailedActionSet(); for(simgrid::surf::ActionList::iterator it(action_list->begin()), itNext = it, itend(action_list->end()) ; it != itend ; it=itNext) { ++itNext; -- 2.20.1