fofi/FoFiTrueType.cc | 4 ++-- fofi/FoFiTrueType.h | 4 ++-- fofi/FoFiType1C.cc | 4 ++-- fofi/FoFiType1C.h | 4 ++-- poppler/CairoOutputDev.cc | 8 ++++---- poppler/CairoOutputDev.h | 4 ++-- poppler/CairoRescaleBox.cc | 4 ++-- poppler/CharCodeToUnicode.cc | 2 +- poppler/CharCodeToUnicode.h | 2 +- poppler/DateInfo.cc | 2 +- poppler/DateInfo.h | 2 +- poppler/Decrypt.cc | 34 +++++++++++++++++----------------- poppler/GfxState.cc | 18 +++++++++--------- poppler/GfxState.h | 18 +++++++++--------- poppler/OutputDev.cc | 2 +- poppler/OutputDev.h | 2 +- poppler/PSOutputDev.cc | 10 +++++----- poppler/PSOutputDev.h | 10 +++++----- poppler/PreScanOutputDev.cc | 2 +- poppler/PreScanOutputDev.h | 2 +- poppler/SplashOutputDev.cc | 4 ++-- poppler/SplashOutputDev.h | 2 +- poppler/UTF.cc | 2 +- poppler/UTF.h | 2 +- poppler/XRef.cc | 2 +- poppler/XRef.h | 2 +- qt5/src/ArthurOutputDev.cc | 2 +- qt5/src/ArthurOutputDev.h | 2 +- qt5/src/poppler-annotation-helper.h | 4 ++-- splash/Splash.cc | 4 ++-- splash/Splash.h | 4 ++-- splash/SplashFont.cc | 2 +- splash/SplashFont.h | 4 ++-- splash/SplashTypes.h | 5 +++-- utils/HtmlOutputDev.cc | 2 +- utils/HtmlOutputDev.h | 2 +- utils/ImageOutputDev.cc | 2 +- utils/ImageOutputDev.h | 2 +- 38 files changed, 94 insertions(+), 93 deletions(-)
New commits: commit 120cfc0de67501988edc9ded58d2a534d0b5a70e Author: Albert Astals Cid <[email protected]> Date: Fri Sep 27 18:03:30 2019 +0200 Add some const Suggested by clang-tidy readability-non-const-parameter check diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc index c9c353c6..8213c1d1 100644 --- a/fofi/FoFiTrueType.cc +++ b/fofi/FoFiTrueType.cc @@ -572,7 +572,7 @@ void FoFiTrueType::convertToType1(const char *psName, const char **newEncoding, } void FoFiTrueType::convertToCIDType2(const char *psName, - int *cidMap, int nCIDs, + const int *cidMap, int nCIDs, bool needVerticalMetrics, FoFiOutputFunc outputFunc, void *outputStream) const { @@ -880,7 +880,7 @@ void FoFiTrueType::cvtEncoding(char **encoding, } void FoFiTrueType::cvtCharStrings(char **encoding, - int *codeToGID, + const int *codeToGID, FoFiOutputFunc outputFunc, void *outputStream) const { const char *name; diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h index ee35e4f3..7ef0cabf 100644 --- a/fofi/FoFiTrueType.h +++ b/fofi/FoFiTrueType.h @@ -125,7 +125,7 @@ public: // name (so we don't need to depend on the 'name' table in the // font). The <cidMap> array maps CIDs to GIDs; it has <nCIDs> // entries. (Not useful for OpenType CFF fonts.) - void convertToCIDType2(const char *psName, int *cidMap, int nCIDs, + void convertToCIDType2(const char *psName, const int *cidMap, int nCIDs, bool needVerticalMetrics, FoFiOutputFunc outputFunc, void *outputStream) const; @@ -169,7 +169,7 @@ private: FoFiOutputFunc outputFunc, void *outputStream) const; void cvtCharStrings(char **encoding, - int *codeToGID, + const int *codeToGID, FoFiOutputFunc outputFunc, void *outputStream) const; void cvtSfnts(FoFiOutputFunc outputFunc, diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc index 522b86a6..96b0586f 100644 --- a/fofi/FoFiType1C.cc +++ b/fofi/FoFiType1C.cc @@ -489,7 +489,7 @@ void FoFiType1C::convertToType1(const char *psName, const char **newEncoding, bo (*outputFunc)(outputStream, "cleartomark\n", 12); } -void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes, +void FoFiType1C::convertToCIDType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream) { int *cidMap; @@ -834,7 +834,7 @@ void FoFiType1C::convertToCIDType0(const char *psName, int *codeMap, int nCodes, gfree(cidMap); } -void FoFiType1C::convertToType0(const char *psName, int *codeMap, int nCodes, +void FoFiType1C::convertToType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream) { int *cidMap; diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h index 920abdd6..a1f8edcc 100644 --- a/fofi/FoFiType1C.h +++ b/fofi/FoFiType1C.h @@ -186,7 +186,7 @@ public: // font's internal CID-to-GID mapping is used // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then // the identity CID-to-GID mapping is used - void convertToCIDType0(const char *psName, int *codeMap, int nCodes, + void convertToCIDType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream); // Convert to a Type 0 (but non-CID) composite font, suitable for @@ -198,7 +198,7 @@ public: // font's internal CID-to-GID mapping is used // (3) is <codeMap> is NULL and this is an 8-bit CFF font, then // the identity CID-to-GID mapping is used - void convertToType0(const char *psName, int *codeMap, int nCodes, + void convertToType0(const char *psName, const int *codeMap, int nCodes, FoFiOutputFunc outputFunc, void *outputStream); private: diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index d09cab55..25710410 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -3068,7 +3068,7 @@ private: GfxRGB *lookup; int width; GfxImageColorMap *colorMap; - int *maskColors; + const int *maskColors; int current_row; bool imageError; @@ -3078,7 +3078,7 @@ public: int scaledWidth, int scaledHeight, bool printing, GfxImageColorMap *colorMapA, - int *maskColorsA) { + const int *maskColorsA) { cairo_surface_t *image = nullptr; int i; @@ -3253,7 +3253,7 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int widthA, int heightA, GfxImageColorMap *colorMap, bool interpolate, - int *maskColors, bool inlineImg) + const int *maskColors, bool inlineImg) { cairo_surface_t *image; cairo_pattern_t *pattern, *maskPattern; @@ -3474,7 +3474,7 @@ void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) + bool interpolate, const int *maskColors, bool inlineImg) { cairo_t *cr; cairo_surface_t *surface; diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h index 0fbbf0d5..b6ff8394 100644 --- a/poppler/CairoOutputDev.h +++ b/poppler/CairoOutputDev.h @@ -221,7 +221,7 @@ public: void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, @@ -469,7 +469,7 @@ public: bool interpolate, bool inlineImg) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, diff --git a/poppler/CairoRescaleBox.cc b/poppler/CairoRescaleBox.cc index 7fd07041..04b0955c 100644 --- a/poppler/CairoRescaleBox.cc +++ b/poppler/CairoRescaleBox.cc @@ -62,8 +62,8 @@ static void downsample_row_box_filter ( int start, int width, - uint32_t *src, uint32_t *src_limit, uint32_t *dest, - int coverage[], int pixel_coverage) + uint32_t *src, const uint32_t *src_limit, uint32_t *dest, + const int coverage[], int pixel_coverage) { /* we need an array of the pixel contribution of each destination pixel on the boundaries. * we invert the value to get the value on the other size of the box */ diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc index 90d1baca..3faeaeee 100644 --- a/poppler/CharCodeToUnicode.cc +++ b/poppler/CharCodeToUnicode.cc @@ -603,7 +603,7 @@ int CharCodeToUnicode::mapToUnicode(CharCode c, Unicode **u) { return 0; } -int CharCodeToUnicode::mapToCharCode(Unicode* u, CharCode *c, int usize) const { +int CharCodeToUnicode::mapToCharCode(const Unicode* u, CharCode *c, int usize) const { //look for charcode in map if (usize == 1 || (usize > 1 && !(*u & ~0xff))) { if (isIdentity) { diff --git a/poppler/CharCodeToUnicode.h b/poppler/CharCodeToUnicode.h index 9c57fb23..187fa8ae 100644 --- a/poppler/CharCodeToUnicode.h +++ b/poppler/CharCodeToUnicode.h @@ -91,7 +91,7 @@ public: int mapToUnicode(CharCode c, Unicode **u); // Map a Unicode to CharCode. - int mapToCharCode(Unicode* u, CharCode *c, int usize) const; + int mapToCharCode(const Unicode* u, CharCode *c, int usize) const; // Return the mapping's length, i.e., one more than the max char // code supported by the mapping. diff --git a/poppler/DateInfo.cc b/poppler/DateInfo.cc index 4cbc0959..394325e4 100644 --- a/poppler/DateInfo.cc +++ b/poppler/DateInfo.cc @@ -76,7 +76,7 @@ bool parseDateString(const char *dateString, int *year, int *month, int *day, in return false; } -GooString *timeToDateString(time_t *timeA) +GooString *timeToDateString(const time_t *timeA) { const time_t timet = timeA ? *timeA : time(nullptr); diff --git a/poppler/DateInfo.h b/poppler/DateInfo.h index d726b310..feb9be04 100644 --- a/poppler/DateInfo.h +++ b/poppler/DateInfo.h @@ -33,7 +33,7 @@ bool parseDateString(const char *string, int *year, int *month, int *day, int *h * If timet is NULL, current time is used. * Returns new GooString. Free with delete. */ -GooString *timeToDateString(time_t *timet); +GooString *timeToDateString(const time_t *timet); /* Convert PDF date string to time. * Returns -1 if conversion fails. diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc index cc343a55..60daf40e 100644 --- a/poppler/Decrypt.cc +++ b/poppler/Decrypt.cc @@ -37,18 +37,18 @@ #include "Decrypt.h" #include "Error.h" -static void rc4InitKey(unsigned char *key, int keyLen, unsigned char *state); +static void rc4InitKey(const unsigned char *key, int keyLen, unsigned char *state); static unsigned char rc4DecryptByte(unsigned char *state, unsigned char *x, unsigned char *y, unsigned char c); static bool aesReadBlock(Stream *str, unsigned char *in, bool addPadding); -static void aesKeyExpansion(DecryptAESState *s, unsigned char *objKey, int objKeyLen, bool decrypt); -static void aesEncryptBlock(DecryptAESState *s, unsigned char *in); -static void aesDecryptBlock(DecryptAESState *s, unsigned char *in, bool last); +static void aesKeyExpansion(DecryptAESState *s, const unsigned char *objKey, int objKeyLen, bool decrypt); +static void aesEncryptBlock(DecryptAESState *s, const unsigned char *in); +static void aesDecryptBlock(DecryptAESState *s, const unsigned char *in, bool last); -static void aes256KeyExpansion(DecryptAES256State *s, unsigned char *objKey, int objKeyLen, bool decrypt); -static void aes256EncryptBlock(DecryptAES256State *s, unsigned char *in); -static void aes256DecryptBlock(DecryptAES256State *s, unsigned char *in, bool last); +static void aes256KeyExpansion(DecryptAES256State *s, const unsigned char *objKey, int objKeyLen, bool decrypt); +static void aes256EncryptBlock(DecryptAES256State *s, const unsigned char *in); +static void aes256DecryptBlock(DecryptAES256State *s, const unsigned char *in, bool last); static void sha256(unsigned char *msg, int msgLen, unsigned char *hash); static void sha384(unsigned char *msg, int msgLen, unsigned char *hash); @@ -574,7 +574,7 @@ int DecryptStream::lookChar() { // RC4-compatible decryption //------------------------------------------------------------------------ -static void rc4InitKey(unsigned char *key, int keyLen, unsigned char *state) { +static void rc4InitKey(const unsigned char *key, int keyLen, unsigned char *state) { unsigned char index1, index2; unsigned char t; int i; @@ -925,7 +925,7 @@ static inline void invMixColumnsW(unsigned int *w) { } } -static inline void addRoundKey(unsigned char *state, unsigned int *w) { +static inline void addRoundKey(unsigned char *state, const unsigned int *w) { int c; for (c = 0; c < 4; ++c) { @@ -937,7 +937,7 @@ static inline void addRoundKey(unsigned char *state, unsigned int *w) { } static void aesKeyExpansion(DecryptAESState *s, - unsigned char *objKey, int /*objKeyLen*/, bool decrypt) { + const unsigned char *objKey, int /*objKeyLen*/, bool decrypt) { unsigned int temp; int i, round; @@ -963,7 +963,7 @@ static void aesKeyExpansion(DecryptAESState *s, } } -static void aesEncryptBlock(DecryptAESState *s, unsigned char *in) { +static void aesEncryptBlock(DecryptAESState *s, const unsigned char *in) { int c, round; // initial state (input is xor'd with previous output because of CBC) @@ -1000,7 +1000,7 @@ static void aesEncryptBlock(DecryptAESState *s, unsigned char *in) { s->bufIdx = 0; } -static void aesDecryptBlock(DecryptAESState *s, unsigned char *in, bool last) { +static void aesDecryptBlock(DecryptAESState *s, const unsigned char *in, bool last) { int c, round, n, i; // initial state @@ -1059,7 +1059,7 @@ static void aesDecryptBlock(DecryptAESState *s, unsigned char *in, bool last) { //------------------------------------------------------------------------ static void aes256KeyExpansion(DecryptAES256State *s, - unsigned char *objKey, int objKeyLen, bool decrypt) { + const unsigned char *objKey, int objKeyLen, bool decrypt) { unsigned int temp; int i, round; @@ -1087,7 +1087,7 @@ static void aes256KeyExpansion(DecryptAES256State *s, } } -static void aes256EncryptBlock(DecryptAES256State *s, unsigned char *in) { +static void aes256EncryptBlock(DecryptAES256State *s, const unsigned char *in) { int c, round; // initial state (input is xor'd with previous output because of CBC) @@ -1124,7 +1124,7 @@ static void aes256EncryptBlock(DecryptAES256State *s, unsigned char *in) { s->bufIdx = 0; } -static void aes256DecryptBlock(DecryptAES256State *s, unsigned char *in, bool last) { +static void aes256DecryptBlock(DecryptAES256State *s, const unsigned char *in, bool last) { int c, round, n, i; // initial state @@ -1411,7 +1411,7 @@ static inline unsigned int sha256sigma1(unsigned int x) { return rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10); } -static void sha256HashBlock(unsigned char *blk, unsigned int *H) { +static void sha256HashBlock(const unsigned char *blk, unsigned int *H) { unsigned int W[64]; unsigned int a, b, c, d, e, f, g, h; unsigned int T1, T2; @@ -1561,7 +1561,7 @@ static inline uint64_t sha512sigma1(uint64_t x) { return rotr(x, 19) ^ rotr(x, 61) ^ (x >> 6); } -static void sha512HashBlock(unsigned char *blk, uint64_t *H) { +static void sha512HashBlock(const unsigned char *blk, uint64_t *H) { uint64_t W[80]; uint64_t a, b, c, d, e, f, g, h; uint64_t T1, T2; diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc index 5a95386d..43c91319 100644 --- a/poppler/GfxState.cc +++ b/poppler/GfxState.cc @@ -3401,8 +3401,8 @@ GfxTilingPattern *GfxTilingPattern::parse(Object *patObj, int patternRefNum) { } GfxTilingPattern::GfxTilingPattern(int paintTypeA, int tilingTypeA, - double *bboxA, double xStepA, double yStepA, - Object *resDictA, double *matrixA, + const double *bboxA, double xStepA, double yStepA, + Object *resDictA, const double *matrixA, Object *contentStreamA, int patternRefNumA) : GfxPattern(1, patternRefNumA) { @@ -3468,7 +3468,7 @@ GfxShadingPattern *GfxShadingPattern::parse(GfxResources *res, Object *patObj, O return new GfxShadingPattern(shadingA, matrixA, patternRefNum); } -GfxShadingPattern::GfxShadingPattern(GfxShading *shadingA, double *matrixA, int patternRefNumA): +GfxShadingPattern::GfxShadingPattern(GfxShading *shadingA, const double *matrixA, int patternRefNumA): GfxPattern(2, patternRefNumA) { int i; @@ -3652,7 +3652,7 @@ bool GfxShading::init(GfxResources *res, Dict *dict, OutputDev *out, GfxState *s GfxFunctionShading::GfxFunctionShading(double x0A, double y0A, double x1A, double y1A, - double *matrixA, + const double *matrixA, Function **funcsA, int nFuncsA): GfxShading(1) { @@ -5893,7 +5893,7 @@ GfxImageColorMap::~GfxImageColorMap() { gfree(byte_lookup); } -void GfxImageColorMap::getGray(unsigned char *x, GfxGray *gray) { +void GfxImageColorMap::getGray(const unsigned char *x, GfxGray *gray) { GfxColor color; int i; @@ -5910,7 +5910,7 @@ void GfxImageColorMap::getGray(unsigned char *x, GfxGray *gray) { } } -void GfxImageColorMap::getRGB(unsigned char *x, GfxRGB *rgb) { +void GfxImageColorMap::getRGB(const unsigned char *x, GfxRGB *rgb) { GfxColor color; int i; @@ -6191,7 +6191,7 @@ void GfxImageColorMap::getDeviceNLine(unsigned char *in, unsigned char *out, int } -void GfxImageColorMap::getCMYK(unsigned char *x, GfxCMYK *cmyk) { +void GfxImageColorMap::getCMYK(const unsigned char *x, GfxCMYK *cmyk) { GfxColor color; int i; @@ -6208,7 +6208,7 @@ void GfxImageColorMap::getCMYK(unsigned char *x, GfxCMYK *cmyk) { } } -void GfxImageColorMap::getDeviceN(unsigned char *x, GfxColor *deviceN) { +void GfxImageColorMap::getDeviceN(const unsigned char *x, GfxColor *deviceN) { GfxColor color; int i; @@ -6225,7 +6225,7 @@ void GfxImageColorMap::getDeviceN(unsigned char *x, GfxColor *deviceN) { } } -void GfxImageColorMap::getColor(unsigned char *x, GfxColor *color) { +void GfxImageColorMap::getColor(const unsigned char *x, GfxColor *color) { int maxPixel, i; maxPixel = (1 << bits) - 1; diff --git a/poppler/GfxState.h b/poppler/GfxState.h index 5a66a18c..7a6e4031 100644 --- a/poppler/GfxState.h +++ b/poppler/GfxState.h @@ -806,8 +806,8 @@ public: private: GfxTilingPattern(int paintTypeA, int tilingTypeA, - double *bboxA, double xStepA, double yStepA, - Object *resDictA, double *matrixA, + const double *bboxA, double xStepA, double yStepA, + Object *resDictA, const double *matrixA, Object *contentStreamA, int patternRefNumA); int paintType; @@ -836,7 +836,7 @@ public: private: - GfxShadingPattern(GfxShading *shadingA, double *matrixA, int patternRefNumA); + GfxShadingPattern(GfxShading *shadingA, const double *matrixA, int patternRefNumA); GfxShading *shading; double matrix[6]; @@ -943,7 +943,7 @@ public: GfxFunctionShading(double x0A, double y0A, double x1A, double y1A, - double *matrixA, + const double *matrixA, Function **funcsA, int nFuncsA); GfxFunctionShading(GfxFunctionShading *shading); ~GfxFunctionShading(); @@ -1206,17 +1206,17 @@ public: bool useDeviceNLine() const { return (colorSpace2 && colorSpace2->useGetDeviceNLine ()) || (!colorSpace2 && colorSpace->useGetDeviceNLine ()); } // Convert an image pixel to a color. - void getGray(unsigned char *x, GfxGray *gray); - void getRGB(unsigned char *x, GfxRGB *rgb); + void getGray(const unsigned char *x, GfxGray *gray); + void getRGB(const unsigned char *x, GfxRGB *rgb); void getRGBLine(unsigned char *in, unsigned int *out, int length); void getRGBLine(unsigned char *in, unsigned char *out, int length); void getRGBXLine(unsigned char *in, unsigned char *out, int length); void getGrayLine(unsigned char *in, unsigned char *out, int length); void getCMYKLine(unsigned char *in, unsigned char *out, int length); void getDeviceNLine(unsigned char *in, unsigned char *out, int length); - void getCMYK(unsigned char *x, GfxCMYK *cmyk); - void getDeviceN(unsigned char *x, GfxColor *deviceN); - void getColor(unsigned char *x, GfxColor *color); + void getCMYK(const unsigned char *x, GfxCMYK *cmyk); + void getDeviceN(const unsigned char *x, GfxColor *deviceN); + void getColor(const unsigned char *x, GfxColor *color); // Matte color ops void setMatteColor(const GfxColor *color) { useMatte = true; matteColor = *color; } diff --git a/poppler/OutputDev.cc b/poppler/OutputDev.cc index 15ab4a1a..de550d05 100644 --- a/poppler/OutputDev.cc +++ b/poppler/OutputDev.cc @@ -126,7 +126,7 @@ void OutputDev::unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) void OutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) { + bool interpolate, const int *maskColors, bool inlineImg) { int i, j; if (inlineImg) { diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h index b7b113de..01858f98 100644 --- a/poppler/OutputDev.h +++ b/poppler/OutputDev.h @@ -299,7 +299,7 @@ public: virtual void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg); + bool interpolate, const int *maskColors, bool inlineImg); virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc index 694d059e..52fd8223 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -5247,7 +5247,7 @@ void PSOutputDev::unsetSoftMaskFromImageMask(GfxState * state, double *baseMatri void PSOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) { + bool interpolate, const int *maskColors, bool inlineImg) { int len; len = height * ((width * colorMap->getNumPixelComps() * @@ -5314,7 +5314,7 @@ void PSOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, void PSOutputDev::doImageL1(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert) { ImageStream *imgStr; unsigned char pixBuf[gfxColorMaxComps]; @@ -5470,7 +5470,7 @@ void PSOutputDev::doImageL1(Object *ref, GfxImageColorMap *colorMap, void PSOutputDev::doImageL1Sep(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert) { ImageStream *imgStr; unsigned char *lineBuf; @@ -5696,7 +5696,7 @@ void PSOutputDev::maskToClippingPath(Stream *maskStr, int maskWidth, int maskHei void PSOutputDev::doImageL2(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert) { Stream *str2; ImageStream *imgStr; @@ -6176,7 +6176,7 @@ void PSOutputDev::doImageL2(Object *ref, GfxImageColorMap *colorMap, void PSOutputDev::doImageL3(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert) { Stream *str2; GooString *s; diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h index 44dacf88..7e6d1703 100644 --- a/poppler/PSOutputDev.h +++ b/poppler/PSOutputDev.h @@ -271,7 +271,7 @@ public: void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, @@ -388,22 +388,22 @@ private: void doImageL1(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert); void doImageL1Sep(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert); void doImageL2(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert); void doImageL3(Object *ref, GfxImageColorMap *colorMap, bool invert, bool inlineImg, Stream *str, int width, int height, int len, - int *maskColors, Stream *maskStr, + const int *maskColors, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert); void dumpColorSpaceL2(GfxColorSpace *colorSpace, bool genXform, bool updateColors, diff --git a/poppler/PreScanOutputDev.cc b/poppler/PreScanOutputDev.cc index 9c460490..7812cf29 100644 --- a/poppler/PreScanOutputDev.cc +++ b/poppler/PreScanOutputDev.cc @@ -218,7 +218,7 @@ void PreScanOutputDev::drawImageMask(GfxState *state, Object * /*ref*/, Stream * void PreScanOutputDev::drawImage(GfxState *state, Object * /*ref*/, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool /*interpolate*/, int * /*maskColors*/, bool inlineImg) { + bool /*interpolate*/, const int * /*maskColors*/, bool inlineImg) { GfxColorSpace *colorSpace; int i, j; diff --git a/poppler/PreScanOutputDev.h b/poppler/PreScanOutputDev.h index cd62479c..a2ec0276 100644 --- a/poppler/PreScanOutputDev.h +++ b/poppler/PreScanOutputDev.h @@ -108,7 +108,7 @@ public: bool interpolate, bool inlineImg) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index aba4578e..440ee307 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -2831,7 +2831,7 @@ struct SplashOutImageData { ImageStream *imgStr; GfxImageColorMap *colorMap; SplashColorPtr lookup; - int *maskColors; + const int *maskColors; SplashColorMode colorMode; int width, height, y; ImageStream *maskStr; @@ -3317,7 +3317,7 @@ void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, - int *maskColors, bool inlineImg) { + const int *maskColors, bool inlineImg) { SplashCoord mat[6]; SplashOutImageData imgData; SplashColorMode srcMode; diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h index 72ad9f04..b3070ce0 100644 --- a/poppler/SplashOutputDev.h +++ b/poppler/SplashOutputDev.h @@ -306,7 +306,7 @@ public: void unsetSoftMaskFromImageMask(GfxState *state, double *baseMatrix) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, diff --git a/poppler/UTF.cc b/poppler/UTF.cc index 9a205f30..0129c93e 100644 --- a/poppler/UTF.cc +++ b/poppler/UTF.cc @@ -431,7 +431,7 @@ struct Ascii7Map }; void unicodeToAscii7(Unicode *in, int len, Unicode **ucs4_out, - int *out_len, int *in_idx, int **indices) + int *out_len, const int *in_idx, int **indices) { static Ascii7Map uMap; int *idx = nullptr; diff --git a/poppler/UTF.h b/poppler/UTF.h index 566bfb39..c3d63255 100644 --- a/poppler/UTF.h +++ b/poppler/UTF.h @@ -87,6 +87,6 @@ char *utf16ToUtf8(const uint16_t *utf16, int *len = nullptr); // of length @out_len + 1, for each character in the ascii string giving the index // of the corresponding character in the text of the line (thanks to this info // being passed in @in_idx parameter). -void unicodeToAscii7(Unicode *in, int len, Unicode **ucs4_out, int *out_len, int *in_idx, int **indices); +void unicodeToAscii7(Unicode *in, int len, Unicode **ucs4_out, int *out_len, const int *in_idx, int **indices); #endif diff --git a/poppler/XRef.cc b/poppler/XRef.cc index 22ce7f9b..7b94a835 100644 --- a/poppler/XRef.cc +++ b/poppler/XRef.cc @@ -733,7 +733,7 @@ bool XRef::readXRefStream(Stream *xrefStr, Goffset *pos) { return more; } -bool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) { +bool XRef::readXRefStreamSection(Stream *xrefStr, const int *w, int first, int n) { unsigned long long offset, gen; int type, c, i, j; diff --git a/poppler/XRef.h b/poppler/XRef.h index fc5c8388..2e72ae54 100644 --- a/poppler/XRef.h +++ b/poppler/XRef.h @@ -242,7 +242,7 @@ private: int resize(int newSize); bool readXRef(Goffset *pos, std::vector<Goffset> *followedXRefStm, std::vector<int> *xrefStreamObjsNum); bool readXRefTable(Parser *parser, Goffset *pos, std::vector<Goffset> *followedXRefStm, std::vector<int> *xrefStreamObjsNum); - bool readXRefStreamSection(Stream *xrefStr, int *w, int first, int n); + bool readXRefStreamSection(Stream *xrefStr, const int *w, int first, int n); bool readXRefStream(Stream *xrefStr, Goffset *pos); bool constructXRef(bool *wasReconstructed, bool needCatalogDict = false); bool parseEntry(Goffset offset, XRefEntry *entry); diff --git a/qt5/src/ArthurOutputDev.cc b/qt5/src/ArthurOutputDev.cc index faa6407b..2636bbe7 100644 --- a/qt5/src/ArthurOutputDev.cc +++ b/qt5/src/ArthurOutputDev.cc @@ -1054,7 +1054,7 @@ void ArthurOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) + bool interpolate, const int *maskColors, bool inlineImg) { unsigned int *data; unsigned int *line; diff --git a/qt5/src/ArthurOutputDev.h b/qt5/src/ArthurOutputDev.h index 396ce578..f877bc66 100644 --- a/qt5/src/ArthurOutputDev.h +++ b/qt5/src/ArthurOutputDev.h @@ -150,7 +150,7 @@ public: bool interpolate, bool inlineImg) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, diff --git a/qt5/src/poppler-annotation-helper.h b/qt5/src/poppler-annotation-helper.h index 45611fd9..b1f61bb0 100644 --- a/qt5/src/poppler-annotation-helper.h +++ b/qt5/src/poppler-annotation-helper.h @@ -53,7 +53,7 @@ class XPDFReader static inline void lookupDate( Dict *, char *, QDateTime & dest ); // transform from user coords to normalized ones using the matrix M static inline void transform( double * M, double x, double y, QPointF &res ); - static inline void invTransform( double * M, const QPointF p, double &x, double &y ); + static inline void invTransform( const double * M, const QPointF p, double &x, double &y ); }; void XPDFReader::lookupName( Dict * dict, char * type, QString & dest ) @@ -170,7 +170,7 @@ void XPDFReader::transform( double * M, double x, double y, QPointF &res ) res.setY( M[1] * x + M[3] * y + M[5] ); } -void XPDFReader::invTransform( double * M, const QPointF p, double &x, double &y ) +void XPDFReader::invTransform( const double * M, const QPointF p, double &x, double &y ) { const double det = M[0]*M[3] - M[1]*M[2]; Q_ASSERT(det != 0); diff --git a/splash/Splash.cc b/splash/Splash.cc index c3e54b84..6e30fd80 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -1553,7 +1553,7 @@ inline void Splash::drawAALine(SplashPipe *pipe, int x0, int x1, int y, bool adj //------------------------------------------------------------------------ // Transform a point from user space to device space. -inline void Splash::transform(SplashCoord *matrix, +inline void Splash::transform(const SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo) { // [ m[0] m[1] 0 ] @@ -5291,7 +5291,7 @@ SplashError Splash::composite(SplashBitmap *src, int xSrc, int ySrc, return splashOk; } -void Splash::compositeBackground(SplashColorPtr color) { +void Splash::compositeBackground(SplashColorConstPtr color) { SplashColorPtr p; unsigned char *q; unsigned char alpha, alpha1, c, color0, color1, color2; diff --git a/splash/Splash.h b/splash/Splash.h index f18d7ae9..251a1001 100644 --- a/splash/Splash.h +++ b/splash/Splash.h @@ -222,7 +222,7 @@ public: // Composite this Splash object onto a background color. The // background alpha is assumed to be 1. - void compositeBackground(SplashColorPtr color); + void compositeBackground(SplashColorConstPtr color); // Copy a rectangular region from <src> onto the bitmap belonging to // this Splash object. The destination alpha values are all set to @@ -306,7 +306,7 @@ private: void drawAAPixel(SplashPipe *pipe, int x, int y); void drawSpan(SplashPipe *pipe, int x0, int x1, int y, bool noClip); void drawAALine(SplashPipe *pipe, int x0, int x1, int y, bool adjustLine = false, unsigned char lineOpacity = 0); - void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, + void transform(const SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo); void updateModX(int x); void updateModY(int y); diff --git a/splash/SplashFont.cc b/splash/SplashFont.cc index db168bf5..da81b523 100644 --- a/splash/SplashFont.cc +++ b/splash/SplashFont.cc @@ -42,7 +42,7 @@ struct SplashFontCacheTag { // SplashFont //------------------------------------------------------------------------ -SplashFont::SplashFont(SplashFontFile *fontFileA, SplashCoord *matA, +SplashFont::SplashFont(SplashFontFile *fontFileA, const SplashCoord *matA, const SplashCoord *textMatA, bool aaA) { fontFile = fontFileA; fontFile->incRefCnt(); diff --git a/splash/SplashFont.h b/splash/SplashFont.h index 45875c9f..8677f017 100644 --- a/splash/SplashFont.h +++ b/splash/SplashFont.h @@ -46,7 +46,7 @@ class SplashPath; class SplashFont { public: - SplashFont(SplashFontFile *fontFileA, SplashCoord *matA, + SplashFont(SplashFontFile *fontFileA, const SplashCoord *matA, const SplashCoord *textMatA, bool aaA); // This must be called after the constructor, so that the subclass @@ -61,7 +61,7 @@ public: SplashFontFile *getFontFile() { return fontFile; } // Return true if <this> matches the specified font file and matrix. - bool matches(SplashFontFile *fontFileA, SplashCoord *matA, + bool matches(SplashFontFile *fontFileA, const SplashCoord *matA, const SplashCoord *textMatA) const { return fontFileA == fontFile && matA[0] == mat[0] && matA[1] == mat[1] && diff --git a/splash/SplashTypes.h b/splash/SplashTypes.h index b00693fe..0e41ade8 100644 --- a/splash/SplashTypes.h +++ b/splash/SplashTypes.h @@ -85,6 +85,7 @@ constexpr std::size_t splashMaxColorComps = SPOT_NCOMPS+4; typedef unsigned char SplashColor[splashMaxColorComps]; typedef unsigned char *SplashColorPtr; +typedef const unsigned char *SplashColorConstPtr; // RGB8 static inline unsigned char splashRGB8R(SplashColorPtr rgb8) { return rgb8[0]; } @@ -118,7 +119,7 @@ static inline void splashClearColor(SplashColorPtr dest) { dest[i] = 0; } -static inline void splashColorCopy(SplashColorPtr dest, SplashColorPtr src) { +static inline void splashColorCopy(SplashColorPtr dest, SplashColorConstPtr src) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; @@ -127,7 +128,7 @@ static inline void splashColorCopy(SplashColorPtr dest, SplashColorPtr src) { dest[i] = src[i]; } -static inline void splashColorXor(SplashColorPtr dest, SplashColorPtr src) { +static inline void splashColorXor(SplashColorPtr dest, SplashColorConstPtr src) { dest[0] ^= src[0]; dest[1] ^= src[1]; dest[2] ^= src[2]; diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc index 954a4779..7cabd5f7 100644 --- a/utils/HtmlOutputDev.cc +++ b/utils/HtmlOutputDev.cc @@ -1507,7 +1507,7 @@ void HtmlOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void HtmlOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) { + bool interpolate, const int *maskColors, bool inlineImg) { if (ignore||(complexMode && !xml)) { OutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate, diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h index e35c2c9c..49651b35 100644 --- a/utils/HtmlOutputDev.h +++ b/utils/HtmlOutputDev.h @@ -303,7 +303,7 @@ public: bool interpolate, bool inlineImg) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; //new feature virtual int DevType() {return 1234;} diff --git a/utils/ImageOutputDev.cc b/utils/ImageOutputDev.cc index 850eb102..99b3b08d 100644 --- a/utils/ImageOutputDev.cc +++ b/utils/ImageOutputDev.cc @@ -695,7 +695,7 @@ void ImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, void ImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) { + bool interpolate, const int *maskColors, bool inlineImg) { if (listImages) listImage(state, ref, str, width, height, colorMap, interpolate, inlineImg, imgImage); else diff --git a/utils/ImageOutputDev.h b/utils/ImageOutputDev.h index d13bfe17..74700cbd 100644 --- a/utils/ImageOutputDev.h +++ b/utils/ImageOutputDev.h @@ -127,7 +127,7 @@ public: bool interpolate, bool inlineImg) override; void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - bool interpolate, int *maskColors, bool inlineImg) override; + bool interpolate, const int *maskColors, bool inlineImg) override; void drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
