Commit 120cfc0d authored by Albert Astals Cid's avatar Albert Astals Cid

Add some const

Suggested by clang-tidy readability-non-const-parameter check
parent cec2397f
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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:
......
......@@ -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;
......
......@@ -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,
......
......@@ -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 */
......
......@@ -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) {
......
......@@ -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.
......
......@@ -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);
......
......@@ -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.
......
......@@ -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;
......
......@@ -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;
......
......@@ -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; }
......
......@@ -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) {
......
......@@ -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,
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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,
......
......@@ -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;
......
......@@ -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
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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,
......
......@@ -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