Commit 4813adfa authored by Albert Astals Cid's avatar Albert Astals Cid

Some more const

parent 81a86064
...@@ -44,7 +44,7 @@ typedef struct ...@@ -44,7 +44,7 @@ typedef struct
const gchar *label; const gchar *label;
} Annotations; } Annotations;
static Annotations supported_annots[] = { static const Annotations supported_annots[] = {
{ POPPLER_ANNOT_TEXT, "Text" }, { POPPLER_ANNOT_TEXT, "Text" },
{ POPPLER_ANNOT_LINE, "Line" }, { POPPLER_ANNOT_LINE, "Line" },
{ POPPLER_ANNOT_SQUARE, "Square" }, { POPPLER_ANNOT_SQUARE, "Square" },
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// All changes made under the Poppler project to this file are licensed // All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2005, 2007-2011, 2014, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005, 2007-2011, 2014, 2018, 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Kristian Høgsberg <krh@bitplanet.net> // Copyright (C) 2006 Kristian Høgsberg <krh@bitplanet.net>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com> // Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2010 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp> // Copyright (C) 2010 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
...@@ -327,7 +327,7 @@ struct SplashFTFontPath { ...@@ -327,7 +327,7 @@ struct SplashFTFontPath {
}; };
SplashPath *SplashFTFont::getGlyphPath(int c) { SplashPath *SplashFTFont::getGlyphPath(int c) {
static FT_Outline_Funcs outlineFuncs = { static const FT_Outline_Funcs outlineFuncs = {
#if FREETYPE_MINOR <= 1 #if FREETYPE_MINOR <= 1
(int (*)(FT_Vector *, void *))&glyphPathMoveTo, (int (*)(FT_Vector *, void *))&glyphPathMoveTo,
(int (*)(FT_Vector *, void *))&glyphPathLineTo, (int (*)(FT_Vector *, void *))&glyphPathLineTo,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// All changes made under the Poppler project to this file are licensed // All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2009, 2016, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2009, 2016, 2018, 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it> // Copyright (C) 2012 Fabio D'Urso <fabiodurso@hotmail.it>
// //
// To see a description of the changes please see the Changelog file that // To see a description of the changes please see the Changelog file that
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "SplashMath.h" #include "SplashMath.h"
#include "SplashScreen.h" #include "SplashScreen.h"
static SplashScreenParams defaultParams = { static const SplashScreenParams defaultParams = {
splashScreenDispersed, // type splashScreenDispersed, // type
2, // size 2, // size
2, // dotRadius 2, // dotRadius
...@@ -62,7 +62,7 @@ struct cmpDistancesFunctor { ...@@ -62,7 +62,7 @@ struct cmpDistancesFunctor {
// sqrt(2)). If <clustered> is false, this generates an optimal // sqrt(2)). If <clustered> is false, this generates an optimal
// threshold matrix using recursive tesselation. Gamma correction // threshold matrix using recursive tesselation. Gamma correction
// (gamma = 1 / 1.33) is also computed here. // (gamma = 1 / 1.33) is also computed here.
SplashScreen::SplashScreen(SplashScreenParams *params) { SplashScreen::SplashScreen(const SplashScreenParams *params) {
if (!params) { if (!params) {
params = &defaultParams; params = &defaultParams;
...@@ -80,7 +80,7 @@ void SplashScreen::createMatrix() ...@@ -80,7 +80,7 @@ void SplashScreen::createMatrix()
unsigned char u; unsigned char u;
int black, white, i; int black, white, i;
SplashScreenParams *params = screenParams; const SplashScreenParams *params = screenParams;
// size must be a power of 2, and at least 2 // size must be a power of 2, and at least 2
for (size = 2, log2Size = 1; size < params->size; size <<= 1, ++log2Size) ; for (size = 2, log2Size = 1; size < params->size; size <<= 1, ++log2Size) ;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// All changes made under the Poppler project to this file are licensed // All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later // under GPL version 2 or later
// //
// Copyright (C) 2009, 2018 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2009, 2018, 2020 Albert Astals Cid <aacid@kde.org>
// //
// To see a description of the changes please see the Changelog file that // 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 // came with your tarball or type make ChangeLog if you are building from git
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
class SplashScreen { class SplashScreen {
public: public:
SplashScreen(SplashScreenParams *params); SplashScreen(const SplashScreenParams *params);
SplashScreen(SplashScreen *screen); SplashScreen(SplashScreen *screen);
~SplashScreen(); ~SplashScreen();
...@@ -65,7 +65,7 @@ private: ...@@ -65,7 +65,7 @@ private:
int distance(int x0, int y0, int x1, int y1); int distance(int x0, int y0, int x1, int y1);
void buildSCDMatrix(int r); void buildSCDMatrix(int r);
SplashScreenParams *screenParams; // params to create the other members const SplashScreenParams *screenParams; // params to create the other members
unsigned char *mat; // threshold matrix unsigned char *mat; // threshold matrix
int size; // size of the threshold matrix int size; // size of the threshold matrix
int sizeM1; // size - 1 int sizeM1; // size - 1
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
// This file is licensed under the GPLv2 or later // This file is licensed under the GPLv2 or later
// //
// Copyright (C) 2018, 2019 Greg Knight <lyngvi@gmail.com> // Copyright (C) 2018, 2019 Greg Knight <lyngvi@gmail.com>
// Copyright (C) 2020 Albert Astals Cid <aacid@kde.org>
// //
//======================================================================== //========================================================================
...@@ -63,7 +64,7 @@ FILE* InMemoryFile::open(const char* mode) ...@@ -63,7 +64,7 @@ FILE* InMemoryFile::open(const char* mode)
fprintf(stderr, "InMemoryFile: BUG: Why is this opened more than once?"); fprintf(stderr, "InMemoryFile: BUG: Why is this opened more than once?");
return nullptr; // maybe there's some legit reason for it, whoever comes up with one can remove this line return nullptr; // maybe there's some legit reason for it, whoever comes up with one can remove this line
} }
static cookie_io_functions_t methods = { static const cookie_io_functions_t methods = {
/* .read = */ [](void* self, char* buf, size_t sz) { return ((InMemoryFile*)self)->_read(buf, sz); }, /* .read = */ [](void* self, char* buf, size_t sz) { return ((InMemoryFile*)self)->_read(buf, sz); },
/* .write = */ [](void* self, const char* buf, size_t sz) { return ((InMemoryFile*)self)->_write(buf, sz); }, /* .write = */ [](void* self, const char* buf, size_t sz) { return ((InMemoryFile*)self)->_write(buf, sz); },
/* .seek = */ [](void* self, off64_t* offset, int whence) { return ((InMemoryFile*)self)->_seek(offset, whence); }, /* .seek = */ [](void* self, off64_t* offset, int whence) { return ((InMemoryFile*)self)->_seek(offset, whence); },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// This file is licensed under the GPLv2 or later // This file is licensed under the GPLv2 or later
// //
// Copyright (C) 2019 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2019, 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de> // Copyright (C) 2019 Oliver Sander <oliver.sander@tu-dresden.de>
// //
// To see a description of the changes please see the Changelog file that // To see a description of the changes please see the Changelog file that
...@@ -27,7 +27,7 @@ static bool doReplace = false; ...@@ -27,7 +27,7 @@ static bool doReplace = false;
static bool printVersion = false; static bool printVersion = false;
static bool printHelp = false; static bool printHelp = false;
static ArgDesc argDesc[] = { static const ArgDesc argDesc[] = {
{"-replace", argFlag, &doReplace, 0, {"-replace", argFlag, &doReplace, 0,
"replace embedded file with same name (if it exists)"}, "replace embedded file with same name (if it exists)"},
{"-v", argFlag, &printVersion, 0, {"-v", argFlag, &printVersion, 0,
......
...@@ -55,7 +55,7 @@ static char userPassword[33] = "\001"; ...@@ -55,7 +55,7 @@ static char userPassword[33] = "\001";
static bool printVersion = false; static bool printVersion = false;
static bool printHelp = false; static bool printHelp = false;
static ArgDesc argDesc[] = { static const ArgDesc argDesc[] = {
{"-list", argFlag, &doList, 0, {"-list", argFlag, &doList, 0,
"list all embedded files"}, "list all embedded files"},
{"-save", argInt, &saveNum, 0, {"-save", argInt, &saveNum, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment