Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s/NULL/nullptr/ in our C++ codebase
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 5 Jul 2016 09:37:26 +0000 (11:37 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 5 Jul 2016 09:39:30 +0000 (11:39 +0200)
22 files changed:
src/simix/SynchroComm.hpp
src/simix/SynchroExec.hpp
src/smpi/instr_smpi.cpp
src/surf/AsCluster.hpp
src/surf/AsClusterDragonfly.cpp
src/surf/AsClusterDragonfly.hpp
src/surf/AsVivaldi.hpp
src/surf/PropertyHolder.hpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.hpp
src/surf/network_ib.hpp
src/surf/network_interface.hpp
src/surf/surf_interface.hpp
src/surf/xml/platf_private.hpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/backtrace.cpp
src/xbt/backtrace_linux.cpp
src/xbt/cunit.cpp
src/xbt/dict.cpp
src/xbt/dynar.cpp
src/xbt/xbt_replay.cpp
src/xbt/xbt_str.cpp

index fe672fc..02c427d 100644 (file)
@@ -35,7 +35,7 @@ namespace simix {
 
 #if HAVE_MC
     smx_mailbox_t mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
 
 #if HAVE_MC
     smx_mailbox_t mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
-                                       (comm.mbox set to NULL when the communication is removed from the mailbox
+                                       (comm.mbox set to nullptr when the communication is removed from the mailbox
                                        (used as garbage collector)) */
 #endif
     bool detached = false;          /* If detached or not */
                                        (used as garbage collector)) */
 #endif
     bool detached = false;          /* If detached or not */
index e52d59d..b9e31aa 100644 (file)
@@ -21,7 +21,7 @@ namespace simix {
     void post() override;
     double remains();
 
     void post() override;
     double remains();
 
-    sg_host_t host = nullptr; /* The host where the execution takes place. If NULL, then this is a parallel exec (and only surf knows the hosts) */
+    sg_host_t host = nullptr; /* The host where the execution takes place. If nullptr, then this is a parallel exec (and only surf knows the hosts) */
     surf_action_t surf_exec = nullptr; /* The Surf execution action encapsulated */
   };
 
     surf_action_t surf_exec = nullptr; /* The Surf execution action encapsulated */
   };
 
index 8b1dac5..41134db 100644 (file)
@@ -222,7 +222,7 @@ void TRACE_smpi_init(int rank)
      * multiple times but only the last one would be used...
      */
     if (PJ_type_get_or_null(it.first.c_str(), container->type) == nullptr) {
      * multiple times but only the last one would be used...
      */
     if (PJ_type_get_or_null(it.first.c_str(), container->type) == nullptr) {
-      PJ_type_variable_new(it.first.c_str(), NULL, container->type);
+      PJ_type_variable_new(it.first.c_str(), nullptr, container->type);
     }
   }
 #endif
     }
   }
 #endif
index 8e79c33..3e0493b 100644 (file)
@@ -22,7 +22,7 @@ public:
   virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
   virtual void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) {}
 
   virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
   virtual void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) {}
 
-  xbt_dynar_t privateLinks_ = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
+  xbt_dynar_t privateLinks_ = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),nullptr);
 
   Link* backbone_ = nullptr;
   void *loopback_ = nullptr;
 
   Link* backbone_ = nullptr;
   void *loopback_ = nullptr;
index 663da3a..e3eff8c 100644 (file)
@@ -23,7 +23,7 @@ AsClusterDragonfly::AsClusterDragonfly(const char*name)
 
 AsClusterDragonfly::~AsClusterDragonfly() {
 
 
 AsClusterDragonfly::~AsClusterDragonfly() {
 
-  if(this->routers_!=NULL){
+  if(this->routers_!=nullptr){
     unsigned int i;
     for (i=0; i<this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;i++)
         delete(routers_[i]);
     unsigned int i;
     for (i=0; i<this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;i++)
         delete(routers_[i]);
@@ -109,13 +109,13 @@ DragonflyRouter::DragonflyRouter(int group, int chassis, int blade){
 }
 
 DragonflyRouter::~DragonflyRouter(){
 }
 
 DragonflyRouter::~DragonflyRouter(){
-  if(this->myNodes_!=NULL)
+  if(this->myNodes_!=nullptr)
     xbt_free(myNodes_);
     xbt_free(myNodes_);
-  if(this->greenLinks_!=NULL)
+  if(this->greenLinks_!=nullptr)
     xbt_free(greenLinks_);
     xbt_free(greenLinks_);
-  if(this->blackLinks_!=NULL)
+  if(this->blackLinks_!=nullptr)
     xbt_free(blackLinks_);
     xbt_free(blackLinks_);
-  if(this->blueLinks_!=NULL)
+  if(this->blueLinks_!=nullptr)
     xbt_free(blueLinks_);
 }
 
     xbt_free(blueLinks_);
 }
 
@@ -139,8 +139,8 @@ for(i=0;i<this->numGroups_;i++){
 
 
 void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link** linkdown){
 
 
 void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link** linkdown){
-  *linkup=NULL;
-  *linkdown=NULL;
+  *linkup=nullptr;
+  *linkdown=nullptr;
   s_sg_platf_link_cbarg_t linkTemplate;
   memset(&linkTemplate, 0, sizeof(linkTemplate));
   linkTemplate.bandwidth = this->cluster_->bw * numlinks;
   s_sg_platf_link_cbarg_t linkTemplate;
   memset(&linkTemplate, 0, sizeof(linkTemplate));
   linkTemplate.bandwidth = this->cluster_->bw * numlinks;
@@ -173,7 +173,7 @@ void AsClusterDragonfly::generateLinks() {
 
   unsigned int i, j, k, l;
   static int uniqueId = 0;
 
   unsigned int i, j, k, l;
   static int uniqueId = 0;
-  char* id = NULL;
+  char* id = nullptr;
   Link* linkup, *linkdown;
 
   unsigned int numRouters = this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;
   Link* linkup, *linkdown;
 
   unsigned int numRouters = this->numGroups_*this->numChassisPerGroup_*this->numBladesPerChassis_;
index 115abfb..f587ae4 100644 (file)
@@ -17,10 +17,10 @@ class XBT_PRIVATE DragonflyRouter {
       unsigned int group_;
       unsigned int chassis_;
       unsigned int blade_;
       unsigned int group_;
       unsigned int chassis_;
       unsigned int blade_;
-      surf::Link** blueLinks_=NULL;
-      surf::Link** blackLinks_=NULL;
-      surf::Link** greenLinks_=NULL;
-      surf::Link** myNodes_=NULL;
+      surf::Link** blueLinks_=nullptr;
+      surf::Link** blackLinks_=nullptr;
+      surf::Link** greenLinks_=nullptr;
+      surf::Link** myNodes_=nullptr;
       DragonflyRouter(int i, int j, int k);
       ~DragonflyRouter();
 };
       DragonflyRouter(int i, int j, int k);
       ~DragonflyRouter();
 };
@@ -82,7 +82,7 @@ class XBT_PRIVATE AsClusterDragonfly
       unsigned int numLinksBlack_ = 0;
       unsigned int numLinksBlue_ = 0;
       unsigned int numLinksperLink_ = 1; //fullduplex -> 2, only for local link
       unsigned int numLinksBlack_ = 0;
       unsigned int numLinksBlue_ = 0;
       unsigned int numLinksperLink_ = 1; //fullduplex -> 2, only for local link
-      DragonflyRouter** routers_=NULL;
+      DragonflyRouter** routers_=nullptr;
     };
 
   }}
     };
 
   }}
index 4e072d8..a2ba680 100644 (file)
@@ -17,7 +17,7 @@ public:
   explicit AsVivaldi(const char *name);
   ~AsVivaldi() override;
 
   explicit AsVivaldi(const char *name);
   ~AsVivaldi() override;
 
-  xbt_dynar_t getOneLinkRoutes() override {return NULL;};
+  xbt_dynar_t getOneLinkRoutes() override {return nullptr;};
   void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
 };
 
   void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency) override;
 };
 
index d58c486..e7da433 100644 (file)
@@ -28,7 +28,7 @@ public:
    */
   xbt_dict_t getProperties();
 private:
    */
   xbt_dict_t getProperties();
 private:
-  xbt_dict_t properties_ = NULL;
+  xbt_dict_t properties_ = nullptr;
 };
 
 } /* namespace surf */
 };
 
 } /* namespace surf */
index 032df19..4a3f3b2 100644 (file)
@@ -133,12 +133,12 @@ public:
   int coresAmount_ = 1;
   simgrid::s4u::Host* host_;
 
   int coresAmount_ = 1;
   simgrid::s4u::Host* host_;
 
-  xbt_dynar_t speedPerPstate_ = NULL; /*< List of supported CPU capacities (pstate related) */
+  xbt_dynar_t speedPerPstate_ = nullptr; /*< List of supported CPU capacities (pstate related) */
   int pstate_ = 0;                   /*< Current pstate (index in the speedPeakList)*/
 
   /* Note (hypervisor): */
   int pstate_ = 0;                   /*< Current pstate (index in the speedPeakList)*/
 
   /* Note (hypervisor): */
-  lmm_constraint_t *p_constraintCore=NULL;
-  void **p_constraintCoreId=NULL;
+  lmm_constraint_t *p_constraintCore=nullptr;
+  void **p_constraintCoreId=nullptr;
 
 public:
   virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF). Trace must contain boolean values (0 or 1). */
 
 public:
   virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF). Trace must contain boolean values (0 or 1). */
index 4f70915..c39ee40 100644 (file)
@@ -128,8 +128,8 @@ public:
 
   void modified(bool modified);
 
 
   void modified(bool modified);
 
