Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 27 Jul 2017 12:31:44 +0000 (14:31 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Thu, 27 Jul 2017 12:31:44 +0000 (14:31 +0200)
119 files changed:
CMakeLists.txt
examples/msg/app-chainsend/broadcaster.c
examples/msg/app-chainsend/peer.c
examples/msg/cloud-masterworker/cloud-masterworker.c
examples/msg/dht-kademlia/answer.c
examples/msg/dht-kademlia/dht-kademlia.c
examples/msg/dht-kademlia/node.c
examples/msg/dht-kademlia/routing_table.c
examples/msg/dht-pastry/dht-pastry.c
examples/msg/mc/bugged2.c
examples/msg/mc/bugged3.c
examples/simdag/dag-dotload/sd_dag-dotload.c
examples/simdag/daxload/sd_daxload.c
examples/simdag/schedule-dotload/sd_schedule-dotload.c
examples/simdag/test/sd_test.cpp
examples/smpi/NAS/dt.c
examples/smpi/replay_multiple/generate_multiple_deployment.sh
include/msg/datatypes.h [deleted file]
include/msg/msg.h [deleted file]
include/simdag/datatypes.h [deleted file]
include/simdag/simdag.h [deleted file]
include/simgrid/jedule/jedule.hpp
include/xbt/string.hpp
include/xbt/sysdep.h
src/bindings/java/jmsg.cpp
src/bindings/java/jxbt_utilities.cpp
src/bindings/lua/lua_platf.cpp
src/instr/instr_paje_types.cpp
src/kernel/context/Context.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/NetPoint.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/mc/PageStore.cpp
src/mc/Session.cpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/SafetyChecker.cpp
src/mc/compare.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_comm_pattern.cpp
src/mc/mc_dwarf.cpp
src/mc/mc_record.cpp
src/mc/mc_snapshot.cpp
src/mc/mc_state.cpp
src/mc/mc_unw.cpp
src/mc/mc_xbt.cpp
src/mc/remote/Channel.cpp
src/mc/remote/Client.cpp
src/mc/remote/RemoteClient.cpp
src/mc/remote/mc_protocol.cpp
src/msg/msg_actions.cpp
src/msg/msg_synchro.cpp
src/simdag/sd_dotloader.cpp
src/simix/smx_global.cpp
src/simix/smx_synchro.cpp
src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp
src/smpi/colls/alltoall/alltoall-2dmesh.cpp
src/smpi/colls/alltoall/alltoall-3dmesh.cpp
src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp
src/smpi/colls/reduce/reduce-ompi.cpp
src/smpi/colls/reduce/reduce-rab.cpp
src/smpi/colls/smpi_automatic_selector.cpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_utils.cpp
src/smpi/mpi/smpi_f2c.cpp
src/smpi/mpi/smpi_topo.cpp
src/smpi/smpirun.in
src/surf/fair_bottleneck.cpp
src/surf/lagrange.cpp
src/surf/maxmin.cpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/surf_interface.cpp
src/surf/trace_mgr.cpp
src/surf/trace_mgr_test.cpp
src/xbt/backtrace_linux.cpp
src/xbt/config.cpp
src/xbt/cunit.cpp
src/xbt/dict.cpp
src/xbt/ex.cpp
src/xbt/parmap.cpp
src/xbt/xbt_main.cpp
src/xbt/xbt_os_thread.c
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.c
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/s4u/comm-waitany/comm-waitany.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/smpi/coll-alltoallv/coll-alltoallv.c
teshsuite/smpi/coll-scatter/coll-scatter.c
teshsuite/smpi/mpich3-test/coll/allgatherv4.c
teshsuite/smpi/mpich3-test/datatype/dataalign.c
teshsuite/smpi/mpich3-test/datatype/longdouble.c
teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c
teshsuite/smpi/mpich3-test/generate_report
teshsuite/smpi/mpich3-test/util/dtypes.c
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp
teshsuite/xbt/mmalloc/mmalloc_test.cpp
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.cmake
tools/cmake/GCCFlags.cmake
tools/cmake/Java.cmake
tools/doxygen/xbt_log_extract_hierarchy.pl
tools/git-hooks/clang-format.pre-commit
tools/jenkins/Coverage.sh

index 8c2ea59..40d0e0b 100644 (file)
@@ -950,11 +950,6 @@ message("                version .............: ${CMAKE_CXX_COMPILER_VERSION}")
 if(${Java_FOUND})
   message("        Compiler: Javac .............: ${Java_JAVAC_EXECUTABLE}")
   message("                version .............: ${Java_VERSION_STRING}")
-if(${SWIG_FOUND})
-  message("                SWIG ................: Version ${SWIG_VERSION} found.")
-else()
-  message("                SWIG ................: Missing.")
-endif()
 endif()
 if(CMAKE_Fortran_COMPILER)
   message("        Compiler: Fortran ...........: ${SMPI_Fortran_COMPILER} (id: ${CMAKE_Fortran_COMPILER_ID})")
index 61a1aca..79612fc 100644 (file)
@@ -114,9 +114,9 @@ int broadcaster(int argc, char *argv[])
   /* argv[2] is the number of pieces */
   if (argc > 2) {
     piece_count = xbt_str_parse_int(argv[2], "Invalid number of pieces: %s");
-    XBT_DEBUG("piece_count set to %d", piece_count);
+    XBT_DEBUG("piece_count set to %u", piece_count);
   } else {
-    XBT_DEBUG("No piece_count specified, defaulting to %d", piece_count);
+    XBT_DEBUG("No piece_count specified, defaulting to %u", piece_count);
   }
   broadcaster_t bc = broadcaster_init(host_list, piece_count);
 
index de72e55..1201149 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,11 +29,11 @@ int peer_execute_task(peer_t peer, msg_task_t task)
   int done = 0;
   message_t msg = MSG_task_get_data(task);
 
-  XBT_DEBUG("Peer %s got message of type %d\n", peer->me, msg->type);
+  XBT_DEBUG("Peer %s got message of type %u\n", peer->me, msg->type);
   if (msg->type == MESSAGE_BUILD_CHAIN)
     peer_init_chain(peer, msg);
   else if (msg->type == MESSAGE_SEND_DATA) {
-    xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %d before initialization", msg->type);
+    xbt_assert(peer->init, "peer_execute_task() failed: got msg_type %u before initialization", msg->type);
     if (peer->next != NULL)
       peer_forward_msg(peer, msg);
     peer->pieces++;
@@ -63,7 +63,7 @@ msg_error_t peer_wait_for_message(peer_t peer)
     if (idx != -1) {
       comm = xbt_dynar_get_as(peer->pending_recvs, idx, msg_comm_t);
       status = MSG_comm_get_status(comm);
-      XBT_DEBUG("peer_wait_for_message: error code = %d", status);
+      XBT_DEBUG("peer_wait_for_message: error code = %u", status);
       xbt_assert(status == MSG_OK, "peer_wait_for_message() failed");
 
       task = MSG_comm_get_task(comm);
index 17242ba..86449a4 100644 (file)
@@ -122,8 +122,8 @@ static int master_fun(int argc, char *argv[])
   XBT_INFO("# Add one more process on each VM");
   xbt_dynar_foreach(vms, i, vm) {
     unsigned int index = i + xbt_dynar_length(vms);
-    char *vm_name = bprintf("VM%02d", i);
-    char *pr_name = bprintf("WRK%02d", index);
+    char* vm_name      = bprintf("VM%02u", i);
+    char* pr_name      = bprintf("WRK%02u", index);
 
     XBT_INFO("put a process (%s) on %s", pr_name, vm_name);
     MSG_process_create(pr_name, worker_fun, NULL, (msg_host_t)vm);
index 6fb5f75..14b9020 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -35,9 +35,9 @@ void answer_print(answer_t answer)
 {
   unsigned int cpt;
   node_contact_t contact;
-  XBT_INFO("Searching %08x, size %d", answer->destination_id, answer->size);
+  XBT_INFO("Searching %08x, size %u", answer->destination_id, answer->size);
   xbt_dynar_foreach(answer->nodes, cpt, contact) {
-    XBT_INFO("Node %08x: %08x is at distance %d", cpt, contact->id, contact->distance);
+    XBT_INFO("Node %08x: %08x is at distance %u", cpt, contact->id, contact->distance);
   }
 }
 
index c0c6999..d40ca6c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -96,7 +96,7 @@ static int node(int argc, char *argv[])
     XBT_INFO("I couldn't join the network :(");
   }
   XBT_DEBUG("I'm leaving the network");
-  XBT_INFO("%d/%d FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
+  XBT_INFO("%u/%u FIND_NODE have succeeded", node->find_node_success, node->find_node_success + node->find_node_failed);
   node_free(node);
 
   return 0;
@@ -229,8 +229,8 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_
               answers++;
 
               nodes_added = answer_merge(node_list, data->answer);
-              XBT_DEBUG("Received an answer from %s (%s) with %ld nodes on it",
-                        data->answer_to, data->issuer_host_name, xbt_dynar_length(data->answer->nodes));
+              XBT_DEBUG("Received an answer from %s (%s) with %lu nodes on it", data->answer_to, data->issuer_host_name,
+                        xbt_dynar_length(data->answer->nodes));
 
               task_free(node->task_received);
             } else {
@@ -254,12 +254,12 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_
     if (count_in_stats)
       node->find_node_success++;
     if (queries > 4)
-      XBT_VERB("FIND_NODE on %08x success in %d steps", id_to_find, steps);
+      XBT_VERB("FIND_NODE on %08x success in %u steps", id_to_find, steps);
     node_routing_table_update(node, id_to_find);
   } else {
     if (count_in_stats) {
       node->find_node_failed++;
-      XBT_VERB("%08x not found in %d steps", id_to_find, steps);
+      XBT_VERB("%08x not found in %u steps", id_to_find, steps);
     }
   }
   answer_free(node_list);
index c0741d6..2d8c22f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2016. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -20,7 +20,7 @@ node_t node_init(unsigned int node_id)
 
   node->id = node_id;
   node->table = routing_table_init(node_id);
-  snprintf(node->mailbox,MAILBOX_NAME_SIZE-1, "%d", node_id);
+  snprintf(node->mailbox, MAILBOX_NAME_SIZE - 1, "%u", node_id);
   node->find_node_failed = 0;
   node->find_node_success = 0;
 
@@ -139,7 +139,7 @@ unsigned int get_node_prefix(unsigned int id, unsigned int nb_bits)
 /** @brief Gets the mailbox name of a host given its identifier */
 void get_node_mailbox(unsigned int id, char *mailbox)
 {
-  snprintf(mailbox,MAILBOX_NAME_SIZE-1, "%d", id);
+  snprintf(mailbox, MAILBOX_NAME_SIZE - 1, "%u", id);
 }
 
 /** Constructor, build a new contact information. */
index f0d6a6e..a109676 100644 (file)
@@ -51,9 +51,9 @@ void routing_table_print(routing_table_t table)
 
   for (unsigned int i = 0; i <= identifier_size; i++) {
     if (!xbt_dynar_is_empty(table->buckets[i].nodes)) {
-      XBT_INFO("Bucket number %d: ", i);
+      XBT_INFO("Bucket number %u: ", i);
       xbt_dynar_foreach(table->buckets[i].nodes, j, value) {
-        XBT_INFO("Element %d: %08x", j, value);
+        XBT_INFO("Element %u: %08x", j, value);
       }
     }
   }
index 517797e..1c029d2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -32,12 +32,12 @@ static int timeout = 50;
 static int max_simulation_time = 1000;
 
 typedef struct s_node {
-  int id;                                 //128bits generated random(2^128 -1)
-  int known_id;
+  unsigned id; // 128bits generated random(2^128 -1)
+  unsigned known_id;
   char mailbox[MAILBOX_NAME_SIZE];        // my mailbox name (string representation of the id)
-  int namespace_set[NAMESPACE_SIZE];
-  int neighborhood_set[NEIGHBORHOOD_SIZE];
-  int routing_table[LEVELS_COUNT][LEVEL_SIZE];
+  unsigned namespace_set[NAMESPACE_SIZE];
+  unsigned neighborhood_set[NEIGHBORHOOD_SIZE];
+  unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE];
   int ready;
   msg_comm_t comm_receive;                // current communication to receive
   xbt_dynar_t pending_tasks;
@@ -45,10 +45,10 @@ typedef struct s_node {
 typedef s_node_t* node_t;
 
 typedef struct s_state {
-  int id;
-  int namespace_set[NAMESPACE_SIZE];
-  int neighborhood_set[NEIGHBORHOOD_SIZE];
-  int routing_table[LEVELS_COUNT][LEVEL_SIZE];
+  unsigned id;
+  unsigned namespace_set[NAMESPACE_SIZE];
+  unsigned neighborhood_set[NEIGHBORHOOD_SIZE];
+  unsigned routing_table[LEVELS_COUNT][LEVEL_SIZE];
 } s_state_t;
 typedef s_state_t* state_t;
 
@@ -62,9 +62,9 @@ typedef enum {
 
 typedef struct s_task_data {
   e_task_type_t type;                     // type of task
-  int sender_id;                          // id parameter (used by some types of tasks)
-  //int request_finger;                     // finger parameter (used by some types of tasks)
-  int answer_id;                          // answer (used by some types of tasks)
+  unsigned sender_id;                     // id parameter (used by some types of tasks)
+  // int request_finger;                     // finger parameter (used by some types of tasks)
+  unsigned answer_id;                     // answer (used by some types of tasks)
   char answer_to[MAILBOX_NAME_SIZE];      // mailbox to send an answer to (if any)
   //const char* issuer_host_name;           // used for logging
   int steps;
@@ -190,7 +190,7 @@ static state_t node_get_state(node_t node) {
 }
 
 static void print_node_id(node_t node) {
-  XBT_INFO(" Id: %i '%08x' ", node->id, node->id);
+  XBT_INFO(" Id: %u '%08x' ", node->id, node->id);
 }
 
 static void print_node_neighborood_set(node_t node) {
@@ -230,14 +230,14 @@ static void handle_task(node_t node, msg_task_t task) {
   int j;
   int min;
   int max;
-  int next;
+  unsigned next;
   msg_task_t task_sent;
   task_data_t req_data;
   task_data_t task_data = (task_data_t) MSG_task_get_data(task);
   e_task_type_t type = task_data->type;
   // If the node is not ready keep the task for later
   if (node->ready != 0 && !(type==TASK_JOIN_LAST_REPLY || type==TASK_JOIN_REPLY)) {
-    XBT_DEBUG("Task pending %i", type);
+    XBT_DEBUG("Task pending %u", type);
     xbt_dynar_push(node->pending_tasks, &task);
     return;
   }
@@ -259,7 +259,7 @@ static void handle_task(node_t node, msg_task_t task) {
         task_data->steps++;
         task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, task_data);
         if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) {
-          XBT_DEBUG("Timeout expired when forwarding join to next %d", next);
+          XBT_DEBUG("Timeout expired when forwarding join to next %u", next);
           task_free(task_sent);
         }
         type = TASK_JOIN_REPLY;
@@ -272,7 +272,7 @@ static void handle_task(node_t node, msg_task_t task) {
       req_data->state = node_get_state(node);
       task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
       if (MSG_task_send_with_timeout(task_sent, task_data->answer_to, timeout)== MSG_TIMEOUT) {
-        XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %d", node->id);
+        XBT_DEBUG("Timeout expired when sending back the current node state to the joining node to %u", node->id);
         task_free(task_sent);
       }
       break;
@@ -311,7 +311,7 @@ static void handle_task(node_t node, msg_task_t task) {
       node->ready--;
       // if the node is ready, do all the pending tasks and send update to known nodes
       if (node->ready==0) {
-        XBT_DEBUG("Node %i is ready!!!", node->id);
+        XBT_DEBUG("Node %u is ready!!!", node->id);
         while(xbt_dynar_length(node->pending_tasks)){
           msg_task_t task;
           xbt_dynar_shift(node->pending_tasks, &task);
@@ -342,10 +342,10 @@ static void handle_task(node_t node, msg_task_t task) {
       break;
     /* Received an update of state */
     case TASK_UPDATE:
-      XBT_DEBUG("Task update %i !!!", node->id);
+      XBT_DEBUG("Task update %u !!!", node->id);
 
       /* Update namespace ses */
-      XBT_INFO("Task update from %i !!!", task_data->sender_id);
+      XBT_INFO("Task update from %u !!!", task_data->sender_id);
       XBT_INFO("Node:");
       print_node_id(node);
       print_node_namespace_set(node);
@@ -447,7 +447,7 @@ static int join(node_t node){
   msg_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
   XBT_DEBUG("Trying to join Pastry ring... (with node %s)", mailbox);
   if (MSG_task_send_with_timeout(task_sent, mailbox, timeout)== MSG_TIMEOUT) {
-    XBT_DEBUG("Timeout expired when joining ring with node %d", node->known_id);
+    XBT_DEBUG("Timeout expired when joining ring with node %u", node->known_id);
     task_free(task_sent);
   }
 
index 90dba11..fdcc4ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2017. 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. */
@@ -23,25 +23,25 @@ static int server(int argc, char *argv[])
   long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task1);
   task1 = NULL;
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   long val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task2);
   task2 = NULL;
-  XBT_INFO("Received %lu", val2);
+  XBT_INFO("Received %ld", val2);
 
   MC_assert(MIN(val1, val2) == 1);
 
   MSG_task_receive(&task1, "mymailbox");
   val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task1);
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = xbt_str_parse_int(MSG_task_get_name(task2), "Task name is not a numerical ID: %s");
   MSG_task_destroy(task2);
-  XBT_INFO("Received %lu", val2);
+  XBT_INFO("Received %ld", val2);
 
   XBT_INFO("OK");
   return 0;
index 879c37d..5e805d9 100644 (file)
@@ -29,7 +29,7 @@ static int server(int argc, char *argv[])
   MSG_comm_wait(comm2, -1);
 
   long val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
-  XBT_INFO("Received %lu", val1);
+  XBT_INFO("Received %ld", val1);
 
   MC_assert(val1 == 2);
 
index 176bd08..7dfd2f0 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010-2015. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
           sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index ef3d029..8276fc9 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DAX file.                                   */
 
-/* Copyright (c) 2009-2015. The SimGrid Team.
+/* Copyright (c) 2009-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
               sg_host_get_name(wsl[0]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index aa77528..f4f1355 100644 (file)
@@ -1,6 +1,6 @@
 /* simple test trying to load a DOT file.                                   */
 
-/* Copyright (c) 2010-2016. The SimGrid Team.
+/* Copyright (c) 2010-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ int main(int argc, char **argv)
           sg_host_get_name(wsl[0]), sg_host_get_name(wsl[1]), SD_task_get_amount(task), SD_task_get_name(task));
       break;
     default:
-      xbt_die("Task %s is of unknown kind %d", SD_task_get_name(task), SD_task_get_kind(task));
+      xbt_die("Task %s is of unknown kind %u", SD_task_get_name(task), SD_task_get_kind(task));
     }
     SD_task_destroy(task);
   }
index 5ba0bc0..3b3de64 100644 (file)
@@ -1,16 +1,16 @@
-/* Copyright (c) 2006-2015. The SimGrid Team.
+/* Copyright (c) 2006-2017. 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. */
 
-#include "simgrid/simdag.h"
 #include "simgrid/s4u.hpp"
+#include "simgrid/simdag.h"
 #include "xbt/ex.h"
-#include <xbt/ex.hpp>
 #include "xbt/log.h"
-#include <math.h>
+#include <cmath>
 #include <set>
+#include <xbt/ex.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test, "Logging specific to this SimDag example");
 
index 7dacc29..45398c9 100644 (file)
@@ -180,14 +180,14 @@ static DGraph *buildSH(const char cls){
   tmpS>>=1;
   }
   for(i=0;i<numSources;i++){
-  snprintf(nm,BLOCK_SIZE,"Source.%d",i);
-  nd=newNode(nm);
-  AttachNode(dg,nd);
+    snprintf(nm, BLOCK_SIZE, "Source.%u", i);
+    nd = newNode(nm);
+    AttachNode(dg, nd);
   }
   for(j=0;j<numOfLayers;j++){
     mask=0x00000001<<j;
     for(i=0;i<numSources;i++){
-      snprintf(nm,BLOCK_SIZE,"Comparator.%d",(i+j*firstLayerNode));
+      snprintf(nm, BLOCK_SIZE, "Comparator.%u", (i + j * firstLayerNode));
       nd=newNode(nm);
       AttachNode(dg,nd);
       ndoff=i&(~mask);
@@ -203,7 +203,7 @@ static DGraph *buildSH(const char cls){
   }
   mask=0x00000001<<numOfLayers;
   for(i=0;i<numSources;i++){
-    snprintf(nm,BLOCK_SIZE,"Sink.%d",i);
+    snprintf(nm, BLOCK_SIZE, "Sink.%u", i);
     nd=newNode(nm);
     AttachNode(dg,nd);
     ndoff=i&(~mask);
index 1288fcb..f267b72 100755 (executable)
@@ -146,15 +146,15 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
         HAVE_SEQ=$(which seq 2>/dev/null)
 
         if [ -n "${HAVE_SEQ}" ]; then
-            SEQ1=$( ${HAVE_SEQ} 0 $(( $NUMPROCSMINE - 1 )) )
+            SEQ1=$( ${HAVE_SEQ} 0 $(( NUMPROCSMINE - 1 )) )
         else
             cnt=0
-            while (( $cnt < $NUMPROCSMINE )) ; do
-            SEQ1="$SEQ1 $cnt"
-            cnt=$((cnt + 1));
+            while (( cnt < NUMPROCSMINE )) ; do
+                SEQ1="$SEQ1 $cnt"
+                cnt=$((cnt + 1))
             done
         fi
-        #NUMPROCS=$((${NUMPROCS}+${NUMPROCSMINE}));
+        #NUMPROCS=$(( NUMPROCS + NUMPROCSMINE ));
         for i in $SEQ1
 ##----------------------------------------------------------
 ##  generate application.xml with hostnames from hostfile:
@@ -166,7 +166,7 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
 ##---- generate <actor> tags------------------------------
         do
            if [ -n "${HOSTFILE}" ]; then
-               j=$(( $NUMPROCS % $NUMHOSTS +1))
+               j=$(( NUMPROCS % NUMHOSTS + 1))
             fi
             hostname=$(echo $hostnames|cut -d' ' -f$j)
             if [ -z "${hostname}" ]; then
@@ -178,11 +178,11 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
             echo "  <actor host=\"${host}\" function=\"${instance}\"> <!-- function name used only for logging -->" >> ${APPLICATIONTMP}
             echo "    <argument value=\"${instance}\"/> <!-- instance -->" >> ${APPLICATIONTMP}
             echo "    <argument value=\"${i}\"/> <!-- rank -->" >> ${APPLICATIONTMP}
-            echo "    <argument value=\"$(echo $hosttrace|cut -d' ' -f$(($i+1)))\"/>" >> ${APPLICATIONTMP}
+            echo "    <argument value=\"$(echo $hosttrace|cut -d' ' -f$((i+1)))\"/>" >> ${APPLICATIONTMP}
            
             echo "    <argument value=\"${sleeptime}\"/> <!-- delay -->" >> ${APPLICATIONTMP}
             echo "  </actor>" >> ${APPLICATIONTMP}
-            NUMPROCS=$(( $NUMPROCS +1))
+            NUMPROCS=$(( NUMPROCS + 1))
         done
         # return IFS back to newline for "for" loop
         IFS_OLD=$IFS
diff --git a/include/msg/datatypes.h b/include/msg/datatypes.h
deleted file mode 100644 (file)
index 34c965a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/msg.h instead of msg/datatypes.h
-#include "simgrid/msg.h"
diff --git a/include/msg/msg.h b/include/msg/msg.h
deleted file mode 100644 (file)
index e86d89b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/msg.h instead of msg/msg.h
-#include "simgrid/msg.h"
diff --git a/include/simdag/datatypes.h b/include/simdag/datatypes.h
deleted file mode 100644 (file)
index 571d1aa..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/simdag.h instead of simdag/datatypes.h
-#include "simgrid/simdag.h"
diff --git a/include/simdag/simdag.h b/include/simdag/simdag.h
deleted file mode 100644 (file)
index 6306622..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#warning You should now include directly simgrid/simdag.h instead of simdag/simdag.h
-#include "simgrid/simdag.h"
index 43387f2..ebb956e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2016. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,8 +6,8 @@
 
 #ifndef JEDULE_HPP_
 #define JEDULE_HPP_
-#include <stdio.h>
 #include "simgrid_config.h"
+#include <cstdio>
 
 #include "jedule_events.hpp"
 #include "jedule_platform.hpp"
index cafddcb..912fe8d 100644 (file)
@@ -8,15 +8,14 @@
 
 #include <simgrid_config.h>
 
-#include <string>
 #include <cstdarg>
-#include <stdlib.h>
+#include <cstdlib>
+#include <string>
 
 #if SIMGRID_HAVE_MC
 
 #include <stdexcept>
 #include <cstddef>
-#include <cstdlib>
 #include <cstring>
 #include <iterator>
 
index fac49a7..f29739e 100644 (file)
@@ -2,7 +2,7 @@
 /*  no system header should be loaded out of this file so that we have only */
 /*  one file to check when porting to another OS                            */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -76,13 +76,7 @@ XBT_PUBLIC(void) xbt_backtrace_display_current();
 /** @brief Like malloc, but xbt_die() on error
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
-  void *res;
-/*  if (n==0) {
-     xbt_backtrace_display_current();
-     xbt_die("malloc(0) is not portable");
-  }*/
-
-  res = malloc(n);
+  void* res = malloc(n);
   if (!res)
     xbt_die("Memory allocation of %lu bytes failed", (unsigned long)n);
   return res;
@@ -91,9 +85,7 @@ static XBT_ALWAYS_INLINE void *xbt_malloc(size_t n) {
 /** @brief like malloc, but xbt_die() on error and memset data to 0
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) {
-  void *res;
-  //if (n==0) xbt_die("calloc(0) is not portable");
-  res = calloc(n, 1);
+  void* res = calloc(n, 1);
   if (!res)
     xbt_die("Memory callocation of %lu bytes failed", (unsigned long)n);
   return res;
@@ -103,7 +95,6 @@ static XBT_ALWAYS_INLINE void *xbt_malloc0(size_t n) {
     @hideinitializer */
 static XBT_ALWAYS_INLINE void *xbt_realloc(void *p, size_t s) {
   void *res = NULL;
-  //if (s==0) xbt_die("realloc(0) is not portable");
   if (s) {
     if (p) {
       res = realloc(p, s);
index 4f76619..11342f2 100644 (file)
@@ -5,7 +5,7 @@
 /* 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. */
 
-#include <locale.h>
+#include <clocale>
 
 #include "simgrid/msg.h"
 #include "simgrid/plugins/energy.h"
index 128f077..a5e6ed1 100644 (file)
@@ -8,7 +8,7 @@
 #include "xbt/sysdep.h"
 #include "jxbt_utilities.h"
 
-#include <stdlib.h> /* abort */
+#include <cstdlib> /* abort */
 
 SG_BEGIN_DECL()
 
index 6f9f856..c0b812c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2012-2015. The SimGrid Team.
+/* Copyright (c) 2010, 2012-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -10,8 +10,8 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include <ctype.h>
-#include <string.h>
+#include <cctype>
+#include <cstring>
 
 extern "C" {
 #include <lauxlib.h>
index c93da96..792fc4c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2012, 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -142,8 +142,8 @@ type_t PJ_type_variable_new (const char *name, const char *color, type_t father)
 
   type_t ret = nullptr;
 
-  char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
   if (not color) {
+    char white[INSTR_DEFAULT_STR_SIZE] = "1 1 1";
     ret = newType (name, name, white, TYPE_VARIABLE, father);
   }else{
     ret = newType (name, name, color, TYPE_VARIABLE, father);
index 087b175..e45c097 100644 (file)
@@ -30,8 +30,8 @@
 #include "xbt/swag.h"
 #include "xbt/xbt_os_time.h"
 
-#include <signal.h>
 #include "src/simix/ActorImpl.hpp"
+#include <csignal>
 
 #include <simgrid/simix.hpp>
 
index 1a191c8..52f8bb1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2017. 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. */
@@ -22,7 +22,7 @@ ClusterZone::ClusterZone(NetZone* father, const char* name) : NetZoneImpl(father
 
 void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
   xbt_assert(not privateLinks_.empty(),
              "Cluster routing: no links attached to the source node - did you use host_link tag?");
 
index 0efd92e..b5c5313 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2017. 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. */
@@ -7,7 +7,7 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 
-#include <float.h>
+#include <cfloat>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
 
index a89ff4b..4975caf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2017. 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. */
@@ -286,7 +286,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_c
   if (dst->isRouter() || src->isRouter())
     return;
 
-  XBT_VERB("dragonfly getLocalRout from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
+  XBT_VERB("dragonfly getLocalRout from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
            dst->id());
 
   if ((src->id() == dst->id()) && hasLoopback_) {
index 9031a4f..49f8b8b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2017. 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. */
@@ -64,16 +64,16 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cba
 
   /* Let's find the source and the destination in our internal structure */
   auto searchedNode = this->computeNodes_.find(src->id());
-  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%d] in the fat tree",
+  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the source %s [%u] in the fat tree",
              src->name().c_str(), src->id());
   FatTreeNode* source = searchedNode->second;
 
   searchedNode = this->computeNodes_.find(dst->id());
-  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%d] in the fat tree",
+  xbt_assert(searchedNode != this->computeNodes_.end(), "Could not find the destination %s [%u] in the fat tree",
              dst->name().c_str(), dst->id());
   FatTreeNode* destination = searchedNode->second;
 
-  XBT_VERB("Get route and latency from '%s' [%d] to '%s' [%d] in a fat tree", src->name().c_str(), src->id(),
+  XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->name().c_str(), src->id(),
            dst->name().c_str(), dst->id());
 
   /* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
@@ -242,7 +242,7 @@ void FatTreeZone::generateSwitches()
 
   if (this->nodesByLevel_[0] != this->nodes_.size()) {
     surf_parse_error("The number of provided nodes does not fit with the wanted topology."
-                     " Please check your platform description (We need %d nodes, we got %zu)",
+                     " Please check your platform description (We need %u nodes, we got %zu)",
                      this->nodesByLevel_[0], this->nodes_.size());
     return;
   }
@@ -264,7 +264,7 @@ void FatTreeZone::generateSwitches()
   for (unsigned int i = 0; i < this->levels_; i++) {
     for (unsigned int j = 0; j < this->nodesByLevel_[i + 1]; j++) {
       FatTreeNode* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j);
-      XBT_DEBUG("We create the switch %d(%d,%d)", newNode->id, newNode->level, newNode->position);
+      XBT_DEBUG("We create the switch %d(%u,%u)", newNode->id, newNode->level, newNode->position);
       newNode->children.resize(this->lowerLevelNodesNumber_[i] * this->lowerLevelPortsNumber_[i]);
       if (i != this->levels_ - 1) {
         newNode->parents.resize(this->upperLevelNodesNumber_[i + 1] * this->lowerLevelPortsNumber_[i + 1]);
@@ -348,7 +348,7 @@ void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeN
 {
   FatTreeLink* newLink;
   newLink = new FatTreeLink(this->cluster_, child, parent);
-  XBT_DEBUG("Creating a link between the parent (%d,%d,%u) and the child (%d,%d,%u)", parent->level, parent->position,
+  XBT_DEBUG("Creating a link between the parent (%u,%u,%u) and the child (%u,%u,%u)", parent->level, parent->position,
             parentPort, child->level, child->position, childPort);
   parent->children[parentPort] = newLink;
   child->parents[childPort]    = newLink;
index 457b0e1..863c876 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2017. 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. */
@@ -8,7 +8,7 @@
 #include "src/surf/network_interface.hpp"
 #include "xbt/log.h"
 
-#include <float.h>
+#include <cfloat>
 #include <limits>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
index 7f6a98e..9bae539 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2017. 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. */
@@ -60,7 +60,7 @@ FullZone::~FullZone()
 
 void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
 {
-  XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->cname(), src->id(), dst->cname(), dst->id());
 
   unsigned int table_size        = getTableSize();
   sg_platf_route_cbarg_t e_route = TO_ROUTE_FULL(src->id(), dst->id());
index 285ef6a..fd54a2f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-2017. 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. */
 #include <xbt/signal.hpp>
 
 #include "src/kernel/routing/NetZoneImpl.hpp"
-/*
-#include <float.h>
-#include <vector>
-*/
+
 namespace simgrid {
 namespace kernel {
 namespace routing {
index 1486801..30b2750 100644 (file)
@@ -32,7 +32,7 @@ NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, na
              "Refusing to create a second NetZone called '%s'.", name);
 
   netpoint_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
-  XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netpoint_->id());
+  XBT_DEBUG("NetZone '%s' created with the id '%u'", name, netpoint_->id());
 }
 NetZoneImpl::~NetZoneImpl()
 {
index 7f6b210..399ac2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2017. 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 @@ void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
 
-  XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
+  XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
            dst->id());
 
   if (dst->isRouter() || src->isRouter())
@@ -175,7 +175,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 
           assert(linkOffset >= 0);
         }
-        XBT_DEBUG("torus_get_route_and_latency - current_node: %i, next_node: %u, linkOffset is %i", current_node,
+        XBT_DEBUG("torus_get_route_and_latency - current_node: %u, next_node: %u, linkOffset is %i", current_node,
                   next_node, linkOffset);
         break;
       }
index 97849e0..8ebb7fa 100644 (file)
@@ -76,7 +76,7 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s
 
 void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
-  XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
+  XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->cname(), src->id(), dst->cname(), dst->id());
 
   if (src->isNetZone()) {
     std::string srcName = "router_" + src->name();
index 29d624c..20d3e5e 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. 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. */
 
+#include <cstring> // memcpy, memcmp
 #include <unistd.h>
-#include <string.h> // memcpy, memcmp
 
 #include <sys/mman.h>
 #ifdef __FreeBSD__
index d38c528..810351b 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2015-2016. The SimGrid Team.
+/* Copyright (c) 2015-2017. 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. */
 
+#include <csignal>
 #include <fcntl.h>
-#include <signal.h>
 
 #include <functional>
 
index fad3f3a..6e9bd09 100644 (file)
@@ -67,25 +67,25 @@ static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int p
 
   switch(diff) {
   case TYPE_DIFF:
-    res = bprintf("%s Different type for communication #%d", type, cursor);
+    res = bprintf("%s Different type for communication #%u", type, cursor);
     break;
   case RDV_DIFF:
-    res = bprintf("%s Different rdv for communication #%d", type, cursor);
+    res = bprintf("%s Different rdv for communication #%u", type, cursor);
     break;
   case TAG_DIFF:
-    res = bprintf("%s Different tag for communication #%d", type, cursor);
+    res = bprintf("%s Different tag for communication #%u", type, cursor);
     break;
   case SRC_PROC_DIFF:
-      res = bprintf("%s Different source for communication #%d", type, cursor);
+    res = bprintf("%s Different source for communication #%u", type, cursor);
     break;
   case DST_PROC_DIFF:
-      res = bprintf("%s Different destination for communication #%d", type, cursor);
+    res = bprintf("%s Different destination for communication #%u", type, cursor);
     break;
   case DATA_SIZE_DIFF:
-    res = bprintf("%s\n Different data size for communication #%d", type, cursor);
+    res = bprintf("%s\n Different data size for communication #%u", type, cursor);
     break;
   case DATA_DIFF:
-    res = bprintf("%s\n Different data for communication #%d", type, cursor);
+    res = bprintf("%s\n Different data for communication #%u", type, cursor);
     break;
   default:
     res = nullptr;
@@ -436,7 +436,7 @@ void CommunicationDeterminismChecker::main()
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %zd)", stack_.size(), state->num,
+    XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), state->num,
               state->interleaveSize());
 
     /* Update statistics */
@@ -508,13 +508,13 @@ void CommunicationDeterminismChecker::main()
         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);
       else
-        XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size());
+        XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size());
 
       if (not this->initial_communications_pattern_done)
         this->initial_communications_pattern_done = 1;
 
       /* Trash the current state, no longer needed */
-      XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size());
+      XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size());
       stack_.pop_back();
 
       visited_state = nullptr;
@@ -530,16 +530,16 @@ void CommunicationDeterminismChecker::main()
         stack_.pop_back();
         if (state->interleaveSize() && stack_.size() < (std::size_t)_sg_mc_max_depth) {
           /* We found a back-tracking point, let's loop */
-          XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+          XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
           stack_.push_back(std::move(state));
 
           this->restoreState();
 
-          XBT_DEBUG("Back-tracking to state %d at depth %zi done", stack_.back()->num, stack_.size());
+          XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
 
           break;
         } else {
-          XBT_DEBUG("Delete state %d at depth %zi", state->num, stack_.size() + 1);
+          XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
         }
       }
     }
index 7cc2f8b..4f3a21a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011-2015. The SimGrid Team.
+/* Copyright (c) 2011-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -282,7 +282,7 @@ void LivenessChecker::showAcceptanceCycle(std::size_t depth)
   for (auto& s : this->getTextualTrace())
     XBT_INFO("%s", s.c_str());
   simgrid::mc::session->logState();
-  XBT_INFO("Counter-example depth : %zd", depth);
+  XBT_INFO("Counter-example depth : %zu", depth);
 }
 
 std::vector<std::string> LivenessChecker::getTextualTrace() // override
@@ -372,11 +372,10 @@ void LivenessChecker::run()
     /* Update current state in buchi automaton */
     simgrid::mc::property_automaton->current_state = current_pair->automaton_state;
 
-    XBT_DEBUG("********************* ( Depth = %d, search_cycle = %d, interleave size = %zd, pair_num = %d, requests = %d)",
-       current_pair->depth, current_pair->search_cycle,
-       current_pair->graph_state->interleaveSize(),
-       current_pair->num,
-       current_pair->requests);
+    XBT_DEBUG(
+        "********************* ( Depth = %d, search_cycle = %d, interleave size = %zu, pair_num = %d, requests = %d)",
+        current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleaveSize(), current_pair->num,
+        current_pair->requests);
 
     if (current_pair->requests == 0) {
       this->backtrack();
index 7906265..a48780f 100644 (file)
@@ -97,8 +97,8 @@ void SafetyChecker::run()
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth=%zi (state=%p, num %d)(%zu interleave)",
-      stack_.size(), state, state->num, state->interleaveSize());
+    XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num,
+              state->interleaveSize());
 
     mc_model_checker->visited_states++;
 
@@ -125,7 +125,7 @@ void SafetyChecker::run()
     // req is now the transition of the process that was selected to be executed
 
     if (req == nullptr) {
-      XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1);
+      XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size() + 1);
 
       this->backtrack();
       continue;
@@ -259,15 +259,13 @@ void SafetyChecker::backtrack()
     if (state->interleaveSize()
         && stack_.size() < (std::size_t) _sg_mc_max_depth) {
       /* We found a back-tracking point, let's loop */
-      XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+      XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
       stack_.push_back(std::move(state));
       this->restoreState();
-      XBT_DEBUG("Back-tracking to state %d at depth %zi done",
-        stack_.back()->num, stack_.size());
+      XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
       break;
     } else {
-      XBT_DEBUG("Delete state %d at depth %zi",
-        state->num, stack_.size() + 1);
+      XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
     }
   }
 }
index fabd66b..5a342c6 100644 (file)
@@ -1638,8 +1638,7 @@ int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc:
 #else
 
 #ifdef MC_VERBOSE
-      XBT_VERB("(%d - %d) Different local variables between stacks %d", num1,
-               num2, cursor + 1);
+      XBT_VERB("(%d - %d) Different local variables between stacks %u", num1, num2, cursor + 1);
 #endif
 
       return 1;
index 9f7775c..daf52a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,10 +6,10 @@
 
 #include <unistd.h>
 
+#include <cstring>
+#include <dirent.h>
 #include <fcntl.h>
-#include <string.h>
 #include <link.h>
-#include <dirent.h>
 
 #ifndef WIN32
 #include <sys/mman.h>
index 3f3d1bd..cb7029c 100644 (file)
@@ -3,7 +3,7 @@
 /* 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. */
 
-#include <string.h>
+#include <cstring>
 
 #include "xbt/dynar.h"
 #include "xbt/sysdep.h"
index 47b5771..e05b628 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2008-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -539,8 +539,7 @@ static void MC_dwarf_fill_member_location(
     // It's supposed to be possible in DWARF2 but I couldn't find its semantic
     // in the spec.
   default:
-    xbt_die("Can't handle form class (%i) / form 0x%x as DW_AT_member_location",
-            (int) form_class, form);
+    xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
   }
 
 }
@@ -790,11 +789,8 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
     break;
 
   default:
-    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location "
-            "in <%" PRIx64 ">%s",
-            form, form, (int) form_class, (int) form_class,
-            (uint64_t) variable->id,
-            variable->name.c_str());
+    xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%" PRIx64 ">%s", (unsigned)form, form,
+            (unsigned)form_class, (int)form_class, (uint64_t)variable->id, variable->name.c_str());
   }
 
   // Handle start_scope:
