[poppler] 12 commits - poppler/Annot.cc poppler/CompactFontTables.h poppler/DCTStream.cc poppler/Decrypt.cc poppler/Function.cc poppler/GfxFont.cc poppler/GfxState.cc poppler/GlobalParams.cc poppler/JBIG2Stream.cc poppler/JPXStream.cc poppler/Lexer.cc poppler/Object.cc poppler/Object.h poppler/PSOutputDev.cc poppler/PSTokenizer.cc poppler/SplashOutputDev.cc poppler/Stream.cc poppler/Stream-CCITT.h poppler/UnicodeTypeTable.cc poppler/XRef.cc utils/parseargs.c utils/parseargs.h utils/pdffonts.cc utils/pdfimages.cc utils/pdfinfo.cc utils/pdftoabw.cc utils/pdftohtml.cc utils/pdftoppm.cc utils/pdftops.cc utils/pdftotext.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Apr 29 14:46:31 PDT 2008


 poppler/Annot.cc            |    2 +-
 poppler/CompactFontTables.h |    2 +-
 poppler/DCTStream.cc        |    2 +-
 poppler/Decrypt.cc          |    8 ++++----
 poppler/Function.cc         |    2 +-
 poppler/GfxFont.cc          |    6 +++---
 poppler/GfxState.cc         |    4 ++--
 poppler/GlobalParams.cc     |    2 +-
 poppler/JBIG2Stream.cc      |   40 ++++++++++++++++++++--------------------
 poppler/JPXStream.cc        |    4 ++--
 poppler/Lexer.cc            |    2 +-
 poppler/Object.cc           |    2 +-
 poppler/Object.h            |    2 +-
 poppler/PSOutputDev.cc      |    6 +++---
 poppler/PSTokenizer.cc      |    2 +-
 poppler/SplashOutputDev.cc  |    2 +-
 poppler/Stream-CCITT.h      |   12 ++++++------
 poppler/Stream.cc           |   10 +++++-----
 poppler/UnicodeTypeTable.cc |    2 +-
 poppler/XRef.cc             |    2 +-
 utils/parseargs.c           |   18 +++++++++---------
 utils/parseargs.h           |    4 ++--
 utils/pdffonts.cc           |    2 +-
 utils/pdfimages.cc          |    2 +-
 utils/pdfinfo.cc            |    2 +-
 utils/pdftoabw.cc           |    4 ++--
 utils/pdftohtml.cc          |    6 +++---
 utils/pdftoppm.cc           |    4 ++--
 utils/pdftops.cc            |    4 ++--
 utils/pdftotext.cc          |    2 +-
 30 files changed, 81 insertions(+), 81 deletions(-)

New commits:
commit 926c13825d5f7364286975db8ffa507b92f4b3ab
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:44:51 2008 +0200

    add lost return when adding kees patch

diff --git a/poppler/Object.h b/poppler/Object.h
index 19cec9d..c73d010 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -295,7 +295,7 @@ inline Object *Object::dictGetValNF(int i, Object *obj)
 #include "Stream.h"
 
 inline GBool Object::streamIs(char *dictType)
-  { OBJECT_TYPE_CHECK(objStream); stream->getDict()->is(dictType); }
+  { OBJECT_TYPE_CHECK(objStream); return stream->getDict()->is(dictType); }
 
 inline GBool Object::isStream(char *dictType)
   { return type == objStream && streamIs(dictType); }
commit ba9283f6bc78e97006e52ef5de20c958ee9e1a37
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:42:00 2008 +0200

    make the function static

diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 4a4006d..4d32e6b 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -99,7 +99,7 @@ static const ArgDesc argDesc[] = {
   {NULL}
 };
 
