Commit 22053d55 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Replace Guint by unsigned int

parent b7503eb3
......@@ -148,8 +148,8 @@ int FoFiBase::getS32BE(int pos, bool *ok) const {
return x;
}
Guint FoFiBase::getU32BE(int pos, bool *ok) const {
Guint x;
unsigned int FoFiBase::getU32BE(int pos, bool *ok) const {
unsigned int x;
if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) {
*ok = false;
......@@ -162,8 +162,8 @@ Guint FoFiBase::getU32BE(int pos, bool *ok) const {
return x;
}
Guint FoFiBase::getU32LE(int pos, bool *ok) const {
Guint x;
unsigned int FoFiBase::getU32LE(int pos, bool *ok) const {
unsigned int x;
if (pos < 0 || pos+3 >= len || pos > INT_MAX - 3) {
*ok = false;
......@@ -176,8 +176,8 @@ Guint FoFiBase::getU32LE(int pos, bool *ok) const {
return x;
}
Guint FoFiBase::getUVarBE(int pos, int size, bool *ok) const {
Guint x;
unsigned int FoFiBase::getUVarBE(int pos, int size, bool *ok) const {
unsigned int x;
int i;
if (pos < 0 || pos + size > len || pos > INT_MAX - size) {
......
......@@ -53,9 +53,9 @@ protected:
int getS16BE(int pos, bool *ok) const;
int getU16BE(int pos, bool *ok) const;
int getS32BE(int pos, bool *ok) const;
Guint getU32BE(int pos, bool *ok) const;
Guint getU32LE(int pos, bool *ok) const;
Guint getUVarBE(int pos, int size, bool *ok) const;
unsigned int getU32BE(int pos, bool *ok) const;
unsigned int getU32LE(int pos, bool *ok) const;
unsigned int getUVarBE(int pos, int size, bool *ok) const;
bool checkRegion(int pos, int size) const;
......
......@@ -48,15 +48,15 @@ public:
// Read a big-endian unsigned 32-bit integer. Fills in *val and
// returns true if successful.
virtual bool getU32BE(int pos, Guint *val) = 0;
virtual bool getU32BE(int pos, unsigned int *val) = 0;
// Read a little-endian unsigned 32-bit integer. Fills in *val and
// returns true if successful.
virtual bool getU32LE(int pos, Guint *val) = 0;
virtual bool getU32LE(int pos, unsigned int *val) = 0;
// Read a big-endian unsigned <size>-byte integer, where 1 <= size
// <= 4. Fills in *val and returns true if successful.
virtual bool getUVarBE(int pos, int size, Guint *val) = 0;
virtual bool getUVarBE(int pos, int size, unsigned int *val) = 0;
// Compare against a string. Returns true if equal.
virtual bool cmp(int pos, const char *s) = 0;
......@@ -72,9 +72,9 @@ public:
~MemReader();
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, Guint *val) override;
bool getU32LE(int pos, Guint *val) override;
bool getUVarBE(int pos, int size, Guint *val) override;
bool getU32BE(int pos, unsigned int *val) override;
bool getU32LE(int pos, unsigned int *val) override;
bool getUVarBE(int pos, int size, unsigned int *val) override;
bool cmp(int pos, const char *s) override;
private:
......@@ -113,7 +113,7 @@ bool MemReader::getU16BE(int pos, int *val) {
return true;
}
bool MemReader::getU32BE(int pos, Guint *val) {
bool MemReader::getU32BE(int pos, unsigned int *val) {
if (pos < 0 || pos > len - 4) {
return false;
}
......@@ -124,7 +124,7 @@ bool MemReader::getU32BE(int pos, Guint *val) {
return true;
}
bool MemReader::getU32LE(int pos, Guint *val) {
bool MemReader::getU32LE(int pos, unsigned int *val) {
if (pos < 0 || pos > len - 4) {
return false;
}
......@@ -135,7 +135,7 @@ bool MemReader::getU32LE(int pos, Guint *val) {
return true;
}
bool MemReader::getUVarBE(int pos, int size, Guint *val) {
bool MemReader::getUVarBE(int pos, int size, unsigned int *val) {
int i;
if (size < 1 || size > 4 || pos < 0 || pos > len - size) {
......@@ -167,9 +167,9 @@ public:
~FileReader();
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, Guint *val) override;
bool getU32LE(int pos, Guint *val) override;
bool getUVarBE(int pos, int size, Guint *val) override;
bool getU32BE(int pos, unsigned int *val) override;
bool getU32LE(int pos, unsigned int *val) override;
bool getUVarBE(int pos, int size, unsigned int *val) override;
bool cmp(int pos, const char *s) override;
private:
......@@ -217,7 +217,7 @@ bool FileReader::getU16BE(int pos, int *val) {
return true;
}
bool FileReader::getU32BE(int pos, Guint *val) {
bool FileReader::getU32BE(int pos, unsigned int *val) {
if (!fillBuf(pos, 4)) {
return false;
}
......@@ -228,7 +228,7 @@ bool FileReader::getU32BE(int pos, Guint *val) {
return true;
}
bool FileReader::getU32LE(int pos, Guint *val) {
bool FileReader::getU32LE(int pos, unsigned int *val) {
if (!fillBuf(pos, 4)) {
return false;
}
......@@ -239,7 +239,7 @@ bool FileReader::getU32LE(int pos, Guint *val) {
return true;
}
bool FileReader::getUVarBE(int pos, int size, Guint *val) {
bool FileReader::getUVarBE(int pos, int size, unsigned int *val) {
int i;
if (size < 1 || size > 4 || !fillBuf(pos, size)) {
......@@ -290,9 +290,9 @@ public:
~StreamReader();
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, Guint *val) override;
bool getU32LE(int pos, Guint *val) override;
bool getUVarBE(int pos, int size, Guint *val) override;
bool getU32BE(int pos, unsigned int *val) override;
bool getU32LE(int pos, unsigned int *val) override;
bool getUVarBE(int pos, int size, unsigned int *val) override;
bool cmp(int pos, const char *s) override;
private:
......@@ -338,7 +338,7 @@ bool StreamReader::getU16BE(int pos, int *val) {
return true;
}
bool StreamReader::getU32BE(int pos, Guint *val) {
bool StreamReader::getU32BE(int pos, unsigned int *val) {
if (!fillBuf(pos, 4)) {
return false;
}
......@@ -349,7 +349,7 @@ bool StreamReader::getU32BE(int pos, Guint *val) {
return true;
}
bool StreamReader::getU32LE(int pos, Guint *val) {
bool StreamReader::getU32LE(int pos, unsigned int *val) {
if (!fillBuf(pos, 4)) {
return false;
}
......@@ -360,7 +360,7 @@ bool StreamReader::getU32LE(int pos, Guint *val) {
return true;
}
bool StreamReader::getUVarBE(int pos, int size, Guint *val) {
bool StreamReader::getUVarBE(int pos, int size, unsigned int *val) {
int i;
if (size < 1 || size > 4 || !fillBuf(pos, size)) {
......@@ -474,7 +474,7 @@ FoFiIdentifierType FoFiIdentifier::identifyStream(int (*getChar)(void *data),
}
static FoFiIdentifierType identify(Reader *reader) {
Guint n;
unsigned int n;
//----- PFA
if (reader->cmp(0, "%!PS-AdobeFont-1") ||
......@@ -535,7 +535,7 @@ static FoFiIdentifierType identify(Reader *reader) {
static FoFiIdentifierType identifyOpenType(Reader *reader) {
FoFiIdentifierType type;
Guint offset;
unsigned int offset;
int nTables, i;
if (!reader->getU16BE(4, &nTables)) {
......@@ -544,7 +544,7 @@ static FoFiIdentifierType identifyOpenType(Reader *reader) {
for (i = 0; i < nTables; ++i) {
if (reader->cmp(12 + i*16, "CFF ")) {
if (reader->getU32BE(12 + i*16 + 8, &offset) &&
offset < (Guint)INT_MAX) {
offset < (unsigned int)INT_MAX) {
type = identifyCFF(reader, (int)offset);
if (type == fofiIdCFF8Bit) {
type = fofiIdOpenTypeCFF8Bit;
......@@ -560,7 +560,7 @@ static FoFiIdentifierType identifyOpenType(Reader *reader) {
}
static FoFiIdentifierType identifyCFF(Reader *reader, int start) {
Guint offset0, offset1;
unsigned int offset0, offset1;
int hdrSize, offSize0, offSize1, pos, endPos, b0, n, i;
//----- read the header
......@@ -590,7 +590,7 @@ static FoFiIdentifierType identifyCFF(Reader *reader, int start) {
return fofiIdUnknown;
}
if (!reader->getUVarBE(pos + 3 + n * offSize1, offSize1, &offset1) ||
offset1 > (Guint)INT_MAX) {
offset1 > (unsigned int)INT_MAX) {
return fofiIdUnknown;
}
pos += 3 + (n + 1) * offSize1 + (int)offset1 - 1;
......@@ -607,9 +607,9 @@ static FoFiIdentifierType identifyCFF(Reader *reader, int start) {
return fofiIdUnknown;
}
if (!reader->getUVarBE(pos + 3, offSize1, &offset0) ||
offset0 > (Guint)INT_MAX ||
offset0 > (unsigned int)INT_MAX ||
!reader->getUVarBE(pos + 3 + offSize1, offSize1, &offset1) ||
offset1 > (Guint)INT_MAX ||
offset1 > (unsigned int)INT_MAX ||
offset0 > offset1) {
return fofiIdUnknown;
}
......
......@@ -107,8 +107,8 @@
//------------------------------------------------------------------------
struct TrueTypeTable {
Guint tag;
Guint checksum;
unsigned int tag;
unsigned int checksum;
int offset;
int origOffset;
int len;
......@@ -337,10 +337,10 @@ int FoFiTrueType::findCmap(int platform, int encoding) const {
return -1;
}
int FoFiTrueType::mapCodeToGID(int i, Guint c) const {
int FoFiTrueType::mapCodeToGID(int i, unsigned int c) const {
int gid;
Guint segCnt, segEnd, segStart, segDelta, segOffset;
Guint cmapFirst, cmapLen;
unsigned int segCnt, segEnd, segStart, segDelta, segOffset;
unsigned int cmapFirst, cmapLen;
int pos, a, b, m;
bool ok;
......@@ -351,7 +351,7 @@ int FoFiTrueType::mapCodeToGID(int i, Guint c) const {
pos = cmaps[i].offset;
switch (cmaps[i].fmt) {
case 0:
if (c + 6 >= (Guint)cmaps[i].len) {
if (c + 6 >= (unsigned int)cmaps[i].len) {
return 0;
}
gid = getU8(cmaps[i].offset + 6 + c, &ok);
......@@ -942,7 +942,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
TrueTypeTable newTables[nT42Tables];
unsigned char tableDir[12 + nT42Tables*16];
bool ok;
Guint checksum;
unsigned int checksum;
int nNewTables;
int glyfTableLen, length, pos, glyfPos, i, j, k, vmtxTabLength;
unsigned char vheaTab[36] = {
......@@ -1283,8 +1283,8 @@ void FoFiTrueType::dumpString(const unsigned char *s, int length,
(*outputFunc)(outputStream, "00>\n", 4);
}
Guint FoFiTrueType::computeTableChecksum(const unsigned char *data, int length) const {
Guint checksum, word;
unsigned int FoFiTrueType::computeTableChecksum(const unsigned char *data, int length) const {
unsigned int checksum, word;
int i;
checksum = 0;
......@@ -1315,7 +1315,7 @@ Guint FoFiTrueType::computeTableChecksum(const unsigned char *data, int length)
}
void FoFiTrueType::parse() {
Guint topTag;
unsigned int topTag;
int pos, ver, i, j;
parsedOk = true;
......@@ -1518,7 +1518,7 @@ void FoFiTrueType::readPostTable() {
}
int FoFiTrueType::seekTable(const char *tag) const {
Guint tagI;
unsigned int tagI;
int i;
tagI = ((tag[0] & 0xff) << 24) |
......@@ -1533,10 +1533,10 @@ int FoFiTrueType::seekTable(const char *tag) const {
return -1;
}
Guint FoFiTrueType::charToTag(const char *tagName)
unsigned int FoFiTrueType::charToTag(const char *tagName)
{
int n = strlen(tagName);
Guint tag = 0;
unsigned int tag = 0;
int i;
if (n > 4) n = 4;
......@@ -1567,20 +1567,20 @@ int FoFiTrueType::setupGSUB(const char *scriptName)
int FoFiTrueType::setupGSUB(const char *scriptName,
const char *languageName)
{
Guint gsubTable;
unsigned int gsubTable;
unsigned int i;
Guint scriptList, featureList;
Guint scriptCount;
Guint tag;
Guint scriptTable = 0;
Guint langSys;
Guint featureCount;
Guint featureIndex;
Guint ftable = 0;
Guint llist;
Guint scriptTag;
unsigned int scriptList, featureList;
unsigned int scriptCount;
unsigned int tag;
unsigned int scriptTable = 0;
unsigned int langSys;
unsigned int featureCount;
unsigned int featureIndex;
unsigned int ftable = 0;
unsigned int llist;
unsigned int scriptTag;
int x;
Guint pos;
unsigned int pos;
if (scriptName == nullptr) {
gsubFeatureTable = 0;
......@@ -1625,8 +1625,8 @@ int FoFiTrueType::setupGSUB(const char *scriptName,
pos = gsubTable+scriptList+scriptTable;
langSys = 0;
if (languageName) {
Guint langTag = charToTag(languageName);
Guint langCount = getU16BE(pos+2,&parsedOk);
unsigned int langTag = charToTag(languageName);
unsigned int langCount = getU16BE(pos+2,&parsedOk);
for (i = 0;i < langCount && langSys == 0;i++) {
tag = getU32BE(pos+4+i*(4+2),&parsedOk);
if (tag == langTag) {
......@@ -1650,7 +1650,7 @@ int FoFiTrueType::setupGSUB(const char *scriptName,
pos += 2;
if (featureIndex != 0xffff) {
Guint tpos;
unsigned int tpos;
/* read feature record */
tpos = gsubTable+featureList;
featureCount = getU16BE(tpos,&parsedOk);
......@@ -1671,7 +1671,7 @@ int FoFiTrueType::setupGSUB(const char *scriptName,
pos += 2;
/* find 'vrt2' or 'vert' feature */
for (i = 0;i < featureCount;i++) {
Guint oldPos;
unsigned int oldPos;
featureIndex = getU16BE(pos,&parsedOk);
pos += 2;
......@@ -1698,13 +1698,13 @@ int FoFiTrueType::setupGSUB(const char *scriptName,
return 0;
}
Guint FoFiTrueType::doMapToVertGID(Guint orgGID)
unsigned int FoFiTrueType::doMapToVertGID(unsigned int orgGID)
{
Guint lookupCount;
Guint lookupListIndex;
Guint i;
Guint gid = 0;
Guint pos;
unsigned int lookupCount;
unsigned int lookupListIndex;
unsigned int i;
unsigned int gid = 0;
unsigned int pos;
pos = gsubFeatureTable+2;
lookupCount = getU16BE(pos,&parsedOk);
......@@ -1719,9 +1719,9 @@ Guint FoFiTrueType::doMapToVertGID(Guint orgGID)
return gid;
}
Guint FoFiTrueType::mapToVertGID(Guint orgGID)
unsigned int FoFiTrueType::mapToVertGID(unsigned int orgGID)
{
Guint mapped;
unsigned int mapped;
if (gsubFeatureTable == 0) return orgGID;
if ((mapped = doMapToVertGID(orgGID)) != 0) {
......@@ -1730,14 +1730,14 @@ Guint FoFiTrueType::mapToVertGID(Guint orgGID)
return orgGID;
}
Guint FoFiTrueType::scanLookupList(Guint listIndex, Guint orgGID)
unsigned int FoFiTrueType::scanLookupList(unsigned int listIndex, unsigned int orgGID)
{
Guint lookupTable;
Guint subTableCount;
Guint subTable;
Guint i;
Guint gid = 0;
Guint pos;
unsigned int lookupTable;
unsigned int subTableCount;
unsigned int subTable;
unsigned int i;
unsigned int gid = 0;
unsigned int pos;
if (gsubLookupList == 0) return 0; /* no lookup list */
pos = gsubLookupList+2+listIndex*2;
......@@ -1755,14 +1755,14 @@ Guint FoFiTrueType::scanLookupList(Guint listIndex, Guint orgGID)
return gid;
}
Guint FoFiTrueType::scanLookupSubTable(Guint subTable, Guint orgGID)
unsigned int FoFiTrueType::scanLookupSubTable(unsigned int subTable, unsigned int orgGID)
{
Guint format;
Guint coverage;
unsigned int format;
unsigned int coverage;
int delta;
int glyphCount;
Guint substitute;
Guint gid = 0;
unsigned int substitute;
unsigned int gid = 0;
int coverageIndex;
int pos;
......@@ -1798,13 +1798,13 @@ Guint FoFiTrueType::scanLookupSubTable(Guint subTable, Guint orgGID)
return gid;
}
int FoFiTrueType::checkGIDInCoverage(Guint coverage, Guint orgGID)
int FoFiTrueType::checkGIDInCoverage(unsigned int coverage, unsigned int orgGID)
{
int index = -1;
Guint format;
Guint count;
Guint i;
Guint pos;
unsigned int format;
unsigned int count;
unsigned int i;
unsigned int pos;
pos = coverage;
format = getU16BE(pos,&parsedOk);
......@@ -1817,7 +1817,7 @@ int FoFiTrueType::checkGIDInCoverage(Guint coverage, Guint orgGID)
// thus we cannot finish checking even when the range
// including orgGID seems to have already passed.
for (i = 0;i < count;i++) {
Guint gid;
unsigned int gid;
gid = getU16BE(pos,&parsedOk);
pos += 2;
......@@ -1832,8 +1832,8 @@ int FoFiTrueType::checkGIDInCoverage(Guint coverage, Guint orgGID)
count = getU16BE(pos,&parsedOk);
pos += 2;
for (i = 0;i < count;i++) {
Guint startGID, endGID;
Guint startIndex;
unsigned int startGID, endGID;
unsigned int startIndex;
startGID = getU16BE(pos,&parsedOk);
pos += 2;
......
......@@ -71,11 +71,11 @@ public:
int findCmap(int platform, int encoding) const;
// Return the GID corresponding to <c> according to the <i>th cmap.
int mapCodeToGID(int i, Guint c) const;
int mapCodeToGID(int i, unsigned int c) const;
// map gid to vertical glyph gid if exist.
// if not exist return original gid
Guint mapToVertGID(Guint orgGID);
unsigned int mapToVertGID(unsigned int orgGID);
// Returns the GID corresponding to <name> according to the post
// table. Returns 0 if there is no mapping for <name> or if the
......@@ -180,15 +180,15 @@ private:
void dumpString(const unsigned char *s, int length,
FoFiOutputFunc outputFunc,
void *outputStream) const;
Guint computeTableChecksum(const unsigned char *data, int length) const;
unsigned int computeTableChecksum(const unsigned char *data, int length) const;
void parse();
void readPostTable();
int seekTable(const char *tag) const;
Guint charToTag(const char *tagName);
Guint doMapToVertGID(Guint orgGID);
Guint scanLookupList(Guint listIndex, Guint orgGID);
Guint scanLookupSubTable(Guint subTable, Guint orgGID);
int checkGIDInCoverage(Guint coverage, Guint orgGID);
unsigned int charToTag(const char *tagName);
unsigned int doMapToVertGID(unsigned int orgGID);
unsigned int scanLookupList(unsigned int listIndex, unsigned int orgGID);
unsigned int scanLookupSubTable(unsigned int subTable, unsigned int orgGID);
int checkGIDInCoverage(unsigned int coverage, unsigned int orgGID);
TrueTypeTable *tables;
int nTables;
......@@ -202,8 +202,8 @@ private:
bool parsedOk;
int faceIndex;
Guint gsubFeatureTable;
Guint gsubLookupList;
unsigned int gsubFeatureTable;
unsigned int gsubLookupList;
};
#endif
......@@ -368,7 +368,7 @@ void FoFiType1::undoPFB() {
bool ok;
unsigned char *file2;
int pos1, pos2, type;
Guint segLen;
unsigned int segLen;
ok = true;
if (getU8(0, &ok) != 0x80 || !ok) {
......
......@@ -57,7 +57,7 @@ void PopplerInputStream::reset()
{
GSeekable *seekable = G_SEEKABLE(inputStream);
savePos = (Guint)g_seekable_tell(seekable);
savePos = (unsigned int)g_seekable_tell(seekable);
g_seekable_seek(seekable, start, G_SEEK_SET, cancellable, nullptr);
saved = true;
bufPtr = bufEnd = buf;
......@@ -74,7 +74,7 @@ void PopplerInputStream::close()
void PopplerInputStream::setPos(Goffset pos, int dir)
{
Guint size;
unsigned int size;
GSeekable *seekable = G_SEEKABLE(inputStream);
if (dir >= 0) {
......@@ -82,13 +82,13 @@ void PopplerInputStream::setPos(Goffset pos, int dir)
bufPos = pos;
} else {
g_seekable_seek(seekable, 0, G_SEEK_END, cancellable, nullptr);
size = (Guint)g_seekable_tell(seekable);
size = (unsigned int)g_seekable_tell(seekable);
if (pos > size)
pos = size;
g_seekable_seek(seekable, -(goffset)pos, G_SEEK_END, cancellable, nullptr);
bufPos = (Guint)g_seekable_tell(seekable);
bufPos = (unsigned int)g_seekable_tell(seekable);
}
bufPtr = bufEnd = buf;
}
......
......@@ -54,7 +54,7 @@ namespace
union GooStringFormatArg {
int i;
Guint ui;
unsigned int ui;
long l;
Gulong ul;
long long ll;
......@@ -279,7 +279,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
case fmtUIntHexUpper:
case fmtUIntOctal:
case fmtUIntBinary:
args[argsLen].ui = va_arg(argList, Guint);
args[argsLen].ui = va_arg(argList, unsigned int);
break;
case fmtLongDecimal:
case fmtLongHex:
......
......@@ -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 int Guint;
typedef unsigned long Gulong;
#endif
......@@ -1401,7 +1401,7 @@ void Annot::setModified(GooString *new_modified) {
update ("M", Object(modified->copy()));
}
void Annot::setFlags(Guint new_flags) {
void Annot::setFlags(unsigned int new_flags) {
annotLocker();
flags = new_flags;
update ("F", Object(int(flags)));
......
......@@ -682,7 +682,7 @@ public:
virtual void setContents(GooString *new_content);
void setName(GooString *new_name);
void setModified(GooString *new_date);
void setFlags(Guint new_flags);
void setFlags(unsigned int new_flags);
void setBorder(std::unique_ptr<AnnotBorder> &&new_border);
void setColor(std::unique_ptr<AnnotColor> &&new_color);
......@@ -701,7 +701,7 @@ public:
int getPageNum() const { return page; }
const GooString *getName() const { return name.get(); }
const GooString *getModified() const { return modified.get(); }
Guint getFlags() const { return flags; }
unsigned int getFlags() const { return flags; }
AnnotAppearance *getAppearStreams() const { return appearStreams.get(); }
const GooString *getAppearState() const { return appearState.get(); }
AnnotBorder *getBorder() const { return border.get(); }
......@@ -755,7 +755,7 @@ protected:
std::unique_ptr<GooString> name; // NM
std::unique_ptr<GooString> modified; // M
int page; // P
Guint flags; // F (must be a 32 bit unsigned int)
unsigned int flags; // F (must be a 32 bit unsigned int)
std::unique_ptr<AnnotAppearance> appearStreams; // AP
Object appearance; // a reference to the Form XObject stream
// for the normal appearance
......
......@@ -133,7 +133,7 @@ CMap *CMap::parse(CMapCache *cache, const GooString *collectionA,
PSTokenizer *pst;
char tok1[256], tok2[256], tok3[256];
int n1, n2, n3;
Guint start, end, code;
unsigned int start, end, code;
if (stream) {
stream->reset();
......@@ -231,7 +231,7 @@ void CMap::parse2(CMapCache *cache, int (*getCharFunc)(void *), void *data) {
PSTokenizer *pst;
char tok1[256], tok2[256], tok3[256];
int n1, n2, n3;
Guint start = 0, end = 0, code;
unsigned int start = 0, end = 0, code;
pst = new PSTokenizer(getCharFunc, data);
pst->getToken(tok1, sizeof(tok1), &n1);
......@@ -385,11 +385,11 @@ void CMap::copyVector(CMapVectorEntry *dest, CMapVectorEntry *src) {
}
}
void CMap::addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID) {
void CMap::addCIDs(unsigned int start, unsigned int end, unsigned int nBytes, CID firstCID) {
CMapVectorEntry *vec;
CID cid;
int byte;
Guint i, j;
unsigned int i, j;
vec = vector;
for (i = nBytes - 1; i >= 1; --i) {
......@@ -480,8 +480,8 @@ CID CMap::getCID(const char *s, int len, CharCode *c, int *nUsed) {
return 0;
}
void CMap::setReverseMapVector(Guint startCode, CMapVectorEntry *vec,
Guint *rmap, Guint rmapSize, Guint ncand) {
void CMap::setReverseMapVector(unsigned int startCode, CMapVectorEntry *vec,
unsigned int *rmap, unsigned int rmapSize, unsigned int ncand) {
int i;
if (vec == nullptr) return;
......@@ -490,14 +490,14 @@ void CMap::setReverseMapVector(Guint startCode, CMapVectorEntry *vec,
setReverseMapVector((startCode+i) << 8,
vec[i].vector,rmap,rmapSize,ncand);
} else {
Guint cid = vec[i].cid;
unsigned int cid = vec[i].cid;
if (cid < rmapSize) {
Guint cand;
unsigned int cand;
for (cand = 0;cand < ncand;cand++) {
Guint code = startCode+i;
Guint idx = cid*ncand+cand;
unsigned int code = startCode+i;
unsigned int idx = cid*ncand+cand;
if (rmap[idx] == 0) {
rmap[idx] = code;
break;
......@@ -510,7 +510,7 @@ void CMap::setReverseMapVector(Guint startCode, CMapVectorEntry *vec,
}
}
void CMap::setReverseMap(Guint *rmap, Guint rmapSize,