@@ -814,9 +810,8 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(
 
     case simgrid::dwarf::FormClass::RangeListPtr:     // TODO
     default:
-      xbt_die
-          ("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s",
-           form, (int) form_class, name == nullptr ? "?" : name);
+      xbt_die("Unhandled form 0x%x, class 0x%X for DW_AT_start_scope of variable %s", (unsigned)form,
+              (unsigned)form_class, name == nullptr ? "?" : name);
     }
   }
 
index ce2bfa2..a8dfdb1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -86,7 +86,7 @@ RecordTrace parseRecordTrace(const char* data)
   while (*current) {
 
     simgrid::mc::Transition item;
-    int count = sscanf(current, "%u/%u", &item.pid, &item.argument);
+    int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
     if(count != 2 && count != 1)
       throw std::runtime_error("Could not parse record path");
     res.push_back(item);
index e365f98..11dba26 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -196,8 +196,8 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size,
 
 #ifdef SIMGRID_TEST
 
-#include <string.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <cstring>
 
 #include <sys/mman.h>
 
index 1a36d31..0bce019 100644 (file)
@@ -3,7 +3,7 @@
 /* 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. */
 
-#include <assert.h>
+#include <cassert>
 
 #include <boost/range/algorithm.hpp>
 
index 6b2d206..ebe8c8e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,7 +11,7 @@
 // We need this for the register indices:
 // #define _GNU_SOURCE
 
-#include <string.h>
+#include <cstring>
 
 // On x86_64, libunwind unw_context_t has the same layout as ucontext_t:
 #include <sys/types.h>
index 257ebb4..1cd7efb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@ void read_element(AddressSpace const& as,
   s_xbt_dynar_t d;
   as.read_bytes(&d, sizeof(d), addr);
   if (i >= d.used)
-    xbt_die("Out of bound index %zi/%lu", i, d.used);
+    xbt_die("Out of bound index %zu/%lu", i, d.used);
   if (len != d.elmsize)
     xbt_die("Bad size in simgrid::mc::read_element");
   as.read_bytes(local, len, remote(xbt_dynar_get_ptr(&d, i)));
index 6c4000d..1fee675 100644 (file)
@@ -1,10 +1,10 @@
-/* Copyright (c) 2015-2016. The SimGrid Team.
+/* Copyright (c) 2015-2017. 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. */
 
-#include <errno.h>
+#include <cerrno>
 #include <unistd.h>
 
 #include <sys/socket.h>
index 9bfc523..d6a72a1 100644 (file)
@@ -140,33 +140,33 @@ void Client::handleMessages()
     switch (message->type) {
 
       case MC_MESSAGE_DEADLOCK_CHECK:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zu != %zu)",
+        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for DEADLOCK_CHECK (%zd != %zu)",
                    received_size, sizeof(mc_message_t));
         handleDeadlockCheck(message);
         break;
 
       case MC_MESSAGE_CONTINUE:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zu != %zu)",
+        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_CONTINUE (%zd != %zu)",
                    received_size, sizeof(mc_message_t));
         handleContinue(message);
         return;
 
       case MC_MESSAGE_SIMCALL_HANDLE:
         xbt_assert(received_size == sizeof(s_mc_message_simcall_handle_t),
-                   "Unexpected size for SIMCALL_HANDLE (%zu != %zu)", received_size,
+                   "Unexpected size for SIMCALL_HANDLE (%zd != %zu)", received_size,
                    sizeof(s_mc_message_simcall_handle_t));
         handleSimcall((s_mc_message_simcall_handle_t*)message_buffer);
         break;
 
       case MC_MESSAGE_RESTORE:
-        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zu != %zu)",
+        xbt_assert(received_size == sizeof(mc_message_t), "Unexpected size for MESSAGE_RESTORE (%zd != %zu)",
                    received_size, sizeof(mc_message_t));
         handleRestore((s_mc_message_restore_t*)message_buffer);
         break;
 
       case MC_MESSAGE_ACTOR_ENABLED:
         xbt_assert(received_size == sizeof(s_mc_message_actor_enabled_t),
-                   "Unexpected size for ACTOR_ENABLED (%zu != %zu)", received_size,
+                   "Unexpected size for ACTOR_ENABLED (%zd != %zu)", received_size,
                    sizeof(s_mc_message_actor_enabled_t));
         handleActorEnabled((s_mc_message_actor_enabled_t*)message_buffer);
         break;
index f96e1e5..3811904 100644 (file)
@@ -5,10 +5,10 @@
 
 #define _FILE_OFFSET_BITS 64 /* needed for pread_whole to work as expected on 32bits */
 
-#include <assert.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdint.h>
+#include <cassert>
+#include <cerrno>
+#include <cstddef>
+#include <cstdint>
 
 #include <sys/ptrace.h>
 
@@ -427,7 +427,7 @@ void RemoteClient::read_variable(const char* name, void* target, size_t size) co
   simgrid::mc::Variable* var = this->find_variable(name);
   xbt_assert(var->address, "No simple location for this variable");
   xbt_assert(var->type->full_type, "Partial type for %s, cannot check size", name);
-  xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zi, was %zi)", name,
+  xbt_assert((size_t)var->type->full_type->byte_size == size, "Unexpected size for %s (expected %zu, was %zu)", name,
              size, (size_t)var->type->full_type->byte_size);
   this->read_bytes(target, size, remote(var->address));
 }
index 74bec4e..6567377 100644 (file)
@@ -1,13 +1,13 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2017. 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. */
 
+#include <cerrno>
 #include <cstddef> // std::size_t
-#include <errno.h>
-#include <stdio.h> // perror
-#include <string.h>
+#include <cstdio>  // perror
+#include <cstring>
 
 #include <sys/socket.h>
 #include <sys/types.h>
index b5d171a..9557caa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2017. 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. */
@@ -6,7 +6,7 @@
 #include "src/msg/msg_private.h"
 #include "xbt/replay.hpp"
 
-#include <errno.h>
+#include <cerrno>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_action, msg, "MSG actions for trace driven simulation");
 
