[poppler] cmake/modules cpp/tests glib/poppler-action.cc goo/gmem.h goo/JpegWriter.cc poppler/Annot.cc poppler/Decrypt.cc poppler/TextOutputDev.cc qt4/src qt4/tests qt5/src qt5/tests test/perf-test.cc test/perf-test-preview-dummy.cc utils/pdfinfo.cc utils/pdfseparate.cc utils/pdfsig.cc utils/pdftotext.cc utils/pdfunite.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Sep 16 16:16:51 UTC 2017


 cmake/modules/PopplerMacros.cmake |    2 -
 cpp/tests/poppler-dump.cpp        |    2 -
 glib/poppler-action.cc            |    1 
 goo/JpegWriter.cc                 |    2 -
 goo/gmem.h                        |    2 -
 poppler/Annot.cc                  |    6 +--
 poppler/Decrypt.cc                |    2 -
 poppler/TextOutputDev.cc          |    2 -
 qt4/src/poppler-link.cc           |    2 -
 qt4/src/poppler-private.cc        |    6 +--
 qt4/tests/check_links.cpp         |    4 +-
 qt4/tests/poppler-forms.cpp       |   14 ++++----
 qt5/src/poppler-link.cc           |    2 -
 qt5/src/poppler-private.cc        |    6 +--
 qt5/tests/check_links.cpp         |    4 +-
 qt5/tests/poppler-forms.cpp       |   18 +++++------
 test/perf-test-preview-dummy.cc   |    4 ++
 test/perf-test.cc                 |   62 +++++++++++++++++++-------------------
 utils/pdfinfo.cc                  |    4 +-
 utils/pdfseparate.cc              |    2 -
 utils/pdfsig.cc                   |    6 +--
 utils/pdftotext.cc                |    2 -
 utils/pdfunite.cc                 |    6 +--
 23 files changed, 83 insertions(+), 78 deletions(-)

New commits:
commit 0790dd3afb8370aebca8e7e154bbd2b5ae5cd5a2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Sep 16 18:01:49 2017 +0200

    Fix missing-declarations warnings
    
    ... and add it to default warning set

diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index bc24ed9f..ba4bceb3 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -109,13 +109,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   set(_warn "${_warn} -Wmissing-format-attribute")
   set(_warn "${_warn} -Wnon-virtual-dtor")
   set(_warn "${_warn} -Woverloaded-virtual")
+  set(_warn "${_warn} -Wmissing-declarations")
   if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0")
     set(_warn "${_warn} -Wsuggest-override")
   endif()
 
   # set extra warnings
   set(_warnx "${_warnx} -Wconversion")
-  set(_warnx "${_warnx} -Wmissing-declarations")
   set(_warnx "${_warnx} -Wshadow")
   set(_warnx "${_warnx} -Wundef")
   set(_warnx "${_warnx} -Wuseless-cast")
diff --git a/cpp/tests/poppler-dump.cpp b/cpp/tests/poppler-dump.cpp
index f9c8b6e4..706ad390 100644
--- a/cpp/tests/poppler-dump.cpp
+++ b/cpp/tests/poppler-dump.cpp
@@ -85,7 +85,7 @@ static void error(const std::string &msg)
     exit(1);
 }
 