-  CpuTiTgmr *speedIntegratedTrace_ = NULL;/*< Structure with data needed to integrate trace file */
-  ActionTiList *actionSet_ = NULL;        /*< set with all actions running on cpu */
+  CpuTiTgmr *speedIntegratedTrace_ = nullptr;/*< Structure with data needed to integrate trace file */
+  ActionTiList *actionSet_ = nullptr;        /*< set with all actions running on cpu */
   double sumPriority_ = 0; /*< the sum of actions' priority that are running on cpu */
   double lastUpdate_ = 0;  /*< last update of actions' remaining amount done */
 
   double sumPriority_ = 0; /*< the sum of actions' priority that are running on cpu */
   double lastUpdate_ = 0;  /*< last update of actions' remaining amount done */
 
index b98bbcf..8d1103e 100644 (file)
@@ -22,7 +22,7 @@ namespace simgrid {
       IBNode* destination;
       NetworkAction *action;
       double init_rate;
       IBNode* destination;
       NetworkAction *action;
       double init_rate;
-      ActiveComm() : destination(NULL),action(NULL),init_rate(-1){};
+      ActiveComm() : destination(nullptr),action(nullptr),init_rate(-1){};
       ~ActiveComm(){};
     };
 
       ~ActiveComm(){};
     };
 
index 027a626..8caa9df 100644 (file)
@@ -192,16 +192,16 @@ namespace simgrid {
       virtual void setBandwidthTrace(tmgr_trace_t trace); /*< setup the trace file with bandwidth events (peak speed changes due to external load). Trace must contain percentages (value between 0 and 1). */
       virtual void setLatencyTrace(tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to external load). Trace must contain absolute values */
 
       virtual void setBandwidthTrace(tmgr_trace_t trace); /*< setup the trace file with bandwidth events (peak speed changes due to external load). Trace must contain percentages (value between 0 and 1). */
       virtual void setLatencyTrace(tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to external load). Trace must contain absolute values */
 
-      tmgr_trace_iterator_t m_stateEvent = NULL;
-      s_surf_metric_t m_latency = {1.0,0,NULL};
-      s_surf_metric_t m_bandwidth = {1.0,0,NULL};
+      tmgr_trace_iterator_t m_stateEvent = nullptr;
+      s_surf_metric_t m_latency = {1.0,0,nullptr};
+      s_surf_metric_t m_bandwidth = {1.0,0,nullptr};
 
       /* User data */
         public:
       void *getData()        { return userData;}
       void  setData(void *d) { userData=d;}
         private:
 
       /* User data */
         public:
       void *getData()        { return userData;}
       void  setData(void *d) { userData=d;}
         private:
-      void *userData = NULL;
+      void *userData = nullptr;
 
       /* List of all links */
         private:
 
       /* List of all links */
         private:
index 51e5d8b..819ed57 100644 (file)
@@ -111,7 +111,7 @@ private:
    * @brief Common initializations for the constructors
    */
   void initialize(simgrid::surf::Model *model, double cost, bool failed,
    * @brief Common initializations for the constructors
    */
   void initialize(simgrid::surf::Model *model, double cost, bool failed,
-                  lmm_variable_t var = NULL);
+                  lmm_variable_t var = nullptr);
 
 public:
   /**
 
 public:
   /**
@@ -219,7 +219,7 @@ public:
   /** @brief Get the state set in which the action is */
   ActionList* getStateSet() {return stateSet_;};
 
   /** @brief Get the state set in which the action is */
   ActionList* getStateSet() {return stateSet_;};
 
-  s_xbt_swag_hookup_t stateHookup_ = {NULL,NULL};
+  s_xbt_swag_hookup_t stateHookup_ = {nullptr,nullptr};
 
   simgrid::surf::Model *getModel() {return model_;}
 
 
   simgrid::surf::Model *getModel() {return model_;}
 
@@ -233,11 +233,11 @@ protected:
 
 private:
   double start_; /**< start time  */
 
 private:
   double start_; /**< start time  */
-  char *category_ = NULL;            /**< tracing category for categorized resource utilization monitoring */
+  char *category_ = nullptr;            /**< tracing category for categorized resource utilization monitoring */
 
   double    cost_;
   simgrid::surf::Model *model_;
 
   double    cost_;
   simgrid::surf::Model *model_;
-  void *data_ = NULL; /**< for your convenience */
+  void *data_ = nullptr; /**< for your convenience */
 
   /* LMM */
 public:
 
   /* LMM */
 public:
index a195303..01dcc51 100644 (file)
@@ -192,7 +192,7 @@ typedef struct s_sg_platf_AS_cbarg {
   int routing;
 } s_sg_platf_AS_cbarg_t;
 
   int routing;
 } s_sg_platf_AS_cbarg_t;
 
-#define SG_PLATF_AS_INITIALIZER {NULL,0}
+#define SG_PLATF_AS_INITIALIZER {nullptr,0}
 
 /********** Routing **********/
 void routing_cluster_add_backbone(Link* bb);
 
 /********** Routing **********/
 void routing_cluster_add_backbone(Link* bb);
index 0bb09f1..9812300 100644 (file)
@@ -728,8 +728,8 @@ void ETag_surfxml_route(void){
   memset(&route,0,sizeof(route));
 
 
   memset(&route,0,sizeof(route));
 
 
-  route.src       = sg_netcard_by_name_or_null(A_surfxml_route_src); // tested to not be NULL in start tag
-  route.dst       = sg_netcard_by_name_or_null(A_surfxml_route_dst); // tested to not be NULL in start tag
+  route.src       = sg_netcard_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
+  route.dst       = sg_netcard_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
   route.gw_src    = nullptr;
   route.gw_dst    = nullptr;
   route.link_list = new std::vector<Link*>();
   route.gw_src    = nullptr;
   route.gw_dst    = nullptr;
   route.link_list = new std::vector<Link*>();
@@ -751,11 +751,11 @@ void ETag_surfxml_ASroute(void){
   s_sg_platf_route_cbarg_t ASroute;
   memset(&ASroute,0,sizeof(ASroute));
 
   s_sg_platf_route_cbarg_t ASroute;
   memset(&ASroute,0,sizeof(ASroute));
 
-  ASroute.src    = sg_netcard_by_name_or_null(A_surfxml_ASroute_src); // tested to not be NULL in start tag
-  ASroute.dst    = sg_netcard_by_name_or_null(A_surfxml_ASroute_dst); // tested to not be NULL in start tag
+  ASroute.src    = sg_netcard_by_name_or_null(A_surfxml_ASroute_src); // tested to not be nullptr in start tag
+  ASroute.dst    = sg_netcard_by_name_or_null(A_surfxml_ASroute_dst); // tested to not be nullptr in start tag
 
 
-  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src); // tested to not be NULL in start tag
-  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst); // tested to not be NULL in start tag
+  ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src); // tested to not be nullptr in start tag
+  ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst); // tested to not be nullptr in start tag
 
   ASroute.link_list =  new std::vector<Link*>();
 
 
   ASroute.link_list =  new std::vector<Link*>();
 