-void savePageSlice(PDFDoc *doc,
+static void savePageSlice(PDFDoc *doc,
                    SplashOutputDev *splashOut, 
                    int pg, int x, int y, int w, int h, 
                    double pg_w, double pg_h, 
commit 931a8272f556ba8a35342f0c5bf53bdb57ea7a31
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:41:31 2008 +0200

    make the variable static

diff --git a/utils/pdftoabw.cc b/utils/pdftoabw.cc
index ebbf271..10e9bb3 100644
--- a/utils/pdftoabw.cc
+++ b/utils/pdftoabw.cc
@@ -38,7 +38,7 @@
 static int firstPage = 1;
 static int lastPage = 0;
 static GBool printHelp = gFalse;
-GBool stout = gFalse;
+static GBool stout = gFalse;
 static char ownerPassword[33] = "";
 static char userPassword[33] = "";
 
commit 1887d2910d2006c7fc3ecc95db0150f1537e9d0a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:35:17 2008 +0200

    constify some static arrays

diff --git a/poppler/CompactFontTables.h b/poppler/CompactFontTables.h
index 28e16e7..757e1cb 100644
--- a/poppler/CompactFontTables.h
+++ b/poppler/CompactFontTables.h
@@ -429,7 +429,7 @@ static Gushort type1CISOAdobeCharset[229] = {
   220, 221, 222, 223, 224, 225, 226, 227, 228
 };
 
-static Gushort type1CExpertCharset[166] = {
+static const Gushort type1CExpertCharset[166] = {
     0,   1, 229, 230, 231, 232, 233, 234, 235, 236,
   237, 238,  13,  14,  15,  99, 239, 240, 241, 242,
   243, 244, 245, 246, 247, 248,  27,  28, 249, 250,
diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
index cc148ba..4c89ae4 100644
--- a/poppler/Decrypt.cc
+++ b/poppler/Decrypt.cc
@@ -22,7 +22,7 @@ static void aesKeyExpansion(DecryptAESState *s,
 			    Guchar *objKey, int objKeyLen);
 static void aesDecryptBlock(DecryptAESState *s, Guchar *in, GBool last);
 
-static Guchar passwordPad[32] = {
+static const Guchar passwordPad[32] = {
   0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
   0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 
   0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 
@@ -351,7 +351,7 @@ static Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
 // AES decryption
 //------------------------------------------------------------------------
 
-static Guchar sbox[256] = {
+static const Guchar sbox[256] = {
   0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
   0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
   0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
@@ -370,7 +370,7 @@ static Guchar sbox[256] = {
   0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
 };
 
-static Guchar invSbox[256] = {
+static const Guchar invSbox[256] = {
   0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb,
   0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb,
   0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e,
@@ -389,7 +389,7 @@ static Guchar invSbox[256] = {
   0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
 };
 
-static Guint rcon[11] = {
+static const Guint rcon[11] = {
   0x00000000, // unused
   0x01000000,
   0x02000000,
diff --git a/poppler/Function.cc b/poppler/Function.cc
index 4cc94c2..f852e01 100644
--- a/poppler/Function.cc
+++ b/poppler/Function.cc
@@ -753,7 +753,7 @@ enum PSOp {
 // Note: 'if' and 'ifelse' are parsed separately.
 // The rest are listed here in alphabetical order.
 // The index in this table is equivalent to the entry in PSOp.
-static char *psOpNames[] = {
+static const char *psOpNames[] = {
   "abs",
   "add",
   "and",
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 19aae31..9ec64d5 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -42,7 +42,7 @@ struct StdFontMapEntry {
 // the proper Base14 names.  This table is from implementation note 44
 // in the PDF 1.4 spec, with some additions based on empirical
 // evidence.
-static StdFontMapEntry stdFontMap[] = {
+static const StdFontMapEntry stdFontMap[] = {
   { "Arial",                        "Helvetica" },
   { "Arial,Bold",                   "Helvetica-Bold" },
   { "Arial,BoldItalic",             "Helvetica-BoldOblique" },
@@ -1724,7 +1724,7 @@ Gushort GfxCIDFont::mapCodeToGID(FoFiTrueType *ff, int cmapi,
 Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
 #define N_UCS_CANDIDATES 2
   /* space characters */
-  static unsigned long spaces[] = { 
+  static const unsigned long spaces[] = { 
     0x2000,0x2001,0x2002,0x2003,0x2004,0x2005,0x2006,0x2007,
     0x2008,0x2009,0x200A,0x00A0,0x200B,0x2060,0x3000,0xFEFF,
     0
@@ -1945,7 +1945,7 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
     }
     if (gid == 0) {
       /* special handling space characters */
-      unsigned long *p;
+      const unsigned long *p;
 
       if (humap != 0) unicode = humap[code];
       if (unicode != 0) {
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 371ef3d..98628bf 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -66,7 +66,7 @@ struct GfxBlendModeInfo {
   GfxBlendMode mode;
 };
 
-static GfxBlendModeInfo gfxBlendModeNames[] = {
+static const GfxBlendModeInfo gfxBlendModeNames[] = {
   { "Normal",     gfxBlendNormal },
   { "Compatible", gfxBlendNormal },
   { "Multiply",   gfxBlendMultiply },
@@ -699,7 +699,7 @@ void GfxDeviceCMYKColorSpace::getDefaultColor(GfxColor *color) {
 
 // This is the inverse of MatrixLMN in Example 4.10 from the PostScript
 // Language Reference, Third Edition.
-static double xyzrgb[3][3] = {
+static const double xyzrgb[3][3] = {
   {  3.240449, -1.537136, -0.498531 },
   { -0.969265,  1.876011,  0.041556 },
   {  0.055643, -0.204026,  1.057229 }
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 14bd7a2..4d9157b 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -24,8 +24,8 @@
 
 //------------------------------------------------------------------------
 
-static int contextSize[4] = { 16, 13, 10, 10 };
-static int refContextSize[2] = { 13, 10 };
+static const int contextSize[4] = { 16, 13, 10, 10 };
+static const int refContextSize[2] = { 13, 10 };
 
 //------------------------------------------------------------------------
 // JBIG2HuffmanTable
@@ -471,7 +471,7 @@ void JBIG2MMRDecoder::reset() {
 }
 
 int JBIG2MMRDecoder::get2DCode() {
-  CCITTCode *p;
+  const CCITTCode *p;
 
   if (bufLen == 0) {
     buf = str->getChar() & 0xff;
@@ -498,7 +498,7 @@ int JBIG2MMRDecoder::get2DCode() {
 }
 
 int JBIG2MMRDecoder::getWhiteCode() {
-  CCITTCode *p;
+  const CCITTCode *p;
   Guint code;
 
   if (bufLen == 0) {
@@ -541,7 +541,7 @@ int JBIG2MMRDecoder::getWhiteCode() {
 }
 
 int JBIG2MMRDecoder::getBlackCode() {
-  CCITTCode *p;
+  const CCITTCode *p;
   Guint code;
 
   if (bufLen == 0) {
diff --git a/poppler/JPXStream.cc b/poppler/JPXStream.cc
index 38246ba..1068a78 100644
--- a/poppler/JPXStream.cc
+++ b/poppler/JPXStream.cc
@@ -65,7 +65,7 @@
 // where subband = 0 for HL
 //               = 1 for LH and LL
 //               = 2 for HH
-static Guint sigPropContext[3][3][5][3] = {
+static const Guint sigPropContext[3][3][5][3] = {
   {{{ 0, 0, 0 },   // horiz=0, vert=0, diag=0
     { 1, 1, 3 },   // horiz=0, vert=0, diag=1
     { 2, 2, 6 },   // horiz=0, vert=0, diag=2
@@ -119,7 +119,7 @@ static Guint sigPropContext[3][3][5][3] = {
 // where horiz/vert are offset by 2 (i.e., range is -2 .. 2)
 // and k = 0 for the context
 //       = 1 for the xor bit
-static Guint signContext[5][5][2] = {
+static const Guint signContext[5][5][2] = {
   {{ 13, 1 },  // horiz=-2, vert=-2
    { 13, 1 },  // horiz=-2, vert=-1
    { 12, 1 },  // horiz=-2, vert= 0
diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index beb83da..83ebb05 100644
--- a/poppler/Lexer.cc
+++ b/poppler/Lexer.cc
@@ -24,7 +24,7 @@
 
 // A '1' in this array means the character is white space.  A '1' or
 // '2' means the character ends a name or command.
-static char specialChars[256] = {
+static const char specialChars[256] = {
   1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,   // 0x
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   // 1x
   1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2,   // 2x
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 7eb486d..e8aeb46 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -753,7 +753,7 @@ struct PSSubstFont {
   double mWidth;		// width of 'm' character
 };
 
-static char *psFonts[] = {
+static const char *psFonts[] = {
   "Courier",
   "Courier-Bold",
   "Courier-Oblique",
@@ -771,7 +771,7 @@ static char *psFonts[] = {
   NULL
 };
 
-static PSSubstFont psSubstFonts[] = {
+static const PSSubstFont psSubstFonts[] = {
   {"Helvetica",             0.833},
   {"Helvetica-Oblique",     0.833},
   {"Helvetica-Bold",        0.889},
@@ -1851,7 +1851,7 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
 }
 
 void PSOutputDev::setupEmbeddedType1Font(Ref *id, GooString *psName) {
-  static char hexChar[17] = "0123456789abcdef";
+  static const char hexChar[17] = "0123456789abcdef";
   Object refObj, strObj, obj1, obj2, obj3;
   Dict *dict;
   int length1, length2, length3;
diff --git a/poppler/PSTokenizer.cc b/poppler/PSTokenizer.cc
index 96ad4e5..0e70df5 100644
--- a/poppler/PSTokenizer.cc
+++ b/poppler/PSTokenizer.cc
@@ -20,7 +20,7 @@
 
 // A '1' in this array means the character is white space.  A '1' or
 // '2' means the character ends a name or command.
-static char specialChars[256] = {
+static const char specialChars[256] = {
   1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0,   // 0x
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,   // 1x
   1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2,   // 2x
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 55b7564..65bd6b1 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -395,7 +395,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
 }
 
 // NB: This must match the GfxBlendMode enum defined in GfxState.h.
-static SplashBlendFunc splashOutBlendFuncs[] = {
+static const SplashBlendFunc splashOutBlendFuncs[] = {
   NULL,
   &splashOutBlendMultiply,
   &splashOutBlendScreen,
diff --git a/poppler/Stream-CCITT.h b/poppler/Stream-CCITT.h
index c4458fe..492fdad 100644
--- a/poppler/Stream-CCITT.h
+++ b/poppler/Stream-CCITT.h
@@ -30,7 +30,7 @@ struct CCITTCode {
 #define twoDimVertL3 8
 
 // 1-7 bit codes
-static CCITTCode twoDimTab1[128] = {
+static const CCITTCode twoDimTab1[128] = {
   {-1, -1}, {-1, -1},		        // 000000x
   {7, twoDimVertL3},		        // 0000010
   {7, twoDimVertR3},		        // 0000011
@@ -103,7 +103,7 @@ static CCITTCode twoDimTab1[128] = {
 //------------------------------------------------------------------------
 
 // 11-12 bit codes (upper 7 bits are 0)
-static CCITTCode whiteTab1[32] = {
+static const CCITTCode whiteTab1[32] = {
   {-1, -1},					// 00000
   {12, ccittEOL},				// 00001
   {-1, -1}, {-1, -1},				// 0001x
@@ -126,7 +126,7 @@ static CCITTCode whiteTab1[32] = {
 };
 
 // 1-9 bit codes
-static CCITTCode whiteTab2[512] = {
+static const CCITTCode whiteTab2[512] = {
   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},	// 0000000xx
   {8, 29}, {8, 29},				// 00000010x
   {8, 30}, {8, 30},				// 00000011x
@@ -295,7 +295,7 @@ static CCITTCode whiteTab2[512] = {
 //------------------------------------------------------------------------
 
 // 10-13 bit codes (upper 6 bits are 0)
-static CCITTCode blackTab1[128] = {
+static const CCITTCode blackTab1[128] = {
   {-1, -1}, {-1, -1},					// 000000000000x
   {12, ccittEOL}, {12, ccittEOL},			// 000000000001x
   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},		// 00000000001xx
@@ -357,7 +357,7 @@ static CCITTCode blackTab1[128] = {
 };
 
 // 7-12 bit codes (upper 4 bits are 0)
-static CCITTCode blackTab2[192] = {
+static const CCITTCode blackTab2[192] = {
   {8, 13}, {8, 13}, {8, 13}, {8, 13},			// 00000100xxxx
     {8, 13}, {8, 13}, {8, 13}, {8, 13},
     {8, 13}, {8, 13}, {8, 13}, {8, 13},
@@ -437,7 +437,7 @@ static CCITTCode blackTab2[192] = {
 };
 
 // 2-6 bit codes
-static CCITTCode blackTab3[64] = {
+static const CCITTCode blackTab3[64] = {
   {-1, -1}, {-1, -1}, {-1, -1}, {-1, -1},		// 0000xx
   {6, 9},						// 000100
   {6, 8},						// 000101
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index f00587d..b662edb 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -1735,7 +1735,7 @@ int CCITTFaxStream::lookChar() {
 
 short CCITTFaxStream::getTwoDimCode() {
   short code;
-  CCITTCode *p;
+  const CCITTCode *p;
   int n;
 
   code = 0; // make gcc happy
@@ -1765,7 +1765,7 @@ short CCITTFaxStream::getTwoDimCode() {
 
 short CCITTFaxStream::getWhiteCode() {
   short code;
-  CCITTCode *p;
+  const CCITTCode *p;
   int n;
 
   code = 0; // make gcc happy
@@ -1822,7 +1822,7 @@ short CCITTFaxStream::getWhiteCode() {
 
 short CCITTFaxStream::getBlackCode() {
   short code;
-  CCITTCode *p;
+  const CCITTCode *p;
   int n;
 
   code = 0; // make gcc happy
@@ -1984,7 +1984,7 @@ static Guchar dctClip[768];
 static int dctClipInit = 0;
 
 // zig zag decode map
-static int dctZigZag[64] = {
+static const int dctZigZag[64] = {
    0,
    1,  8,
   16,  9,  2,
@@ -4558,7 +4558,7 @@ void ASCIIHexEncoder::reset() {
 }
 
 GBool ASCIIHexEncoder::fillBuf() {
-  static char *hex = "0123456789abcdef";
+  static const char *hex = "0123456789abcdef";
   int c;
 
   if (eof) {
diff --git a/poppler/UnicodeTypeTable.cc b/poppler/UnicodeTypeTable.cc
index 1f5f41f..2aade77 100644
--- a/poppler/UnicodeTypeTable.cc
+++ b/poppler/UnicodeTypeTable.cc
@@ -20,7 +20,7 @@ struct UnicodeCaseTableVector {
   Unicode codes[256];
 };
 
-static UnicodeMapTableEntry typeTable[256] = {
+static const UnicodeMapTableEntry typeTable[256] = {
   { "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNLNNNNNNNNNNLNNNNLNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL", 'X' },
   { NULL, 'L' },
   { "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNNLLLLLLLNNNNNNNNNNNNNNLLNNNNNNNNNNNNNNLLLLLNNNNNNNNNLNNNNNNNNNNNNNNNNN", 'X' },
commit 51140e2d9490696d716f77d3225da0bfdfc212b4
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:14:59 2008 +0200

    more static markers

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index f611558..ecf76d8 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -94,7 +94,7 @@ AnnotLineEndingStyle parseAnnotLineEndingStyle(GooString *string) {
   }  
 }
 
-AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
+static AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
   Object obj1;
   AnnotExternalDataType type;
 
diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc
index b568ca5..99f1aeb 100644
--- a/poppler/DCTStream.cc
+++ b/poppler/DCTStream.cc
@@ -62,7 +62,7 @@ DCTStream::~DCTStream() {
   delete str;
 }
 
-void exitErrorHandler(jpeg_common_struct *error) {
+static void exitErrorHandler(jpeg_common_struct *error) {
   j_decompress_ptr cinfo = (j_decompress_ptr)error;
   str_src_mgr * src = (struct str_src_mgr *)cinfo->src;
   src->abort = true;
diff --git a/poppler/Object.cc b/poppler/Object.cc
index ae6a172..b5c0d51 100644
--- a/poppler/Object.cc
+++ b/poppler/Object.cc
@@ -24,7 +24,7 @@
 // Object
 //------------------------------------------------------------------------
 
-char *objTypeNames[numObjTypes] = {
+static char *objTypeNames[numObjTypes] = {
   "boolean",
   "integer",
   "real",
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 9aa99db..55b7564 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -395,7 +395,7 @@ static void splashOutBlendLuminosity(SplashColorPtr src, SplashColorPtr dest,
 }
 
 // NB: This must match the GfxBlendMode enum defined in GfxState.h.
-SplashBlendFunc splashOutBlendFuncs[] = {
+static SplashBlendFunc splashOutBlendFuncs[] = {
   NULL,
   &splashOutBlendMultiply,
   &splashOutBlendScreen,
commit 893703cb9eee879f728db329f7ee1fc19e7f980e
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:03:51 2008 +0200

    add static

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 7362a3c..26a4aa8 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -1070,7 +1070,7 @@ Ref XRef::addIndirectObject (Object* o) {
 
 
 //used to sort the entries
-int compare (const void* a, const void* b)
+static int compare (const void* a, const void* b)
 {
   return (((XRefEntry*)a)->num - ((XRefEntry*)b)->num);
 }
commit 7333bc913111e56ee241b7ef2bf6e9fea68b7da2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 23:01:13 2008 +0200

    add static

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 5801489..14bd7a2 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -42,7 +42,7 @@ struct JBIG2HuffmanTable {
   Guint prefix;
 };
 
-JBIG2HuffmanTable huffTableA[] = {
+static JBIG2HuffmanTable huffTableA[] = {
   {     0, 1,  4,              0x000 },
   {    16, 2,  8,              0x002 },
   {   272, 3, 16,              0x006 },
@@ -50,7 +50,7 @@ JBIG2HuffmanTable huffTableA[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableB[] = {
+static JBIG2HuffmanTable huffTableB[] = {
   {     0, 1,  0,              0x000 },
   {     1, 2,  0,              0x002 },
   {     2, 3,  0,              0x006 },
@@ -61,7 +61,7 @@ JBIG2HuffmanTable huffTableB[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableC[] = {
+static JBIG2HuffmanTable huffTableC[] = {
   {     0, 1,  0,              0x000 },
   {     1, 2,  0,              0x002 },
   {     2, 3,  0,              0x006 },
@@ -74,7 +74,7 @@ JBIG2HuffmanTable huffTableC[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableD[] = {
+static JBIG2HuffmanTable huffTableD[] = {
   {     1, 1,  0,              0x000 },
   {     2, 2,  0,              0x002 },
   {     3, 3,  0,              0x006 },
@@ -84,7 +84,7 @@ JBIG2HuffmanTable huffTableD[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableE[] = {
+static JBIG2HuffmanTable huffTableE[] = {
   {     1, 1,  0,              0x000 },
   {     2, 2,  0,              0x002 },
   {     3, 3,  0,              0x006 },
@@ -96,7 +96,7 @@ JBIG2HuffmanTable huffTableE[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableF[] = {
+static JBIG2HuffmanTable huffTableF[] = {
   {     0, 2,  7,              0x000 },
   {   128, 3,  7,              0x002 },
   {   256, 3,  8,              0x003 },
@@ -114,7 +114,7 @@ JBIG2HuffmanTable huffTableF[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableG[] = {
+static JBIG2HuffmanTable huffTableG[] = {
   {  -512, 3,  8,              0x000 },
   {   256, 3,  8,              0x001 },
   {   512, 3,  9,              0x002 },
@@ -133,7 +133,7 @@ JBIG2HuffmanTable huffTableG[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableH[] = {
+static JBIG2HuffmanTable huffTableH[] = {
   {     0, 2,  1,              0x000 },
   {     0, 2, jbig2HuffmanOOB, 0x001 },
   {     4, 3,  4,              0x004 },
@@ -158,7 +158,7 @@ JBIG2HuffmanTable huffTableH[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableI[] = {
+static JBIG2HuffmanTable huffTableI[] = {
   {     0, 2, jbig2HuffmanOOB, 0x000 },
   {    -1, 3,  1,              0x002 },
   {     1, 3,  1,              0x003 },
@@ -184,7 +184,7 @@ JBIG2HuffmanTable huffTableI[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableJ[] = {
+static JBIG2HuffmanTable huffTableJ[] = {
   {    -2, 2,  2,              0x000 },
   {     6, 2,  6,              0x001 },
   {     0, 2, jbig2HuffmanOOB, 0x002 },
@@ -209,7 +209,7 @@ JBIG2HuffmanTable huffTableJ[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableK[] = {
+static JBIG2HuffmanTable huffTableK[] = {
   {     1, 1,  0,              0x000 },
   {     2, 2,  1,              0x002 },
   {     4, 4,  0,              0x00c },
@@ -226,7 +226,7 @@ JBIG2HuffmanTable huffTableK[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableL[] = {
+static JBIG2HuffmanTable huffTableL[] = {
   {     1, 1,  0,              0x000 },
   {     2, 2,  0,              0x002 },
   {     3, 3,  1,              0x006 },
@@ -243,7 +243,7 @@ JBIG2HuffmanTable huffTableL[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableM[] = {
+static JBIG2HuffmanTable huffTableM[] = {
   {     1, 1,  0,              0x000 },
   {     2, 3,  0,              0x004 },
   {     7, 3,  3,              0x005 },
@@ -260,7 +260,7 @@ JBIG2HuffmanTable huffTableM[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableN[] = {
+static JBIG2HuffmanTable huffTableN[] = {
   {     0, 1,  0,              0x000 },
   {    -2, 3,  0,              0x004 },
   {    -1, 3,  0,              0x005 },
@@ -269,7 +269,7 @@ JBIG2HuffmanTable huffTableN[] = {
   {     0, 0, jbig2HuffmanEOT, 0     }
 };
 
-JBIG2HuffmanTable huffTableO[] = {
+static JBIG2HuffmanTable huffTableO[] = {
   {     0, 1,  0,              0x000 },
   {    -1, 3,  0,              0x004 },
   {     1, 3,  0,              0x005 },
commit 1ea36507f9c9f163b6772268046e7560d0c00dbc
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 22:47:19 2008 +0200

    make findModifier static

diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 925a602..db1ac04 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -907,7 +907,7 @@ FILE *GlobalParams::findToUnicodeFile(GooString *name) {
   return NULL;
 }
 
-GBool findModifier(const char *name, const char *modifier, const char **start)
+static GBool findModifier(const char *name, const char *modifier, const char **start)
 {
   const char *match;
 
commit be9961571dbfabb982e6f69abd3bbc98fa971864
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 21:48:09 2008 +0200

    make variables not used outside static

diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 2604db7..392f336 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -50,8 +50,8 @@ double scale=1.5;
 GBool noframes=gFalse;
 GBool stout=gFalse;
 GBool xml=gFalse;
-GBool errQuiet=gFalse;
-GBool noDrm=gFalse;
+static GBool errQuiet=gFalse;
+static GBool noDrm=gFalse;
 
 GBool showHidden = gFalse;
 GBool noMerge = gFalse;
commit b157064a85350da6ea9c4f46e965e45ebc59d227
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 21:43:23 2008 +0200

    constify setPSPaperSize

diff --git a/utils/pdftops.cc b/utils/pdftops.cc
index e3f426c..69562a2 100644
--- a/utils/pdftops.cc
+++ b/utils/pdftops.cc
@@ -29,7 +29,7 @@
 #include "PSOutputDev.h"
 #include "Error.h"
 
-GBool setPSPaperSize(char *size, int &psPaperWidth, int &psPaperHeight) {
+static GBool setPSPaperSize(char *size, int &psPaperWidth, int &psPaperHeight) {
   if (!strcmp(size, "match")) {
     psPaperWidth = psPaperHeight = -1;
   } else if (!strcmp(size, "letter")) {
commit ee57ead8a6f34fa8de044399e5912395e0f3a425
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 21:37:57 2008 +0200

    constify argDesc arrays
    
    Gives me binaries 2KB smaller (in total) in release build

diff --git a/utils/parseargs.c b/utils/parseargs.c
index 9f57943..465c2cb 100644
--- a/utils/parseargs.c
+++ b/utils/parseargs.c
@@ -13,11 +13,11 @@
 #include <ctype.h>
 #include "parseargs.h"
 
-static ArgDesc *findArg(ArgDesc *args, char *arg);
-static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]);
+static const ArgDesc *findArg(const ArgDesc *args, char *arg);
+static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]);
 
-GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) {
-  ArgDesc *arg;
+GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]) {
+  const ArgDesc *arg;
   int i, j;
   GBool ok;
 
@@ -39,8 +39,8 @@ GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) {
   return ok;
 }
 
-void printUsage(char *program, char *otherArgs, ArgDesc *args) {
-  ArgDesc *arg;
+void printUsage(char *program, char *otherArgs, const ArgDesc *args) {
+  const ArgDesc *arg;
   char *typ;
   int w, w1;
 
@@ -84,8 +84,8 @@ void printUsage(char *program, char *otherArgs, ArgDesc *args) {
   }
 }
 
-static ArgDesc *findArg(ArgDesc *args, char *arg) {
-  ArgDesc *p;
+static const ArgDesc *findArg(const ArgDesc *args, char *arg) {
+  const ArgDesc *p;
 
   for (p = args; p->arg; ++p) {
     if (p->kind < argFlagDummy && !strcmp(p->arg, arg))
@@ -94,7 +94,7 @@ static ArgDesc *findArg(ArgDesc *args, char *arg) {
   return NULL;
 }
 
-static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]) {
+static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]) {
   int n;
   int j;
   GBool ok;
diff --git a/utils/parseargs.h b/utils/parseargs.h
index 1b1c570..983a425 100644
--- a/utils/parseargs.h
+++ b/utils/parseargs.h
@@ -51,12 +51,12 @@ typedef struct {
  * descriptor list <args>.  Stops parsing if "--" is found (and removes
  * it).  Returns gFalse if there was an error.
  */
-extern GBool parseArgs(ArgDesc *args, int *argc, char *argv[]);
+extern GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]);
 
 /*
  * Print usage message, based on arg descriptor list.
  */
-extern void printUsage(char *program, char *otherArgs, ArgDesc *args);
+extern void printUsage(char *program, char *otherArgs, const ArgDesc *args);
 
 /*
  * Check if a string is a valid integer or floating point number.
diff --git a/utils/pdffonts.cc b/utils/pdffonts.cc
index 8be7531..7691d7e 100644
--- a/utils/pdffonts.cc
+++ b/utils/pdffonts.cc
@@ -49,7 +49,7 @@ static char userPassword[33] = "\001";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
    "first page to examine"},
   {"-l",      argInt,      &lastPage,      0,
diff --git a/utils/pdfimages.cc b/utils/pdfimages.cc
index 3f42218..febbdea 100644
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@ -38,7 +38,7 @@ static GBool quiet = gFalse;
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
    "first page to convert"},
   {"-l",      argInt,      &lastPage,      0,
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 5dbd724..b9fc10e 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -46,7 +46,7 @@ static char userPassword[33] = "\001";
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,        0,
    "first page to convert"},
   {"-l",      argInt,      &lastPage,         0,
diff --git a/utils/pdftoabw.cc b/utils/pdftoabw.cc
index 1de338d..ebbf271 100644
--- a/utils/pdftoabw.cc
+++ b/utils/pdftoabw.cc
@@ -44,7 +44,7 @@ static char userPassword[33] = "";
 
 // static char textEncName[128] = "";
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
    "first page to convert"},
   {"-l",      argInt,      &lastPage,      0,
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 1ebd7af..2604db7 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -65,7 +65,7 @@ static GooString* getInfoDate(Dict *infoDict, char *key);
 
 static char textEncName[128] = "";
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
    "first page to convert"},
   {"-l",      argInt,      &lastPage,      0,
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 164679d..4a4006d 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -42,7 +42,7 @@ static GBool quiet = gFalse;
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",      argInt,      &firstPage,     0,
    "first page to print"},
   {"-l",      argInt,      &lastPage,      0,
diff --git a/utils/pdftops.cc b/utils/pdftops.cc
index 8f60ea3..e3f426c 100644
--- a/utils/pdftops.cc
+++ b/utils/pdftops.cc
@@ -83,7 +83,7 @@ static GBool quiet = gFalse;
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",          argInt,      &firstPage,      0,
    "first page to print"},
   {"-l",          argInt,      &lastPage,       0,
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index a0caed8..10707e5 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -49,7 +49,7 @@ static GBool quiet = gFalse;
 static GBool printVersion = gFalse;
 static GBool printHelp = gFalse;
 
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
   {"-f",       argInt,      &firstPage,     0,
    "first page to convert"},
   {"-l",       argInt,      &lastPage,      0,
commit 9f93d9eb464877e0d23dcf205295da9162f03253
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 29 20:45:01 2008 +0200

    make psOpNames static
    
    Makes my release build 64 bytes smaller

diff --git a/poppler/Function.cc b/poppler/Function.cc
index c7ffbe1..4cc94c2 100644
--- a/poppler/Function.cc
+++ b/poppler/Function.cc
@@ -753,7 +753,7 @@ enum PSOp {
 // Note: 'if' and 'ifelse' are parsed separately.
 // The rest are listed here in alphabetical order.
 // The index in this table is equivalent to the entry in PSOp.
-char *psOpNames[] = {
+static char *psOpNames[] = {
   "abs",
   "add",
   "and",


More information about the poppler mailing list