[pan] replaced in tasks



commit 15c860c0e1ad768c6810292836e144043f0d30e6
Author: Thomas Tanner <thosrtanner googlemail com>
Date:   Fri Sep 30 19:43:14 2022 +0100

    replaced in tasks

 pan/tasks/decoder.cc             |  6 ++---
 pan/tasks/encoder.cc             |  4 +--
 pan/tasks/nntp-pool.cc           | 18 ++++++-------
 pan/tasks/nntp.cc                |  4 +--
 pan/tasks/nzb.cc                 | 14 +++++-----
 pan/tasks/queue.cc               | 24 ++++++++---------
 pan/tasks/socket-impl-gio.cc     | 28 ++++++++++----------
 pan/tasks/socket-impl-main.cc    |  2 +-
 pan/tasks/socket-impl-openssl.cc | 56 ++++++++++++++++++++--------------------
 pan/tasks/socket.cc              |  6 ++---
 pan/tasks/task-article.cc        | 12 ++++-----
 pan/tasks/task-upload.cc         |  8 +++---
 pan/tasks/task-xover.cc          | 14 +++++-----
 13 files changed, 98 insertions(+), 98 deletions(-)
---
diff --git a/pan/tasks/decoder.cc b/pan/tasks/decoder.cc
index f163406..5c290ed 100644
--- a/pan/tasks/decoder.cc
+++ b/pan/tasks/decoder.cc
@@ -109,7 +109,7 @@ Decoder :: do_work()
     {
       if (was_cancelled()) break; // poll WorkerPool::Worker stop flag
 
-      gchar * contents (0);
+      gchar * contents (nullptr);
       gsize length (0);
       if (g_file_get_contents (it->c_str(), &contents, &length, NULL) && length>0)
       {
@@ -163,7 +163,7 @@ Decoder :: do_work()
         if (options == TaskArticle::SAVE_ALL && !article_subject.empty()) {
           global_subject = article_subject.c_str();
         }
-        if ((res = UULoadFileWithPartNo (const_cast<char*>(it->c_str()), 0, 0, ++i, global_subject)) != 
UURET_OK) {
+        if ((res = UULoadFileWithPartNo (const_cast<char*>(it->c_str()), nullptr, 0, ++i, global_subject)) 
!= UURET_OK) {
           g_snprintf(buf, bufsz,
                      _("Error reading from %s: %s"),
                      it->c_str(),
@@ -248,7 +248,7 @@ void
 Decoder :: uu_log (void* data, char* message, int severity)
 {
   Decoder *self = static_cast<Decoder *>(data);
-  char * pch (g_locale_to_utf8 (message, -1, 0, 0, 0));
+  char * pch (g_locale_to_utf8 (message, -1, nullptr, nullptr, nullptr));
 
   if (severity >= UUMSG_WARNING)
     self->file_errors.push_back (pch ? pch : message);
diff --git a/pan/tasks/encoder.cc b/pan/tasks/encoder.cc
index 1573121..7523152 100644
--- a/pan/tasks/encoder.cc
+++ b/pan/tasks/encoder.cc
@@ -166,7 +166,7 @@ Encoder :: do_work()
         continue;
       }
 
-      res = UUEncodePartial_byFSize (fp, NULL, (char*)filename.c_str(), YENC_ENCODED , 
(char*)basename.c_str(), 0, 0, cnt, bpf ,&crc);
+      res = UUEncodePartial_byFSize (fp, NULL, (char*)filename.c_str(), YENC_ENCODED , 
(char*)basename.c_str(), nullptr, 0, cnt, bpf ,&crc);
 
       if (fp) fclose(fp);
       if (res != UURET_CONT && res != UURET_OK) break;
@@ -206,7 +206,7 @@ Encoder :: uu_log (void* data, char* message, int severity)
 {
   Encoder *self = static_cast<Encoder *>(data);
   if (self->was_cancelled()) return;
-  char * pch (g_locale_to_utf8 (message, -1, 0, 0, 0));
+  char * pch (g_locale_to_utf8 (message, -1, nullptr, nullptr, nullptr));
 
   if (severity >= UUMSG_WARNING)
     self->file_errors.push_back (pch ? pch : message);
diff --git a/pan/tasks/nntp-pool.cc b/pan/tasks/nntp-pool.cc
index d693b82..434881f 100644
--- a/pan/tasks/nntp-pool.cc
+++ b/pan/tasks/nntp-pool.cc
@@ -69,13 +69,13 @@ NNTP_Pool :: ~NNTP_Pool ()
 bool
 NNTP_Pool :: new_connections_are_allowed () const
 {
-  return _time_to_allow_new_connections <= time(0);
+  return _time_to_allow_new_connections <= time(nullptr);
 }
 
 void
 NNTP_Pool :: disallow_new_connections_for_n_seconds (int n)
 {
-  _time_to_allow_new_connections = time(0) + n;
+  _time_to_allow_new_connections = time(nullptr) + n;
 }
 
 void
@@ -107,7 +107,7 @@ NNTP_Pool :: kill_tasks ()
 NNTP*
 NNTP_Pool :: check_out ()
 {
-  NNTP * nntp (0);
+  NNTP * nntp (nullptr);
 
   foreach (pool_items_t, _pool_items, it) {
     debug("pool item "<<it->is_checked_in<<" "<<it->nntp);
@@ -246,20 +246,20 @@ NNTP_Pool :: on_nntp_done (NNTP* nntp, Health health, const StringView& response
    {
       delete nntp->_socket;
       delete nntp;
-      nntp = 0;
+      nntp = nullptr;
    }
 
    --_pending_connections;
 
    // if success...
-   if (nntp != 0)
+   if (nntp != nullptr)
    {
       debug ("success with handshake to " << _server << ", nntp " << nntp);
 
       PoolItem i;
       i.nntp = nntp;
       i.is_checked_in = true;
-      i.last_active_time = time (0);
+      i.last_active_time = time (nullptr);
       _pool_items.push_back (i);
 
       fire_pool_has_nntp_available ();
@@ -335,9 +335,9 @@ NNTP_Pool :: idle_upkeep ()
 {
   for (;;)
   {
-    PoolItem * item (0);
+    PoolItem * item (nullptr);
 
-    const time_t now (time (0));
+    const time_t now (time (nullptr));
     foreach (pool_items_t, _pool_items, it) {
       if (it->is_checked_in && ((now - it->last_active_time) > MAX_IDLE_SECS)) {
         item = &*it;
@@ -359,7 +359,7 @@ NNTP_Pool :: idle_upkeep ()
       item->nntp->goodbye (new NoopListener (this, true));
     else
       item->nntp->noop (new NoopListener (this, false));
-    item = 0;
+    item = nullptr;
   }
 }
 
diff --git a/pan/tasks/nntp.cc b/pan/tasks/nntp.cc
index 2774bdf..3a174e7 100644
--- a/pan/tasks/nntp.cc
+++ b/pan/tasks/nntp.cc
@@ -88,7 +88,7 @@ NNTP :: fire_done_func (Health health, const StringView& response)
       Listener * l = _listener;
       debug ("I (" << (void*)this << ") am setting my _listener to 0");
       _compression = false;
-      _listener = 0;
+      _listener = nullptr;
       l->on_nntp_done (this, health, response);
    }
 }
@@ -123,7 +123,7 @@ NNTP :: on_socket_response (Socket * sock UNUSED, const StringView& line_in)
          if (line.len>=2 && line.str[0]=='.' && line.str[1]=='.') // rfc 977: 2.4.1
             line.rtruncate (line.len-1);
 
-         assert (_listener != 0);
+         assert (_listener != nullptr);
          if (_listener)
             _listener->on_nntp_line (this, line);
       }
diff --git a/pan/tasks/nzb.cc b/pan/tasks/nzb.cc
index c365a76..a39e238 100644
--- a/pan/tasks/nzb.cc
+++ b/pan/tasks/nzb.cc
@@ -127,7 +127,7 @@ namespace
       for (const char **k(attribute_names), **v(attribute_vals); *k; ++k, ++v) {
              if (!strcmp (*k,"poster"))  mc.a.author = *v;
         else if (!strcmp (*k,"subject")) mc.a.subject = *v;
-        else if (!strcmp (*k,"date"))    mc.a.time_posted = strtoul(*v,0,10);
+        else if (!strcmp (*k,"date"))    mc.a.time_posted = strtoul(*v,nullptr,10);
       }
     }
     else if (!strcmp (element_name, "segments")) {
@@ -137,7 +137,7 @@ namespace
       mc.bytes = 0;
       mc.number = 0;
       for (const char **k(attribute_names), **v(attribute_vals); *k; ++k, ++v) {
-             if (!strcmp (*k,"bytes"))  mc.bytes  = strtoul (*v,0,10);
+             if (!strcmp (*k,"bytes"))  mc.bytes  = strtoul (*v,nullptr,10);
         else if (!strcmp (*k,"number")) mc.number = atoi (*v);
       }
     }
@@ -184,7 +184,7 @@ namespace
       }
       const StringView p (mc.path.empty() ? mc.fallback_path : StringView(mc.path));
       /// TODO get action mark read from prefs (?)
-      TaskArticle* a = new TaskArticle (mc.ranks, mc.gs, mc.a, mc.cache, mc.read, TaskArticle::NO_ACTION, 0, 
TaskArticle::DECODE, p);
+      TaskArticle* a = new TaskArticle (mc.ranks, mc.gs, mc.a, mc.cache, mc.read, TaskArticle::NO_ACTION, 
nullptr, TaskArticle::DECODE, p);
       if (mc.paused == "1")
         a->set_start_paused(true);
       mc.tasks.push_back (a);
@@ -218,11 +218,11 @@ NZB :: tasks_from_nzb_string (const StringView      & nzb_in,
   p.start_element = start_element;
   p.end_element = end_element;
   p.text = text;
-  p.passthrough = 0;
-  p.error = 0;
+  p.passthrough = nullptr;
+  p.error = nullptr;
   GMarkupParseContext* c (
-    g_markup_parse_context_new (&p, (GMarkupParseFlags)0, &mc, 0));
-  GError * gerr (0);
+    g_markup_parse_context_new (&p, (GMarkupParseFlags)0, &mc, nullptr));
+  GError * gerr (nullptr);
   g_markup_parse_context_parse (c, nzb.c_str(), nzb.size(), &gerr);
   if (gerr) {
     Log::add_urgent (gerr->message);
diff --git a/pan/tasks/queue.cc b/pan/tasks/queue.cc
index d485e95..e830ce6 100644
--- a/pan/tasks/queue.cc
+++ b/pan/tasks/queue.cc
@@ -54,8 +54,8 @@ Queue :: Queue (ServerInfo         & server_info,
   _worker_pool (pool),
   _decoder (pool),
   _encoder (pool),
-  _decoder_task (0),
-  _encoder_task (0),
+  _decoder_task (nullptr),
+  _encoder_task (nullptr),
   _save_delay_secs (save_delay_secs),
   _needs_saving (false),
   _last_time_saved (0),
@@ -93,7 +93,7 @@ void
 Queue :: on_pool_has_nntp_available (const Quark& server)
 {
   Task * task = find_first_task_needing_server (server);
-  if (task != 0)
+  if (task != nullptr)
     process_task (task);
 }
 
@@ -106,7 +106,7 @@ Queue :: on_pool_error (const Quark& server UNUSED, const StringView& message)
 NNTP_Pool&
 Queue :: get_pool (const Quark& servername)
 {
-  NNTP_Pool * pool (0);
+  NNTP_Pool * pool (nullptr);
 
   pools_t::iterator it (_pools.find (servername));
   if (it != _pools.end())
@@ -141,11 +141,11 @@ Queue :: clean_n_save ()
 
   // maybe save the task list.
   // only do it once in awhile to prevent thrashing.
-  const time_t now (time(0));
+  const time_t now (time(nullptr));
   if (_needs_saving && _last_time_saved<(now-_save_delay_secs)) {
     _archive.save_tasks (tmp);
     _needs_saving = false;
-    _last_time_saved = time(0);
+    _last_time_saved = time(nullptr);
   }
 }
 
@@ -287,7 +287,7 @@ Queue :: give_task_a_download_slot (TaskArticle* task)
 void
 Queue :: process_task (Task * task)
 {
-  pan_return_if_fail (task != 0);
+  pan_return_if_fail (task != nullptr);
 
   debug ("in process_task with a task of type " << task->get_type());
 
@@ -387,7 +387,7 @@ Queue :: find_first_task_needing_decoder ()
       return *it;
   }
 
-  return 0;
+  return nullptr;
 }
 
 Task*
@@ -401,7 +401,7 @@ Queue :: find_first_task_needing_encoder ()
       return *it;
   }
 
-  return 0;
+  return nullptr;
 }
 
 Task*
@@ -418,7 +418,7 @@ Queue :: find_first_task_needing_server (const Quark& server)
       return *it;
   }
 
-  return 0;
+  return nullptr;
 }
 
 bool
@@ -791,7 +791,7 @@ void
 Queue :: check_in (Decoder* decoder UNUSED, Task* task)
 {
   // take care of our decoder counting...
-  _decoder_task = 0;
+  _decoder_task = nullptr;
 
   // notify the listeners if the task isn't active anymore...
   if (!task_is_active (task))
@@ -818,7 +818,7 @@ void
 Queue :: check_in (Encoder* encoder UNUSED, Task* task)
 {
   // take care of our decoder counting...
-  _encoder_task = 0;
+  _encoder_task = nullptr;
 
   // notify the listeners if the task isn't active anymore...
   if (!task_is_active (task))
diff --git a/pan/tasks/socket-impl-gio.cc b/pan/tasks/socket-impl-gio.cc
index 9b14232..b648f40 100644
--- a/pan/tasks/socket-impl-gio.cc
+++ b/pan/tasks/socket-impl-gio.cc
@@ -128,13 +128,13 @@ namespace
       err = WSAGetLastError();
       if (err || !ans) {
         setme_err = get_last_error (err, hpbuf);
-        return 0;
+        return nullptr;
       }
 
       // try opening the socket
       sockfd = socket (AF_INET, SOCK_STREAM, 0 /*IPPROTO_TCP*/);
       if (sockfd < 0)
-        return 0;
+        return nullptr;
 
       // Try connecting
       int i = 0;
@@ -154,7 +154,7 @@ namespace
       if (err) {
         closesocket (sockfd);
         setme_err = get_last_error (err, hpbuf);
-        return 0;
+        return nullptr;
       }
     }
     else
@@ -177,7 +177,7 @@ namespace
           setme_err += file :: pan_strerror (errno);
           setme_err += ")";
         }
-        return 0;
+        return nullptr;
       }
 
       // try to open a socket on any ipv4 or ipv6 addresses we found
@@ -215,10 +215,10 @@ namespace
         setme_err += file :: pan_strerror (errno);
         setme_err += ")";
       }
-      return 0;
+      return nullptr;
     }
 
-    GIOChannel * channel (0);
+    GIOChannel * channel (nullptr);
 #ifndef G_OS_WIN32
     channel = g_io_channel_unix_new (sockfd);
     g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, NULL);
