From 78be459db6482a2092f0226099d909e3f6119c04 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Sat, 3 Feb 2024 09:06:45 -0700 Subject: [PATCH] Correcting print type --- include/epiworld/agent-meat.hpp | 24 ++++++++++++++++-------- include/epiworld/tool-meat.hpp | 12 ++++++------ include/epiworld/tools-bones.hpp | 2 +- include/epiworld/virus-meat.hpp | 16 ++++++++-------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/include/epiworld/agent-meat.hpp b/include/epiworld/agent-meat.hpp index 03295f75a..a5006b5d1 100644 --- a/include/epiworld/agent-meat.hpp +++ b/include/epiworld/agent-meat.hpp @@ -687,26 +687,34 @@ inline void Agent::print( if (compressed) { printf_epiworld( - "Agent: %i, state: %s (%lu), Has virus: %s, NTools: %lu, NNeigh: %lu\n", - id, model->states_labels[state].c_str(), state, + "Agent: %i, state: %s (%i), Has virus: %s, NTools: %ii NNeigh: %i\n", + static_cast(id), + model->states_labels[state].c_str(), + static_cast(state), virus == nullptr ? std::string("no").c_str() : std::string("yes").c_str(), - n_tools, neighbors.size() + static_cast(n_tools), + static_cast(neighbors.size()) ); } else { - printf_epiworld("Information about agent id %i\n", this->id); - printf_epiworld(" State : %s (%lu)\n", model->states_labels[state].c_str(), state); + printf_epiworld("Information about agent id %i\n", + static_cast(this->id)); + printf_epiworld(" State : %s (%i)\n", + model->states_labels[state].c_str(), static_cast(state)); printf_epiworld(" Has virus : %s\n", virus == nullptr ? std::string("no").c_str() : std::string("yes").c_str()); - printf_epiworld(" Tool count : %lu\n", n_tools); - printf_epiworld(" Neigh. count : %lu\n", neighbors.size()); + printf_epiworld(" Tool count : %i\n", static_cast(n_tools)); + printf_epiworld(" Neigh. count : %i\n", static_cast(neighbors.size())); size_t nfeats = model->get_agents_data_ncols(); if (nfeats > 0) { - printf_epiworld("This model includes features (%lu): [ ", nfeats); + printf_epiworld( + "This model includes features (%i): [ ", + static_cast(nfeats) + ); int max_to_show = static_cast((nfeats > 10)? 10 : nfeats); diff --git a/include/epiworld/tool-meat.hpp b/include/epiworld/tool-meat.hpp index a4925c552..604ca2ec2 100644 --- a/include/epiworld/tool-meat.hpp +++ b/include/epiworld/tool-meat.hpp @@ -488,12 +488,12 @@ template inline void Tool::print() const { - printf_epiworld("Tool : %s\n", tool_name->c_str()); - printf_epiworld("Id : %s\n", (id < 0)? std::string("(empty)").c_str() : std::to_string(id).c_str()); - printf_epiworld("state_init : %i\n", state_init); - printf_epiworld("state_post : %i\n", state_post); - printf_epiworld("queue_init : %i\n", queue_init); - printf_epiworld("queue_post : %i\n", queue_post); + printf_epiworld("Tool : %s\n", tool_name->c_str()); + printf_epiworld("Id : %s\n", (id < 0)? std::string("(empty)").c_str() : std::to_string(id).c_str()); + printf_epiworld("state_init : %i\n", static_cast(state_init)); + printf_epiworld("state_post : %i\n", static_cast(state_post)); + printf_epiworld("queue_init : %i\n", static_cast(queue_init)); + printf_epiworld("queue_post : %i\n", static_cast(queue_post)); } diff --git a/include/epiworld/tools-bones.hpp b/include/epiworld/tools-bones.hpp index c3ee9f2f9..39fa9e200 100644 --- a/include/epiworld/tools-bones.hpp +++ b/include/epiworld/tools-bones.hpp @@ -90,7 +90,7 @@ inline void Tools::print() const noexcept return; } - printf_epiworld("List of tools (%i): ", *n_tools); + printf_epiworld("List of tools (%i): ", static_cast(*n_tools)); // Printing the name of each virus separated by a comma for (size_t i = 0u; i < *n_tools; ++i) diff --git a/include/epiworld/virus-meat.hpp b/include/epiworld/virus-meat.hpp index c0fae7a1e..e27bc91fb 100644 --- a/include/epiworld/virus-meat.hpp +++ b/include/epiworld/virus-meat.hpp @@ -675,14 +675,14 @@ template inline void Virus::print() const { - printf_epiworld("Virus : %s\n", virus_name->c_str()); - printf_epiworld("Id : %s\n", (id < 0)? std::string("(empty)").c_str() : std::to_string(id).c_str()); - printf_epiworld("state_init : %i\n", state_init); - printf_epiworld("state_post : %i\n", state_post); - printf_epiworld("state_removed : %i\n", state_removed); - printf_epiworld("queue_init : %i\n", queue_init); - printf_epiworld("queue_post : %i\n", queue_post); - printf_epiworld("queue_removed : %i\n", queue_removed); + printf_epiworld("Virus : %s\n", virus_name->c_str()); + printf_epiworld("Id : %s\n", (id < 0)? std::string("(empty)").c_str() : std::to_string(id).c_str()); + printf_epiworld("state_init : %i\n", static_cast(state_init)); + printf_epiworld("state_post : %i\n", static_cast(state_post)); + printf_epiworld("state_removed : %i\n", static_cast(state_removed)); + printf_epiworld("queue_init : %i\n", static_cast(queue_init)); + printf_epiworld("queue_post : %i\n", static_cast(queue_post)); + printf_epiworld("queue_removed : %i\n", static_cast(queue_removed)); }