[poppler] 2 commits - fofi/FoFiType1C.cc goo/GooString.h poppler/Form.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 10 15:14:26 UTC 2019


 fofi/FoFiType1C.cc |    9 +++++----
 goo/GooString.h    |    5 +++--
 poppler/Form.cc    |    5 +++--
 3 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit e1e15db0a4d0a5b051efc9947d5ac79184447b9b
Author: himajin100000 <himajin100000 at gmail.com>
Date:   Mon Apr 8 21:14:59 2019 +0900

    avoid more C4310

diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 5df096ca..522b86a6 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -16,6 +16,7 @@
 // Copyright (C) 2009, 2010, 2017, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
+// Copyright (C) 2019 Tomoyuki Kubota <himajin100000 at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1205,10 +1206,10 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
 
   start = charBuf->getLength();
   if (top) {
-    charBuf->append((char)73);
-    charBuf->append((char)58);
-    charBuf->append((char)147);
-    charBuf->append((char)134);
+    charBuf->append('\x49'); //73;
+    charBuf->append('\x3A'); //58;
+    charBuf->append('\x93'); //147;
+    charBuf->append('\x86'); //134;
     nOps = 0;
     nHints = 0;
     firstOp = true;
diff --git a/poppler/Form.cc b/poppler/Form.cc
index f6c71dab..c13eda8f 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -25,6 +25,7 @@
 // Copyright 2018 Adam Reichold <adam.reichold at t-online.de>
 // Copyright 2018, 2019 Nelson Benítez León <nbenitezl at gmail.com>
 // Copyright 2019 Oliver Sander <oliver.sander at tu-dresden.de>
+// Copyright 2019 Tomoyuki Kubota <himajin100000 at gmail.com>
 //
 //========================================================================
 
@@ -64,8 +65,8 @@ char* pdfDocEncodingToUTF16 (const GooString* orig, int* length)
   char *result = new char[(*length)];
   const char *cstring = orig->c_str();
   //unicode marker
-  result[0] = (char)0xfe;
-  result[1] = (char)0xff;
+  result[0] = '\xfe';
+  result[1] = '\xff';
   //convert to utf16
   for(int i=2,j=0; i<(*length); i+=2,j++) {
     Unicode u = pdfDocEncoding[(unsigned int)((unsigned char)cstring[j])]&0xffff;
commit 1fbbb3e499873e92d775cac9cc285b3c362e5db7
Author: himajin100000 <himajin100000 at gmail.com>
Date:   Sun Apr 7 21:43:55 2019 +0900

    avoid warning C4310: cast truncates constant value

diff --git a/goo/GooString.h b/goo/GooString.h
index 8d2c6d4b..74e4f77f 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -25,6 +25,7 @@
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
 // Copyright (C) 2019 Christophe Fergeau <cfergeau at redhat.com>
+// Copyright (C) 2019 Tomoyuki Kubota <himajin100000 at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -172,8 +173,8 @@ public:
   // Return true if string ends with suffix
   bool endsWith(const char *suffix) const;
 
-  bool hasUnicodeMarker() const { return size() >= 2 && (*this)[0] == char(0xfe) && (*this)[1] == char(0xff); }
-  bool hasUnicodeMarkerLE() const { return size() >= 2 && (*this)[0] == char(0xff) && (*this)[1] == char(0xfe); }
+  bool hasUnicodeMarker() const { return size() >= 2 && (*this)[0] == '\xfe' && (*this)[1] == '\xff'; }
+  bool hasUnicodeMarkerLE() const { return size() >= 2 && (*this)[0] == '\xff' && (*this)[1] == '\xfe'; }
   bool hasJustUnicodeMarker() const { return size() == 2 && hasUnicodeMarker(); }
 
   void prependUnicodeMarker();


More information about the poppler mailing list