]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Replace NULL with nullptr.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 22 Jan 2019 14:01:31 +0000 (15:01 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 22 Jan 2019 14:01:31 +0000 (15:01 +0100)
communicator.cpp
deployment.cpp
main.cpp
msg_thread.cpp
named_object_list.h
options.cpp
process.cpp
sync_queue.h

index 2df6d76d9a04531e725aa1f9fb5fce8c538b95a1..bb48bd777bb2b217fe700ccbf7b6569a1a5fa311 100644 (file)
@@ -31,11 +31,11 @@ communicator::~communicator()
     msg_task_t task;
 
     XBT_DEBUG("send finalize to receiver/ctrl");
-    task = MSG_task_create("finalize", 0.0, 0, NULL);
+    task = MSG_task_create("finalize", 0.0, 0, nullptr);
     MSG_task_send(task, host->get_ctrl_mbox());
 
     XBT_DEBUG("send finalize to receiver/data");
-    task = MSG_task_create("finalize", 0.0, 0, NULL);
+    task = MSG_task_create("finalize", 0.0, 0, nullptr);
     MSG_task_send(task, host->get_data_mbox());
 
     receiver_thread->wait();
@@ -76,15 +76,15 @@ void communicator::real_flush(sent_comm_type& sent_comm, bool wait)
 
 void communicator::receiver()
 {
-    xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), NULL);
+    xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), nullptr);
     struct channel {
         msg_comm_t comm;
         msg_task_t task;
         const char* mbox;
         message_queue& received;
     };
-    channel chan[] = { { NULL, NULL, host->get_ctrl_mbox(), ctrl_received },
-                       { NULL, NULL, host->get_data_mbox(), data_received } };
+    channel chan[] = { { nullptr, nullptr, host->get_ctrl_mbox(), ctrl_received },
+                       { nullptr, nullptr, host->get_data_mbox(), data_received } };
     const int chan_size = (sizeof chan) / (sizeof chan[0]);
 
     for (int i = 0 ; i < chan_size ; ++i) {
@@ -105,15 +105,15 @@ void communicator::receiver()
         if (strcmp(MSG_task_get_name(ch->task), "finalize")) {
             XBT_DEBUG("received message on %s", ch->mbox);
             ch->received.push(ch->task);
-            ch->task = NULL;
+            ch->task = nullptr;
             ch->comm = MSG_task_irecv(&ch->task, ch->mbox);
             xbt_dynar_set_as(comms, index, msg_comm_t, ch->comm);
         } else {
             XBT_DEBUG("received finalize on %s", ch->mbox);
             MSG_task_destroy(ch->task);
-            ch->task = NULL;
-            ch->comm = NULL;
-            xbt_dynar_remove_at(comms, index, NULL);
+            ch->task = nullptr;
+            ch->comm = nullptr;
+            xbt_dynar_remove_at(comms, index, nullptr);
         }
 
     }