index 827c481..5cf06a0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@ void MSG_barrier_destroy(msg_bar_t bar) {
 int MSG_barrier_wait(msg_bar_t bar) {
   xbt_mutex_acquire(bar->mutex);
   bar->arrived_processes++;
-  XBT_DEBUG("waiting %p %d/%d", bar, bar->arrived_processes, bar->expected_processes);
+  XBT_DEBUG("waiting %p %u/%u", bar, bar->arrived_processes, bar->expected_processes);
   if (bar->arrived_processes == bar->expected_processes) {
     xbt_cond_broadcast(bar->cond);
     xbt_mutex_release(bar->mutex);
index 619fcb1..7c82c61 100644 (file)
@@ -8,7 +8,7 @@
 #include "simgrid/simdag.h"
 #include "src/internal_config.h"
 #include "xbt/file.h"
-#include <string.h>
+#include <cstring>
 #include <unordered_map>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
index f0f8268..d00955b 100644 (file)
@@ -6,9 +6,9 @@
 #include <functional>
 #include <memory>
 
-#include <signal.h> /* Signal handling */
-#include <stdlib.h>
 #include "src/internal_config.h"
+#include <csignal> /* Signal handling */
+#include <cstdlib>
 
 #include <xbt/functional.hpp>
 
@@ -37,7 +37,6 @@
 #include "src/mc/mc_private.h"
 #include "src/mc/remote/Client.hpp"
 #include "src/mc/remote/mc_protocol.h"
-#include <stdlib.h>
 #endif
 
 #include "src/mc/mc_record.h"
@@ -128,8 +127,8 @@ static void install_segvhandler()
     return;
   }
   if (not(old_stack.ss_flags & SS_DISABLE)) {
-    XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zd, flags=%x). Restore it.",
-              old_stack.ss_sp, old_stack.ss_size, old_stack.ss_flags);
+    XBT_DEBUG("An alternate stack was already installed (sp=%p, size=%zu, flags=%x). Restore it.", old_stack.ss_sp,
+              old_stack.ss_size, (unsigned)old_stack.ss_flags);
     sigaltstack(&old_stack, nullptr);
   }
 
index bad673a..66f332c 100644 (file)
@@ -1,5 +1,4 @@
-
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -169,7 +168,7 @@ void MutexImpl::unlock(smx_actor_t issuer)
 
   /* If the mutex is not owned by the issuer, that's not good */
   if (issuer != this->owner)
-    THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
+    THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%lu), not by you.",
            this->owner->cname(), this->owner->pid);
 
   if (xbt_swag_size(this->sleeping) > 0) {
index 3874163..8ae33f0 100644 (file)
@@ -98,8 +98,7 @@ int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
    unsigned int size = comm->size();
    unsigned int rank = comm->rank();
 
-   XBT_DEBUG(
-                "coll:tuned:allgather_ompi_bruck rank %d", rank);
+   XBT_DEBUG("coll:tuned:allgather_ompi_bruck rank %u", rank);
 
    sdtype->extent(&slb, &sext);
 
index 062d5cb..e75003a 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "../colls_private.h"
-#include <math.h>
+#include <cmath>
 
 /*****************************************************************************
 
index bb8ca3d..85baad3 100644 (file)
@@ -5,7 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "../colls_private.h"
-#include <math.h>
+#include <cmath>
 
 /*****************************************************************************
 
index e2a0958..52ad605 100644 (file)
@@ -98,7 +98,7 @@ Coll_bcast_ompi_split_bintree::bcast ( void* buffer,
     else
       segsize = 1024 << 3;
 
-    XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5d", rank, root, segsize);
+    XBT_DEBUG("ompi_coll_tuned_bcast_intra_split_bintree rank %d root %d ss %5u", rank, root, segsize);
 
     if (size == 1) {
         return MPI_SUCCESS;
index 25d1cb8..f5d593d 100644 (file)
@@ -68,7 +68,9 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
         sendtmpbuf = (char *)recvbuf;
     }
 
-    XBT_DEBUG( "coll:tuned:reduce_generic count %d, msg size %ld, segsize %ld, max_requests %d", original_count, (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment, max_outstanding_reqs);
+    XBT_DEBUG("coll:tuned:reduce_generic count %d, msg size %lu, segsize %lu, max_requests %d", original_count,
+              (unsigned long)(num_segments * segment_increment), (unsigned long)segment_increment,
+              max_outstanding_reqs);
 
     rank = comm->rank();
 
@@ -335,7 +337,7 @@ int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count,
     size_t typelng;
     int fanout = comm->size()/2;
 
-    XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5d", comm->rank(), fanout, segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_chain rank %d fo %d ss %5u", comm->rank(), fanout, segsize);
 
     /**
      * Determine number of segments and number of elements
@@ -386,8 +388,7 @@ int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf,
         segsize = 64*1024;
     }
 
-    XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_pipeline rank %d ss %5u", comm->rank(), segsize);
 
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
@@ -417,8 +418,7 @@ int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf,
         // Binary_32K
     segsize = 32*1024;
 
-    XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_binary rank %d ss %5u", comm->rank(), segsize);
 
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
@@ -459,8 +459,7 @@ int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf,
         segsize = 1024;
     }
 
-    XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5d",
-                 comm->rank(), segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_binomial rank %d ss %5u", comm->rank(), segsize);
     COLL_TUNED_COMPUTED_SEGCOUNT( segsize, typelng, segcount );
 
     return smpi_coll_tuned_ompi_reduce_generic( sendbuf, recvbuf, count, datatype,
@@ -491,8 +490,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
 
     rank = comm->rank();
     size = comm->size();
-    XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5d",
-                 rank, segsize);
+    XBT_DEBUG("coll:tuned:reduce_intra_in_order_binary rank %d ss %5u", rank, segsize);
 
     /**
      * Determine number of segments and number of elements
index ac19cd5..b2c90e0 100644 (file)
@@ -10,8 +10,8 @@
  */
 
 #include "../colls_private.h"
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
 
 #define REDUCE_NEW_ALWAYS 1
 
index 017e61e..3ffffa0 100644 (file)
@@ -4,7 +4,7 @@
 /* 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. */
 
-#include <float.h>
+#include <cfloat>
 
 #include <exception>
 
index 52e6e4b..ec33a27 100644 (file)
@@ -6,10 +6,10 @@
 
 #include "private.h"
 #include "private.hpp"
-#include <ctype.h>
+#include <cctype>
+#include <cstdarg>
+#include <cwchar>
 #include <simgrid/sg_config.h>
-#include <stdarg.h>
-#include <wchar.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_smpi, instr, "Tracing SMPI");
 
index 6342bd9..44fdedf 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
-#include <math.h> // sqrt
+#include <cmath>
 
 #if HAVE_PAPI
 #include <papi.h>
index 47fa986..e864e81 100644 (file)
 #include "smpi_info.hpp"
 #include "smpi_process.hpp"
 
+#include <cfloat> /* DBL_MAX */
 #include <dlfcn.h>
 #include <fcntl.h>
-#include <sys/stat.h>
-#include <float.h> /* DBL_MAX */
 #include <fstream>
+#include <sys/stat.h>
 
 #if HAVE_SENDFILE
 #include <sys/sendfile.h>
index 719b28b..9a1147f 100644 (file)
@@ -9,13 +9,13 @@
 
 #include <vector>
 
-#include <stdlib.h>
-#include <sys/types.h>
-#include <string.h>
-#include <stdio.h>
+#include <cerrno>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <errno.h>
+#include <sys/types.h>
 
 #ifndef WIN32
 #include <sys/mman.h>
@@ -135,7 +135,7 @@ void smpi_initialize_global_memory_segments()
     int status;
 
     do {
-      snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffff);
+      snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffffU);
       file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
     } while (file_descriptor == -1 && errno == EEXIST);
     if (file_descriptor < 0) {
index 4ffaea8..742af85 100644 (file)
@@ -24,13 +24,13 @@ extern int* index_to_process_data;
 
 static char *get_mailbox_name(char *str, int index)
 {
-  snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int> (sizeof(int) * 2), index);
+  snprintf(str, MAILBOX_NAME_MAXLEN, "SMPI-%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
   return str;
 }
 
 static char *get_mailbox_name_small(char *str, int index)
 {
-  snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int> (sizeof(int) * 2), index);
+  snprintf(str, MAILBOX_NAME_MAXLEN, "small%0*x", static_cast<int>(sizeof(int) * 2), static_cast<unsigned>(index));
   return str;
 }
 
index cd4b820..a213733 100644 (file)
 #include "private.hpp"
 #include "xbt/dict.h"
 #include "xbt/ex.hpp"
-#include <errno.h>
+#include <cerrno>
 
 #include <sys/types.h>
 #ifndef WIN32
 #include <sys/mman.h>
 #endif
-#include <sys/stat.h>
+#include <cstdio>
 #include <fcntl.h>
-#include <string.h>
-#include <stdio.h>
+#include <sys/stat.h>
 
 #ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
@@ -307,7 +306,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
     size_t start_block_offset = ALIGN_UP(start_offset, smpi_shared_malloc_blocksize);
     size_t stop_block_offset = ALIGN_DOWN(stop_offset, smpi_shared_malloc_blocksize);
     for (unsigned block_id=0, i = start_block_offset / smpi_shared_malloc_blocksize; i < stop_block_offset / smpi_shared_malloc_blocksize; block_id++, i++) {
-      XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %d", block_id);
+      XBT_DEBUG("\t\tglobal shared allocation, mmap block offset %u", block_id);
       void* pos = (void*)((unsigned long)mem + i * smpi_shared_malloc_blocksize);
       void* res = mmap(pos, smpi_shared_malloc_blocksize, PROT_READ | PROT_WRITE, mmap_flag,
                        huge_fd, 0);
index e0ef96f..b1a9e09 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016. The SimGrid Team.
+/* Copyright (c) 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
index e5a5706..fc2a5c6 100644 (file)
@@ -32,12 +32,12 @@ int F2C::f2c_id(){
 };
 
 char* F2C::get_key(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x",id);
+  std::snprintf(key, KEY_SIZE, "%x", (unsigned)id);
   return key;
 }
 
 char* F2C::get_key_id(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x_%d",id, smpi_process()->index());
+  std::snprintf(key, KEY_SIZE, "%x_%d", (unsigned)id, smpi_process()->index());
   return key;
 }
 
index fa3701d..b55b0e3 100644 (file)
@@ -3,13 +3,13 @@
 /* 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. */
 
-#include "xbt/sysdep.h"
 #include "smpi/smpi.h"
 #include "private.h"
-#include <vector>
-#include <math.h>
 #include "smpi_comm.hpp"
 #include "smpi_topo.hpp"
+#include "xbt/sysdep.h"
+#include <cmath>
+#include <vector>
 
 /* static functions */
 static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims);
index a8c75e1..750e28f 100755 (executable)
@@ -75,6 +75,11 @@ unset pid
 
 trapped_signals="HUP INT QUIT ILL ABRT SEGV FPE ALRM TERM USR1 USR2 BUS"
 
+die () {
+    printf '[%s] ** error: %s. Aborting.\n' "$(basename $0)" "$*" >&2
+    exit 1
+}
+
 smpirun_cleanup()
 {
   if [ -z "${KEEP}" ] ; then
@@ -138,24 +143,21 @@ while true; do
         "-platform")
            PLATFORM="$2"
             if [ ! -f "${PLATFORM}" ]; then
-               echo "[`basename $0`] ** error: the file '${PLATFORM}' does not exist. Aborting."
-               exit 1
+                die "the file '${PLATFORM}' does not exist"
             fi
            shift 2
             ;;
         "-hostfile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
+                die "the file '${HOSTFILE}' does not exist"
             fi
            shift 2
             ;;
         "-machinefile")
            HOSTFILE="$2"
             if [ ! -f "${HOSTFILE}" ]; then
-               echo "[`basename $0`] ** error: the file '${HOSTFILE}' does not exist. Aborting."
-               exit 1
+                die "the file '${HOSTFILE}' does not exist"
             fi
            shift 2
             ;;
@@ -298,7 +300,7 @@ fi
 UNROLLEDHOSTFILETMP=0
 
 #parse if our lines are terminated by :num_process