-std::ostream& operator<<(std::ostream& stream, const poppler::ustring &str)
+static std::ostream& operator<<(std::ostream& stream, const poppler::ustring &str)
 {
     const poppler::byte_array ba = str.to_utf8();
     for (unsigned int i = 0; i < ba.size(); ++i) {
diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index ad8ed18d..72969a5e 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -229,6 +229,7 @@ poppler_action_copy (PopplerAction *action)
 	return new_action;
 }
 
+static
 PopplerDest *
 dest_new_goto (PopplerDocument *document,
 	       LinkDest        *link_dest)
diff --git a/goo/JpegWriter.cc b/goo/JpegWriter.cc
index a5a4d5a6..43c25e09 100644
--- a/goo/JpegWriter.cc
+++ b/goo/JpegWriter.cc
@@ -30,7 +30,7 @@ struct JpegWriterPrivate {
   struct jpeg_error_mgr jerr;
 };
 
-void outputMessage(j_common_ptr cinfo)
+static void outputMessage(j_common_ptr cinfo)
 {
   char buffer[JMSG_LENGTH_MAX];
 
diff --git a/goo/gmem.h b/goo/gmem.h
index 898f3393..e6eb6368 100644
--- a/goo/gmem.h
+++ b/goo/gmem.h
@@ -44,7 +44,7 @@ extern void *gmalloc_checkoverflow(size_t size);
  * returns NULL.  If <p> is NULL, calls malloc instead of realloc().
  */
 extern void *grealloc(void *p, size_t size);
-extern void *grealloc_checkoverflow(size_t size);
+extern void *grealloc_checkoverflow(void *p, size_t size);
 
 /*
  * These are similar to gmalloc and grealloc, but take an object count
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 83261038..db9a5715 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -113,7 +113,7 @@
 // = (4 * (sqrt(2) - 1) / 3) * r
 #define bezierCircle 0.55228475
 
-AnnotLineEndingStyle parseAnnotLineEndingStyle(GooString *string) {
+static AnnotLineEndingStyle parseAnnotLineEndingStyle(GooString *string) {
   if (string != NULL) {
     if (!string->cmp("Square")) {
       return annotLineEndingSquare;
@@ -141,7 +141,7 @@ AnnotLineEndingStyle parseAnnotLineEndingStyle(GooString *string) {
   }  
 }
 
-const char* convertAnnotLineEndingStyle(AnnotLineEndingStyle style) {
+static const char* convertAnnotLineEndingStyle(AnnotLineEndingStyle style) {
   switch (style) {
     case annotLineEndingSquare:
       return "Square";
@@ -185,7 +185,7 @@ static AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
   return type;
 }
 
-PDFRectangle *parseDiffRectangle(Array *array, PDFRectangle *rect) {
+static PDFRectangle *parseDiffRectangle(Array *array, PDFRectangle *rect) {
   PDFRectangle *newRect = NULL;
   if (array->getLength() == 4) {
     // deltas
diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index c8246fab..8d4377a0 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -1345,7 +1345,7 @@ static inline Guint sha256sigma1(Guint x) {
   return rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10);
 }
 
-void sha256HashBlock(Guchar *blk, Guint *H) {
+static void sha256HashBlock(Guchar *blk, Guint *H) {
   Guint W[64];
   Guint a, b, c, d, e, f, g, h;
   Guint T1, T2;
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index a89ba23c..d30874cf 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -565,7 +565,7 @@ static struct CombiningTable combiningTable[] = {
 };
 
 // returning combining versions of characters
-Unicode getCombiningChar(Unicode u) {
+static Unicode getCombiningChar(Unicode u) {
   int len = sizeof(combiningTable) / sizeof(combiningTable[0]);
   for (int i = 0; i < len; ++i) {
     if (u == combiningTable[i].base)
diff --git a/qt4/src/poppler-link.cc b/qt4/src/poppler-link.cc
index 4715f255..a1c035f9 100644
--- a/qt4/src/poppler-link.cc
+++ b/qt4/src/poppler-link.cc
@@ -34,7 +34,7 @@
 #include "Link.h"
 #include "Rendition.h"
 
-bool operator==( const Ref &r1, const Ref &r2 )
+static bool operator==( const Ref &r1, const Ref &r2 )
 {
 	return r1.num == r2.num && r1.gen == r2.gen;
 }
diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index 4ff68f94..9b0c2228 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -39,7 +39,7 @@ namespace Poppler {
 
 namespace Debug {
 
-    void qDebugDebugFunction(const QString &message, const QVariant & /*closure*/)
+    static void qDebugDebugFunction(const QString &message, const QVariant & /*closure*/)
     {
         qDebug() << message;
     }
@@ -57,7 +57,7 @@ namespace Debug {
         Debug::debugClosure = closure;
     }
 
-    void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
+    static void qt4ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
     {
         QString emsg;
 
@@ -162,7 +162,7 @@ namespace Debug {
         return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'"));
     }
 
-    void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e )
+    static void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e )
     {
         if ( !a || !e )
             return;
diff --git a/qt4/tests/check_links.cpp b/qt4/tests/check_links.cpp
index 5b6cc59e..e5c17368 100644
--- a/qt4/tests/check_links.cpp
+++ b/qt4/tests/check_links.cpp
@@ -13,12 +13,12 @@ private slots:
     void checkDests_xr02();
 };
 
