sg_comm_t comm_received = sg_mailbox_get_async(peer->mailbox, &message);
res = sg_comm_wait_for(comm_received, GET_PEERS_TIMEOUT);
if (res == SG_OK) {
- const tracker_answer_t ta = (const tracker_answer_t)message;
+ const_tracker_answer_t ta = (const_tracker_answer_t)message;
// Add the peers the tracker gave us to our peer list.
unsigned i;
int peer_id;
xbt_dynar_t peers; // the peer list the peer has asked for.
} s_tracker_answer_t;
typedef s_tracker_answer_t* tracker_answer_t;
+typedef const s_tracker_answer_t* const_tracker_answer_t;
tracker_query_t tracker_query_new(int peer_id, sg_mailbox_t return_mailbox);
tracker_answer_t tracker_answer_new(int interval);
err = sg_comm_wait_for(comm, timeout);
if (err == SG_ERROR_TIMEOUT) {
XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %d", node->id);
- message_free(message);
}
break;
/* Join reply from all the node touched by the join */
XBT_LOG_NEW_DEFAULT_CATEGORY(io_file_system, "Messages specific for this io example");
-static void show_info(unsigned int disk_count, sg_disk_t* disks)
+static void show_info(unsigned int disk_count, const sg_disk_t* disks)
{
XBT_INFO("Storage info on %s:", sg_host_self_get_name());
static void coordinator()
{
int CS_used = 0;
- Message* m = nullptr;
+ const Message* m = nullptr;
std::queue<simgrid::s4u::Mailbox*> requests;
simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name("coordinator");
XBT_INFO("Propositions changed : r=1, cs=0");
}
- Message* grant = static_cast<Message*>(my_mailbox->get());
+ const Message* grant = static_cast<Message*>(my_mailbox->get());
if ((id == 1) && (grant->kind == Message::Kind::GRANT)) {
cs = 1;
#include <simgrid/modelchecker.h>
#include <simgrid/s4u.hpp>
-#define N 3
+constexpr int N = 3;
XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
#include <simgrid/modelchecker.h>
#include <simgrid/s4u.hpp>
-#define N 3
XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
kernel::routing::NetPoint::on_creation.connect(on_netpoint_creation);
}
s4u::NetZone::on_creation.connect(on_netzone_creation);
- s4u::Engine::on_time_advance.connect([](double time_delta) { TRACE_paje_dump_buffer(false); });
+ s4u::Engine::on_time_advance.connect([](double /*time_delta*/) { TRACE_paje_dump_buffer(false); });
kernel::resource::CpuAction::on_state_change.connect(on_action_state_change);
s4u::Link::on_communication_state_change.connect(on_action_state_change);