summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorOliver Sander <oliver.sander@tu-dresden.de>2018-11-30 18:12:17 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2018-12-06 17:31:41 +0000
commit22053d55a26baf856a0b95552875e748dd1fb849 (patch)
tree0079f6fa152b41c49c63995ad42cd948dab8f456 /fofi
parentb7503eb3c2364e7ca7fc37418bb4cc484437ea71 (diff)
Replace Guint by unsigned int
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiBase.cc12
-rw-r--r--fofi/FoFiBase.h6
-rw-r--r--fofi/FoFiIdentifier.cc56
-rw-r--r--fofi/FoFiTrueType.cc114
-rw-r--r--fofi/FoFiTrueType.h20
-rw-r--r--fofi/FoFiType1.cc2
6 files changed, 105 insertions, 105 deletions
diff --git a/fofi/FoFiBase.cc b/fofi/FoFiBase.cc
index bbe70b9a..ad5d0067 100644
--- a/fofi/FoFiBase.cc
+++ b/fofi/FoFiBase.cc
@@ -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) {
diff --git a/fofi/FoFiBase.h b/fofi/FoFiBase.h
index 62c7e606..bd472c2e 100644
--- a/fofi/FoFiBase.h
+++ b/fofi/FoFiBase.h
@@ -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;
diff --git a/fofi/FoFiIdentifier.cc b/fofi/FoFiIdentifier.cc
index 5cd7506a..7632ac35 100644
--- a/fofi/FoFiIdentifier.cc
+++ b/fofi/FoFiIdentifier.cc
@@ -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;
}
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 2cc35c3f..35a4aae7 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -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;
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index 1f6f1f8a..b63e3b6c 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -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
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 6fdeb4ec..f9ac55bd 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -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) {