Commit 51bb4676 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Replace Guchar by unsigned char

parent 27954f7d
......@@ -35,7 +35,7 @@
//------------------------------------------------------------------------
FoFiBase::FoFiBase(const char *fileA, int lenA, bool freeFileDataA) {
file = (const Guchar *)fileA;
file = (const unsigned char *)fileA;
len = lenA;
freeFileData = freeFileDataA;
}
......
......@@ -59,7 +59,7 @@ protected:
bool checkRegion(int pos, int size) const;
const Guchar *file;
const unsigned char *file;
int len;
bool freeFileData;
};
......
......@@ -936,16 +936,16 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
void *outputStream, GooString *name,
bool needVerticalMetrics,
int *maxUsedGlyph) const {
Guchar headData[54];
unsigned char headData[54];
TrueTypeLoca *locaTable;
Guchar *locaData;
unsigned char *locaData;
TrueTypeTable newTables[nT42Tables];
Guchar tableDir[12 + nT42Tables*16];
unsigned char tableDir[12 + nT42Tables*16];
bool ok;
Guint checksum;
int nNewTables;
int glyfTableLen, length, pos, glyfPos, i, j, k, vmtxTabLength;
Guchar vheaTab[36] = {
unsigned char vheaTab[36] = {
0, 1, 0, 0, // table version number
0, 0, // ascent
0, 0, // descent
......@@ -964,7 +964,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
0, 0, // metric data format
0, 1 // number of advance heights in vmtx table
};
Guchar *vmtxTab;
unsigned char *vmtxTab;
bool needVhea, needVmtx;
int advance;
......@@ -978,7 +978,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
return;
}
memcpy(headData, file + pos, 54);
headData[8] = headData[9] = headData[10] = headData[11] = (Guchar)0;
headData[8] = headData[9] = headData[10] = headData[11] = (unsigned char)0;
// check for a bogus loca format field in the 'head' table
// (I've encountered fonts with loca format set to 0x0100 instead of 0x0001)
......@@ -1032,17 +1032,17 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
}
// construct the new 'loca' table
locaData = (Guchar *)gmallocn(nGlyphs + 1, (locaFmt ? 4 : 2));
locaData = (unsigned char *)gmallocn(nGlyphs + 1, (locaFmt ? 4 : 2));
for (i = 0; i <= nGlyphs; ++i) {
pos = locaTable[i].newOffset;
if (locaFmt) {
locaData[4*i ] = (Guchar)(pos >> 24);
locaData[4*i+1] = (Guchar)(pos >> 16);
locaData[4*i+2] = (Guchar)(pos >> 8);
locaData[4*i+3] = (Guchar) pos;
locaData[4*i ] = (unsigned char)(pos >> 24);
locaData[4*i+1] = (unsigned char)(pos >> 16);
locaData[4*i+2] = (unsigned char)(pos >> 8);
locaData[4*i+3] = (unsigned char) pos;
} else {
locaData[2*i ] = (Guchar)(pos >> 9);
locaData[2*i+1] = (Guchar)(pos >> 1);
locaData[2*i ] = (unsigned char)(pos >> 9);
locaData[2*i+1] = (unsigned char)(pos >> 1);
}
}
......@@ -1114,7 +1114,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
} else if (needVerticalMetrics && i == t42VmtxTable) {
length = 4 + (nGlyphs - 1) * 2;
vmtxTabLength = length;
vmtxTab = (Guchar *)gmalloc(length);
vmtxTab = (unsigned char *)gmalloc(length);
vmtxTab[0] = advance / 256;
vmtxTab[1] = advance % 256;
for (j = 2; j < length; j += 2) {
......@@ -1153,29 +1153,29 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
tableDir[4] = 0; // numTables
tableDir[5] = nNewTables;
tableDir[6] = 0; // searchRange
tableDir[7] = (Guchar)128;
tableDir[7] = (unsigned char)128;
tableDir[8] = 0; // entrySelector
tableDir[9] = 3;
tableDir[10] = 0; // rangeShift
tableDir[11] = (Guchar)(16 * nNewTables - 128);
tableDir[11] = (unsigned char)(16 * nNewTables - 128);
pos = 12;
for (i = 0; i < nNewTables; ++i) {
tableDir[pos ] = (Guchar)(newTables[i].tag >> 24);
tableDir[pos+ 1] = (Guchar)(newTables[i].tag >> 16);
tableDir[pos+ 2] = (Guchar)(newTables[i].tag >> 8);
tableDir[pos+ 3] = (Guchar) newTables[i].tag;
tableDir[pos+ 4] = (Guchar)(newTables[i].checksum >> 24);
tableDir[pos+ 5] = (Guchar)(newTables[i].checksum >> 16);
tableDir[pos+ 6] = (Guchar)(newTables[i].checksum >> 8);
tableDir[pos+ 7] = (Guchar) newTables[i].checksum;
tableDir[pos+ 8] = (Guchar)(newTables[i].offset >> 24);
tableDir[pos+ 9] = (Guchar)(newTables[i].offset >> 16);
tableDir[pos+10] = (Guchar)(newTables[i].offset >> 8);
tableDir[pos+11] = (Guchar) newTables[i].offset;
tableDir[pos+12] = (Guchar)(newTables[i].len >> 24);
tableDir[pos+13] = (Guchar)(newTables[i].len >> 16);
tableDir[pos+14] = (Guchar)(newTables[i].len >> 8);
tableDir[pos+15] = (Guchar) newTables[i].len;
tableDir[pos ] = (unsigned char)(newTables[i].tag >> 24);
tableDir[pos+ 1] = (unsigned char)(newTables[i].tag >> 16);
tableDir[pos+ 2] = (unsigned char)(newTables[i].tag >> 8);
tableDir[pos+ 3] = (unsigned char) newTables[i].tag;
tableDir[pos+ 4] = (unsigned char)(newTables[i].checksum >> 24);
tableDir[pos+ 5] = (unsigned char)(newTables[i].checksum >> 16);
tableDir[pos+ 6] = (unsigned char)(newTables[i].checksum >> 8);
tableDir[pos+ 7] = (unsigned char) newTables[i].checksum;
tableDir[pos+ 8] = (unsigned char)(newTables[i].offset >> 24);
tableDir[pos+ 9] = (unsigned char)(newTables[i].offset >> 16);
tableDir[pos+10] = (unsigned char)(newTables[i].offset >> 8);
tableDir[pos+11] = (unsigned char) newTables[i].offset;
tableDir[pos+12] = (unsigned char)(newTables[i].len >> 24);
tableDir[pos+13] = (unsigned char)(newTables[i].len >> 16);
tableDir[pos+14] = (unsigned char)(newTables[i].len >> 8);
tableDir[pos+15] = (unsigned char) newTables[i].len;
pos += 16;
}
......@@ -1185,10 +1185,10 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
checksum += newTables[i].checksum;
}
checksum = 0xb1b0afba - checksum; // because the TrueType spec says so
headData[ 8] = (Guchar)(checksum >> 24);
headData[ 9] = (Guchar)(checksum >> 16);
headData[10] = (Guchar)(checksum >> 8);
headData[11] = (Guchar) checksum;
headData[ 8] = (unsigned char)(checksum >> 24);
headData[ 9] = (unsigned char)(checksum >> 16);
headData[10] = (unsigned char)(checksum >> 8);
headData[11] = (unsigned char) checksum;
// start the sfnts array
if (name) {
......@@ -1254,7 +1254,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
}
}
void FoFiTrueType::dumpString(const Guchar *s, int length,
void FoFiTrueType::dumpString(const unsigned char *s, int length,
FoFiOutputFunc outputFunc,
void *outputStream) const {
GooString *buf;
......@@ -1283,7 +1283,7 @@ void FoFiTrueType::dumpString(const Guchar *s, int length,
(*outputFunc)(outputStream, "00>\n", 4);
}
Guint FoFiTrueType::computeTableChecksum(const Guchar *data, int length) const {
Guint FoFiTrueType::computeTableChecksum(const unsigned char *data, int length) const {
Guint checksum, word;
int i;
......
......@@ -177,10 +177,10 @@ private:
void *outputStream, GooString *name,
bool needVerticalMetrics,
int *maxUsedGlyph) const;
void dumpString(const Guchar *s, int length,
void dumpString(const unsigned char *s, int length,
FoFiOutputFunc outputFunc,
void *outputStream) const;
Guint computeTableChecksum(const Guchar *data, int length) const;
Guint computeTableChecksum(const unsigned char *data, int length) const;
void parse();
void readPostTable();
int seekTable(const char *tag) const;
......
......@@ -366,7 +366,7 @@ void FoFiType1::parse() {
// Undo the PFB encoding, i.e., remove the PFB headers.
void FoFiType1::undoPFB() {
bool ok;
Guchar *file2;
unsigned char *file2;
int pos1, pos2, type;
Guint segLen;
......@@ -374,7 +374,7 @@ void FoFiType1::undoPFB() {
if (getU8(0, &ok) != 0x80 || !ok) {
return;
}
file2 = (Guchar *)gmalloc(len);
file2 = (unsigned char *)gmalloc(len);
pos1 = pos2 = 0;
while (getU8(pos1, &ok) == 0x80 && ok) {
type = getU8(pos1 + 1, &ok);
......
......@@ -1186,7 +1186,7 @@ void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
buf = GooString::format("/{0:s} {1:d} RD ", glyphName, charBuf->getLength());
eexecWrite(eb, buf->c_str());
delete buf;
eexecWriteCharstring(eb, (Guchar *)charBuf->c_str(),
eexecWriteCharstring(eb, (unsigned char *)charBuf->c_str(),
charBuf->getLength());
eexecWrite(eb, " ND\n");
......@@ -1200,7 +1200,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
bool ok, dFP;
double d, dx, dy;
Gushort r2;
Guchar byte;
unsigned char byte;
int pos, subrBias, start, i, k;
start = charBuf->getLength();
......@@ -1848,7 +1848,7 @@ void FoFiType1C::cvtGlyphWidth(bool useOp, GooString *charBuf,
}
void FoFiType1C::cvtNum(double x, bool isFP, GooString *charBuf) const {
Guchar buf[12];
unsigned char buf[12];
int y, n;
n = 0;
......@@ -1856,10 +1856,10 @@ void FoFiType1C::cvtNum(double x, bool isFP, GooString *charBuf) const {
if (x >= -32768 && x < 32768) {
y = (int)(x * 256.0);
buf[0] = 255;
buf[1] = (Guchar)(y >> 24);
buf[2] = (Guchar)(y >> 16);
buf[3] = (Guchar)(y >> 8);
buf[4] = (Guchar)y;
buf[1] = (unsigned char)(y >> 24);
buf[2] = (unsigned char)(y >> 16);
buf[3] = (unsigned char)(y >> 8);
buf[4] = (unsigned char)y;
buf[5] = 255;
buf[6] = 0;
buf[7] = 0;
......@@ -1874,24 +1874,24 @@ void FoFiType1C::cvtNum(double x, bool isFP, GooString *charBuf) const {
} else {
y = (int)x;
if (y >= -107 && y <= 107) {
buf[0] = (Guchar)(y + 139);
buf[0] = (unsigned char)(y + 139);
n = 1;
} else if (y > 107 && y <= 1131) {
y -= 108;
buf[0] = (Guchar)((y >> 8) + 247);
buf[1] = (Guchar)(y & 0xff);
buf[0] = (unsigned char)((y >> 8) + 247);
buf[1] = (unsigned char)(y & 0xff);
n = 2;
} else if (y < -107 && y >= -1131) {
y = -y - 108;
buf[0] = (Guchar)((y >> 8) + 251);
buf[1] = (Guchar)(y & 0xff);
buf[0] = (unsigned char)((y >> 8) + 251);
buf[1] = (unsigned char)(y & 0xff);
n = 2;
} else {
buf[0] = 255;
buf[1] = (Guchar)(y >> 24);
buf[2] = (Guchar)(y >> 16);
buf[3] = (Guchar)(y >> 8);
buf[4] = (Guchar)y;
buf[1] = (unsigned char)(y >> 24);
buf[2] = (unsigned char)(y >> 16);
buf[3] = (unsigned char)(y >> 8);
buf[4] = (unsigned char)y;
n = 5;
}
}
......@@ -1899,10 +1899,10 @@ void FoFiType1C::cvtNum(double x, bool isFP, GooString *charBuf) const {
}
void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, const char *s) const {
Guchar *p;
Guchar x;
unsigned char *p;
unsigned char x;
for (p = (Guchar *)s; *p; ++p) {
for (p = (unsigned char *)s; *p; ++p) {
x = *p ^ (eb->r1 >> 8);
eb->r1 = (x + eb->r1) * 52845 + 22719;
if (eb->ascii) {
......@@ -1920,8 +1920,8 @@ void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, const char *s) const {
}
void FoFiType1C::eexecWriteCharstring(Type1CEexecBuf *eb,
const Guchar *s, int n) const {
Guchar x;
const unsigned char *s, int n) const {
unsigned char x;
int i;
// eexec encryption
......@@ -2360,7 +2360,7 @@ void FoFiType1C::readPrivateDict(int offset, int length,
void FoFiType1C::readFDSelect() {
int fdSelectFmt, pos, nRanges, gid0, gid1, fd, i, j;
fdSelect = (Guchar *)gmalloc(nGlyphs);
fdSelect = (unsigned char *)gmalloc(nGlyphs);
if (topDict.fdSelectOffset == 0) {
for (i = 0; i < nGlyphs; ++i) {
fdSelect[i] = 0;
......
......@@ -216,7 +216,7 @@ private:
Type1CPrivateDict *pDict);
void cvtNum(double x, bool isFP, GooString *charBuf) const;
void eexecWrite(Type1CEexecBuf *eb, const char *s) const;
void eexecWriteCharstring(Type1CEexecBuf *eb, const Guchar *s, int n) const;
void eexecWriteCharstring(Type1CEexecBuf *eb, const unsigned char *s, int n) const;
void writePSString(const char *s, FoFiOutputFunc outputFunc, void *outputStream) const;
bool parse();
void readTopDict();
......@@ -246,7 +246,7 @@ private:
int nGlyphs;
int nFDs;
Guchar *fdSelect;
unsigned char *fdSelect;
Gushort *charset;
Gushort charsetLength;
int gsubrBias;
......
......@@ -125,7 +125,7 @@ bool PopplerInputStream::fillBuf()
return true;
}
int PopplerInputStream::getChars(int nChars, Guchar *buffer)
int PopplerInputStream::getChars(int nChars, unsigned char *buffer)
{
int n, m;
......
......@@ -56,7 +56,7 @@ private:
bool fillBuf();
bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
int getChars(int nChars, unsigned char *buffer) override;
GInputStream *inputStream;
GCancellable *cancellable;
......
......@@ -24,10 +24,10 @@ auto& grandom_engine()
}
void grandom_fill(Guchar *buff, int size)
void grandom_fill(unsigned char *buff, int size)
{
auto& engine = grandom_engine();
std::uniform_int_distribution<unsigned short> distribution{std::numeric_limits<Guchar>::min(), std::numeric_limits<Guchar>::max()};
std::uniform_int_distribution<unsigned short> distribution{std::numeric_limits<unsigned char>::min(), std::numeric_limits<unsigned char>::max()};
for (int index = 0; index < size; ++index) {
buff[index] = distribution(engine);
}
......
......@@ -15,7 +15,7 @@
#include "gtypes.h"
/// Fills the given buffer with random bytes
void grandom_fill(Guchar *buff, int size);
void grandom_fill(unsigned char *buff, int size);
/// Returns a random number in [0,1)
double grandom_double();
......
......@@ -31,7 +31,6 @@
* These have stupid names to avoid conflicts with <sys/types.h>,
* which on various systems defines some random subset of these.
*/
typedef unsigned char Guchar;
typedef unsigned short Gushort;
typedef unsigned int Guint;
typedef unsigned long Gulong;
......
......@@ -1992,7 +1992,7 @@ void CairoOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
/* work around a cairo bug when scaling 1x1 surfaces */
if (width == 1 && height == 1) {
ImageStream *imgStr;
Guchar pix;
unsigned char pix;
int invert_bit;
imgStr = new ImageStream(str, width, 1, 1);
......@@ -2046,7 +2046,7 @@ void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stre
/* work around a cairo bug when scaling 1x1 surfaces */
if (width == 1 && height == 1) {
ImageStream *imgStr;
Guchar pix;
unsigned char pix;
int invert_bit;
imgStr = new ImageStream(str, width, 1, 1);
......@@ -2118,7 +2118,7 @@ void CairoOutputDev::drawImageMaskRegular(GfxState *state, Object *ref, Stream *
cairo_pattern_t *pattern;
int x, y, i, bit;
ImageStream *imgStr;
Guchar *pix;
unsigned char *pix;
cairo_matrix_t matrix;
int invert_bit;
ptrdiff_t row_stride;
......@@ -2225,7 +2225,7 @@ void CairoOutputDev::drawImageMaskPrescaled(GfxState *state, Object *ref, Stream
cairo_surface_t *image;
cairo_pattern_t *pattern;
ImageStream *imgStr;
Guchar *pix;
unsigned char *pix;
cairo_matrix_t matrix;
int invert_bit;
ptrdiff_t row_stride;
......@@ -2529,7 +2529,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref,
cairo_pattern_t *maskPattern, *pattern;
cairo_matrix_t matrix;
cairo_matrix_t maskMatrix;
Guchar *pix;
unsigned char *pix;
int x, y;
int invert_bit;
cairo_filter_t filter;
......@@ -2686,7 +2686,7 @@ void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *s
cairo_surface_t *maskImage, *image;
cairo_pattern_t *maskPattern, *pattern;
cairo_matrix_t maskMatrix, matrix;
Guchar *pix;
unsigned char *pix;
int y;
cairo_filter_t filter;
cairo_filter_t maskFilter;
......@@ -3107,12 +3107,12 @@ public:
// build a lookup table here
if (colorMap->getNumPixelComps() == 1) {
int n;
Guchar pix;
unsigned char pix;
n = 1 << colorMap->getBits();
lookup = (GfxRGB *)gmallocn(n, sizeof(GfxRGB));
for (i = 0; i < n; ++i) {
pix = (Guchar)i;
pix = (unsigned char)i;
colorMap->getRGB(&pix, &lookup[i]);
}
......@@ -3187,7 +3187,7 @@ public:
}
void getRow(int row_num, uint32_t *row_data) override {
Guchar *pix;
unsigned char *pix;
if (row_num <= current_row)
return;
......@@ -3204,7 +3204,7 @@ public:
imageError = true;
}
} else if (lookup) {
Guchar *p = pix;
unsigned char *p = pix;
GfxRGB rgb;
for (int i = 0; i < width; i++) {
......
......@@ -228,7 +228,7 @@ int DCTStream::getChar() {
return c;
}
int DCTStream::getChars(int nChars, Guchar *buffer) {
int DCTStream::getChars(int nChars, unsigned char *buffer) {
// Use volatile to prevent the compiler optimizing
// variables into registers. See setjmp man page.
volatile int i, c;
......
......@@ -68,7 +68,7 @@ private:
void init();
bool hasGetChars() override { return true; }
int getChars(int nChars, Guchar *buffer) override;
int getChars(int nChars, unsigned char *buffer) override;
int colorXform;
JSAMPLE *current;
......
This diff is collapsed.
......@@ -50,7 +50,7 @@ public:
const GooString *ownerEnc, const GooString *userEnc,
int permissions, const GooString *fileID,
const GooString *ownerPassword, const GooString *userPassword,
Guchar *fileKey, bool encryptMetadata,
unsigned char *fileKey, bool encryptMetadata,
bool *ownerPasswordOk);
private:
......@@ -58,7 +58,7 @@ private:
static bool makeFileKey2(int encVersion, int encRevision, int keyLength,
const GooString *ownerKey, const GooString *userKey,
int permissions, const GooString *fileID,
const GooString *userPassword, Guchar *fileKey,
const GooString *userPassword, unsigned char *fileKey,
bool encryptMetadata);
};
......@@ -74,24 +74,24 @@ private:
* previous output is kept in buf. The paddingReached field is only used in
* case of encryption. */
struct DecryptRC4State {
Guchar state[256];
Guchar x, y;
unsigned char state[256];
unsigned char x, y;
};
struct DecryptAESState {
Guint w[44];
Guchar state[16];
Guchar cbc[16];
Guchar buf[16];
unsigned char state[16];
unsigned char cbc[16];
unsigned char buf[16];
bool paddingReached; // encryption only
int bufIdx;
};
struct DecryptAES256State {
Guint w[60];
Guchar state[16];
Guchar cbc[16];
Guchar buf[16];
unsigned char state[16];
unsigned char cbc[16];
unsigned char buf[16];
bool paddingReached; // encryption only
int bufIdx;
};
......@@ -99,7 +99,7 @@ struct DecryptAES256State {
class BaseCryptStream : public FilterStream {
public:
BaseCryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA,
BaseCryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
~BaseCryptStream();
StreamKind getKind() override { return strCrypt; }
......@@ -114,7 +114,7 @@ public:
protected:
CryptAlgorithm algo;
int objKeyLength;
Guchar objKey[32];
unsigned char objKey[32];
Goffset charactersRead; // so that getPos() can be correct
int nextCharBuff; // EOF means not read yet
bool autoDelete;
......@@ -133,7 +133,7 @@ protected:
class EncryptStream : public BaseCryptStream {
public:
EncryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA,
EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
~EncryptStream();
void reset() override;
......@@ -143,7 +143,7 @@ public:
class DecryptStream : public BaseCryptStream {
public:
DecryptStream(Stream *strA, const Guchar *fileKey, CryptAlgorithm algoA,
DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, int objNum, int objGen);
~DecryptStream();
void reset() override;
......@@ -152,6 +152,6 @@ public:
//------------------------------------------------------------------------
extern void md5(const Guchar *msg, int msgLen, Guchar *digest);
extern void md5(const unsigned char *msg, int msgLen, unsigned char *digest);
#endif
......@@ -56,10 +56,10 @@ private:
static const int inBufSize = 16384;
static const int outBufSize = inBufSize;
Guchar inBuf[ inBufSize ];
Guchar outBuf[ outBufSize ];
Guchar *outBufPtr;
Guchar *outBufEnd;
unsigned char inBuf[ inBufSize ];
unsigned char outBuf[ outBufSize ];
unsigned char *outBufPtr;
unsigned char *outBufEnd;
bool inBufEof;
bool outBufEof;
z_stream zlib_stream;
......
......@@ -658,7 +658,7 @@ void Gfx::initDisplayProfile() {
if (profile.isStream()) {
Stream *iccStream = profile.getStream();
int length = 0;
Guchar *profBuf = iccStream->toUnsignedChars(&length, 65536, 65536);
unsigned char *profBuf = iccStream->toUnsignedChars(&length, 65536, 65536);
cmsHPROFILE hp = cmsOpenProfileFromMem(profBuf,length);
if (hp == nullptr) {
error(errSyntaxWarning, -1, "read ICCBased color space profile error");
......
......@@ -346,7 +346,7 @@ public:
bool getUsesMacRomanEnc() const { return usesMacRomanEnc; }
// Get width of a character.
double getWidth(Guchar c) const { return widths[c]; }
double getWidth(unsigned char c) const { return widths[c]; }
// Return a char code-to-GID mapping for the provided font file.
// (This is only useful for TrueType fonts.)
......
This diff is collapsed.
This diff is collapsed.
......@@ -18,7 +18,7 @@
JArithmeticDecoderStats::JArithmeticDecoderStats(int contextSizeA) {
contextSize = contextSizeA;
cxTab = (Guchar *)gmallocn(contextSize, sizeof(Guchar));
cxTab = (unsigned char *)gmallocn(contextSize, sizeof(unsigned char));
reset();
}
......
......@@ -48,7 +48,7 @@ public:
private:
Guchar *cxTab; // cxTab[cx] = (i[cx] << 1) + mps[cx]
unsigned char *cxTab; // cxTab[cx] = (i[cx] << 1) + mps[cx]
int contextSize;
friend class JArithmeticDecoder;
......
......@@ -664,7 +664,7 @@ private:
//------------------------------------------------------------------------
struct JBIG2BitmapPtr {
Guchar *p;
unsigned char *p;
int shift;
int x;
};
......@@ -694,7 +694,7 @@ public:
int nextPixel(JBIG2BitmapPtr *ptr);
void duplicateRow(int yDest, int ySrc);
void combine(JBIG2Bitmap *bitmap, int x, int y, Guint combOp);
Guchar *getDataPtr() { return data; }
unsigned char *getDataPtr() { return data; }
int getDataSize() { return h * line; }
bool isOk() { return data != nullptr; }
......@@ -703,7 +703,7 @@ private:
JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap);
int w, h, line;
Guchar *data;
unsigned char *data;
};
JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, int wA, int hA):
......@@ -719,7 +719,7 @@ JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, int wA, int hA):
return;
}
// need to allocate one extra guard byte for use in combine()
data = (Guchar *)gmalloc_checkoverflow(h * line + 1);
data = (unsigned char *)gmalloc_checkoverflow(h * line + 1);
if (data != nullptr) {
data[h * line] = 0;
}
......@@ -745,7 +745,7 @@ JBIG2Bitmap::JBIG2Bitmap(Guint segNumA, JBIG2Bitmap *bitmap):
return;
}
// need to allocate one extra guard byte for use in combine()
data = (Guchar *)gmalloc(h * line + 1);
data = (unsigned char *)gmalloc(h * line + 1);
memcpy(data, bitmap->data, h * line);
data[h * line] = 0;
}
......@@ -788,7 +788,7 @@ void JBIG2Bitmap::expand(int newH, Guint pixel) {
return;
}
// need to allocate one extra guard byte for use in combine()
data = (Guchar *)grealloc(data, newH * line + 1);
data = (unsigned char *)grealloc(data, newH * line + 1);
if (pixel) {
memset(data + h * line, 0xff, (newH - h) * line);
} else {