index 287ca4f88fb2432a5c7f710b52ed2dc7606bb379..0af3e3b214482d58e372d9b5f7e99856b5b3eb2a 100644 (file)
@@ -93,7 +93,7 @@ void deployment_generator::distribute_load()
 
 void deployment_generator::deploy()
 {
-    xbt_dynar_t args = xbt_dynar_new(sizeof(const char*), NULL);
+    xbt_dynar_t args = xbt_dynar_new(sizeof(const char*), nullptr);
     for (unsigned i = 0 ; i < hosts.size() ; ++i) {
         const char* hostname = hostdata::at(i).get_name();
         std::ostringstream oss;
index 64fa49f2d0ce547465acbe0916882766dad888f4..efeac389fea8aec6f92c4dc6dde2081153197719 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -181,7 +181,7 @@ static void install_signal_handler()
     action.sa_handler = signal_handler;
     sigemptyset(&action.sa_mask);
     action.sa_flags = SA_RESTART;
-    if (sigaction(SIGINT, &action, NULL) == -1) {
+    if (sigaction(SIGINT, &action, nullptr) == -1) {
         std::cerr << "ERROR: sigaction: " << strerror(errno) << "\n";
         exit(EXIT_FAILURE_OTHER);
     }
@@ -294,7 +294,7 @@ int main(int argc, char* argv[])
     simulated_time = MSG_get_clock();
     XBT_INFO("Simulation ended at %f.", simulated_time);
 
-    process::set_proc_mutex(NULL);
+    process::set_proc_mutex(nullptr);
     delete proc_cond;
     delete proc_mutex;
 
index 35ee01a4268eeaf476fe631155d85d43df8b9b5d..309d5734e672430c5870cf6a270a20509ff7ca17 100644 (file)
@@ -8,14 +8,14 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(thrd);
 
 msg_thread::msg_thread()
     : started(false)
-    , thread(NULL)
+    , thread(nullptr)
     , thread_name("msg_thread")
 {
 }
 
 msg_thread::msg_thread(const char* name)
     : started(false)
-    , thread(NULL)
+    , thread(nullptr)
     , thread_name(name)
 {
 }
@@ -61,7 +61,7 @@ int msg_thread::start_wrapper(int, char* [])
 
     XBT_DEBUG("terminate \"%s\"", self->thread_name.c_str());
     self->mutex.acquire();
-    self->thread = NULL;
+    self->thread = nullptr;
     self->cond.signal();
     self->mutex.release();
     return 0;
index 2c691faba198aec9b64e308e5535c3dbeff16628..7731a89f5d99e08d179b78e33c2f59f3f11d26f6 100644 (file)
@@ -65,7 +65,7 @@ public:
         if (it != assoc.end())
             return (*it->second)();
         else
-            return NULL;
+            return nullptr;
     }
 
     const std::string& get_name(iterator& it) const { return it->first; }
@@ -130,7 +130,7 @@ public:
         if (it != assoc.end())
             return (*it->second)(arg1, arg2);
         else
-            return NULL;
+            return nullptr;
     }
 
     const std::string& get_name(iterator& it) const { return it->first; }
index 76de43bb579eb5d885a1874bfcad98aed3745e69..006c83a9ffe966959e221ba6a81c54e580019353 100644 (file)
@@ -395,7 +395,7 @@ bool opt::parse_args(int* argc, char* argv[])
     }
 
     if (!opt::auto_depl::random_seed)
-        opt::auto_depl::random_seed = time(NULL);
+        opt::auto_depl::random_seed = time(nullptr);
 
     return result;
 }
index 76082c5742f8f9a819ba95fb20ce689ffa981fdc..38cec99c39da88882395f5a0ada5eade1b074c34 100644 (file)
@@ -249,7 +249,7 @@ void process::compute_loop()
         idle_duration += MSG_get_clock() - idle_since_date;
         ++comp_iter;
         double flops = opt::comp_cost(real_load);
-        msg_task_t task = MSG_task_create("computation", flops, 0.0, NULL);
+        msg_task_t task = MSG_task_create("computation", flops, 0.0, nullptr);
         // MSG_task_set_category(task, TRACE_CAT_COMP);
         XBT_DEBUG("compute %g flop%s", flops, ESSE(flops));
         MSG_task_execute(task);
index d400578c802e4b3acc5f1f3af9156bbb1bc6ffe3..55d2e7949933e756efd571c30f28762b552c37c3 100644 (file)
@@ -18,7 +18,7 @@ public:
     ~sync_queue()
     {
         node* n = head_node;
-        while (n != NULL) {
+        while (n != nullptr) {
             node* prev = n;
             n = n->next;
             delete prev;
@@ -84,7 +84,7 @@ public:
 
 private:
     struct node {
-        node(): next(NULL) { }
+        node(): next(nullptr) { }
         T values[SYNC_QUEUE_BUFSIZE];
         node* next;
     };