From a86c635da5973707a1aca4d5301b813093b39ad3 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 24 May 2017 00:24:48 +0200 Subject: [PATCH] hunt down some more short negation forms --- src/mc/checker/CommunicationDeterminismChecker.cpp | 4 ++-- src/msg/msg_gos.cpp | 2 +- src/simix/smx_network.cpp | 2 +- src/smpi/smpi_op.cpp | 2 +- src/smpi/smpi_request.cpp | 6 +++--- src/smpi/smpi_win.cpp | 2 +- src/surf/instr_routing.cpp | 4 ++-- src/surf/network_cm02.cpp | 2 +- src/surf/network_cm02.hpp | 1 - src/surf/network_ib.cpp | 2 +- src/surf/surf_c_bindings.cpp | 2 +- src/surf/surf_interface.cpp | 2 +- 12 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index f3d7caa8e1..89e553e9ab 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -370,7 +370,7 @@ static inline bool all_communications_are_finished() for (size_t current_actor = 1; current_actor < MC_smx_get_maxpid(); current_actor++) { xbt_dynar_t pattern = xbt_dynar_get_as(incomplete_communications_pattern, current_actor, xbt_dynar_t); if (not xbt_dynar_is_empty(pattern)) { - XBT_DEBUG("Some communications are not finished, cannot stop the exploration ! State not visited."); + XBT_DEBUG("Some communications are not finished, cannot stop the exploration! State not visited."); return false; } } @@ -503,7 +503,7 @@ void CommunicationDeterminismChecker::main() } else { if (stack_.size() > (std::size_t) _sg_mc_max_depth) - XBT_WARN("/!\\ Max depth reached ! /!\\ "); + XBT_WARN("/!\\ Max depth reached! /!\\ "); else if (visited_state != nullptr) XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.", visited_state->original_num == -1 ? visited_state->num : visited_state->original_num); diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index daf0f1dfc5..7bbb3033ed 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -318,7 +318,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *al t_simdata->comm = static_cast(act); msg_comm_t comm = nullptr; - if (! detached) { + if (not detached) { comm = xbt_new0(s_msg_comm_t, 1); comm->task_sent = task; comm->task_received = nullptr; diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index b10306a84f..ef153ce17a 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -189,7 +189,7 @@ smx_activity_t SIMIX_comm_irecv(smx_actor_t dst_proc, smx_mailbox_t mbox, void * simgrid::kernel::activity::Comm* other_comm; //communication already done, get it inside the list of completed comms - if (mbox->permanent_receiver != nullptr && ! mbox->done_comm_queue.empty()) { + if (mbox->permanent_receiver != nullptr && not mbox->done_comm_queue.empty()) { XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication"); //find a match in the list of already received comms diff --git a/src/smpi/smpi_op.cpp b/src/smpi/smpi_op.cpp index 35b0a73744..9cd6612b1c 100644 --- a/src/smpi/smpi_op.cpp +++ b/src/smpi/smpi_op.cpp @@ -246,7 +246,7 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype) } if (not smpi_process()->replaying() && *len > 0) { - if(! is_fortran_op_) + if (not is_fortran_op_) this->func_(invec, inoutvec, len, &datatype); else{ XBT_DEBUG("Applying operation of length %d from %p and from/to %p", *len, invec, inoutvec); diff --git a/src/smpi/smpi_request.cpp b/src/smpi/smpi_request.cpp index ac052b4f99..733ae20b76 100644 --- a/src/smpi/smpi_request.cpp +++ b/src/smpi/smpi_request.cpp @@ -373,9 +373,9 @@ void Request::start() // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later real_size_=size_; - action_ = simcall_comm_irecv(process->process(), mailbox, buf_, &real_size_, &match_recv, - ! process->replaying()? smpi_comm_copy_data_callback - : &smpi_comm_null_copy_buffer_callback, this, -1.0); + action_ = simcall_comm_irecv( + process->process(), mailbox, buf_, &real_size_, &match_recv, + process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0); XBT_DEBUG("recv simcall posted"); if (async_small_thresh != 0 || (flags_ & RMA) != 0 ) diff --git a/src/smpi/smpi_win.cpp b/src/smpi/smpi_win.cpp index 6ac1654daa..2de320092d 100644 --- a/src/smpi/smpi_win.cpp +++ b/src/smpi/smpi_win.cpp @@ -419,7 +419,7 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr, target_disp, 1, datatype, &req); if (req != MPI_REQUEST_NULL) Request::wait(&req, MPI_STATUS_IGNORE); - if(! memcmp (result_addr, compare_addr, datatype->get_extent() )){ + if (not memcmp(result_addr, compare_addr, datatype->get_extent())) { put(origin_addr, 1, datatype, target_rank, target_disp, 1, datatype); } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index d73ddac27c..72d975cc47 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -213,7 +213,7 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link) container_t container = PJ_container_new(link.name(), INSTR_LINK, father); - if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) { + if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) { type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type); if (bandwidth == nullptr) { bandwidth = PJ_type_variable_new("bandwidth", nullptr, container->type); @@ -238,7 +238,7 @@ void sg_instr_new_host(simgrid::s4u::Host& host) container_t father = currentContainer.back(); container_t container = PJ_container_new(host.cname(), INSTR_HOST, father); - if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_speed())) { + if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) { type_t speed = PJ_type_get_or_null ("power", container->type); if (speed == nullptr){ speed = PJ_type_variable_new ("power", nullptr, container->type); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 1f204a778d..2a867cf9ee 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -318,7 +318,7 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz action->latency_ *= latencyFactor(size); action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size); if (haveGap_) { - xbt_assert(! route->empty(), + xbt_assert(not route->empty(), "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!"); gapAppend(size, route->at(0), action); diff --git a/src/surf/network_cm02.hpp b/src/surf/network_cm02.hpp index 08702719bb..df834a8dd1 100644 --- a/src/surf/network_cm02.hpp +++ b/src/surf/network_cm02.hpp @@ -13,7 +13,6 @@ #include "xbt/graph.h" - /*********** * Classes * ***********/ diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 8304958761..f0b33205bd 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -159,7 +159,7 @@ namespace simgrid { if((*it)->init_rate==-1) (*it)->init_rate= rate_before_update; - penalized_bw= ! num_comm_out ? (*it)->init_rate : (*it)->init_rate /penalty; + penalized_bw = num_comm_out ? (*it)->init_rate / penalty : (*it)->init_rate; if (not double_equals(penalized_bw, rate_before_update, sg_surf_precision)) { XBT_DEBUG("%d->%d action %p penalty updated : bw now %f, before %f , initial rate %f", root->id,(*it)->destination->id,(*it)->action,penalized_bw, (*it)->action->getBound(), (*it)->init_rate ); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 85582c57e4..c35e6d18ab 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -74,7 +74,7 @@ double surf_solve(double max_date) next_event_date = future_evt_set->next_date(); XBT_DEBUG("Next TRACE event: %f", next_event_date); - if(! surf_network_model->nextOccuringEventIsIdempotent()){ // NS3, I see you + if (not surf_network_model->nextOccuringEventIsIdempotent()) { // NS3, I see you if (next_event_date!=-1.0 && time_delta!=-1.0) { time_delta = MIN(next_event_date - NOW, time_delta); } else { diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 58dacc900c..845a9248e8 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -577,7 +577,7 @@ bool Resource::isOn() const { return isOn_; } bool Resource::isOff() const { - return ! isOn_; + return not isOn_; } void Resource::turnOn() -- 2.20.1