Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[TESHSUITE] NULL -> nullptr substitution
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Wed, 8 Jun 2016 21:22:15 +0000 (23:22 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 9 Jun 2016 07:40:52 +0000 (09:40 +0200)
I used the following command: (the '**' means recursion in ZSH)
sed -i -e 's/\([^_]\s*\)NULL/\1nullptr/g' src/**/*.cpp

We check for the underscore to avoid replacing MPI_*_NULL

teshsuite/mc/dwarf/dwarf.cpp
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/is-router/is-router.cpp
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp
teshsuite/surf/trace_usage/trace_usage.cpp

index 048984e..09ad40e 100644 (file)
@@ -68,7 +68,7 @@ static void test_local_variable(simgrid::mc::ObjectInformation* info, const char
 
   void* frame_base = subprogram->frame_base(*cursor);
   simgrid::dwarf::Location location = simgrid::dwarf::resolve(
-    var->location_list, info, cursor, frame_base, NULL, -1);
+    var->location_list, info, cursor, frame_base, nullptr, -1);
 
   xbt_assert(location.in_memory(),
     "Expected the variable %s of function %s to be in memory",
index 7bb5f30..bd48f32 100644 (file)
@@ -53,14 +53,14 @@ static void create_environment(xbt_os_timer_t parse_time, const char *platformFi
 
 int main(int argc, char **argv)
 {
-  char *platformFile = NULL;
+  char *platformFile = nullptr;
   int timings=0;
   int version = 4;
   unsigned int i;
-  xbt_dict_t props = NULL;
-  xbt_dict_cursor_t cursor = NULL;
-  xbt_lib_cursor_t cursor_src = NULL;
-  xbt_lib_cursor_t cursor_dst = NULL;
+  xbt_dict_t props = nullptr;
+  xbt_dict_cursor_t cursor = nullptr;
+  xbt_lib_cursor_t cursor_src = nullptr;
+  xbt_lib_cursor_t cursor_dst = nullptr;
   char *src,*dst,*key,*data;
   sg_netcard_t value1;
   sg_netcard_t value2;
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
       xbt_dict_foreach(host_list, cursor_dst, dst, host2){ //to host
         std::vector<Link*> *route = new std::vector<Link*>();
         value2 = sg_host_by_name(dst)->pimpl_netcard;
-        routing_platf->getRouteAndLatency(value1, value2, route,NULL);
+        routing_platf->getRouteAndLatency(value1, value2, route,nullptr);
         if (! route->empty()){
           printf("  <route src=\"%s\" dst=\"%s\">\n  ", src, dst);
           for (auto link: *route)
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
         if(value2->isRouter()){
           printf("  <route src=\"%s\" dst=\"%s\">\n  ", src, dst);
           std::vector<Link*> *route = new std::vector<Link*>();
-          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route,NULL);
+          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route,nullptr);
           for (auto link : *route)
             printf("<link_ctn id=\"%s\"/>",link->getName());
           delete route;
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
           if(value2->isRouter()){
             printf("  <route src=\"%s\" dst=\"%s\">\n  ", src, dst);
             std::vector<Link*> *route = new std::vector<Link*>();
-            routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route,NULL);
+            routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route,nullptr);
             for(auto link :*route)
               printf("<link_ctn id=\"%s\"/>",link->getName());
             delete route;
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
           printf("  <route src=\"%s\" dst=\"%s\">\n  ",src, dst);
           std::vector<Link*> *route = new std::vector<Link*>();
           value2 = sg_host_by_name(dst)->pimpl_netcard;
-          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route, NULL);
+          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,route, nullptr);
           for(auto link : *route)
             printf("<link_ctn id=\"%s\"/>",link->getName());
           delete route;
index 41e4be8..9e056dd 100644 (file)
@@ -12,7 +12,7 @@ int main(int argc, char **argv)
 {
   /* SD initialization */
   int size;
-  xbt_lib_cursor_t cursor = NULL;
+  xbt_lib_cursor_t cursor = nullptr;
   char *key, *data;
 
   SD_init(&argc, argv);
index d15eaf3..fadbaa6 100644 (file)
@@ -88,15 +88,15 @@ static double diff_lagrange_test_1(double x)
 
 static void test1(method_t method)
 {
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t L1 = NULL;
-  lmm_constraint_t L2 = NULL;
-  lmm_constraint_t L3 = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t L1 = nullptr;
+  lmm_constraint_t L2 = nullptr;
+  lmm_constraint_t L3 = nullptr;
 
-  lmm_variable_t R_1_2_3 = NULL;
-  lmm_variable_t R_1 = NULL;
-  lmm_variable_t R_2 = NULL;
-  lmm_variable_t R_3 = NULL;
+  lmm_variable_t R_1_2_3 = nullptr;
+  lmm_variable_t R_1 = nullptr;
+  lmm_variable_t R_2 = nullptr;
+  lmm_variable_t R_3 = nullptr;
 
   double a = 1.0, b = 10.0;
 
@@ -205,12 +205,12 @@ static void test1(method_t method)
 
 static void test2(method_t method)
 {
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t CPU1 = NULL;
-  lmm_constraint_t CPU2 = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t CPU1 = nullptr;
+  lmm_constraint_t CPU2 = nullptr;
 
-  lmm_variable_t T1 = NULL;
-  lmm_variable_t T2 = NULL;
+  lmm_variable_t T1 = nullptr;
+  lmm_variable_t T2 = nullptr;
 
   if (method == LAGRANGE_VEGAS)
     lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi);
@@ -258,9 +258,9 @@ static void test3(method_t method)
 
   double **A;
 
-  lmm_system_t Sys = NULL;
-  lmm_constraint_t *tmp_cnst = NULL;
-  lmm_variable_t *tmp_var = NULL;
+  lmm_system_t Sys = nullptr;
+  lmm_constraint_t *tmp_cnst = nullptr;
+  lmm_variable_t *tmp_var = nullptr;
   char **tmp_name;
 
   /*array to add the the constraints of fictitious variables */
index 133e392..949c7be 100644 (file)
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
 
   surf_solve(-1.0);
   do {
-    surf_action_t action = NULL;
+    surf_action_t action = nullptr;
     now = surf_get_clock();
     XBT_INFO("Next Event : %g", now);
     XBT_DEBUG("\t CPU actions");
index 2308198..5683d9e 100644 (file)
@@ -17,8 +17,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
 int main(int argc, char **argv)
 {
-  sg_host_t hostA = NULL;
-  sg_host_t hostB = NULL;
+  sg_host_t hostA = nullptr;
+  sg_host_t hostB = nullptr;
   double now = -1.0;
   int running;
 
@@ -47,9 +47,9 @@ int main(int argc, char **argv)
 
   surf_solve(-1.0);                 /* Takes traces into account. Returns 0.0 */
   do {
-    surf_action_t action = NULL;
+    surf_action_t action = nullptr;
     unsigned int iter;
-    surf_model_t model = NULL;
+    surf_model_t model = nullptr;
     running = 0;
 
     now = surf_get_clock();
index 30a48c4..eae571f 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
   tmgr_trace_t trace_B = tmgr_trace_new_from_file("trace_B.txt");
   double next_event_date = -1.0;
   double value = -1.0;
-  simgrid::surf::Resource *resource = NULL;
+  simgrid::surf::Resource *resource = nullptr;
   simgrid::surf::Resource *hostA = new DummyTestResource("Host A");
   simgrid::surf::Resource *hostB = new DummyTestResource("Host B");