@@ -785,8 +785,8 @@ void ETag_surfxml_bypassRoute(void){
   s_sg_platf_route_cbarg_t route;
   memset(&route,0,sizeof(route));
 
   s_sg_platf_route_cbarg_t route;
   memset(&route,0,sizeof(route));
 
-  route.src = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be NULL in start tag
-  route.dst = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be NULL in start tag
+  route.src = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
+  route.dst = sg_netcard_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
   route.gw_src = nullptr;
   route.gw_dst = nullptr;
   route.symmetrical = false;
   route.gw_src = nullptr;
   route.gw_dst = nullptr;
   route.symmetrical = false;
index 669856a..8a75837 100644 (file)
@@ -43,7 +43,7 @@ std::unique_ptr<char, void(*)(void*)> demangle(const char* name)
 #ifdef __GXX_ABI_VERSION
   int status;
   auto res = std::unique_ptr<char, void(*)(void*)>(
 #ifdef __GXX_ABI_VERSION
   int status;
   auto res = std::unique_ptr<char, void(*)(void*)>(
-    abi::__cxa_demangle(name, NULL, NULL, &status),
+    abi::__cxa_demangle(name, nullptr, nullptr, &status),
     std::free
   );
   if (res != nullptr)
     std::free
   );
   if (res != nullptr)
index 80cd509..fd51d6b 100644 (file)
@@ -78,7 +78,7 @@ backtrace_helper (struct _Unwind_Context *ctx, void *a)
 int xbt_backtrace_no_malloc(void **array, int size) {
   int i = 0;
   for(i=0; i < size; i++)
 int xbt_backtrace_no_malloc(void **array, int size) {
   int i = 0;
   for(i=0; i < size; i++)
-    array[i] = NULL;
+    array[i] = nullptr;
 
   struct trace_arg arg;
   arg .array = array;
 
   struct trace_arg arg;
   arg .array = array;
@@ -88,9 +88,9 @@ int xbt_backtrace_no_malloc(void **array, int size) {
   if (size >= 1)
     _Unwind_Backtrace(backtrace_helper, &arg);
 
   if (size >= 1)
     _Unwind_Backtrace(backtrace_helper, &arg);
 
-  /* _Unwind_Backtrace on IA-64 seems to put NULL address above
+  /* _Unwind_Backtrace on IA-64 seems to put nullptr address above
      _start.  Fix it up here.  */
      _start.  Fix it up here.  */
-  if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL)
+  if (arg.cnt > 1 && arg.array[arg.cnt - 1] == nullptr)
     --arg.cnt;
   return arg.cnt != -1 ? arg.cnt : 0;
 }
     --arg.cnt;
   return arg.cnt != -1 ? arg.cnt : 0;
 }
@@ -246,7 +246,7 @@ std::vector<std::string> resolveBacktrace(
       while (!found) {
         long int first, last;
 
       while (!found) {
         long int first, last;
 
-        if (fgets(maps_buff, 512, maps) == NULL)
+        if (fgets(maps_buff, 512, maps) == nullptr)
           break;
         if (i == 0) {
           maps_buff[strlen(maps_buff) - 1] = '\0';
           break;
         if (i == 0) {
           maps_buff[strlen(maps_buff) - 1] = '\0';
@@ -353,7 +353,7 @@ std::vector<std::string> resolveBacktrace(
 int xbt_libunwind_backtrace(void** bt, int size){
   int i = 0;
   for(i=0; i < size; i++)
 int xbt_libunwind_backtrace(void** bt, int size){
   int i = 0;
   for(i=0; i < size; i++)
-    bt[i] = NULL;
+    bt[i] = nullptr;
 
   i=0;
 
 
   i=0;
 
index 4ca449f..3be162f 100644 (file)
@@ -18,7 +18,7 @@
 #include "xbt/dynar.h"
 
 /* collection of all suites */
 #include "xbt/dynar.h"
 
 /* collection of all suites */
-static xbt_dynar_t _xbt_test_suites = NULL;
+static xbt_dynar_t _xbt_test_suites = nullptr;
 /* global statistics */
 static int _xbt_test_nb_tests = 0;
 static int _xbt_test_test_failed = 0;
 /* global statistics */
 static int _xbt_test_nb_tests = 0;
 static int _xbt_test_test_failed = 0;
@@ -36,7 +36,7 @@ static int _xbt_test_suite_ignore = 0;
 static int _xbt_test_suite_disabled = 0;
 
 /* Context */
 static int _xbt_test_suite_disabled = 0;
 
 /* Context */
-xbt_test_unit_t _xbt_test_current_unit = NULL;
+xbt_test_unit_t _xbt_test_current_unit = nullptr;
 
 /* test suite test log */
 typedef struct s_xbt_test_log {
 
 /* test suite test log */
 typedef struct s_xbt_test_log {
@@ -50,7 +50,7 @@ static void xbt_test_log_dump(xbt_test_log_t log)
   if (log)
     fprintf(stderr, "      log %p(%s:%d)=%s\n", log, log->file, log->line, log->text);
   else
   if (log)
     fprintf(stderr, "      log %p(%s:%d)=%s\n", log, log->file, log->line, log->text);
   else
-    fprintf(stderr, "      log=NULL\n");
+    fprintf(stderr, "      log=nullptr\n");
 }
 
 /* test suite test check */
 }
 
 /* test suite test check */
@@ -74,7 +74,7 @@ static void xbt_test_test_dump(xbt_test_test_t test)
     xbt_dynar_foreach(test->logs, it_log, log)
         xbt_test_log_dump(log);
   } else
     xbt_dynar_foreach(test->logs, it_log, log)
         xbt_test_log_dump(log);
   } else
-    fprintf(stderr, "    test=NULL\n");
+    fprintf(stderr, "    test=nullptr\n");
 }
 
 /* test suite test unit */
 }
 
 /* test suite test unit */
@@ -101,7 +101,7 @@ static void xbt_test_unit_dump(xbt_test_unit_t unit)
       xbt_dynar_foreach(unit->tests, it_test, test)
           xbt_test_test_dump(test);
   } else {
       xbt_dynar_foreach(unit->tests, it_test, test)
           xbt_test_test_dump(test);
   } else {
-    fprintf(stderr, "  unit=NULL\n");
+    fprintf(stderr, "  unit=nullptr\n");
   }
 }
 
   }
 }
 
@@ -122,7 +122,7 @@ static void xbt_test_suite_free(void *s)
 {
   xbt_test_suite_t suite = *(xbt_test_suite_t *) s;
 
 {
   xbt_test_suite_t suite = *(xbt_test_suite_t *) s;
 
-  if (suite == NULL)
+  if (suite == nullptr)
     return;
   xbt_dynar_free(&suite->units);
   free(suite->title);
     return;
   xbt_dynar_free(&suite->units);
   free(suite->title);
@@ -191,7 +191,7 @@ xbt_test_suite_t xbt_test_suite_by_name(const char *name, const char *fmt, ...)
   va_start(ap, fmt);
   bufname = bvprintf(fmt, ap);
   va_end(ap);
   va_start(ap, fmt);
   bufname = bvprintf(fmt, ap);
   va_end(ap);
-  suite = xbt_test_suite_new(name, bufname, NULL);
+  suite = xbt_test_suite_new(name, bufname, nullptr);
   free(bufname);
 
   return suite;
   free(bufname);
 
   return suite;
@@ -207,7 +207,7 @@ void xbt_test_suite_dump(xbt_test_suite_t suite)
       xbt_dynar_foreach(suite->units, it_unit, unit)
           xbt_test_unit_dump(unit);
   } else {
       xbt_dynar_foreach(suite->units, it_unit, unit)
           xbt_test_unit_dump(unit);
   } else {
-    fprintf(stderr, "TESTSUITE IS NULL!\n");
+    fprintf(stderr, "TESTSUITE IS nullptr!\n");
   }
 }
 
   }
 }
 
@@ -227,7 +227,7 @@ void xbt_test_suite_push(xbt_test_suite_t suite, const char *name, ts_test_cb_t
   va_end(ap);
   unit->name = (char *) name;
   unit->func = func;
   va_end(ap);
   unit->name = (char *) name;
   unit->func = func;
-  unit->file = NULL;
+  unit->file = nullptr;
   unit->line = 0;
   unit->enabled = 1;
   unit->tests = xbt_dynar_new(sizeof(xbt_test_test_t), xbt_test_test_free);
   unit->line = 0;
   unit->enabled = 1;
   unit->tests = xbt_dynar_new(sizeof(xbt_test_test_t), xbt_test_test_free);
@@ -250,7 +250,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity)
 
   int first = 1;                /* for result pretty printing */
 
 
   int first = 1;                /* for result pretty printing */
 
-  if (suite == NULL)
+  if (suite == nullptr)
     return 0;
 
   /* suite title pretty-printing */
     return 0;
 
   /* suite title pretty-printing */
