[pan] Replaced in data



commit 2f35652cdef68fae9b4452e063a8b82eacc90450
Author: Thomas Tanner <thosrtanner googlemail com>
Date:   Fri Sep 30 20:37:44 2022 +0100

    Replaced in data

 pan/data/article-cache.cc | 18 +++++++++---------
 pan/data/cert-store.cc    |  2 +-
 pan/data/encode-cache.cc  |  4 ++--
 pan/data/parts.cc         |  6 +++---
 pan/data/xref.cc          |  2 +-
 5 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/pan/data/article-cache.cc b/pan/data/article-cache.cc
index bb61f82..0428cb8 100644
--- a/pan/data/article-cache.cc
+++ b/pan/data/article-cache.cc
@@ -100,8 +100,8 @@ char*
 ArticleCache :: message_id_to_filename (char * buf, int len, const StringView& mid) const
 {
   // sanity clause
-  pan_return_val_if_fail (!mid.empty(), 0);
-  pan_return_val_if_fail (buf!=0, NULL);
+  pan_return_val_if_fail (!mid.empty(), nullptr);
+  pan_return_val_if_fail (buf!=nullptr, NULL);
   pan_return_val_if_fail (len>0, NULL);
 
   // some characters in message-ids are illegal on older Windows boxes,
@@ -211,7 +211,7 @@ ArticleCache :: get_filename (char * buf, int buflen, const Quark& mid) const
    *buf = '\0';
    message_id_to_filename (basename, sizeof(basename), mid.to_view());
    g_snprintf (buf, buflen, "%s%c%s", _path.c_str(), G_DIR_SEPARATOR, basename);
-   return buf && *buf ? buf : 0;
+   return buf && *buf ? buf : nullptr;
 };
 
 ArticleCache :: CacheResponse
@@ -225,7 +225,7 @@ ArticleCache :: add (const Quark& message_id, const StringView& article, const b
   pan_return_val_if_fail (!message_id.empty(), res);
   pan_return_val_if_fail (!article.empty(), res);
 
-  FILE * fp = 0;
+  FILE * fp = nullptr;
   char filename[PATH_MAX];
   if (get_filename (filename, sizeof(filename), message_id))
     fp = fopen (filename, "wb+");
@@ -253,7 +253,7 @@ ArticleCache :: add (const Quark& message_id, const StringView& article, const b
       MsgInfo info;
       info._message_id = message_id;
       info._size = article.len;
-      info._date = time(0);
+      info._date = time(nullptr);
       _mid_to_info.insert (mid_to_info_t::value_type (info._message_id, info));
       fire_added (message_id);
 
@@ -375,15 +375,15 @@ ArticleCache :: get_message_file_stream (const Quark& mid) const
 ArticleCache :: get_message_mem_stream (const Quark& mid) const
 {
    debug ("mem stream got quark " << mid);
-   GMimeStream * retval (0);
+   GMimeStream * retval (nullptr);
 
    char filename[PATH_MAX];
    if (get_filename (filename, sizeof(filename), mid))
    {
       debug ("mem stream loading filename " << filename);
       gsize len (0);
-      char * buf (0);
-      GError * err (0);
+      char * buf (nullptr);
+      GError * err (nullptr);
 
       if (g_file_get_contents (filename, &buf, &len, &err)) {
          debug ("got the contents, calling mem_new_with_buffer");
@@ -417,7 +417,7 @@ ArticleCache :: get_message (const mid_sequence_t& mids) const
    const bool in_memory (true); // workaround for bug #439841
    foreach_const (mid_sequence_t, mids, it) {
       const Quark mid (*it);
-      GMimeStream * stream (0);
+      GMimeStream * stream (nullptr);
       if (this->contains (*it))
         stream = in_memory
           ? get_message_mem_stream (mid)
diff --git a/pan/data/cert-store.cc b/pan/data/cert-store.cc
index 53b60d8..64817a1 100644
--- a/pan/data/cert-store.cc
+++ b/pan/data/cert-store.cc
@@ -249,7 +249,7 @@ int CertStore::get_all_certs_from_disk() {
 }
 
 // get certs from ssl certs directory
-       char * ssldir(0);
+       char * ssldir(nullptr);
        ssldir = getenv("SSL_CERT_DIR");
        if (!ssldir)
                ssldir = getenv("SSL_DIR");
diff --git a/pan/data/encode-cache.cc b/pan/data/encode-cache.cc
index 0377cec..aae72a5 100644
--- a/pan/data/encode-cache.cc
+++ b/pan/data/encode-cache.cc
@@ -129,7 +129,7 @@ EncodeCache :: add (const Quark& message_id)
   MsgInfo info;
   info._message_id = message_id;
   info._size = 0;
-  info._date = time(0);
+  info._date = time(nullptr);
   _mid_to_info.insert (mid_to_info_t::value_type (info._message_id, info));
 }
 
@@ -141,7 +141,7 @@ void EncodeCache :: finalize (std::string message_id)
 {
   struct stat sb;
   char out_path[4096];
-  
+
   get_filename(out_path, Quark(message_id));
   stat (out_path, &sb);
   _mid_to_info[message_id]._size = sb.st_size;
diff --git a/pan/data/parts.cc b/pan/data/parts.cc
index d7711ff..2cf5d05 100644
--- a/pan/data/parts.cc
+++ b/pan/data/parts.cc
@@ -135,7 +135,7 @@ Parts :: Parts ():
   n_parts_total (0),
   part_mid_buf_len (0),
   parts (0),
-  part_mid_buf (0)
+  part_mid_buf (nullptr)
 {
 }
 
@@ -146,7 +146,7 @@ Parts :: clear ()
   parts.swap(tmp);
 
   delete [] part_mid_buf;
-  part_mid_buf = 0;
+  part_mid_buf = nullptr;
 
   part_mid_buf_len = 0;
   n_parts_total = 0;
@@ -156,7 +156,7 @@ Parts :: Parts (const Parts& that):
   n_parts_total (0),
   part_mid_buf_len (0),
   parts (0),
-  part_mid_buf (0)
+  part_mid_buf (nullptr)
 {
   *this = that;
 }
diff --git a/pan/data/xref.cc b/pan/data/xref.cc
index d2190f5..c219df5 100644
--- a/pan/data/xref.cc
+++ b/pan/data/xref.cc
@@ -45,7 +45,7 @@ Xref :: insert (const Quark             & server,
   targets.reserve (targets.size() + std::count(xref.begin(), xref.end(), ':'));
   StringView s;
   while (xref.pop_token (s)) {
-    if (s.strchr (':') != 0) {
+    if (s.strchr (':') != nullptr) {
       StringView group_name;
       if (s.pop_token(group_name, ':')) {
         Target t;


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