[poppler] cpp/poppler-document.cpp cpp/poppler-embedded-file.cpp cpp/poppler-global.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 5 14:56:34 UTC 2022


 cpp/poppler-document.cpp      |    6 +++---
 cpp/poppler-embedded-file.cpp |    4 ++--
 cpp/poppler-global.cpp        |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 8a06776bc89ae8f4fa1655befb6d3a24e161150b
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 5 16:50:56 2022 +0200

    cpp: MSVC warning fixes
    
    Cast from time_t to time_type because they are not the same type
    anymore on systems that are protected from the Y2K38 problem
    
    Actual fix for that coming in a different patch

diff --git a/cpp/poppler-document.cpp b/cpp/poppler-document.cpp
index 9c4f4c1d..2ae13199 100644
--- a/cpp/poppler-document.cpp
+++ b/cpp/poppler-document.cpp
@@ -344,7 +344,7 @@ time_type document::info_date(const std::string &key) const
         return time_type(-1);
     }
 
-    return dateStringToTime(goo_date.get());
+    return static_cast<time_type>(dateStringToTime(goo_date.get()));
 }
 
 /**
@@ -654,7 +654,7 @@ time_type document::get_creation_date() const
         return time_type(-1);
     }
 
-    return dateStringToTime(goo_creation_date.get());
+    return static_cast<time_type>(dateStringToTime(goo_creation_date.get()));
 }
 
 /**
@@ -699,7 +699,7 @@ time_type document::get_modification_date() const
         return time_type(-1);
     }
 
-    return dateStringToTime(goo_modification_date.get());
+    return static_cast<time_type>(dateStringToTime(goo_modification_date.get()));
 }
 
 /**
diff --git a/cpp/poppler-embedded-file.cpp b/cpp/poppler-embedded-file.cpp
index 04559615..7255bbef 100644
--- a/cpp/poppler-embedded-file.cpp
+++ b/cpp/poppler-embedded-file.cpp
@@ -103,7 +103,7 @@ time_type embedded_file::modification_date() const
 {
     const EmbFile *ef = d->file_spec->getEmbeddedFile();
     const GooString *goo = ef ? ef->modDate() : nullptr;
-    return goo ? dateStringToTime(goo) : time_type(-1);
+    return goo ? static_cast<time_type>(dateStringToTime(goo)) : time_type(-1);
 }
 
 /**
@@ -114,7 +114,7 @@ time_type embedded_file::creation_date() const
 {
     const EmbFile *ef = d->file_spec->getEmbeddedFile();
     const GooString *goo = ef ? ef->createDate() : nullptr;
-    return goo ? dateStringToTime(goo) : time_type(-1);
+    return goo ? static_cast<time_type>(dateStringToTime(goo)) : time_type(-1);
 }
 
 /**
diff --git a/cpp/poppler-global.cpp b/cpp/poppler-global.cpp
index 934028de..75938321 100644
--- a/cpp/poppler-global.cpp
+++ b/cpp/poppler-global.cpp
@@ -4,7 +4,7 @@
  * Copyright (C) 2014, 2015 Hans-Peter Deifel <hpdeifel at gmx.de>
  * Copyright (C) 2015, Tamas Szekeres <szekerest at gmail.com>
  * Copyright (C) 2016 Jakub Alba <jakubalba at gmail.com>
- * Copyright (C) 2018, 2020, 2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2018, 2020-2022, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2018 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
  * Copyright (C) 2018, 2020, Adam Reichold <adam.reichold at t-online.de>
  *
@@ -322,7 +322,7 @@ ustring ustring::from_latin1(const std::string &str)
 time_type poppler::convert_date(const std::string &date)
 {
     GooString gooDateStr(date.c_str());
-    return dateStringToTime(&gooDateStr);
+    return static_cast<time_type>(dateStringToTime(&gooDateStr));
 }
 
 std::ostream &poppler::operator<<(std::ostream &stream, const byte_array &array)


More information about the poppler mailing list