-multiple_processes=`grep -c ":" $HOSTFILE`
+multiple_processes=$(grep -c ":" $HOSTFILE)
 if [ "${multiple_processes}" -gt 0 ] ; then
     UNROLLEDHOSTFILETMP=1
     UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
@@ -311,10 +313,9 @@ if [ "${multiple_processes}" -gt 0 ] ; then
 fi
 
 # Don't use wc -l to compute it to avoid issues with trailing \n at EOF
-hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE`
+hostfile_procs=$(grep -c "[a-zA-Z0-9]" $HOSTFILE)
 if [ ${hostfile_procs} = 0 ] ; then
-   echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
-   exit 1
+    die "the hostfile '${HOSTFILE}' is empty"
 fi
 
 if [ -z "${NUMPROCS}" ] ; then
@@ -401,10 +402,10 @@ fi
 ##  hostfile has less than i lines.
 ##----------------------------------------------------------
 
-HAVE_SEQ="`which seq 2>/dev/null`"
+HAVE_SEQ="$(which seq 2>/dev/null)"
 
 if [ -n "${HAVE_SEQ}" ]; then
-    SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))`
+    SEQ=$(${HAVE_SEQ} 0 $(( NUMPROCS - 1)))
 else
     cnt=0
     while [ $cnt -lt ${NUMPROCS} ] ; do
@@ -424,7 +425,7 @@ done
 
 for i in ${SEQ}
 do
-    j=$(( $i % ${hostfile_procs} + 1 ))
+    j=$(( i % hostfile_procs + 1 ))
     host=$(eval "echo \${$j}")
 
     ##---- optional display of ranks to actor mapping
index 2f44bdb..2a0fcb7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2011, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2007-2011, 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,9 +7,9 @@
 #include "maxmin_private.hpp"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
+#include <cfloat>
+#include <cmath>
+#include <cstdlib>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
 #define SHOW_EXPR_G(expr) XBT_DEBUG(#expr " = %g",expr);
index dc52269..7e70a86 100644 (file)
@@ -11,9 +11,9 @@
 #include "xbt/sysdep.h"
 #include "maxmin_private.hpp"
 
-#include <stdlib.h>
+#include <cstdlib>
 #ifndef MATH
-#include <math.h>
+#include <cmath>
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_lagrange, surf, "Logging specific to SURF (lagrange)");
index 0fafd62..02c65df 100644 (file)
@@ -9,10 +9,10 @@
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
 #include "xbt/sysdep.h"
+#include <cmath>
+#include <cstdlib>
 #include <cxxabi.h>
 #include <limits>
-#include <math.h>
-#include <stdlib.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_maxmin, surf, "Logging specific to SURF (maxmin)");
 
index 236c577..632c8b9 100644 (file)
@@ -115,7 +115,7 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const
 
   simgrid::kernel::routing::NetPoint* netpoint =
       new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
-  XBT_DEBUG("Router '%s' has the id %d", name, netpoint->id());
+  XBT_DEBUG("Router '%s' has the id %u", name, netpoint->id());
 
   if (coords && strcmp(coords, ""))
     new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords);
@@ -702,7 +702,7 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
   if (as_cluster->privateLinks_.find(netpoint->id()) != as_cluster->privateLinks_.end())
     surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
 
-  XBT_DEBUG("Push Host_link for host '%s' to position %d", netpoint->cname(), netpoint->id());
+  XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->cname(), netpoint->id());
   as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
index 5131db9..c05e8a5 100644 (file)
@@ -6,7 +6,7 @@
 #include "storage_n11.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
-#include <math.h> /*ceil*/
+#include <cmath> /*ceil*/
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
 