@@ -239,10 +239,10 @@ namespace
 ****/
 
 GIOChannelSocket :: GIOChannelSocket ():
-   _channel (0),
+   _channel (nullptr),
    _tag_watch (0),
    _tag_timeout (0),
-   _listener (0),
+   _listener (nullptr),
    _out_buf (g_string_new (NULL)),
    _in_buf (g_string_new (NULL)),
    _io_performed (false)
@@ -271,14 +271,14 @@ GIOChannelSocket :: ~GIOChannelSocket ()
   {
     g_io_channel_shutdown (_channel, TRUE, NULL);
     g_io_channel_unref (_channel);
-    _channel = 0;
+    _channel = nullptr;
   }
 
   g_string_free (_out_buf, TRUE);
-  _out_buf = 0;
+  _out_buf = nullptr;
 
   g_string_free (_in_buf, TRUE);
-  _in_buf = 0;
+  _in_buf = nullptr;
 }
 
 bool
@@ -294,7 +294,7 @@ GIOChannelSocket :: open (const StringView& address, int port, std::string& setm
    _id = g_io_channel_unix_get_fd(_channel);
 #endif // G_OS_WIN32
   }
-  return _channel != 0;
+  return _channel != nullptr;
 }
 
 void
@@ -325,7 +325,7 @@ GIOChannelSocket :: do_read ()
 {
   g_assert (!_out_buf->len);
 
-  GError * err (0);
+  GError * err (nullptr);
   GString * g (_in_buf);
 
   bool more (true);
@@ -383,7 +383,7 @@ GIOChannelSocket :: do_write ()
 #endif
 
   _io_performed = true;
-  GError * err = 0;
+  GError * err = nullptr;
   gsize out = 0;
   GIOStatus status = g->len
     ? g_io_channel_write_chars (_channel, g->str, g->len, &out, &err)
diff --git a/pan/tasks/socket-impl-main.cc b/pan/tasks/socket-impl-main.cc
index 6483d3d..782be4c 100644
--- a/pan/tasks/socket-impl-main.cc
+++ b/pan/tasks/socket-impl-main.cc
@@ -81,7 +81,7 @@ namespace
 
     ThreadWorker (ServerInfo& d, const Quark& s, const StringView& h, int p, Socket::Creator::Listener *l,
                   bool ssl, CertStore& cs):
-      data(d), server(s), host(h), port(p), listener(l), ok(false), socket(0), use_ssl(ssl), store(cs) {}
+      data(d), server(s), host(h), port(p), listener(l), ok(false), socket(nullptr), use_ssl(ssl), store(cs) 
{}
 
     void do_work ()
     {
diff --git a/pan/tasks/socket-impl-openssl.cc b/pan/tasks/socket-impl-openssl.cc
index 11d74d3..ad7addb 100644
--- a/pan/tasks/socket-impl-openssl.cc
+++ b/pan/tasks/socket-impl-openssl.cc
@@ -125,12 +125,12 @@ namespace
 
 GIOChannelSocketGnuTLS :: GIOChannelSocketGnuTLS (ServerInfo& data, const Quark& server, CertStore& cs):
    _data(data),
-   _channel (0),
+   _channel (nullptr),
    _tag_watch (0),
    _tag_timeout (0),
-   _listener (0),
-   _out_buf (g_string_new (0)),
-   _in_buf (g_string_new (0)),
+   _listener (nullptr),
+   _out_buf (g_string_new (nullptr)),
+   _in_buf (g_string_new (nullptr)),
    _io_performed (false),
    _certstore(cs),
    _server(server),
@@ -168,13 +168,13 @@ GIOChannelSocketGnuTLS :: create_channel (const StringView& host_in, int port, s
     err = WSAGetLastError();
     if (err || !ans) {
       setme_err = get_last_error (err, hpbuf);
-      return 0;
+      return nullptr;
     }
 
     // try opening the socket
     sockfd = socket (AF_INET, SOCK_STREAM, 0 /*IPPROTO_TCP*/);
     if (sockfd < 0)
-      return 0;
+      return nullptr;
 
     // Try connecting
     int i = 0;
@@ -195,7 +195,7 @@ GIOChannelSocketGnuTLS :: create_channel (const StringView& host_in, int port, s
     if (err) {
       closesocket (sockfd);
       setme_err = get_last_error (err, hpbuf);
-      return 0;
+      return nullptr;
     }
   }
   else
@@ -218,7 +218,7 @@ GIOChannelSocketGnuTLS :: create_channel (const StringView& host_in, int port, s
         setme_err += file :: pan_strerror (errno);
         setme_err += ")";
       }
-      return 0;
+      return nullptr;
     }
 
     // try to open a socket on any ipv4 or ipv6 addresses we found
@@ -256,18 +256,18 @@ GIOChannelSocketGnuTLS :: create_channel (const StringView& host_in, int port, s
       setme_err += file :: pan_strerror (errno);
       setme_err += ")";
     }
-    return 0;
+    return nullptr;
   }
 
-  GIOChannel * channel (0);
+  GIOChannel * channel (nullptr);
 #ifndef G_OS_WIN32
   channel = g_io_channel_unix_new (sockfd);
   g_io_channel_set_flags (channel, G_IO_FLAG_NONBLOCK, 0);
 #else
   channel = g_io_channel_win32_new_socket (sockfd);
 #endif
-  if (g_io_channel_get_encoding (channel) != 0)
-    g_io_channel_set_encoding (channel, 0, 0);
+  if (g_io_channel_get_encoding (channel) != nullptr)
+    g_io_channel_set_encoding (channel, nullptr, nullptr);
   g_io_channel_set_buffered (channel,true);
   g_io_channel_set_line_term (channel, "\n", 1);
   GIOChannel* ret (gnutls_get_iochannel(channel, host_in.str));
@@ -325,17 +325,17 @@ GIOChannelSocketGnuTLS :: ~GIOChannelSocketGnuTLS ()
 
   if (_channel)
   {
-    g_io_channel_shutdown (_channel, true, 0);
+    g_io_channel_shutdown (_channel, true, nullptr);
     g_string_free(_channel->read_buf,true);
     _gnutls_free(_channel);
-    _channel = 0;
+    _channel = nullptr;
   }
 
   g_string_free (_out_buf, true);
-  _out_buf = 0;
+  _out_buf = nullptr;
 
   g_string_free (_in_buf, true);
-  _in_buf = 0;
+  _in_buf = nullptr;
 }
 
 bool