@@ -321,14 +321,14 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity)
           fprintf(stderr, ".... skip\n");       /* shouldn't happen, but I'm a bit lost with this logic */
         }
         xbt_dynar_foreach(unit->tests, it_test, test) {
           fprintf(stderr, ".... skip\n");       /* shouldn't happen, but I'm a bit lost with this logic */
         }
         xbt_dynar_foreach(unit->tests, it_test, test) {
-          file = (test->file != NULL ? test->file : unit->file);
+          file = (test->file != nullptr ? test->file : unit->file);
           line = (test->line != 0 ? test->line : unit->line);
           fprintf(stderr, "      %s: %s [%s:%d]\n", (test->ignored ? " SKIP" : (test->expected_failure
                   ? (test-> failed ? "EFAIL" : "EPASS") : (test->failed ? " FAIL" : " PASS"))),test->title, file, line);
 
           if ((test->expected_failure && !test->failed) || (!test->expected_failure && test->failed)) {
             xbt_dynar_foreach(test->logs, it_log, log) {
           line = (test->line != 0 ? test->line : unit->line);
           fprintf(stderr, "      %s: %s [%s:%d]\n", (test->ignored ? " SKIP" : (test->expected_failure
                   ? (test-> failed ? "EFAIL" : "EPASS") : (test->failed ? " FAIL" : " PASS"))),test->title, file, line);
 
           if ((test->expected_failure && !test->failed) || (!test->expected_failure && test->failed)) {
             xbt_dynar_foreach(test->logs, it_log, log) {
-              file = (log->file != NULL ? log->file : file);
+              file = (log->file != nullptr ? log->file : file);
               line = (log->line != 0 ? log->line : line);
               fprintf(stderr, "             %s:%d: %s\n", file, line, log->text);
             }
               line = (log->line != 0 ? log->line : line);
               fprintf(stderr, "             %s:%d: %s\n", file, line, log->text);
             }
index 9035e7a..359ce24 100644 (file)
@@ -31,7 +31,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict, xbt, "Dictionaries provide the same fu
  */
 xbt_dict_t xbt_dict_new(void)
 {
  */
 xbt_dict_t xbt_dict_new(void)
 {
-  xbt_dict_t dict = xbt_dict_new_homogeneous(NULL);
+  xbt_dict_t dict = xbt_dict_new_homogeneous(nullptr);
   dict->homogeneous = 0;
 
   return dict;
   dict->homogeneous = 0;
 
   return dict;
@@ -48,7 +48,7 @@ xbt_dict_t xbt_dict_new(void)
  */
 xbt_dict_t xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn)
 {
  */
 xbt_dict_t xbt_dict_new_homogeneous(void_f_pvoid_t free_ctn)
 {
-  if (dict_elm_mallocator == NULL)
+  if (dict_elm_mallocator == nullptr)
     xbt_dict_preinit();
 
   xbt_dict_t dict;
     xbt_dict_preinit();
 
   xbt_dict_t dict;
@@ -79,14 +79,14 @@ void xbt_dict_free(xbt_dict_t * dict)
 
   //  if ( *dict )  xbt_dict_dump_sizes(*dict);
 
 
   //  if ( *dict )  xbt_dict_dump_sizes(*dict);
 
-  if (dict != NULL && *dict != NULL) {
+  if (dict != nullptr && *dict != nullptr) {
     table_size = (*dict)->table_size;
     table = (*dict)->table;
     /* Warning: the size of the table is 'table_size+1'...
      * This is because table_size is used as a binary mask in xbt_dict_rehash */
     for (i = 0; (*dict)->count && i <= table_size; i++) {
       current = table[i];
     table_size = (*dict)->table_size;
     table = (*dict)->table;
     /* Warning: the size of the table is 'table_size+1'...
      * This is because table_size is used as a binary mask in xbt_dict_rehash */
     for (i = 0; (*dict)->count && i <= table_size; i++) {
       current = table[i];
-      while (current != NULL) {
+      while (current != nullptr) {
         previous = current;
         current = current->next;
         xbt_dictelm_free(*dict, previous);
         previous = current;
         current = current->next;
         xbt_dictelm_free(*dict, previous);
@@ -95,7 +95,7 @@ void xbt_dict_free(xbt_dict_t * dict)
     }
     xbt_free(table);
     xbt_free(*dict);
     }
     xbt_free(table);
     xbt_free(*dict);
-    *dict = NULL;
+    *dict = nullptr;
   }
 }
 
   }
 }
 
@@ -161,22 +161,22 @@ void xbt_dict_set_ext(xbt_dict_t dict, const char *key, int key_len, void *data,
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
 
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
 
-  xbt_dictelm_t current, previous = NULL;
+  xbt_dictelm_t current, previous = nullptr;
 
   XBT_CDEBUG(xbt_dict, "ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code,
              dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
 
   XBT_CDEBUG(xbt_dict, "ADD %.*s hash = %u, size = %d, & = %u", key_len, key, hash_code,
              dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
-  while (current != NULL && (hash_code != current->hash_code || key_len != current->key_len
+  while (current != nullptr && (hash_code != current->hash_code || key_len != current->key_len
           || memcmp(key, current->key, key_len))) {
     previous = current;
     current = current->next;
   }
 
           || memcmp(key, current->key, key_len))) {
     previous = current;
     current = current->next;
   }
 
-  if (current == NULL) {
+  if (current == nullptr) {
     /* this key doesn't exist yet */
     current = xbt_dictelm_new(dict, key, key_len, hash_code, data, free_ctn);
     dict->count++;
     /* this key doesn't exist yet */
     current = xbt_dictelm_new(dict, key, key_len, hash_code, data, free_ctn);
     dict->count++;
-    if (previous == NULL) {
+    if (previous == nullptr) {
       dict->table[hash_code & dict->table_size] = current;
       dict->fill++;
       if ((dict->fill * 100) / (dict->table_size + 1) > MAX_FILL_PERCENT)
       dict->table[hash_code & dict->table_size] = current;
       dict->fill++;
       if ((dict->fill * 100) / (dict->table_size + 1) > MAX_FILL_PERCENT)
@@ -223,30 +223,30 @@ void *xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len)
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
-  while (current != NULL && (hash_code != current->hash_code || key_len != current->key_len
+  while (current != nullptr && (hash_code != current->hash_code || key_len != current->key_len
           || memcmp(key, current->key, key_len))) {
     current = current->next;
   }
 
           || memcmp(key, current->key, key_len))) {
     current = current->next;
   }
 
-  if (current == NULL)
+  if (current == nullptr)
     THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
 
   return current->content;
 }
 
     THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
 
   return current->content;
 }
 
-/** @brief like xbt_dict_get_ext(), but returning NULL when not found */
+/** @brief like xbt_dict_get_ext(), but returning nullptr when not found */
 void *xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key, int key_len)
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
 void *xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key, int key_len)
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
-  while (current != NULL && (hash_code != current->hash_code || key_len != current->key_len
+  while (current != nullptr && (hash_code != current->hash_code || key_len != current->key_len
           || memcmp(key, current->key, key_len))) {
     current = current->next;
   }
 
           || memcmp(key, current->key, key_len))) {
     current = current->next;
   }
 
-  if (current == NULL)
-    return NULL;
+  if (current == nullptr)
+    return nullptr;
 
   return current->content;
 }
 
   return current->content;
 }
@@ -254,19 +254,19 @@ void *xbt_dict_get_or_null_ext(xbt_dict_t dict, const char *key, int key_len)
 /**
  * @brief retrieve the key associated to that object. Warning, that's a linear search
  *
 /**
  * @brief retrieve the key associated to that object. Warning, that's a linear search
  *
- * Returns NULL if the object cannot be found
+ * Returns nullptr if the object cannot be found
  */
 char *xbt_dict_get_key(xbt_dict_t dict, const void *data)
 {
   for (int i = 0; i <= dict->table_size; i++) {
     xbt_dictelm_t current = dict->table[i];
  */
 char *xbt_dict_get_key(xbt_dict_t dict, const void *data)
 {
   for (int i = 0; i <= dict->table_size; i++) {
     xbt_dictelm_t current = dict->table[i];
-    while (current != NULL) {
+    while (current != nullptr) {
       if (current->content == data)
         return current->key;
       current = current->next;
     }
   }
       if (current->content == data)
         return current->key;
       current = current->next;
     }
   }
-  return NULL;
+  return nullptr;
 }
 
 /** @brief retrieve the key associated to that xbt_dictelm_t. */
 }
 
 /** @brief retrieve the key associated to that xbt_dictelm_t. */
@@ -283,7 +283,7 @@ char *xbt_dict_get_elm_key(xbt_dictelm_t elm)
  * \return the data that we are looking for
  *
  * Search the given \a key. Throws not_found_error when not found.
  * \return the data that we are looking for
  *
  * Search the given \a key. Throws not_found_error when not found.
- * Check xbt_dict_get_or_null() for a version returning NULL without exception when not found.
+ * Check xbt_dict_get_or_null() for a version returning nullptr without exception when not found.
  */
 void *xbt_dict_get(xbt_dict_t dict, const char *key)
 {
  */
 void *xbt_dict_get(xbt_dict_t dict, const char *key)
 {
@@ -298,40 +298,40 @@ void *xbt_dict_get(xbt_dict_t dict, const char *key)
  * \return the s_xbt_dictelm_t that we are looking for
  *
  * Search the given \a key. Throws not_found_error when not found.
  * \return the s_xbt_dictelm_t that we are looking for
  *
  * Search the given \a key. Throws not_found_error when not found.
- * Check xbt_dict_get_or_null() for a version returning NULL without exception when not found.
+ * Check xbt_dict_get_or_null() for a version returning nullptr without exception when not found.
  */
 xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
 {
   xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
 
  */
 xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
 {
   xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
 
-  if (current == NULL)
+  if (current == nullptr)
     THROWF(not_found_error, 0, "key %s not found", key);
 
   return current;
 }
 
 /**
     THROWF(not_found_error, 0, "key %s not found", key);
 
   return current;
 }
 
 /**
- * \brief like xbt_dict_get(), but returning NULL when not found
+ * \brief like xbt_dict_get(), but returning nullptr when not found
  */
 void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key)
 {
   xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
 
  */
 void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key)
 {
   xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
 
-  if (current == NULL)
-    return NULL;
+  if (current == nullptr)
+    return nullptr;
 
   return current->content;
 }
 
 /**
 
   return current->content;
 }
 
 /**
- * \brief like xbt_dict_get_elm(), but returning NULL when not found
+ * \brief like xbt_dict_get_elm(), but returning nullptr when not found
  */
 xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
 {
   unsigned int hash_code = xbt_str_hash(key);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
  */
 xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
 {
   unsigned int hash_code = xbt_str_hash(key);
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
-  while (current != NULL && (hash_code != current->hash_code || strcmp(key, current->key)))
+  while (current != nullptr && (hash_code != current->hash_code || strcmp(key, current->key)))
     current = current->next;
   return current;
 }
     current = current->next;
   return current;
 }
@@ -348,19 +348,19 @@ xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
 void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
 void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
 {
   unsigned int hash_code = xbt_str_hash_ext(key, key_len);
-  xbt_dictelm_t previous = NULL;
+  xbt_dictelm_t previous = nullptr;
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
   xbt_dictelm_t current = dict->table[hash_code & dict->table_size];
 
-  while (current != NULL && (hash_code != current->hash_code || key_len != current->key_len
+  while (current != nullptr && (hash_code != current->hash_code || key_len != current->key_len
           || strncmp(key, current->key, key_len))) {
     previous = current;         /* save the previous node */
     current = current->next;
   }
 
           || strncmp(key, current->key, key_len))) {
     previous = current;         /* save the previous node */
     current = current->next;
   }
 
-  if (current == NULL)
+  if (current == nullptr)
     THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
 
     THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
 
-  if (previous != NULL) {
+  if (previous != nullptr) {
     previous->next = current->next;
   } else {
     dict->table[hash_code & dict->table_size] = current->next;
     previous->next = current->next;
   } else {
     dict->table[hash_code & dict->table_size] = current->next;
@@ -393,14 +393,14 @@ void xbt_dict_reset(xbt_dict_t dict)
     return;
 
   for (int i = 0; i <= dict->table_size; i++) {
     return;
 
   for (int i = 0; i <= dict->table_size; i++) {
-    xbt_dictelm_t previous = NULL;
+    xbt_dictelm_t previous = nullptr;
     xbt_dictelm_t current = dict->table[i];
     xbt_dictelm_t current = dict->table[i];
-    while (current != NULL) {
+    while (current != nullptr) {
       previous = current;
       current = current->next;
       xbt_dictelm_free(dict, previous);
     }
       previous = current;
       current = current->next;
       xbt_dictelm_free(dict, previous);
     }
-    dict->table[i] = NULL;
+    dict->table[i] = nullptr;
   }
 
   dict->count = 0;
   }
 
   dict->count = 0;
@@ -436,7 +436,7 @@ int xbt_dict_is_empty(xbt_dict_t dict)
  * \param dict the exibitionist
  * \param output a function to dump each data in the tree (check @ref xbt_dict_dump_output_string)
  *
  * \param dict the exibitionist
  * \param output a function to dump each data in the tree (check @ref xbt_dict_dump_output_string)
  *
- * Outputs the content of the structure. (for debugging purpose). \a output is a function to output the data. If NULL,
+ * Outputs the content of the structure. (for debugging purpose). \a output is a function to output the data. If nullptr,
  * data won't be displayed.
  */
 void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
  * data won't be displayed.
  */
 void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
@@ -444,14 +444,14 @@ void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
   int i;
   xbt_dictelm_t element;
   printf("Dict %p:\n", dict);
   int i;
   xbt_dictelm_t element;
   printf("Dict %p:\n", dict);
-  if (dict != NULL) {
+  if (dict != nullptr) {
     for (i = 0; i < dict->table_size; i++) {
       element = dict->table[i];
       if (element) {
         printf("[\n");
     for (i = 0; i < dict->table_size; i++) {
       element = dict->table[i];
       if (element) {
         printf("[\n");
-        while (element != NULL) {
+        while (element != nullptr) {
           printf(" %s -> '", element->key);
           printf(" %s -> '", element->key);
-          if (output != NULL) {
+          if (output != nullptr) {
             output(element->content);
           }
           printf("'\n");
             output(element->content);
           }
           printf("'\n");
@@ -465,7 +465,7 @@ void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
   }
 }
 
   }
 }
 
-xbt_dynar_t all_sizes = NULL;
+xbt_dynar_t all_sizes = nullptr;
 /** @brief shows some debugging info about the bucklet repartition */
 void xbt_dict_dump_sizes(xbt_dict_t dict)
 {
 /** @brief shows some debugging info about the bucklet repartition */
 void xbt_dict_dump_sizes(xbt_dict_t dict)
 {
@@ -478,13 +478,13 @@ void xbt_dict_dump_sizes(xbt_dict_t dict)
     printf("\n");
     return;
   }
     printf("\n");
     return;
   }
-  xbt_dynar_t sizes = xbt_dynar_new(sizeof(int), NULL);
+  xbt_dynar_t sizes = xbt_dynar_new(sizeof(int), nullptr);
 
   for (int i = 0; i < dict->table_size; i++) {
     xbt_dictelm_t element = dict->table[i];
     size = 0;
     if (element) {
 
   for (int i = 0; i < dict->table_size; i++) {
     xbt_dictelm_t element = dict->table[i];
     size = 0;
     if (element) {
-      while (element != NULL) {
+      while (element != nullptr) {
         size++;
         element = element->next;
       }
         size++;
         element = element->next;
       }
@@ -500,7 +500,7 @@ void xbt_dict_dump_sizes(xbt_dict_t dict)
     }
   }
   if (!all_sizes)
     }
   }
   if (!all_sizes)
-    all_sizes = xbt_dynar_new(sizeof(int), NULL);
+    all_sizes = xbt_dynar_new(sizeof(int), nullptr);
 
   xbt_dynar_foreach(sizes, count, size) {
     /* Copy values of this one into all_sizes */
 
   xbt_dynar_foreach(sizes, count, size) {
     /* Copy values of this one into all_sizes */
@@ -532,11 +532,11 @@ void xbt_dict_dump_sizes(xbt_dict_t dict)
  */
 void xbt_dict_preinit(void)
 {
  */
 void xbt_dict_preinit(void)
 {
-  if (dict_elm_mallocator == NULL)
+  if (dict_elm_mallocator == nullptr)
     dict_elm_mallocator = xbt_mallocator_new(
       256, dict_elm_mallocator_new_f, dict_elm_mallocator_free_f,
       dict_elm_mallocator_reset_f);
     dict_elm_mallocator = xbt_mallocator_new(
       256, dict_elm_mallocator_new_f, dict_elm_mallocator_free_f,
       dict_elm_mallocator_reset_f);
-  if (dict_het_elm_mallocator == NULL)
+  if (dict_het_elm_mallocator == nullptr)
     dict_het_elm_mallocator = xbt_mallocator_new(
       256, dict_het_elm_mallocator_new_f, dict_het_elm_mallocator_free_f,
       dict_het_elm_mallocator_reset_f);
     dict_het_elm_mallocator = xbt_mallocator_new(
       256, dict_het_elm_mallocator_new_f, dict_het_elm_mallocator_free_f,
       dict_het_elm_mallocator_reset_f);
@@ -548,11 +548,11 @@ void xbt_dict_preinit(void)
  */
 void xbt_dict_postexit(void)
 {
  */
 void xbt_dict_postexit(void)
 {
-  if (dict_elm_mallocator != NULL) {
+  if (dict_elm_mallocator != nullptr) {
     xbt_mallocator_free(dict_elm_mallocator);
     xbt_mallocator_free(dict_elm_mallocator);
-    dict_elm_mallocator = NULL;
+    dict_elm_mallocator = nullptr;
     xbt_mallocator_free(dict_het_elm_mallocator);
     xbt_mallocator_free(dict_het_elm_mallocator);
-    dict_het_elm_mallocator = NULL;
+    dict_het_elm_mallocator = nullptr;
   }
   if (all_sizes) {
     unsigned int count;
   }
   if (all_sizes) {
     unsigned int count;
@@ -604,7 +604,7 @@ static void debuged_add(xbt_dict_t head, const char *key, void_f_pvoid_t free_f)
 
 static void fill(xbt_dict_t * head, int homogeneous)
 {
 
 static void fill(xbt_dict_t * head, int homogeneous)
 {
-  void_f_pvoid_t free_f = homogeneous ? NULL : &free;
+  void_f_pvoid_t free_f = homogeneous ? nullptr : &free;
 
   xbt_test_add("Fill in the dictionnary");
 
 
   xbt_test_add("Fill in the dictionnary");
 
@@ -626,12 +626,12 @@ static void search_ext(xbt_dict_t head, const char *key, const char *data)
   char *found = (char*) xbt_dict_get(head, key);
   xbt_test_log("Found %s", found);
   if (data) {
   char *found = (char*) xbt_dict_get(head, key);
   xbt_test_log("Found %s", found);
   if (data) {
-    xbt_test_assert(found, "data do not match expectations: found NULL while searching for %s", data);
+    xbt_test_assert(found, "data do not match expectations: found nullptr while searching for %s", data);
     if (found)
       xbt_test_assert(!strcmp(data, found), "data do not match expectations: found %s while searching for %s",
                       found, data);
   } else {
     if (found)
       xbt_test_assert(!strcmp(data, found), "data do not match expectations: found %s while searching for %s",
                       found, data);
   } else {
-    xbt_test_assert(!found, "data do not match expectations: found %s while searching for NULL", found);
+    xbt_test_assert(!found, "data do not match expectations: found %s while searching for nullptr", found);
   }
 }
 
   }
 }
 
@@ -649,7 +649,7 @@ static void debuged_remove(xbt_dict_t head, const char *key)
 
 static void traverse(xbt_dict_t head)
 {
 
 static void traverse(xbt_dict_t head)
 {
-  xbt_dict_cursor_t cursor = NULL;
+  xbt_dict_cursor_t cursor = nullptr;
   char *key;
   char *data;
   int i = 0;
   char *key;
   char *data;
   int i = 0;
@@ -718,7 +718,7 @@ static void count_check_get_key(xbt_dict_t dict, int length)
 }
 
 xbt_ex_t e;
 }
 
 xbt_ex_t e;
-xbt_dict_t head = NULL;
+xbt_dict_t head = nullptr;
 char *data;
 
 static void basic_test(int homogeneous)
 char *data;
 
 static void basic_test(int homogeneous)
@@ -740,7 +740,7 @@ static void basic_test(int homogeneous)
   }
   xbt_dict_free(&head);
 
   }
   xbt_dict_free(&head);
 
-  free_f = homogeneous ? NULL : &free;
+  free_f = homogeneous ? nullptr : &free;
 
   xbt_test_add("Traverse the full dictionary");
   fill(&head, homogeneous);
 
   xbt_test_add("Traverse the full dictionary");
   fill(&head, homogeneous);
@@ -894,17 +894,17 @@ XBT_TEST_UNIT("remove_homogeneous", test_dict_remove_homogeneous, "Removing some
   remove_test(1);
 }
 
   remove_test(1);
 }
 
-XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management")
+XBT_TEST_UNIT("nulldata", test_dict_nulldata, "nullptr data management")
 {
   fill(&head, 1);
 
 {
   fill(&head, 1);
 
-  xbt_test_add("Store NULL under 'null'");
-  xbt_dict_set(head, "null", NULL, NULL);
-  search_ext(head, "null", NULL);
+  xbt_test_add("Store nullptr under 'null'");
+  xbt_dict_set(head, "null", nullptr, nullptr);
+  search_ext(head, "null", nullptr);
 
   xbt_test_add("Check whether I see it while traversing...");
   {
 
   xbt_test_add("Check whether I see it while traversing...");
   {
-    xbt_dict_cursor_t cursor = NULL;
+    xbt_dict_cursor_t cursor = nullptr;
     char *key;
     int found = 0;
 
     char *key;
     int found = 0;
 
@@ -918,7 +918,7 @@ XBT_TEST_UNIT("nulldata", test_dict_nulldata, "NULL data management")
       if (!strcmp(key, "null"))
         found = 1;
     }
       if (!strcmp(key, "null"))
         found = 1;
     }
-    xbt_test_assert(found, "the key 'null', associated to NULL is not found");
+    xbt_test_assert(found, "the key 'null', associated to nullptr is not found");
   }
   xbt_dict_free(&head);
 }
   }
   xbt_dict_free(&head);
 }
@@ -940,11 +940,11 @@ static int countelems(xbt_dict_t head)
 
 XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
 {
 
 XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
 {
-  xbt_dict_t head = NULL;
+  xbt_dict_t head = nullptr;
   int i, j, k;
   char *key;
 
   int i, j, k;
   char *key;
 
-  srand((unsigned int) time(NULL));
+  srand((unsigned int) time(nullptr));
 
   for (i = 0; i < 10; i++) {
     xbt_test_add("CRASH test number %d (%d to go)", i + 1, 10 - i - 1);
 
   for (i = 0; i < 10; i++) {
     xbt_test_add("CRASH test number %d (%d to go)", i + 1, 10 - i - 1);
@@ -953,7 +953,7 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
     head = xbt_dict_new();
     /* if (i%10) printf("."); else printf("%d",i/10); fflush(stdout); */
     for (j = 0; j < 1000; j++) {
     head = xbt_dict_new();
     /* if (i%10) printf("."); else printf("%d",i/10); fflush(stdout); */
     for (j = 0; j < 1000; j++) {
-      char *data = NULL;
+      char *data = nullptr;
       key = (char*) xbt_malloc(SIZEOFKEY);
 
       do {
       key = (char*) xbt_malloc(SIZEOFKEY);
 
       do {
@@ -962,7 +962,7 @@ XBT_TEST_UNIT("crash", test_dict_crash, "Crash test")
         key[k] = '\0';
         /*      printf("[%d %s]\n",j,key); */
         data = (char*) xbt_dict_get_or_null(head, key);
         key[k] = '\0';
         /*      printf("[%d %s]\n",j,key); */
         data = (char*) xbt_dict_get_or_null(head, key);
-      } while (data != NULL);
+      } while (data != nullptr);
 
       xbt_dict_set(head, key, key, &free);
       data = (char*) xbt_dict_get(head, key);
 
       xbt_dict_set(head, key, key, &free);
       data = (char*) xbt_dict_get(head, key);
@@ -1028,7 +1028,7 @@ XBT_TEST_UNIT("ext", test_dict_int, "Test dictionnary with int keys")
   xbt_test_add("Insert elements");
   int i;
   for (i = 0; i < count; ++i)
   xbt_test_add("Insert elements");
   int i;
   for (i = 0; i < count; ++i)
-    xbt_dict_set_ext(dict, (char*) &i, sizeof(i), (void*) (intptr_t) i, NULL);
+    xbt_dict_set_ext(dict, (char*) &i, sizeof(i), (void*) (intptr_t) i, nullptr);
   xbt_test_assert(xbt_dict_size(dict) == (unsigned) count, "Bad number of elements in the dictionnary");
 
   xbt_test_add("Check elements");
   xbt_test_assert(xbt_dict_size(dict) == (unsigned) count, "Bad number of elements in the dictionnary");
 
   xbt_test_add("Check elements");
index dbd8961..a78bdef 100644 (file)
@@ -18,7 +18,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dyn, xbt, "Dynamic arrays");
 
 static inline void _sanity_check_dynar(xbt_dynar_t dynar)
 {
 
 static inline void _sanity_check_dynar(xbt_dynar_t dynar)
 {
-  xbt_assert(dynar, "dynar is NULL");
+  xbt_assert(dynar, "dynar is nullptr");
 }
 
 static inline void _sanity_check_idx(int idx)
 }
 
 static inline void _sanity_check_idx(int idx)
@@ -84,7 +84,7 @@ void xbt_dynar_dump(xbt_dynar_t dynar)
 /** @brief Constructor
  *
  * \param elmsize size of each element in the dynar
 /** @brief Constructor
  *
  * \param elmsize size of each element in the dynar
- * \param free_f function to call each time we want to get rid of an element (or NULL if nothing to do).
+ * \param free_f function to call each time we want to get rid of an element (or nullptr if nothing to do).
  *
  * Creates a new dynar. If a free_func is provided, the elements have to be pointer of pointer. That is to say that
  * dynars can contain either base types (int, char, double, etc) or pointer of pointers (struct **).
  *
  * Creates a new dynar. If a free_func is provided, the elements have to be pointer of pointer. That is to say that
  * dynars can contain either base types (int, char, double, etc) or pointer of pointers (struct **).
@@ -96,7 +96,7 @@ xbt_dynar_t xbt_dynar_new(const unsigned long elmsize, void_f_pvoid_t const free
   dynar->size = 0;
   dynar->used = 0;
   dynar->elmsize = elmsize;
   dynar->size = 0;
   dynar->used = 0;
   dynar->elmsize = elmsize;
-  dynar->data = NULL;
+  dynar->data = nullptr;
   dynar->free_f = free_f;
 
   return dynar;
   dynar->free_f = free_f;
 
   return dynar;
@@ -115,7 +115,7 @@ void xbt_dynar_free_container(xbt_dynar_t * dynar)
     xbt_dynar_t d = *dynar;
     free(d->data);
     free(d);
     xbt_dynar_t d = *dynar;
     free(d->data);
     free(d);
-    *dynar = NULL;
+    *dynar = nullptr;
   }
 }
 
   }
 }
 
@@ -371,7 +371,7 @@ void xbt_dynar_remove_at(xbt_dynar_t const dynar, const int idx, void *const obj
 /** @brief Remove a slice of the dynar, sliding the rest of the values to the left
  *
  * This function removes an n-sized slice that starts at element idx. It is equivalent to xbt_dynar_remove_at with a
 /** @brief Remove a slice of the dynar, sliding the rest of the values to the left
  *
  * This function removes an n-sized slice that starts at element idx. It is equivalent to xbt_dynar_remove_at with a
- * NULL object argument if n equals to 1.
+ * nullptr object argument if n equals to 1.
  *
  * Each of the removed elements is freed using the free_f function passed at dynar creation.
  */
  *
  * Each of the removed elements is freed using the free_f function passed at dynar creation.
  */
@@ -555,7 +555,7 @@ void xbt_dynar_map(const xbt_dynar_t dynar, void_f_pvoid_t const op)
  */
 void xbt_dynar_cursor_rm(xbt_dynar_t dynar, unsigned int *const cursor)
 {
  */
 void xbt_dynar_cursor_rm(xbt_dynar_t dynar, unsigned int *const cursor)
 {
-  xbt_dynar_remove_at(dynar, (*cursor)--, NULL);
+  xbt_dynar_remove_at(dynar, (*cursor)--, nullptr);
 }
 
 /** @brief Sorts a dynar according to the function <tt>compar_fn</tt>
 }
 
 /** @brief Sorts a dynar according to the function <tt>compar_fn</tt>
@@ -647,7 +647,7 @@ XBT_PUBLIC(void) xbt_dynar_three_way_partition(xbt_dynar_t const dynar, int_f_pv
   xbt_free(tmp);
 }
 
   xbt_free(tmp);
 }
 
-/** @brief Transform a dynar into a NULL terminated array. 
+/** @brief Transform a dynar into a nullptr terminated array. 
  *
  *  \param dynar the dynar to transform
  *  \return pointer to the first element of the array
  *
  *  \param dynar the dynar to transform
  *  \return pointer to the first element of the array
@@ -682,7 +682,7 @@ int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2, int(*compar)(const void *,
   if((!d1) && (!d2)) return 0;
   if((!d1) || (!d2))
   {
   if((!d1) && (!d2)) return 0;
   if((!d1) || (!d2))
   {
-    XBT_DEBUG("NULL dynar d1=%p d2=%p",d1,d2);
+    XBT_DEBUG("nullptr dynar d1=%p d2=%p",d1,d2);
     xbt_dynar_free(&d2);
     return 1;
   }
     xbt_dynar_free(&d2);
     return 1;
   }
@@ -727,7 +727,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   int *iptr;
 
   xbt_test_add("==== Traverse the empty dynar");
   int *iptr;
 
   xbt_test_add("==== Traverse the empty dynar");
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   xbt_dynar_foreach(d, cursor, i) {
     xbt_die( "Damnit, there is something in the empty dynar");
   }
   xbt_dynar_foreach(d, cursor, i) {
     xbt_die( "Damnit, there is something in the empty dynar");
   }
@@ -738,7 +738,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   xbt_test_add("==== Push %d int, set them again 3 times, traverse them, shift them", NB_ELEM);
   /* Populate_ints [doxygen cruft] */
   /* 1. Populate the dynar */
   xbt_test_add("==== Push %d int, set them again 3 times, traverse them, shift them", NB_ELEM);
   /* Populate_ints [doxygen cruft] */
   /* 1. Populate the dynar */
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);     /* This is faster (and possible only with scalars) */
     /* xbt_dynar_push(d,&cpt);       This would also work */
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);     /* This is faster (and possible only with scalars) */
     /* xbt_dynar_push(d,&cpt);       This would also work */
@@ -802,7 +802,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Unshift/pop %d int", NB_ELEM);
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Unshift/pop %d int", NB_ELEM);
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_unshift(d, &cpt);
     XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_unshift(d, &cpt);
     XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
@@ -817,7 +817,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add ("==== Push %d int, insert 1000 int in the middle, shift everything", NB_ELEM);
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add ("==== Push %d int, insert 1000 int in the middle, shift everything", NB_ELEM);
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);
     XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);
     XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
@@ -847,7 +847,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push %d int, remove 2000-4000. free the rest", NB_ELEM);
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push %d int, remove 2000-4000. free the rest", NB_ELEM);
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   for (cpt = 0; cpt < NB_ELEM; cpt++)
     xbt_dynar_push_as(d, int, cpt);
 
   for (cpt = 0; cpt < NB_ELEM; cpt++)
     xbt_dynar_push_as(d, int, cpt);
 
@@ -864,7 +864,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
 /*******************************************************************************/
 XBT_TEST_UNIT("insert",test_dynar_insert,"Using the xbt_dynar_insert and xbt_dynar_remove functions")
 {
 /*******************************************************************************/
 XBT_TEST_UNIT("insert",test_dynar_insert,"Using the xbt_dynar_insert and xbt_dynar_remove functions")
 {
-  xbt_dynar_t d = xbt_dynar_new(sizeof(unsigned int), NULL);
+  xbt_dynar_t d = xbt_dynar_new(sizeof(unsigned int), nullptr);
   unsigned int cursor;
   int cpt;
 
   unsigned int cursor;
   int cpt;
 
@@ -899,7 +899,7 @@ XBT_TEST_UNIT("insert",test_dynar_insert,"Using the xbt_dynar_insert and xbt_dyn
 
   /* ********************* */
   xbt_test_add("==== Insert %d int in reverse order, traverse them, remove them",NB_ELEM);
 
   /* ********************* */
   xbt_test_add("==== Insert %d int in reverse order, traverse them, remove them",NB_ELEM);
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   for (cpt = NB_ELEM-1; cpt >=0; cpt--) {
     xbt_dynar_replace(d, cpt, &cpt);
     xbt_test_log("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   for (cpt = NB_ELEM-1; cpt >=0; cpt--) {
     xbt_dynar_replace(d, cpt, &cpt);
     xbt_test_log("Push %d, length=%lu", cpt, xbt_dynar_length(d));
@@ -930,7 +930,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
   double d1, d2;
 
   xbt_test_add("==== Traverse the empty dynar");
   double d1, d2;
 
   xbt_test_add("==== Traverse the empty dynar");
-  d = xbt_dynar_new(sizeof(int), NULL);
+  d = xbt_dynar_new(sizeof(int), nullptr);
   xbt_dynar_foreach(d, cursor, cpt) {
     xbt_test_assert(FALSE, "Damnit, there is something in the empty dynar");
   }
   xbt_dynar_foreach(d, cursor, cpt) {
     xbt_test_assert(FALSE, "Damnit, there is something in the empty dynar");
   }
@@ -939,7 +939,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push/shift 5000 doubles");
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push/shift 5000 doubles");
-  d = xbt_dynar_new(sizeof(double), NULL);
+  d = xbt_dynar_new(sizeof(double), nullptr);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
@@ -958,7 +958,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Unshift/pop 5000 doubles");
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Unshift/pop 5000 doubles");
-  d = xbt_dynar_new(sizeof(double), NULL);
+  d = xbt_dynar_new(sizeof(double), nullptr);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_unshift(d, &d1);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_unshift(d, &d1);
@@ -973,7 +973,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push 5000 doubles, insert 1000 doubles in the middle, shift everything");
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push 5000 doubles, insert 1000 doubles in the middle, shift everything");
-  d = xbt_dynar_new(sizeof(double), NULL);
+  d = xbt_dynar_new(sizeof(double), nullptr);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
@@ -1006,7 +1006,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push 5000 double, remove 2000-4000. free the rest");
   /* in your code is naturally the way to go outside a regression test */
 
   xbt_test_add("==== Push 5000 double, remove 2000-4000. free the rest");
-  d = xbt_dynar_new(sizeof(double), NULL);
+  d = xbt_dynar_new(sizeof(double), nullptr);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
   for (cpt = 0; cpt < 5000; cpt++) {
     d1 = (double) cpt;
     xbt_dynar_push(d, &d1);
index 2d1a2ce..06f9221 100644 (file)
@@ -29,10 +29,10 @@ typedef struct s_replay_reader {
 
 FILE *xbt_action_fp;
 
 
 FILE *xbt_action_fp;
 
-xbt_dict_t xbt_action_funs = NULL;
-xbt_dict_t xbt_action_queues = NULL;
+xbt_dict_t xbt_action_funs = nullptr;
+xbt_dict_t xbt_action_queues = nullptr;
 
 
-static char *action_line = NULL;
+static char *action_line = nullptr;
 static size_t action_len = 0;
 
 int is_replay_active = 0 ;
 static size_t action_len = 0;
 
 int is_replay_active = 0 ;
@@ -56,7 +56,7 @@ xbt_replay_reader_t xbt_replay_reader_new(const char *filename)
 {
   xbt_replay_reader_t res = xbt_new0(s_xbt_replay_reader_t,1);
   res->fp = fopen(filename, "r");
 {
   xbt_replay_reader_t res = xbt_new0(s_xbt_replay_reader_t,1);
   res->fp = fopen(filename, "r");
-  xbt_assert(res->fp != NULL, "Cannot open %s: %s", filename, strerror(errno));
+  xbt_assert(res->fp != nullptr, "Cannot open %s: %s", filename, strerror(errno));
   res->filename = xbt_strdup(filename);
   return res;
 }
   res->filename = xbt_strdup(filename);
   return res;
 }
@@ -69,11 +69,11 @@ const char **xbt_replay_reader_get(xbt_replay_reader_t reader)
   //XBT_INFO("got from trace: %s",reader->line);
   reader->linenum++;
   if (read==-1)
   //XBT_INFO("got from trace: %s",reader->line);
   reader->linenum++;
   if (read==-1)
-    return NULL; /* end of file */
+    return nullptr; /* end of file */
   char *comment = strchr(reader->line, '#');
   char *comment = strchr(reader->line, '#');
-  if (comment != NULL)
+  if (comment != nullptr)
     *comment = '\0';
     *comment = '\0';
-  xbt_str_trim(reader->line, NULL);
+  xbt_str_trim(reader->line, nullptr);
   if (reader->line[0] == '\0')
     return xbt_replay_reader_get(reader); /* Get next line */
 
   if (reader->line[0] == '\0')
     return xbt_replay_reader_get(reader); /* Get next line */
 
@@ -92,7 +92,7 @@ void xbt_replay_reader_free(xbt_replay_reader_t *reader)
   fclose((*reader)->fp);
   free((*reader)->line);
   free(*reader);
   fclose((*reader)->fp);
   free((*reader)->line);
   free(*reader);
-  *reader=NULL;
+  *reader=nullptr;
 }
 
 /**
 }
 
 /**
@@ -110,7 +110,7 @@ void xbt_replay_reader_free(xbt_replay_reader_t *reader)
 void xbt_replay_action_register(const char *action_name, action_fun function)
 {
   char* lowername = str_tolower (action_name);
 void xbt_replay_action_register(const char *action_name, action_fun function)
 {
   char* lowername = str_tolower (action_name);
-  xbt_dict_set(xbt_action_funs, lowername, (void*) function, NULL);
+  xbt_dict_set(xbt_action_funs, lowername, (void*) function, nullptr);
   xbt_free(lowername);
 }
 
   xbt_free(lowername);
 }
 
@@ -123,8 +123,8 @@ int _xbt_replay_action_init(void)
   if (xbt_action_funs)
     return 0;
   is_replay_active = 1;
   if (xbt_action_funs)
     return 0;
   is_replay_active = 1;
-  xbt_action_funs = xbt_dict_new_homogeneous(NULL);
-  xbt_action_queues = xbt_dict_new_homogeneous(NULL);
+  xbt_action_funs = xbt_dict_new_homogeneous(nullptr);
+  xbt_action_queues = xbt_dict_new_homogeneous(nullptr);
   return 1;
 }
 
   return 1;
 }
 
@@ -133,9 +133,9 @@ void _xbt_replay_action_exit(void)
   xbt_dict_free(&xbt_action_queues);
   xbt_dict_free(&xbt_action_funs);
   free(action_line);
   xbt_dict_free(&xbt_action_queues);
   xbt_dict_free(&xbt_action_funs);
   free(action_line);
-  xbt_action_queues = NULL;
-  xbt_action_funs = NULL;
-  action_line = NULL;
+  xbt_action_queues = nullptr;
+  xbt_action_funs = nullptr;
+  action_line = nullptr;
 }
 
 /**
 }
 
 /**
@@ -163,7 +163,7 @@ int xbt_replay_action_runner(int argc, char *argv[])
       catch(xbt_ex& e) {
         xbt_die("Replay error :\n %s", e.what());
       }
       catch(xbt_ex& e) {
         xbt_die("Replay error :\n %s", e.what());
       }
-      for (i=0;evt[i]!= NULL;i++)
+      for (i=0;evt[i]!= nullptr;i++)
         free(evt[i]);
       free(evt);
     }
         free(evt[i]);
       free(evt);
     }
@@ -197,12 +197,12 @@ int xbt_replay_action_runner(int argc, char *argv[])
 
 static char **action_get_action(char *name)
 {
 
 static char **action_get_action(char *name)
 {
-  xbt_dynar_t evt = NULL;
-  char *evtname = NULL;
+  xbt_dynar_t evt = nullptr;
+  char *evtname = nullptr;
 
   xbt_dynar_t myqueue = (xbt_dynar_t) xbt_dict_get_or_null(xbt_action_queues, name);
 
   xbt_dynar_t myqueue = (xbt_dynar_t) xbt_dict_get_or_null(xbt_action_queues, name);
-  if (myqueue == NULL || xbt_dynar_is_empty(myqueue)) {      // nothing stored for me. Read the file further
-    if (xbt_action_fp == NULL) {    // File closed now. There's nothing more to read. I'm out of here
+  if (myqueue == nullptr || xbt_dynar_is_empty(myqueue)) {      // nothing stored for me. Read the file further
+    if (xbt_action_fp == nullptr) {    // File closed now. There's nothing more to read. I'm out of here
       goto todo_done;
     }
     // Read lines until I reach something for me (which breaks in loop body)
       goto todo_done;
     }
     // Read lines until I reach something for me (which breaks in loop body)
@@ -210,9 +210,9 @@ static char **action_get_action(char *name)
     while (xbt_getline(&action_line, &action_len, xbt_action_fp) != -1) {
       // cleanup and split the string I just read
       char *comment = strchr(action_line, '#');
     while (xbt_getline(&action_line, &action_len, xbt_action_fp) != -1) {
       // cleanup and split the string I just read
       char *comment = strchr(action_line, '#');
-      if (comment != NULL)
+      if (comment != nullptr)
         *comment = '\0';
         *comment = '\0';
-      xbt_str_trim(action_line, NULL);
+      xbt_str_trim(action_line, nullptr);
       if (action_line[0] == '\0')
         continue;
       /* we cannot split in place here because we parse&store several lines for
       if (action_line[0] == '\0')
         continue;
       /* we cannot split in place here because we parse&store several lines for
@@ -227,9 +227,9 @@ static char **action_get_action(char *name)
         // Else, I have to store it for the relevant colleague
         xbt_dynar_t otherqueue =
             (xbt_dynar_t) xbt_dict_get_or_null(xbt_action_queues, evtname);
         // Else, I have to store it for the relevant colleague
         xbt_dynar_t otherqueue =
             (xbt_dynar_t) xbt_dict_get_or_null(xbt_action_queues, evtname);
-        if (otherqueue == NULL) {       // Damn. Create the queue of that guy
+        if (otherqueue == nullptr) {       // Damn. Create the queue of that guy
           otherqueue = xbt_dynar_new(sizeof(xbt_dynar_t), xbt_dynar_free_voidp);
           otherqueue = xbt_dynar_new(sizeof(xbt_dynar_t), xbt_dynar_free_voidp);
-          xbt_dict_set(xbt_action_queues, evtname, otherqueue, NULL);
+          xbt_dict_set(xbt_action_queues, evtname, otherqueue, nullptr);
         }
         xbt_dynar_push(otherqueue, &evt);
       }
         }
         xbt_dynar_push(otherqueue, &evt);
       }
@@ -244,9 +244,9 @@ static char **action_get_action(char *name)
   // I did all my actions for me in the file (either I closed the file, or a colleague did)
   // Let's cleanup before leaving
 todo_done:
   // I did all my actions for me in the file (either I closed the file, or a colleague did)
   // Let's cleanup before leaving
 todo_done:
-  if (myqueue != NULL) {
+  if (myqueue != nullptr) {
     xbt_dynar_free(&myqueue);
     xbt_dict_remove(xbt_action_queues, name);
   }
     xbt_dynar_free(&myqueue);
     xbt_dict_remove(xbt_action_queues, name);
   }
-  return NULL;
+  return nullptr;
 }
 }
index 8a956b7..b1f9a38 100644 (file)
 /**  @brief Strip whitespace (or other characters) from the end of a string.
  *
  * Strips the whitespaces from the end of s.
 /**  @brief Strip whitespace (or other characters) from the end of a string.
  *
  * Strips the whitespaces from the end of s.
- * By default (when char_list=NULL), these characters get stripped:
+ * By default (when char_list=nullptr), these characters get stripped:
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  NULL.
+ *  - "\0"    (ASCII 0  (0x00))  nullptr.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip. Modified in place.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip. Modified in place.
@@ -59,13 +59,13 @@ void xbt_str_rtrim(char *s, const char *char_list)
 /**  @brief Strip whitespace (or other characters) from the beginning of a string.
  *
  * Strips the whitespaces from the begining of s.
 /**  @brief Strip whitespace (or other characters) from the beginning of a string.
  *
  * Strips the whitespaces from the begining of s.
- * By default (when char_list=NULL), these characters get stripped:
+ * By default (when char_list=nullptr), these characters get stripped:
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  NULL.
+ *  - "\0"    (ASCII 0  (0x00))  nullptr.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip. Modified in place.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip. Modified in place.
@@ -99,13 +99,13 @@ void xbt_str_ltrim(char *s, const char *char_list)
 /**  @brief Strip whitespace (or other characters) from the end and the begining of a string.
  *
  * Strips the whitespaces from both the beginning and the end of s.
 /**  @brief Strip whitespace (or other characters) from the end and the begining of a string.
  *
  * Strips the whitespaces from both the beginning and the end of s.
- * By default (when char_list=NULL), these characters get stripped:
+ * By default (when char_list=nullptr), these characters get stripped:
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  NULL.
+ *  - "\0"    (ASCII 0  (0x00))  nullptr.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  *
  * @param s The string to strip.
@@ -171,13 +171,13 @@ char *xbt_str_varsubst(const char *str, xbt_dict_t patterns)
  * @param s: the string to split
  * @param sep: a string of all chars to consider as separator.
  *
  * @param s: the string to split
  * @param sep: a string of all chars to consider as separator.
  *
- * By default (with sep=NULL), these characters are used as separator:
+ * By default (with sep=nullptr), these characters are used as separator:
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
  *
  *  - " "    (ASCII 32  (0x20))  space.
  *  - "\t"    (ASCII 9  (0x09))  tab.
  *  - "\n"    (ASCII 10  (0x0A))  line feed.
  *  - "\r"    (ASCII 13  (0x0D))  carriage return.
- *  - "\0"    (ASCII 0  (0x00))  NULL.
+ *  - "\0"    (ASCII 0  (0x00))  nullptr.
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  */
 xbt_dynar_t xbt_str_split(const char *s, const char *sep)
  *  - "\x0B"  (ASCII 11  (0x0B))  vertical tab.
  */
 xbt_dynar_t xbt_str_split(const char *s, const char *sep)
@@ -254,7 +254,7 @@ xbt_dynar_t xbt_str_split_str(const char *s, const char *sep)
     //get the start of the first occurence of the substring
     q = strstr(p, sep);
     //if substring was not found add the entire string
     //get the start of the first occurence of the substring
     q = strstr(p, sep);
     //if substring was not found add the entire string
-    if (NULL == q) {
+    if (nullptr == q) {
       v = strlen(p);
       to_push = (char*) xbt_malloc(v + 1);
       memcpy(to_push, p, v);
       v = strlen(p);
       to_push = (char*) xbt_malloc(v + 1);
       memcpy(to_push, p, v);
@@ -286,7 +286,7 @@ xbt_dynar_t xbt_str_split_str(const char *s, const char *sep)
  * pushes the address of each chunk in the resulting dynar. Yes, that's uneven. Yes, that's gory. But that's efficient.
  */
 xbt_dynar_t xbt_str_split_quoted_in_place(char *s) {
  * pushes the address of each chunk in the resulting dynar. Yes, that's uneven. Yes, that's gory. But that's efficient.
  */
 xbt_dynar_t xbt_str_split_quoted_in_place(char *s) {
-  xbt_dynar_t res = xbt_dynar_new(sizeof(char *), NULL);
+  xbt_dynar_t res = xbt_dynar_new(sizeof(char *), nullptr);
   char *beg, *end;              /* pointers around the parsed chunk */
   int in_simple_quote = 0, in_double_quote = 0;
   int done = 0;
   char *beg, *end;              /* pointers around the parsed chunk */
   int in_simple_quote = 0, in_double_quote = 0;
   int done = 0;
@@ -428,7 +428,7 @@ char *xbt_str_join(xbt_dynar_t dyn, const char *sep)
 
 /** @brief Join a set of strings as a single string
  *
 
 /** @brief Join a set of strings as a single string
  *
- * The parameter must be a NULL-terminated array of chars,
+ * The parameter must be a nullptr-terminated array of chars,
  * just like xbt_dynar_to_array() produces
  */
 char *xbt_str_join_array(const char *const *strs, const char *sep)
  * just like xbt_dynar_to_array() produces
  */
 char *xbt_str_join_array(const char *const *strs, const char *sep)
@@ -488,7 +488,7 @@ char *xbt_str_from_file(FILE * file)
 long int xbt_str_parse_int(const char* str, const char* error_msg)
 {
   char *endptr;
 long int xbt_str_parse_int(const char* str, const char* error_msg)
 {
   char *endptr;
-  if (str == NULL || str[0] == '\0')
+  if (str == nullptr || str[0] == '\0')
     THROWF(arg_error, 0, error_msg, str);
 
   long int res = strtol(str, &endptr, 10);
     THROWF(arg_error, 0, error_msg, str);
 
   long int res = strtol(str, &endptr, 10);
@@ -506,7 +506,7 @@ long int xbt_str_parse_int(const char* str, const char* error_msg)
 double xbt_str_parse_double(const char* str, const char* error_msg)
 {
   char *endptr;
 double xbt_str_parse_double(const char* str, const char* error_msg)
 {
   char *endptr;
-  if (str == NULL || str[0] == '\0')
+  if (str == nullptr || str[0] == '\0')
     THROWF(arg_error, 0, error_msg, str);
 
   double res = strtod(str, &endptr);
     THROWF(arg_error, 0, error_msg, str);
 
   double res = strtod(str, &endptr);
@@ -603,7 +603,7 @@ XBT_TEST_UNIT("xbt_str_parse", test_parse, "Test the parsing functions")
   test_parse_ok(xbt_str_parse_int, "Parse -1 as an int", rint, "-1", -1);
 
   test_parse_error(xbt_str_parse_int, "Parse int + noise", rint, "342 cruft");
   test_parse_ok(xbt_str_parse_int, "Parse -1 as an int", rint, "-1", -1);
 
   test_parse_error(xbt_str_parse_int, "Parse int + noise", rint, "342 cruft");
-  test_parse_error(xbt_str_parse_int, "Parse NULL as an int", rint, NULL);
+  test_parse_error(xbt_str_parse_int, "Parse nullptr as an int", rint, nullptr);
   test_parse_error(xbt_str_parse_int, "Parse '' as an int", rint, "");
   test_parse_error(xbt_str_parse_int, "Parse cruft as an int", rint, "cruft");
 
   test_parse_error(xbt_str_parse_int, "Parse '' as an int", rint, "");
   test_parse_error(xbt_str_parse_int, "Parse cruft as an int", rint, "cruft");
 
@@ -614,7 +614,7 @@ XBT_TEST_UNIT("xbt_str_parse", test_parse, "Test the parsing functions")
   test_parse_ok(xbt_str_parse_double, "Parse -1 as a double", rdouble, "-1", -1);
 
   test_parse_error(xbt_str_parse_double, "Parse double + noise", rdouble, "342 cruft");
   test_parse_ok(xbt_str_parse_double, "Parse -1 as a double", rdouble, "-1", -1);
 
   test_parse_error(xbt_str_parse_double, "Parse double + noise", rdouble, "342 cruft");
-  test_parse_error(xbt_str_parse_double, "Parse NULL as a double", rdouble, NULL);
+  test_parse_error(xbt_str_parse_double, "Parse nullptr as a double", rdouble, nullptr);
   test_parse_error(xbt_str_parse_double, "Parse '' as a double", rdouble, "");
   test_parse_error(xbt_str_parse_double, "Parse cruft as a double", rdouble, "cruft");
 }
   test_parse_error(xbt_str_parse_double, "Parse '' as a double", rdouble, "");
   test_parse_error(xbt_str_parse_double, "Parse cruft as a double", rdouble, "cruft");
 }