From 9fa7e1453457bf349fd0a2fb5941b08b12b77f56 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 28 Mar 2018 11:48:58 +0200 Subject: [PATCH] Use C++'s true/false. --- src/mc/mc_request.cpp | 6 +++--- src/msg/msg_gos.cpp | 12 ++++++------ src/xbt/dynar.cpp | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index b7e23eb7d2..09f9c889ac 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2018. 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. */ @@ -97,7 +97,7 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) #if 0 if((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV) && r2->call == SIMCALL_COMM_TEST) - return FALSE; + return false; #endif if (r1->call == SIMCALL_COMM_WAIT @@ -139,7 +139,7 @@ bool request_depend(smx_simcall_t r1, smx_simcall_t r2) if ((r1->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(r1) > 0) || (r2->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(r2) > 0)) - return TRUE; + return true; if (r1->call != r2->call) return request_depend_asymmetric(r1, r2) diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 68de1d9dc9..70cc9d4536 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -472,14 +472,14 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rat /** \ingroup msg_task_usage * \brief Checks whether a communication is done, and if yes, finalizes it. * \param comm the communication to test - * \return TRUE if the communication is finished + * \return 'true' if the communication is finished * (but it may have failed, use MSG_comm_get_status() to know its status) - * or FALSE if the communication is not finished yet - * If the status is FALSE, don't forget to use MSG_process_sleep() after the test. + * or 'false' if the communication is not finished yet + * If the status is 'false', don't forget to use MSG_process_sleep() after the test. */ int MSG_comm_test(msg_comm_t comm) { - int finished = 0; + bool finished = false; try { finished = simcall_comm_test(comm->s_comm); @@ -492,11 +492,11 @@ int MSG_comm_test(msg_comm_t comm) switch (e.category) { case network_error: comm->status = MSG_TRANSFER_FAILURE; - finished = 1; + finished = true; break; case timeout_error: comm->status = MSG_TIMEOUT; - finished = 1; + finished = true; break; default: throw; diff --git a/src/xbt/dynar.cpp b/src/xbt/dynar.cpp index 2d1164545c..3af15166c8 100644 --- a/src/xbt/dynar.cpp +++ b/src/xbt/dynar.cpp @@ -1,6 +1,6 @@ /* a generic DYNamic ARray implementation. */ -/* Copyright (c) 2004-2017. The SimGrid Team. +/* Copyright (c) 2004-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -898,7 +898,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles") xbt_test_add("==== Traverse the empty dynar"); d = xbt_dynar_new(sizeof(int), nullptr); xbt_dynar_foreach(d, cursor, cpt) { - xbt_test_assert(FALSE, "Damnit, there is something in the empty dynar"); + xbt_test_assert(false, "Damnit, there is something in the empty dynar"); } xbt_dynar_free(&d); /* This code is used both as example and as regression test, so we try to */ xbt_dynar_free(&d); /* free the struct twice here to check that it's ok, but freeing it only once */ @@ -999,7 +999,7 @@ XBT_TEST_UNIT("string", test_dynar_string, "Dynars of strings") xbt_test_add("==== Traverse the empty dynar"); xbt_dynar_t d = xbt_dynar_new(sizeof(char*), &xbt_free_ref); xbt_dynar_foreach(d, iter, s1) { - xbt_test_assert(FALSE, "Damnit, there is something in the empty dynar"); + xbt_test_assert(false, "Damnit, there is something in the empty dynar"); } xbt_dynar_free(&d); /* This code is used both as example and as regression test, so we try to */ xbt_dynar_free(&d); /* free the struct twice here to check that it's ok, but freeing it only once */ -- 2.20.1