index 249ee23..07493f0 100644 (file)
@@ -445,9 +445,9 @@ double Model::nextOccuringEvent(double now)
 
 double Model::nextOccuringEventLazy(double now)
 {
-  XBT_DEBUG("Before share resources, the size of modified actions set is %zd", modifiedSet_->size());
+  XBT_DEBUG("Before share resources, the size of modified actions set is %zu", modifiedSet_->size());
   lmm_solve(maxminSystem_);
-  XBT_DEBUG("After share resources, The size of modified actions set is %zd", modifiedSet_->size());
+  XBT_DEBUG("After share resources, The size of modified actions set is %zu", modifiedSet_->size());
 
   while (not modifiedSet_->empty()) {
     Action *action = &(modifiedSet_->front());
index 7771715..16eb4f8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2005, 2007, 2009-2014. The SimGrid Team.
+/* Copyright (c) 2004-2005, 2007, 2009-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -16,8 +16,8 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string/join.hpp>
 #include <boost/algorithm/string/split.hpp>
+#include <cmath>
 #include <fstream>
-#include <math.h>
 #include <sstream>
 #include <unordered_map>
 
index bc2d47c..24e202c 100644 (file)
@@ -15,7 +15,7 @@ bool init_unit_test(); // boost forget to give this prototype on NetBSD, which d
 #include "xbt/log.h"
 #include "xbt/misc.h"
 
-#include <math.h>
+#include <cmath>
 
 namespace utf  = boost::unit_test;
 namespace tmgr = simgrid::trace_mgr;
@@ -28,7 +28,7 @@ public:
   explicit MockedResource() : simgrid::surf::Resource(nullptr, "fake", nullptr) {}
   void apply_event(tmgr_trace_event_t event, double value)
   {
-    XBT_VERB("t=%.1f: Change value to %lg (idx: %d)", thedate, value, event->idx);
+    XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx);
     tmgr_trace_event_unref(&event);
   }
   bool isUsed() { return true; }
@@ -59,7 +59,7 @@ static void trace2vector(const char* str, std::vector<tmgr::DatedValue>* whereto
       res->apply_event(it, value);
       whereto->push_back(tmgr::DatedValue(thedate, value));
     } else {
-      XBT_DEBUG("%.1f: ignore an event (idx: %d)\n", thedate, it->idx);
+      XBT_DEBUG("%.1f: ignore an event (idx: %u)\n", thedate, it->idx);
     }
   }
   tmgr_finalize();
index 8760a89..7fa8051 100644 (file)
@@ -166,7 +166,7 @@ std::vector<std::string> resolveBacktrace(
   std::vector<std::string> addrs(count);
   for (std::size_t i = 0; i < count; i++) {
     /* retrieve this address */
-    XBT_DEBUG("Retrieving address number %zd from '%s'", i, backtrace_syms[i]);
+    XBT_DEBUG("Retrieving address number %zu from '%s'", i, backtrace_syms[i]);
     char buff[256];
     snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
     char* p = strchr(buff, ']');
@@ -175,7 +175,7 @@ std::vector<std::string> resolveBacktrace(
       addrs[i] = buff;
     else
       addrs[i] = "0x0";
-    XBT_DEBUG("Set up a new address: %zd, '%s'", i, addrs[i].c_str());
+    XBT_DEBUG("Set up a new address: %zu, '%s'", i, addrs[i].c_str());
     /* Add it to the command line args */
     stream << addrs[i] << ' ';
   }
@@ -194,17 +194,17 @@ std::vector<std::string> resolveBacktrace(
   char line_func[1024];
   char line_pos[1024];
   for (std::size_t i = 0; i < count; i++) {
-    XBT_DEBUG("Looking for symbol %zd, addr = '%s'", i, addrs[i].c_str());
+    XBT_DEBUG("Looking for symbol %zu, addr = '%s'", i, addrs[i].c_str());
     if (fgets(line_func, 1024, pipe)) {
       line_func[strlen(line_func) - 1] = '\0';
     } else {
-      XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+      XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
       strncpy(line_func, "???",3);
     }
     if (fgets(line_pos, 1024, pipe)) {
       line_pos[strlen(line_pos) - 1] = '\0';
     } else {
-      XBT_VERB("Cannot run fgets to look for symbol %zd, addr %s", i, addrs[i].c_str());
+      XBT_VERB("Cannot run fgets to look for symbol %zu, addr %s", i, addrs[i].c_str());
       strncpy(line_pos, backtrace_syms[i],1024);
     }
 
@@ -218,7 +218,7 @@ std::vector<std::string> resolveBacktrace(
       /* Damn. The symbol is in a dynamic library. Let's get wild */
 
       char maps_buff[512];
-      long int offset = 0;
+      unsigned long int offset = 0;
       char* p;
       int found = 0;
 
@@ -226,17 +226,15 @@ std::vector<std::string> resolveBacktrace(
       char* maps_name = bprintf("/proc/%d/maps", (int) getpid());
       FILE* maps = fopen(maps_name, "r");
 
-      long int addr = strtol(addrs[i].c_str(), &p, 16);
+      unsigned long int addr = strtoul(addrs[i].c_str(), &p, 16);
       if (*p != '\0') {
-        XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)",
-          addrs[i].c_str(), addr);
+        XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)", addrs[i].c_str(), addr);
       }
-      XBT_DEBUG("addr=%s (as string) =%#lx (as number)",
-        addrs[i].c_str(), addr);
+      XBT_DEBUG("addr=%s (as string) =%#lx (as number)", addrs[i].c_str(), addr);
 
       while (not found) {
-        long int first;
-        long int last;
+        unsigned long int first;
+        unsigned long int last;
 
         if (fgets(maps_buff, 512, maps) == nullptr)
           break;
index 37c41b2..977bad1 100644 (file)
@@ -1,9 +1,9 @@
-/* Copyright (c) 2004-2014,2016. The SimGrid Team. All rights reserved.     */
+/* Copyright (c) 2004-2017. 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. */
 
-#include <stdio.h>
+#include <cstdio>
 
 #include <algorithm>
 #include <cerrno>
 #include <climits>
 
 #include <functional>
+#include <map>
 #include <stdexcept>
 #include <string>
 #include <type_traits>
 #include <typeinfo>
-#include <unordered_map>
 #include <vector>
 
 #include <xbt/ex.hpp>
@@ -260,9 +260,10 @@ const char* TypedConfigurationElement<T>::getTypeName() // override
 class Config {
 private:
   // name -> ConfigElement:
-  std::unordered_map<std::string, simgrid::config::ConfigurationElement*> options;
+  std::map<std::string, simgrid::config::ConfigurationElement*> options;
   // alias -> xbt_dict_elm_t from options:
-  std::unordered_map<std::string, simgrid::config::ConfigurationElement*> aliases;
+  std::map<std::string, simgrid::config::ConfigurationElement*> aliases;
+  bool warn_for_aliases = true;
 
 public:
   Config() = default;
@@ -313,7 +314,8 @@ inline ConfigurationElement* Config::getDictElement(const char* name)
   } catch (std::out_of_range& unfound) {
     try {
       ConfigurationElement* res = aliases.at(name);
-      XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->getKey().c_str());
+      if (warn_for_aliases)
+        XBT_INFO("Option %s has been renamed to %s. Consider switching.", name, res->getKey().c_str());
       return res;
     } catch (std::out_of_range& missing_key) {
       throw simgrid::config::missing_key_error(std::string("Bad config key: ") + name);
@@ -356,28 +358,19 @@ void Config::dump(const char *name, const char *indent)
 /** @brief Displays the declared aliases and their description */
 void Config::showAliases()
 {
-  std::vector<std::string> names;
-
+  bool old_warn_for_aliases = false;
+  std::swap(warn_for_aliases, old_warn_for_aliases);
   for (auto elm : aliases)
-    names.push_back(elm.first);
-  std::sort(names.begin(), names.end());
-
-  for (auto name : names)
-    printf("   %s: %s\n", name.c_str(), (*this)[name.c_str()].getDescription().c_str());
+    printf("   %s: %s\n", elm.first.c_str(), (*this)[elm.first.c_str()].getDescription().c_str());
+  std::swap(warn_for_aliases, old_warn_for_aliases);
 }
 
 /** @brief Displays the declared options and their description */
 void Config::help()
 {
-  std::vector<std::string> names;
-
-  for (auto elm : options)
-    names.push_back(elm.first);
-  std::sort(names.begin(), names.end());
-
-  for (auto name : names) {
-    simgrid::config::ConfigurationElement* variable = this->options.at(name);
-    printf("   %s: %s\n", name.c_str(), variable->getDescription().c_str());
+  for (auto elm : options) {
+    simgrid::config::ConfigurationElement* variable = this->options.at(elm.first);
+    printf("   %s: %s\n", elm.first.c_str(), variable->getDescription().c_str());
     printf("       Type: %s; ", variable->getTypeName());
     printf("Current value: %s\n", variable->getStringValue().c_str());
   }
index eac5f1a..1bf8176 100644 (file)
@@ -9,7 +9,7 @@
 /* At some point we should use https://github.com/google/googletest instead */
 
 #include "src/internal_config.h"
-#include <stdio.h>
+#include <cstdio>
 
 #include <xbt/ex.hpp>
 #include "xbt/sysdep.h"         /* bvprintf */
index 7436c33..6a94aae 100644 (file)
@@ -6,8 +6,8 @@
 /* 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. */
 
-#include <string.h>
-#include <stdio.h>
+#include <cstdio>
+#include <cstring>
 
 #include "xbt/dict.h"
 #include "xbt/ex.h"
@@ -103,7 +103,7 @@ static void xbt_dict_rehash(xbt_dict_t dict)
   newsize--;
   dict->table_size = newsize;
   dict->table = currcell;
-  XBT_DEBUG("REHASH (%d->%d)", oldsize, newsize);
+  XBT_DEBUG("REHASH (%u->%u)", oldsize, newsize);
 
   for (unsigned i = 0; i < oldsize; i++, currcell++) {
     if (*currcell == nullptr) /* empty cell */
@@ -554,11 +554,11 @@ void xbt_dict_postexit()
 }
 
 #ifdef SIMGRID_TEST
-#include <time.h>
+#include "src/internal_config.h"
 #include "xbt.h"
 #include "xbt/ex.h"
+#include <ctime>
 #include <xbt/ex.hpp>
-#include "src/internal_config.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_dict);
 
index 9115b40..50a97f1 100644 (file)
@@ -41,8 +41,8 @@
 /* The extensions made for the SimGrid project can either be distributed    */
 /* under the same license, or under the LGPL v2.1                           */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
 
 #include <xbt/backtrace.hpp>
 #include "src/internal_config.h"           /* execinfo when available */
@@ -113,8 +113,8 @@ const char *xbt_ex_catname(xbt_errcat_t cat)
 }
 
 #ifdef SIMGRID_TEST
-#include <stdio.h>
 #include "xbt/ex.h"
+#include <cstdio>
 #include <xbt/ex.hpp>
 
 XBT_TEST_SUITE("xbt_ex", "Exception Handling");
index df47a7a..935149f 100644 (file)
@@ -16,8 +16,8 @@
 #endif
 
 #if HAVE_FUTEX_H
+#include <climits>
 #include <linux/futex.h>
-#include <limits.h>
 #endif
 
 #include "xbt/parmap.h"
index f4ba9ab..ffd97cd 100644 (file)
@@ -7,14 +7,14 @@
 
 #define XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL /* MSVC don't want it to be declared extern in headers and local here */
 
-#include <math.h>
-#include "xbt/misc.h"
 #include "simgrid_config.h"
-#include "xbt/sysdep.h"
+#include "xbt/config.h"
+#include "xbt/dynar.h"
 #include "xbt/log.h"
 #include "xbt/log.hpp"
-#include "xbt/dynar.h"
-#include "xbt/config.h"
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
+#include <cmath>
 
 #include "xbt/module.h"         /* this module */
 
@@ -23,9 +23,9 @@
 #include "simgrid/sg_config.h"
 
 #include "src/internal_config.h"
-#include <stdio.h>
+#include <cstdio>
 #ifdef _WIN32
-#include <signal.h> /* To silence MSVC on abort() */
+#include <csignal> /* To silence MSVC on abort() */
 #endif
 #if HAVE_UNISTD_H
 #  include <unistd.h>
index af1dc12..04a4978 100644 (file)
@@ -2,7 +2,7 @@
 /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD     */
 /* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead   */
 
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -208,16 +208,16 @@ void xbt_os_thread_setstacksize(int stack_size)
     size_t rem = sz % alignment[i];
     if (rem != 0 || sz == 0) {
       size_t sz2 = sz - rem + alignment[i];
-      XBT_DEBUG("pthread_attr_setstacksize failed for %zd, try again with %zd", sz, sz2);
+      XBT_DEBUG("pthread_attr_setstacksize failed for %zu, try again with %zu", sz, sz2);
       sz = sz2;
       res = pthread_attr_setstacksize(&thread_attr, sz);
     }
   }
 
   if (res == EINVAL)
-    XBT_WARN("invalid stack size (maybe too big): %zd", sz);
+    XBT_WARN("invalid stack size (maybe too big): %zu", sz);
   else if (res != 0)
-    XBT_WARN("unknown error %d in pthread stacksize setting: %zd", res, sz);
+    XBT_WARN("unknown error %d in pthread stacksize setting: %zu", res, sz);
 }
 
 void xbt_os_thread_setguardsize(int guard_size)
@@ -228,7 +228,7 @@ void xbt_os_thread_setguardsize(int guard_size)
   size_t sz = guard_size;
   int res = pthread_attr_setguardsize(&thread_attr, sz);
   if (res)
-    XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zd", res, sz);
+    XBT_WARN("pthread_attr_setguardsize failed (%d) for size: %zu", res, sz);
 #endif
 }
 
index afc7d12..5cd9b46 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,9 +8,9 @@
 #undef NDEBUG
 #endif
 
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
 
 #include "src/mc/mc_private.h"
 
index 20e0645..886d410 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2015. The SimGrid Team.
+/* Copyright (c) 2014-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,8 +8,8 @@
 #undef NDEBUG
 #endif
 
-#include <string.h>
-#include <assert.h>
+#include <cassert>
+#include <cstring>
 
 #include <mc/mc.h>
 
index a064000..9b5bcd2 100644 (file)
@@ -59,7 +59,7 @@ static int commRX(int argc, char *argv[])
   } else if (error==MSG_TRANSFER_FAILURE) {
     XBT_INFO("  Receive message: TRANSFERT_FAILURE");
   } else {
-    XBT_INFO("  Receive message: %d", error);
+    XBT_INFO("  Receive message: %u", error);
   }
   XBT_INFO("  RX Done");
   return 0;
index 6827ed4..430bb73 100644 (file)
@@ -55,38 +55,38 @@ static void sender(std::vector<std::string> args)
 
     switch (args[0][test - 1]) {
       case 'r':
-        XBT_INFO("Test %d: r (regular send)", test);
+        XBT_INFO("Test %u: r (regular send)", test);
         mbox->put((void*)mboxName, 42.0);
         break;
       case 'R':
-        XBT_INFO("Test %d: R (sleep + regular send)", test);
+        XBT_INFO("Test %u: R (sleep + regular send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put((void*)mboxName, 42.0);
         break;
 
       case 'i':
-        XBT_INFO("Test %d: i (asynchronous isend)", test);
+        XBT_INFO("Test %u: i (asynchronous isend)", test);
         mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
       case 'I':
-        XBT_INFO("Test %d: I (sleep + isend)", test);
+        XBT_INFO("Test %u: I (sleep + isend)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put_async((void*)mboxName, 42.0)->wait();
         break;
 
       case 'd':
-        XBT_INFO("Test %d: d (detached send)", test);
+        XBT_INFO("Test %u: d (detached send)", test);
         mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       case 'D':
-        XBT_INFO("Test %d: D (sleep + detached send)", test);
+        XBT_INFO("Test %u: D (sleep + detached send)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->put_init((void*)mboxName, 42.0)->detach();
         break;
       default:
-        xbt_die("Unknown sender spec for test %d: '%c'", test, args[0][test - 1]);
+        xbt_die("Unknown sender spec for test %u: '%c'", test, args[0][test - 1]);
     }
-    XBT_INFO("Test %d OK", test);
+    XBT_INFO("Test %u OK", test);
   }
   simgrid::s4u::this_actor::sleep_for(0.5);
   // FIXME: we should test what happens when the process ends before the end of remote comm instead of hiding it
@@ -103,54 +103,54 @@ static void receiver(std::vector<std::string> args)
 
     switch (args[0][test - 1]) {
       case 'r':
-        XBT_INFO("Test %d: r (regular receive)", test);
+        XBT_INFO("Test %u: r (regular receive)", test);
         received = mbox->get();
         break;
       case 'R':
-        XBT_INFO("Test %d: R (sleep + regular receive)", test);
+        XBT_INFO("Test %u: R (sleep + regular receive)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         received = mbox->get();
         break;
 
       case 'i':
-        XBT_INFO("Test %d: i (asynchronous irecv)", test);
+        XBT_INFO("Test %u: i (asynchronous irecv)", test);
         mbox->get_async(&received)->wait();
         break;
       case 'I':
-        XBT_INFO("Test %d: I (sleep + asynchronous irecv)", test);
+        XBT_INFO("Test %u: I (sleep + asynchronous irecv)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->get_async(&received)->wait();
         break;
       case 'p':
-        XBT_INFO("Test %d: p (regular receive on permanent mailbox)", test);
+        XBT_INFO("Test %u: p (regular receive on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
         received = mbox->get();
         break;
       case 'P':
-        XBT_INFO("Test %d: P (sleep + regular receive on permanent mailbox)", test);
+        XBT_INFO("Test %u: P (sleep + regular receive on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
         received = mbox->get();
         break;
       case 'j':
-        XBT_INFO("Test %d: j (irecv on permanent mailbox)", test);
+        XBT_INFO("Test %u: j (irecv on permanent mailbox)", test);
         mbox->setReceiver(Actor::self());
         mbox->get_async(&received)->wait();
         break;
       case 'J':
-        XBT_INFO("Test %d: J (sleep + irecv on permanent mailbox)", test);
+        XBT_INFO("Test %u: J (sleep + irecv on permanent mailbox)", test);
         simgrid::s4u::this_actor::sleep_for(0.5);
         mbox->setReceiver(Actor::self());
         mbox->get_async(&received)->wait();
         break;
       default:
-        xbt_die("Unknown receiver spec for test %d: '%c'", test, args[0][test - 1]);
+        xbt_die("Unknown receiver spec for test %u: '%c'", test, args[0][test - 1]);
     }
 
     xbt_assert(strcmp(static_cast<char*>(received), mboxName) == 0);
     xbt_free(received);
     xbt_free(mboxName);
-    XBT_INFO("Test %d OK", test);
+    XBT_INFO("Test %u OK", test);
   }
   simgrid::s4u::this_actor::sleep_for(0.5);
 }
index 6b96583..ce34e61 100644 (file)
@@ -3,9 +3,9 @@
 /* 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. */
 
+#include <cstdlib>
 #include <iostream>
 #include <simgrid/s4u.hpp>
-#include <stdlib.h>
 #include <vector>
 
 #define NUM_COMMS 1
index 0b09725..a45915e 100644 (file)
@@ -8,7 +8,7 @@
 #include "simgrid/simdag.h"
 #include "src/kernel/routing/NetPoint.hpp"
 #include <algorithm>
-#include <stdio.h>
+#include <cstdio>
 
 int main(int argc, char **argv)
 {
index 780ee63..fced26e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 static void print_buffer_int(void *buf, int len, char *msg, int rank)
 {
-  int* v;
   printf("[%d] %s (#%d): ", rank, msg, len);
   for (int tmp = 0; tmp < len; tmp++) {
-    v = buf;
+    int* v = buf;
     printf("[%d]", v[tmp]);
   }
   printf("\n");
index 08c2aaf..9f18ddb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -15,7 +15,6 @@ int main(int argc, char **argv)
    int retval;
    int sendcount = 1;            // one double to each process
    int recvcount = 1;
-   int i;
    double *sndbuf = NULL;
    double rcvd;
    int root = 0;                 // arbitrary choice
@@ -27,7 +26,7 @@ int main(int argc, char **argv)
    // on root, initialize sendbuf
    if (root == rank) {
      sndbuf = malloc(size * sizeof(double));
-     for (i = 0; i < size; i++) {
+     for (int i = 0; i < size; i++) {
        sndbuf[i] = (double) i;
      }
    }
index 39ad856..4c4cde6 100644 (file)
@@ -60,9 +60,9 @@ int main(int argc, char **argv)
         if (!rbuf)
             fprintf(stderr, "\trbuf of %d bytes\n", MAX_BUF);
         if (!recvcounts)
-            fprintf(stderr, "\trecvcounts of %zd bytes\n", comm_size * sizeof(int));
+          fprintf(stderr, "\trecvcounts of %zu bytes\n", comm_size * sizeof(int));
         if (!displs)
-            fprintf(stderr, "\tdispls of %zd bytes\n", comm_size * sizeof(int));
+          fprintf(stderr, "\tdispls of %zu bytes\n", comm_size * sizeof(int));
         fflush(stderr);
         MPI_Abort(MPI_COMM_WORLD, -1);
     }
index 9539b95..1754cd9 100644 (file)
@@ -85,12 +85,10 @@ int main(int argc, char *argv[])
              * this can generate a file that diff, for example,
              * believes is a binary file */
             if (isprint((int) (s1[j].c))) {
-                fprintf(stderr, "Got s[%d].c = %c; expected %c\n",
-                        j, s1[j].c, j + status.MPI_SOURCE + 'a');
+              fprintf(stderr, "Got s[%d].c = %c; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
             }
             else {
-                fprintf(stderr, "Got s[%d].c = %x; expected %c\n",
-                        j, (int) s1[j].c, j + status.MPI_SOURCE + 'a');
+              fprintf(stderr, "Got s[%d].c = %hhx; expected %c\n", j, s1[j].c, j + status.MPI_SOURCE + 'a');
             }
         }
     }
index 9275ef1..d9f9ca5 100644 (file)
@@ -35,9 +35,8 @@ int main(int argc, char *argv[])
         if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
             MPI_Type_size(MPI_LONG_DOUBLE, &type_size);
             if (type_size != sizeof(long double)) {
-                printf("type_size != sizeof(long double) : (%d != %zd)\n",
-                       type_size, sizeof(long double));
-                ++errs;
+              printf("type_size != sizeof(long double) : (%d != %zu)\n", type_size, sizeof(long double));
+              ++errs;
             }
         }
 #endif
@@ -45,9 +44,9 @@ int main(int argc, char *argv[])
         if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {
             MPI_Type_size(MPI_C_LONG_DOUBLE_COMPLEX, &type_size);
             if (type_size != sizeof(long double _Complex)) {
-                printf("type_size != sizeof(long double _Complex) : (%d != %zd)\n",
-                       type_size, sizeof(long double _Complex));
-                ++errs;
+              printf("type_size != sizeof(long double _Complex) : (%d != %zu)\n", type_size,
+                     sizeof(long double _Complex));
+              ++errs;
             }
         }
 #endif
index 14c5725..6ff46d2 100644 (file)
@@ -93,7 +93,7 @@ int main(int argc, char **argv)
                             myname, j, world_rank, errloc - 1);
                     p1 = (char *) inbufs[j];
                     p2 = (char *) outbufs[j];
-                    fprintf(stderr, "Got %x expected %x\n", p1[errloc - 1], p2[errloc - 1]);
+                    fprintf(stderr, "Got %hhx expected %hhx\n", p1[errloc - 1], p2[errloc - 1]);
                     err++;
                 }
             }