@@ -351,7 +351,7 @@ GIOChannelSocketGnuTLS :: open  (const StringView& address, int port, std::strin
       _id = g_io_channel_unix_get_fd(_channel);
 #endif // G_OS_WIN32
   }
-  return _channel != 0;
+  return _channel != nullptr;
 }
 
 void
@@ -603,7 +603,7 @@ GIOChannelSocketGnuTLS :: do_read ()
 {
   g_assert (!_out_buf->len);
 
-  GError * err (0);
+  GError * err (nullptr);
   GString * g (_in_buf);
 
   bool more (true);
@@ -640,7 +640,7 @@ GIOChannelSocketGnuTLS :: do_read ()
     {
       const char * msg (err ? err->message : _("Unknown Error"));
       Log::add_err_va (_("Error reading from %s: %s"), _host.c_str(), msg);
-      if (err != 0)
+      if (err != nullptr)
         g_clear_error (&err);
       return IO_ERR;
     }
@@ -665,7 +665,7 @@ GIOChannelSocketGnuTLS :: do_write ()
 #endif
 
   _io_performed = true;
-  GError * err = 0;
+  GError * err = nullptr;
   gsize out = 0;
   GIOStatus status = g->len
     ? gnutls_write_line(_channel, g->str, g->len, &out, &err)
@@ -790,21 +790,21 @@ GIOChannel *
 GIOChannelSocketGnuTLS :: gnutls_get_iochannel(GIOChannel* channel, const char* host, gboolean verify)
 {
 
-  g_return_val_if_fail(channel, 0);
+  g_return_val_if_fail(channel, nullptr);
 
-       GIOGnuTLSChannel *chan(0);
-       GIOChannel *gchan(0);
+       GIOGnuTLSChannel *chan(nullptr);
+       GIOChannel *gchan(nullptr);
        int fd(0);
 
        chan = g_new0(GIOGnuTLSChannel, 1);
-       g_return_val_if_fail(chan, 0);
+       g_return_val_if_fail(chan, nullptr);
 
   gnutls_session_t session(NULL);
 
-       if(!(fd = g_io_channel_unix_get_fd(channel))) return 0;
+       if(!(fd = g_io_channel_unix_get_fd(channel))) return nullptr;
 
-  if (gnutls_init (&session, GNUTLS_CLIENT) != 0) return 0;
-  if (gnutls_set_default_priority (session) != 0) return 0;
+  if (gnutls_init (&session, GNUTLS_CLIENT) != 0) return nullptr;
+  if (gnutls_set_default_priority (session) != 0) return nullptr;
 
   gnutls_priority_set_direct (
   session,
@@ -837,7 +837,7 @@ GIOChannelSocketGnuTLS :: gnutls_get_iochannel(GIOChannel* channel, const char*
 
   set_blocking(session, false);
 
-  return 0;
+  return nullptr;
 }
 
 void
diff --git a/pan/tasks/socket.cc b/pan/tasks/socket.cc
index 2c7a28d..9a928e9 100644
--- a/pan/tasks/socket.cc
+++ b/pan/tasks/socket.cc
@@ -30,7 +30,7 @@ using namespace pan;
 
 Socket :: Socket ():
   _bytes_since_last_check (0),
-  _time_of_last_check (time(0)),
+  _time_of_last_check (time(nullptr)),
   _speed_KiBps (0.0),
   _abort_flag (false),
   _id(0)
@@ -55,7 +55,7 @@ Socket :: is_abort_set () const
 double
 Socket :: get_speed_KiBps () const
 {
-  const time_t now (time(0));
+  const time_t now (time(nullptr));
 
   if (now > _time_of_last_check)
   {
@@ -75,7 +75,7 @@ Socket :: get_speed_KiBps () const
 void
 Socket :: reset_speed_counter ()
 {
-  _time_of_last_check = time(0);
+  _time_of_last_check = time(nullptr);
   _bytes_since_last_check = 0;
 }
 
diff --git a/pan/tasks/task-article.cc b/pan/tasks/task-article.cc
index bcde086..7140ddb 100644
--- a/pan/tasks/task-article.cc
+++ b/pan/tasks/task-article.cc
@@ -101,7 +101,7 @@ TaskArticle :: TaskArticle (const ServerRank          & server_rank,
   _attachment(filename),
   _mark_read_action (mark_read_action),
   _save_mode (save_mode),
-  _decoder(0),
+  _decoder(nullptr),
   _decoder_has_run (false),
   _groups(get_groups_str(article)),
   _options(options),
@@ -110,7 +110,7 @@ TaskArticle :: TaskArticle (const ServerRank          & server_rank,
 
   cache.reserve (article.get_part_mids());
 
-  if (listener != 0)
+  if (listener != nullptr)
     add_listener (listener);
 
   // build a list of all the parts we need to download.
@@ -221,9 +221,9 @@ void
 TaskArticle :: use_nntp (NNTP * nntp)
 {
   // find which part, if any, can use this nntp
-  Needed * needed (0);
+  Needed * needed (nullptr);
   for (needed_t::iterator it(_needed.begin()), end(_needed.end()); !needed && it!=end; ++it)
-    if (it->nntp==0 && it->xref.has_server(nntp->_server) && (it->rank <= _server_rank.get_server_rank 
(nntp->_server)))
+    if (it->nntp==nullptr && it->xref.has_server(nntp->_server) && (it->rank <= _server_rank.get_server_rank 
(nntp->_server)))
       needed = &*it;
 
   if (!needed)
@@ -258,7 +258,7 @@ TaskArticle :: on_nntp_line  (NNTP               * nntp,
                               const StringView   & line_in)
 {
   // FIXME: ugh, this is called for _every line_...
-  Needed * needed (0);
+  Needed * needed (nullptr);
   foreach (needed_t, _needed, it) {
     if (it->nntp == nntp) {
       needed = &*it;
@@ -414,7 +414,7 @@ TaskArticle :: on_worker_done (bool cancelled)
   }
 
   Decoder * d (_decoder);
-  _decoder = 0;
+  _decoder = nullptr;
   update_work ();
   check_in (d);
 }
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index 5ae6245..56d414e 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -94,7 +94,7 @@ TaskUpload :: TaskUpload (const std::string         & filename,
                           Progress::Listener        * listener):
   Task ("UPLOAD", get_description(filename.c_str())),
   _server(server),
-  _encoder(0),
+  _encoder(nullptr),
   _encoder_has_run (false),
   _filename(filename),
   _basename (g_get_basename(filename.c_str())),
@@ -226,10 +226,10 @@ void
 TaskUpload :: use_nntp (NNTP * nntp)
 {
 
-  Needed * needed (0);
+  Needed * needed (nullptr);
   foreach (needed_t, _needed, nit)
   {
-      if (nit->second.nntp==0)
+      if (nit->second.nntp==nullptr)
       {
         needed = &nit->second;
         break;
@@ -449,7 +449,7 @@ TaskUpload :: on_worker_done (bool cancelled)
   }
 
   Encoder * d (_encoder);
-  _encoder = 0;
+  _encoder = nullptr;
   update_work ();
   check_in (d);
 
diff --git a/pan/tasks/task-xover.cc b/pan/tasks/task-xover.cc
index 445450c..77428d1 100644
--- a/pan/tasks/task-xover.cc
+++ b/pan/tasks/task-xover.cc
@@ -99,7 +99,7 @@ TaskXOver::TaskXOver(Data & data, const Quark & group, Mode mode, unsigned long
   _short_group_name(get_short_name(StringView(group.c_str()))),
   _mode(mode),
   _sample_size(sample_size),
-  _days_cutoff(mode == DAYS ? (time(0) - (sample_size * 24 * 60 * 60)) : 0),
+  _days_cutoff(mode == DAYS ? (time(nullptr) - (sample_size * 24 * 60 * 60)) : 0),
   _group_xover_is_reffed(false),
   _bytes_so_far(0),
   _parts_so_far(0ul),
@@ -299,7 +299,7 @@ namespace
     if (!view.empty())
       {
         errno = 0;
-        ul = strtoul(view.str, 0, 10);
+        ul = strtoul(view.str, nullptr, 10);
         if (errno)
           ul = 0ul;
       }
@@ -311,7 +311,7 @@ namespace
   header_is_nonencoded_utf8(const StringView& in)
   {
     const bool is_nonencoded(!in.strstr("=?"));
-    const bool is_utf8(g_utf8_validate(in.str, in.len, 0));
+    const bool is_utf8(g_utf8_validate(in.str, in.len, nullptr));
     return is_nonencoded && is_utf8;
   }
 }
@@ -341,7 +341,7 @@ void
 TaskXOver::on_nntp_line_process(NNTP * nntp, const StringView & line)
 {
 
-  pan_return_if_fail(nntp != 0);
+  pan_return_if_fail(nntp != nullptr);
   pan_return_if_fail(!nntp->_server.empty());
   pan_return_if_fail(!nntp->_group.empty());
 
@@ -399,7 +399,7 @@ TaskXOver::on_nntp_line_process(NNTP * nntp, const StringView & line)
 
   if (xref.len > 6 && !strncmp(xref.str, "Xref: ", 6))
     {
-      xref = xref.substr(xref.str + 6, 0);
+      xref = xref.substr(xref.str + 6, nullptr);
       xref.trim();
     }
 
@@ -416,7 +416,7 @@ TaskXOver::on_nntp_line_process(NNTP * nntp, const StringView & line)
                return;
 
        // if news server doesn't provide an xref, fake one
-       char * buf(0);
+       char * buf(nullptr);
        if (xref.empty())
                xref = buf = g_strdup_printf("%s %s:%" G_GUINT64_FORMAT,
                                nntp->_server.c_str(), nntp->_group.c_str(), static_cast<uint64_t>(number));
@@ -470,7 +470,7 @@ TaskXOver::on_nntp_done(NNTP * nntp, Health health, const StringView & response)
 
   if (compression_enabled && atoi(response.str) == 0)
   {
-    std::stringstream* buffer(0);
+    std::stringstream* buffer(nullptr);
     std::stringstream out, out2;
     if (comp == HEADER_COMPRESS_XZVER || comp == HEADER_COMPRESS_DIABLO)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]