-bool isDestinationValid_pageNumber( const Poppler::LinkDestination *dest, const Poppler::Document *doc )
+static bool isDestinationValid_pageNumber( const Poppler::LinkDestination *dest, const Poppler::Document *doc )
 {
     return dest->pageNumber() > 0 && dest->pageNumber() <= doc->numPages();
 }
 
-bool isDestinationValid_name( const Poppler::LinkDestination *dest )
+static bool isDestinationValid_name( const Poppler::LinkDestination *dest )
 {
     return !dest->destinationName().isEmpty();
 }
diff --git a/qt4/tests/poppler-forms.cpp b/qt4/tests/poppler-forms.cpp
index 66aa11c3..98891a91 100644
--- a/qt4/tests/poppler-forms.cpp
+++ b/qt4/tests/poppler-forms.cpp
@@ -6,7 +6,7 @@
 #include <poppler-qt4.h>
 #include <poppler-form.h>
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
 {
     switch (type) {
         case Poppler::FormField::FormButton:    out << "Button";    break;
@@ -17,7 +17,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonType type)
 {
     switch (type) {
         case Poppler::FormFieldButton::Push:        out << "Push";      break;
@@ -27,7 +27,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonTyp
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType type)
 {
     switch (type) {
         case Poppler::FormFieldText::Normal:        out << "Normal";        break;
@@ -37,7 +37,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType ty
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceType type)
 {
     switch (type) {
         case Poppler::FormFieldChoice::ComboBox:      out << "ComboBox";    break;
@@ -46,7 +46,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceTyp
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
+static std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
 {
     switch (alignment) {
         case Qt::AlignLeft:     out << "Left";      break;
@@ -62,13 +62,13 @@ std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, const QString &string)
+static std::ostream& operator<< (std::ostream &out, const QString &string)
 {
     out << string.toUtf8().constData();
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, const QRectF &rect)
+static std::ostream& operator<< (std::ostream &out, const QRectF &rect)
 {
     out << QString("top: %1 left: %2 width: %3 height: %4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
     return out;
diff --git a/qt5/src/poppler-link.cc b/qt5/src/poppler-link.cc
index ae2878e6..e1cfd3da 100644
--- a/qt5/src/poppler-link.cc
+++ b/qt5/src/poppler-link.cc
@@ -34,7 +34,7 @@
 #include "Link.h"
 #include "Rendition.h"
 
-bool operator==( const Ref &r1, const Ref &r2 )
+static bool operator==( const Ref &r1, const Ref &r2 )
 {
 	return r1.num == r2.num && r1.gen == r2.gen;
 }
diff --git a/qt5/src/poppler-private.cc b/qt5/src/poppler-private.cc
index 1540a66f..8915443e 100644
--- a/qt5/src/poppler-private.cc
+++ b/qt5/src/poppler-private.cc
@@ -39,7 +39,7 @@ namespace Poppler {
 
 namespace Debug {
 
-    void qDebugDebugFunction(const QString &message, const QVariant & /*closure*/)
+    static void qDebugDebugFunction(const QString &message, const QVariant & /*closure*/)
     {
         qDebug() << message;
     }
@@ -57,7 +57,7 @@ namespace Debug {
         Debug::debugClosure = closure;
     }
 
-    void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
+    static void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg)
     {
         QString emsg;
 
@@ -162,7 +162,7 @@ namespace Debug {
         return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'"));
     }
 
-    void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e )
+    static void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e )
     {
         if ( !a || !e )
             return;
diff --git a/qt5/tests/check_links.cpp b/qt5/tests/check_links.cpp
index cce13ec6..79c38579 100644
--- a/qt5/tests/check_links.cpp
+++ b/qt5/tests/check_links.cpp
@@ -13,12 +13,12 @@ private slots:
     void checkDests_xr02();
 };
 
-bool isDestinationValid_pageNumber( const Poppler::LinkDestination *dest, const Poppler::Document *doc )
+static bool isDestinationValid_pageNumber( const Poppler::LinkDestination *dest, const Poppler::Document *doc )
 {
     return dest->pageNumber() > 0 && dest->pageNumber() <= doc->numPages();
 }
 
-bool isDestinationValid_name( const Poppler::LinkDestination *dest )
+static bool isDestinationValid_name( const Poppler::LinkDestination *dest )
 {
     return !dest->destinationName().isEmpty();
 }
diff --git a/qt5/tests/poppler-forms.cpp b/qt5/tests/poppler-forms.cpp
index 72975576..a023dd10 100644
--- a/qt5/tests/poppler-forms.cpp
+++ b/qt5/tests/poppler-forms.cpp
@@ -7,7 +7,7 @@
 #include <poppler-qt5.h>
 #include <poppler-form.h>
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
 {
     switch (type) {
         case Poppler::FormField::FormButton:    out << "Button";    break;
@@ -18,7 +18,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormField::FormType type)
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonType type)
 {
     switch (type) {
         case Poppler::FormFieldButton::Push:        out << "Push";      break;
@@ -28,7 +28,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldButton::ButtonTyp
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType type)
 {
     switch (type) {
         case Poppler::FormFieldText::Normal:        out << "Normal";        break;
@@ -38,7 +38,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldText::TextType ty
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceType type)
+static std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceType type)
 {
     switch (type) {
         case Poppler::FormFieldChoice::ComboBox:      out << "ComboBox";    break;
@@ -47,7 +47,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::FormFieldChoice::ChoiceTyp
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::SignatureStatus status)
+static std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::SignatureStatus status)
 {
     switch (status) {
         case Poppler::SignatureValidationInfo::SignatureValid:          out << "Valid";          break;
@@ -61,7 +61,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::S
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::CertificateStatus status)
+static std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::CertificateStatus status)
 {
     switch (status) {
         case Poppler::SignatureValidationInfo::CertificateTrusted:         out << "Trusted";         break;
@@ -75,7 +75,7 @@ std::ostream& operator<< (std::ostream &out, Poppler::SignatureValidationInfo::C
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
+static std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
 {
     switch (alignment) {
         case Qt::AlignLeft:     out << "Left";      break;
@@ -91,13 +91,13 @@ std::ostream& operator<< (std::ostream &out, Qt::Alignment alignment)
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, const QString &string)
+static std::ostream& operator<< (std::ostream &out, const QString &string)
 {
     out << string.toUtf8().constData();
     return out;
 }
 
-std::ostream& operator<< (std::ostream &out, const QRectF &rect)
+static std::ostream& operator<< (std::ostream &out, const QRectF &rect)
 {
     out << QString("top: %1 left: %2 width: %3 height: %4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
     return out;
diff --git a/test/perf-test-preview-dummy.cc b/test/perf-test-preview-dummy.cc
index 3522d12f..adc4d2e8 100644
--- a/test/perf-test-preview-dummy.cc
+++ b/test/perf-test-preview-dummy.cc
@@ -8,6 +8,10 @@ get any visual feedback during testing.
 
 #include "splash/SplashBitmap.h"
 
+void PreviewBitmapInit(void);
+void PreviewBitmapDestroy(void);
+void PreviewBitmapSplash(SplashBitmap *bmpSplash);
+
 void PreviewBitmapSplash(SplashBitmap *bmpSplash)
 {
 }
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 4fb15d9e..67753ae7 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -196,12 +196,12 @@ static bool gfLoadOnly = false;
   #define DIR_SEP_STR  "/"
 #endif
 
-void memzero(void *data, size_t len)
+static void memzero(void *data, size_t len)
 {
     memset(data, 0, len);
 }
 
-void *zmalloc(size_t len)
+static void *zmalloc(size_t len)
 {
     void *data = malloc(len);
     if (data)
@@ -211,7 +211,7 @@ void *zmalloc(size_t len)
 
 /* Concatenate 4 strings. Any string can be NULL.
    Caller needs to free() memory. */
-char *str_cat4(const char *str1, const char *str2, const char *str3, const char *str4)
+static char *str_cat4(const char *str1, const char *str2, const char *str3, const char *str4)
 {
     char *str;
     char *tmp;
@@ -252,12 +252,12 @@ char *str_cat4(const char *str1, const char *str2, const char *str3, const char
     return str;
 }
 
-char *str_dup(const char *str)
+static char *str_dup(const char *str)
 {
     return str_cat4(str, NULL, NULL, NULL);
 }
 
-bool str_eq(const char *str1, const char *str2)
+static bool str_eq(const char *str1, const char *str2)
 {
     if (!str1 && !str2)
         return true;
@@ -268,7 +268,7 @@ bool str_eq(const char *str1, const char *str2)
     return false;
 }
 
-bool str_ieq(const char *str1, const char *str2)
+static bool str_ieq(const char *str1, const char *str2)
 {
     if (!str1 && !str2)
         return true;
@@ -279,7 +279,7 @@ bool str_ieq(const char *str1, const char *str2)
     return false;
 }
 
-bool str_endswith(const char *txt, const char *end)
+static bool str_endswith(const char *txt, const char *end)
 {
     size_t end_len;
     size_t txt_len;
@@ -298,7 +298,7 @@ bool str_endswith(const char *txt, const char *end)
 
 /* TODO: probably should move to some other file and change name to
    sleep_milliseconds */
-void sleep_milliseconds(int milliseconds)
+static void sleep_milliseconds(int milliseconds)
 {
 #ifdef _WIN32
     Sleep((DWORD)milliseconds);
@@ -327,7 +327,7 @@ void sleep_milliseconds(int milliseconds)
 }
 
 #ifndef HAVE_STRCPY_S
-void strcpy_s(char* dst, size_t dst_size, const char* src)
+static void strcpy_s(char* dst, size_t dst_size, const char* src)
 {
     size_t src_size = strlen(src) + 1;
     if (src_size <= dst_size)
@@ -342,7 +342,7 @@ void strcpy_s(char* dst, size_t dst_size, const char* src)
 #endif
 
 #ifndef HAVE_STRCAT_S
-void strcat_s(char *dst, size_t dst_size, const char* src)
+static void strcat_s(char *dst, size_t dst_size, const char* src)
 {
     size_t dst_len = strlen(dst);
     if (dst_len >= dst_size) {
@@ -390,7 +390,7 @@ static void splashColorSet(SplashColorPtr col, Guchar red, Guchar green, Guchar
     }
 }
 
-void SplashColorsInit(void)
+static void SplashColorsInit(void)
 {
     splashColorSet(SPLASH_COL_RED_PTR, 0xff, 0, 0, 0);
     splashColorSet(SPLASH_COL_GREEN_PTR, 0, 0xff, 0, 0);
@@ -515,7 +515,7 @@ static void win_correct_path_for_FindFirstFile(char *path, int path_max_len)
 }
 #endif
 
-FindFileState *find_file_open(const char *path, const char *pattern)
+static FindFileState *find_file_open(const char *path, const char *pattern)
 {
     FindFileState *s;
 
@@ -544,7 +544,7 @@ void *StandardSecurityHandler::getAuthData()
 }
 #endif
 
-char *makepath(char *buf, int buf_size, const char *path,
+static char *makepath(char *buf, int buf_size, const char *path,
                const char *filename)
 {
     strcpy_s(buf, buf_size, path);
@@ -568,7 +568,7 @@ static int skip_matching_file(const char *filename)
 }
 #endif
 
-int find_file_next(FindFileState *s, char *filename, int filename_size_max)
+static int find_file_next(FindFileState *s, char *filename, int filename_size_max)
 {
 #ifdef _WIN32
     int    fFound;
@@ -635,7 +635,7 @@ CheckFile:
 #endif
 }
 
-void find_file_close(FindFileState *s)
+static void find_file_close(FindFileState *s)
 {
 #ifdef _WIN32
     if (INVALID_HANDLE_VALUE != s->dir)
@@ -647,7 +647,7 @@ void find_file_close(FindFileState *s)
     free(s);
 }
 
-int StrList_Len(StrList **root)
+static int StrList_Len(StrList **root)
 {
     int         len = 0;
     StrList *   cur;
@@ -662,7 +662,7 @@ int StrList_Len(StrList **root)
     return len;
 }
 
-int StrList_InsertAndOwn(StrList **root, char *txt)
+static int StrList_InsertAndOwn(StrList **root, char *txt)
 {
     StrList *   el;
     assert(root && txt);
@@ -678,7 +678,7 @@ int StrList_InsertAndOwn(StrList **root, char *txt)
     return true;
 }
 
-int StrList_Insert(StrList **root, char *txt)
+static int StrList_Insert(StrList **root, char *txt)
 {
     char *txtDup;
 
@@ -696,7 +696,7 @@ int StrList_Insert(StrList **root, char *txt)
     return true;
 }
 
-StrList* StrList_RemoveHead(StrList **root)
+static StrList* StrList_RemoveHead(StrList **root)
 {
     StrList *tmp;
     assert(root);
@@ -711,7 +711,7 @@ StrList* StrList_RemoveHead(StrList **root)
     return tmp;
 }
 
-void StrList_FreeElement(StrList *el)
+static void StrList_FreeElement(StrList *el)
 {
     if (!el)
         return;
@@ -719,7 +719,7 @@ void StrList_FreeElement(StrList *el)
     free((void*)el);
 }
 
-void StrList_Destroy(StrList **root)
+static void StrList_Destroy(StrList **root)
 {
     StrList *   cur;
     StrList *   next;
@@ -736,15 +736,15 @@ void StrList_Destroy(StrList **root)
 }
 
 #ifndef _WIN32
-void OutputDebugString(const char *txt)
+/*static void OutputDebugString(const char *txt)
 {
-    /* do nothing */
-}
+    // do nothing
+}*/
 #define _snprintf snprintf
 #define _vsnprintf vsnprintf
 #endif
 
-void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
+static void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
 #if 0
     char        buf[4096], *p = buf;
 
@@ -798,7 +798,7 @@ void my_error(void *, ErrorCategory, Goffset pos, char *msg) {
 #endif
 }
 
-void LogInfo(const char *fmt, ...)
+static void LogInfo(const char *fmt, ...)
 {
     va_list args;
     char        buf[4096], *p = buf;
@@ -1128,7 +1128,7 @@ Exit:
 #include <sys/types.h>
 #include <sys/stat.h>
 
-bool IsDirectoryName(char *path)
+static bool IsDirectoryName(char *path)
 {
     struct _stat    buf;
     int             result;
@@ -1143,7 +1143,7 @@ bool IsDirectoryName(char *path)
     return false;
 }
 
-bool IsFileName(char *path)
+static bool IsFileName(char *path)
 {
     struct _stat    buf;
     int             result;
@@ -1158,20 +1158,20 @@ bool IsFileName(char *path)
     return false;
 }
 #else
-bool IsDirectoryName(char *path)
+static bool IsDirectoryName(char *path)
 {
     /* TODO: implement me */
     return false;
 }
 
-bool IsFileName(char *path)
+static bool IsFileName(char *path)
 {
     /* TODO: implement me */
     return true;
 }
 #endif
 
-bool IsPdfFileName(char *path)
+static bool IsPdfFileName(char *path)
 {
     if (str_endswith(path, ".pdf"))
         return true;
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 2ef1cd59..b29e97a0 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -186,7 +186,7 @@ static void printInfoDate(Dict *infoDict, const char *key, const char *text) {
   }
 }
 
-void printISODate(Dict *infoDict, const char *key, const char *text)
+static void printISODate(Dict *infoDict, const char *key, const char *text)
 {
   char *s;
   int year, mon, day, hour, min, sec, tz_hour, tz_minute;
@@ -428,7 +428,7 @@ static void printDestinations(PDFDoc *doc, UnicodeMap *uMap) {
   }
 }
 
-void printInfo(PDFDoc *doc, UnicodeMap *uMap, long long filesize, GBool multiPage) {
+static void printInfo(PDFDoc *doc, UnicodeMap *uMap, long long filesize, GBool multiPage) {
   Page *page;
   char buf[256];
   double w, h, wISO, hISO;
diff --git a/utils/pdfseparate.cc b/utils/pdfseparate.cc
index a6f1d5ec..30b524ff 100644
--- a/utils/pdfseparate.cc
+++ b/utils/pdfseparate.cc
@@ -48,7 +48,7 @@ static const ArgDesc argDesc[] = {
   {NULL}
 };
 
-bool extractPages (const char *srcFileName, const char *destFileName) {
+static bool extractPages (const char *srcFileName, const char *destFileName) {
   char pathName[4096];
   GooString *gfileName = new GooString (srcFileName);
   PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
diff --git a/utils/pdfsig.cc b/utils/pdfsig.cc
index 8b5182d9..eb8acd79 100644
--- a/utils/pdfsig.cc
+++ b/utils/pdfsig.cc
@@ -30,7 +30,7 @@
 #include "GlobalParams.h"
 #include "SignatureInfo.h"
 
-const char * getReadableSigState(SignatureValidationStatus sig_vs)
+static const char * getReadableSigState(SignatureValidationStatus sig_vs)
 {
   switch(sig_vs) {
     case SIGNATURE_VALID:
@@ -53,7 +53,7 @@ const char * getReadableSigState(SignatureValidationStatus sig_vs)
   }
 }
 
-const char * getReadableCertState(CertificateValidationStatus cert_vs)
+static const char * getReadableCertState(CertificateValidationStatus cert_vs)
 {
   switch(cert_vs) {
     case CERTIFICATE_TRUSTED:
@@ -79,7 +79,7 @@ const char * getReadableCertState(CertificateValidationStatus cert_vs)
   }
 }
 
-char *getReadableTime(time_t unix_time)
+static char *getReadableTime(time_t unix_time)
 {
   char * time_str = (char *) gmalloc(64);
   strftime(time_str, 64, "%b %d %Y %H:%M:%S", localtime(&unix_time));
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index 141de72a..ebf9a2b2 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -483,7 +483,7 @@ static void printInfoDate(FILE *f, Dict *infoDict, const char *key, const char *
   }
 }
 
-void printLine(FILE *f, TextLine *line) {
+static void printLine(FILE *f, TextLine *line) {
   double xMin, yMin, xMax, yMax;
   double lineXMin = 0, lineYMin = 0, lineXMax = 0, lineYMax = 0;
   TextWord *word;
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
index c223c80b..1c86cdd5 100644
--- a/utils/pdfunite.cc
+++ b/utils/pdfunite.cc
@@ -38,7 +38,7 @@ static const ArgDesc argDesc[] = {
   {NULL}
 };
 
-void doMergeNameTree(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum, int newRefNum, Dict *srcNameTree, Dict *mergeNameTree, int numOffset) {
+static void doMergeNameTree(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum, int newRefNum, Dict *srcNameTree, Dict *mergeNameTree, int numOffset) {
   Object mergeNameArray = mergeNameTree->lookup("Names");
   Object srcNameArray = srcNameTree->lookup("Names");
   if (mergeNameArray.isArray() && srcNameArray.isArray()) {
@@ -95,7 +95,7 @@ void doMergeNameTree(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum,
   }
 }
 
-void doMergeNameDict(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum, int newRefNum, Dict *srcNameDict, Dict *mergeNameDict, int numOffset) {
+static void doMergeNameDict(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum, int newRefNum, Dict *srcNameDict, Dict *mergeNameDict, int numOffset) {
   for (int i = 0; i < mergeNameDict->getLength(); i++) {
     const char *key = mergeNameDict->getKey(i);
     Object mergeNameTree = mergeNameDict->lookup(key);
@@ -110,7 +110,7 @@ void doMergeNameDict(PDFDoc *doc, XRef *srcXRef, XRef *countRef, int oldRefNum,
   }
 }
 
-void doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset) {
+static void doMergeFormDict(Dict *srcFormDict, Dict *mergeFormDict, int numOffset) {
   Object srcFields = srcFormDict->lookup("Fields");
   Object mergeFields = mergeFormDict->lookup("Fields");
   if (srcFields.isArray() && mergeFields.isArray()) {


More information about the poppler mailing list