index ac33562..1b3c55e 100755 (executable)
@@ -2,8 +2,8 @@
 
 explore_files() {
 
-  for cmake in `find -name CMakeLists.txt` ; do
-    d=`dirname $cmake`
+  for cmake in $(find -name CMakeLists.txt) ; do
+    d=$(dirname $cmake)
   
     echo;echo "Directory $d"
   
index 7191e15..8e60c20 100644 (file)
@@ -361,7 +361,7 @@ static int MtestDatatype2CheckAndPrint(void *inbuf, void *outbuf, int size_bytes
                 typename, typenum, world_rank, errloc - 1, size_bytes);
         p1 = (char *) inbuf;
         p2 = (char *) outbuf;
-        fprintf(stderr, "Got %x expected %x\n", p2[errloc - 1], p1[errloc - 1]);
+        fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]);
     }
     return errloc;
 }
index ce8eac5..c35f437 100644 (file)
@@ -1,6 +1,6 @@
 /* A few tests for the maxmin library                                       */
 
-/* Copyright (c) 2007-2015. The SimGrid Team.
+/* Copyright (c) 2007-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,7 +12,7 @@
 #include "xbt/log.h"
 #include "xbt/module.h"
 #include "xbt/sysdep.h"
-#include <math.h>
+#include <cmath>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
index aed2abb..a002dc0 100644 (file)
@@ -1,6 +1,6 @@
 /* A crash few tests for the maxmin library                                 */
 
-/* Copyright (c) 2004-2015. The SimGrid Team.
+/* Copyright (c) 2004-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -14,9 +14,9 @@
 
 #define MYRANDMAX 1000
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
 
 double date;
 int64_t seedx = 0;
@@ -185,10 +185,10 @@ int main(int argc, char **argv)
   float mean_date= acc_date/(float)testcount;
   float stdev_date= sqrt(acc_date2/(float)testcount-mean_date*mean_date);
 
-  fprintf(stderr,
-         "%ix One shot execution time for a total of %d constraints, "
-         "%d variables with %d active constraint each, concurrency in [%i,%i] and max concurrency share %i\n",
-         testcount,nb_cnst, nb_var, nb_elem, (1<<pw_base_limit), (1<<pw_base_limit)+(1<<pw_max_limit), max_share);
+  fprintf(stderr, "%ix One shot execution time for a total of %u constraints, "
+                  "%u variables with %u active constraint each, concurrency in [%i,%i] and max concurrency share %u\n",
+          testcount, nb_cnst, nb_var, nb_elem, (1 << pw_base_limit), (1 << pw_base_limit) + (1 << pw_max_limit),
+          max_share);
   if(mode==3)
     fprintf(stderr, "Execution time: %g +- %g  microseconds \n",mean_date, stdev_date);
 
index c480421..759f09e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -6,12 +6,12 @@
 
 #include "xbt/mmalloc.h"
 #include "xbt.h"
-#include <stdio.h>
-#include <assert.h>
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
 
 #include <xbt/ex.hpp>
@@ -45,7 +45,7 @@ int main(int argc, char**argv)
   for (i = 0; i < TESTSIZE; i++) {
     size = size_of_block(i);
     pointers[i] = mmalloc(heapA, size);
-    XBT_INFO("%d bytes allocated with offset %tx", size, ((char*)pointers[i])-((char*)heapA));
+    XBT_INFO("%d bytes allocated with offset %zx", size, (size_t)((char*)pointers[i] - (char*)heapA));
   }
   XBT_INFO("All blocks were correctly allocated. Free every second block");
   for (i = 0; i < TESTSIZE; i+=2) {
index 2807095..958684d 100644 (file)
@@ -659,10 +659,6 @@ set(MC_SRC
 set(MC_SIMGRID_MC_SRC  src/mc/checker/simgrid_mc.cpp)
 
 set(headers_to_install
-  include/msg/msg.h
-  include/msg/datatypes.h
-  include/simdag/simdag.h
-  include/simdag/datatypes.h
   include/simgrid/chrono.hpp
   include/simgrid/plugins/energy.h
   include/simgrid/plugins/load.h
index 64a6700..aacd81f 100644 (file)
@@ -142,9 +142,6 @@ set(source_to_pack
   ${JEDULE_SRC}
   ${JMSG_C_SRC}
   ${JMSG_JAVA_SRC}
-  ${JSURF_SWIG_SRC}
-  ${JSURF_SWIG_SRC_EXTRA}
-  ${JSURF_C_SRC}
   ${LUA_SRC}
   ${MC_SRC_BASE}
   ${MC_SRC}
index 5731bda..309a69a 100644 (file)
@@ -15,6 +15,9 @@ set(warnCXXFLAGS "")
 
 if(enable_compile_warnings)
   set(warnCFLAGS "-fno-common -Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  if(CMAKE_COMPILER_IS_GNUCC AND (NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0")))
+    set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
+  endif()
   if(CMAKE_C_COMPILER_ID MATCHES "Clang|GCC")
     set(warnCFLAGS "${warnCFLAGS} -Wno-format-nonliteral")
   endif()
@@ -22,7 +25,10 @@ if(enable_compile_warnings)
     set(warnCFLAGS "${warnCFLAGS} -Wclobbered -Wno-error=clobbered  -Wno-unused-local-typedefs -Wno-error=attributes")
   endif()
 
-  set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment  -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  set(warnCXXFLAGS "${warnCFLAGS} -Wall -Wextra -Wunused -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing")
+  if(CMAKE_COMPILER_IS_GNUCXX AND (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0")))
+    set(warnCFLAGS "${warnCFLAGS} -Wformat-signedness")
+  endif()
   if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GCC")
     set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-format-nonliteral")
   endif()
index ebc2e3d..3d5a70d 100644 (file)
@@ -22,15 +22,6 @@ if(WIN32)
   endif()
 endif()
 
-# find_package(SWIG)
-# if(${SWIG_FOUND})
-#   include(UseSWIG)
-#   message("-- [Java] Swig found: version ${SWIG_VERSION}")
-# else()
-#   message("-- [Java] Swig NOT FOUND. That's fine unless you work on this part yourself.")
-# endif()
-#mark_as_advanced(SWIG_EXECUTABLE)
-
 # Rules to build libsimgrid-java
 ################################
 
index adc5dfe..0144743 100755 (executable)
@@ -116,9 +116,7 @@ sub display_subtree {
 display_subtree("XBT_LOG_ROOT_CAT","");
 
 map {
-    if ($_ ne "mc_main") { # This one is not in libsimgrid
-      warn "Category $_ does not seem to be connected.  Use XBT_LOG_CONNECT($_).\n";
-    }
+    warn "Category $_ does not seem to be connected.  Use XBT_LOG_CONNECT($_).\n";
 } grep {!defined $connected{$_}} sort keys %ancestor;
 map {
     warn "Category $_ does not seem to be connected to the root (anc=$ancestor{$_})\n";
index db2e47a..8d1bd55 100755 (executable)
@@ -43,7 +43,7 @@ CLANG_FORMAT=$(which clang-format-3.8)
 for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
  where=$(which $name)
  if [ x != "x$where" ] ; then
-   GIT_SUBCOMMAND=`echo $name|sed 's/git-//'`
+   GIT_SUBCOMMAND=$(echo $name|sed 's/git-//')
    break
  fi
 done
@@ -74,10 +74,10 @@ canonicalize_filename () {
     local result=""
 
     # Need to restore the working directory after work.
-    pushd `pwd` > /dev/null
+    pushd $(pwd) > /dev/null
 
     cd "$(dirname "$target_file")"
-    target_file=`basename $target_file`
+    target_file=$(basename $target_file)
 
     # Iterate down a (possible) chain of symlinks
     while [ -L "$target_file" ]
@@ -89,7 +89,7 @@ canonicalize_filename () {
 
     # Compute the canonicalized name by finding the physical path
     # for the directory we're in and appending the target file.
-    physical_directory=`pwd -P`
+    physical_directory=$(pwd -P)
     result="$physical_directory"/"$target_file"
 
     # restore the working directory after work.
index b2ed44a..a8503ca 100755 (executable)
@@ -75,7 +75,7 @@ if [ -f Testing/TAG ] ; then
     ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
     #convert jacoco xml reports in cobertura xml reports
     cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $WORKSPACE/java_coverage_${i}.xml
-    i=$(($i + 1))
+    i=$((i + 1))
   done
 
    #convert all gcov reports to xml cobertura reports