[poppler] goo/GooString.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 1 22:39:59 UTC 2022


 goo/GooString.h |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e7adc2c5fa0559d8dea76c67e37f7be3f50237a0
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Apr 2 00:36:03 2022 +0200

    More GooString to size_t where it makes some sense

diff --git a/goo/GooString.h b/goo/GooString.h
index e09875e6..86af849e 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -78,11 +78,11 @@ public:
 
     // Create a string from <lengthA> chars at <sA>.  This string
     // can contain null characters.
-    GooString(const char *sA, int lengthA) : std::string(sA ? sA : "", sA ? lengthA : 0) { }
+    GooString(const char *sA, size_t lengthA) : std::string(sA ? sA : "", sA ? lengthA : 0) { }
 
     // Create a string from <lengthA> chars at <idx> in <str>.
-    GooString(const GooString *str, int idx, int lengthA) : std::string(*str, idx, lengthA) { }
-    GooString(const std::string &str, int idx, int lengthA) : std::string(str, idx, lengthA) { }
+    GooString(const GooString *str, int idx, size_t lengthA) : std::string(*str, idx, lengthA) { }
+    GooString(const std::string &str, int idx, size_t lengthA) : std::string(str, idx, lengthA) { }
 
     // Set content of a string to <newStr>.
     GooString *Set(const GooString *newStr)
@@ -150,7 +150,7 @@ public:
     using std::string::c_str;
 
     // Get <i>th character.
-    char getChar(int i) const { return (*this)[i]; }
+    char getChar(size_t i) const { return (*this)[i]; }
 
     // Change <i>th character.
     void setChar(int i, char c) { (*this)[i] = c; }


More information about the poppler mailing list