From: Arnaud Giersch Date: Fri, 4 Feb 2011 07:54:10 +0000 (+0100) Subject: Use %zu instead of casting argument. X-Git-Tag: v0.1~176 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/751ae9fcfc70b0b48670338c2273e2eaebc388d2?ds=sidebyside Use %zu instead of casting argument. --- diff --git a/communicator.cpp b/communicator.cpp index 0808426..649ff80 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -64,11 +64,11 @@ communicator::~communicator() if (data_comm) XBT_WARN("data_comm is pending!"); if (!received.empty()) - XBT_WARN("lost %lu received message%s!", - (unsigned long )received.size(), ESSE(received.size())); + XBT_WARN("lost %zu received message%s!", + received.size(), ESSE(received.size())); if (!sent_comm.empty()) - XBT_WARN("lost %lu sent message%s!", - (unsigned long )sent_comm.size(), ESSE(sent_comm.size())); + XBT_WARN("lost %zu sent message%s!", + sent_comm.size(), ESSE(sent_comm.size())); xbt_cond_destroy(cond); xbt_mutex_destroy(mutex); diff --git a/deployment.cpp b/deployment.cpp index 5659db6..fa9e731 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -138,9 +138,8 @@ void deployment_torus::generate() // here width == ceil(sqrt(size)) unsigned first_on_last_line = (size() - 1) - (size() - 1) % width; - XBT_DEBUG("torus size = %u ; width = %u ; height = %u ; foll = %u", - (unsigned )size(), width, - (unsigned )(size() / width + !!(size() % width)), + XBT_DEBUG("torus size = %zu ; width = %u ; height = %zu ; foll = %u", + size(), width, size() / width + !!(size() % width), first_on_last_line); for (unsigned i = 0; i < size(); i++) { unsigned next_line; diff --git a/hostdata.cpp b/hostdata.cpp index 4d71054..787b7ab 100644 --- a/hostdata.cpp +++ b/hostdata.cpp @@ -36,7 +36,7 @@ void hostdata::create() e_xbt_log_priority_t logp = xbt_log_priority_verbose; if (!LOG_ISENABLED(logp)) return; - XBT_LOG(logp, "Got %lu hosts.", (unsigned long)hosts.size()); + XBT_LOG(logp, "Got %zu hosts.", hosts.size()); for (int i = 0; i < nhosts; i++) { XBT_LOG(logp, "Host #%d named \"%s\".", i, hosts[i].get_name()); } diff --git a/main.cpp b/main.cpp index dcefafc..8b5c3bd 100644 --- a/main.cpp +++ b/main.cpp @@ -172,8 +172,8 @@ int main(int argc, char* argv[]) if (!opt::auto_depl::nhosts) opt::auto_depl::nhosts = hostdata::size(); if (opt::auto_depl::nhosts > hostdata::size()) { - XBT_WARN("%u hosts is too much: limiting to %u", - opt::auto_depl::nhosts, (unsigned )hostdata::size()); + XBT_WARN("%u hosts is too much: limiting to %zu", + opt::auto_depl::nhosts, hostdata::size()); opt::auto_depl::nhosts = hostdata::size(); } if (!opt::auto_depl::load) diff --git a/process.cpp b/process.cpp index 4501dab..8a165c1 100644 --- a/process.cpp +++ b/process.cpp @@ -310,8 +310,7 @@ void process::finalize() finalizing = true; total_load_running -= real_load; - XBT_DEBUG("send CLOSE to %lu neighbor%s", - (unsigned long )neigh.size(), ESSE(neigh.size())); + XBT_DEBUG("send CLOSE to %zu neighbor%s", neigh.size(), ESSE(neigh.size())); std::for_each(neigh.begin(), neigh.end(), bind(&process::finalize1, this, _1));