[poppler] cpp/poppler-private.cpp cpp/poppler-private.h glib/poppler.cc poppler/Error.cc poppler/Error.h qt5/src test/perf-test.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Sep 23 00:10:08 UTC 2018


 cpp/poppler-private.cpp    |    2 +-
 cpp/poppler-private.h      |    2 +-
 glib/poppler.cc            |    2 +-
 poppler/Error.cc           |    4 ++--
 poppler/Error.h            |    2 +-
 qt5/src/poppler-private.cc |    2 +-
 test/perf-test.cc          |    2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 297e6944a67c1891b9ba194fff0562352a5f8d1f
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Sep 23 02:09:50 2018 +0200

    Error: Make the msg be const

diff --git a/cpp/poppler-private.cpp b/cpp/poppler-private.cpp
index 9f49fcfa..2cdc53e7 100644
--- a/cpp/poppler-private.cpp
+++ b/cpp/poppler-private.cpp
@@ -39,7 +39,7 @@ static void stderr_debug_function(const std::string &msg, void * /*data*/)
 debug_func detail::user_debug_function = stderr_debug_function;
 void *detail::debug_closure = nullptr;
 
-void detail::error_function(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
+void detail::error_function(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg)
 {
     std::ostringstream oss;
     if (pos >= 0) {
diff --git a/cpp/poppler-private.h b/cpp/poppler-private.h
index 71cf65a4..36b35ea0 100644
--- a/cpp/poppler-private.h
+++ b/cpp/poppler-private.h
@@ -47,7 +47,7 @@ namespace detail
 
 extern debug_func user_debug_function;
 extern void *debug_closure;
-void error_function(void *data, ErrorCategory category, Goffset pos, char *msg);
+void error_function(void *data, ErrorCategory category, Goffset pos, const char *msg);
 
 rectf pdfrectangle_to_rectf(const PDFRectangle &pdfrect);
 
diff --git a/glib/poppler.cc b/glib/poppler.cc
index 0094c38a..01c3ae88 100644
--- a/glib/poppler.cc
+++ b/glib/poppler.cc
@@ -87,7 +87,7 @@ static void
 error_cb (void *data G_GNUC_UNUSED,
           ErrorCategory category,
           Goffset pos,
-          char *message)
+          const char *message)
 {
   static const char * const cat_str[] = {
     "Syntax warning",
diff --git a/poppler/Error.cc b/poppler/Error.cc
index 356f7972..6c7e43b7 100644
--- a/poppler/Error.cc
+++ b/poppler/Error.cc
@@ -50,11 +50,11 @@ static const char *errorCategoryNames[] = {
 };
 
 static void (*errorCbk)(void *data, ErrorCategory category,
-			Goffset pos, char *msg) = nullptr;
+			Goffset pos, const char *msg) = nullptr;
 static void *errorCbkData = nullptr;
 
 void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
-				  Goffset pos, char *msg),
+				  Goffset pos, const char *msg),
 		      void *data) {
   errorCbk = cbk;
   errorCbkData = data;
diff --git a/poppler/Error.h b/poppler/Error.h
index 9e11733d..f91d90fa 100644
--- a/poppler/Error.h
+++ b/poppler/Error.h
@@ -52,7 +52,7 @@ enum ErrorCategory {
 };
 
 extern void setErrorCallback(void (*cbk)(void *data, ErrorCategory category,
-					 Goffset pos, char *msg),
+					 Goffset pos, const char *msg),
 			     void *data);
 
 extern void CDECL error(ErrorCategory category, Goffset pos, const char *msg, ...) GOOSTRING_FORMAT;
diff --git a/qt5/src/poppler-private.cc b/qt5/src/poppler-private.cc
index ca5251df..edbabe13 100644
--- a/qt5/src/poppler-private.cc
+++ b/qt5/src/poppler-private.cc
@@ -58,7 +58,7 @@ namespace Debug {
         Debug::debugClosure = closure;
     }
 
-    static void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
+    static void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, const char *msg)
     {
         QString emsg;
 
diff --git a/test/perf-test.cc b/test/perf-test.cc
index ea86c910..2db7ceeb 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -739,7 +739,7 @@ static void StrList_Destroy(StrList **root)
     *root = nullptr;
 }
 
-static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
+static void my_error(void *, ErrorCategory, Goffset pos, const char *msg) {
 #if 0
     char        buf[4096], *p = buf;
 


More information about the poppler mailing list