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

Replace Gushort by unsigned short

parent 51bb4676
......@@ -945,7 +945,7 @@ const char *fofiType1CStdStrings[391] = {
"Semibold"
};
Gushort fofiType1CISOAdobeCharset[229] = {
unsigned short fofiType1CISOAdobeCharset[229] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
......@@ -971,7 +971,7 @@ Gushort fofiType1CISOAdobeCharset[229] = {
220, 221, 222, 223, 224, 225, 226, 227, 228
};
Gushort fofiType1CExpertCharset[166] = {
unsigned short fofiType1CExpertCharset[166] = {
0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
......@@ -991,7 +991,7 @@ Gushort fofiType1CExpertCharset[166] = {
373, 374, 375, 376, 377, 378
};
Gushort fofiType1CExpertSubsetCharset[87] = {
unsigned short fofiType1CExpertSubsetCharset[87] = {
0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
......
......@@ -37,8 +37,8 @@ extern const char * const fofiType1ExpertEncoding[256];
//------------------------------------------------------------------------
extern const char *fofiType1CStdStrings[391];
extern Gushort fofiType1CISOAdobeCharset[229];
extern Gushort fofiType1CExpertCharset[166];
extern Gushort fofiType1CExpertSubsetCharset[87];
extern unsigned short fofiType1CISOAdobeCharset[229];
extern unsigned short fofiType1CExpertCharset[166];
extern unsigned short fofiType1CExpertSubsetCharset[87];
#endif
......@@ -1199,7 +1199,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf,
Type1CIndexVal val;
bool ok, dFP;
double d, dx, dy;
Gushort r2;
unsigned short r2;
unsigned char byte;
int pos, subrBias, start, i, k;
......@@ -2502,15 +2502,15 @@ bool FoFiType1C::readCharset() {
if (topDict.charsetOffset == 0) {
charset = fofiType1CISOAdobeCharset;
charsetLength = sizeof(fofiType1CISOAdobeCharset) / sizeof(Gushort);
charsetLength = sizeof(fofiType1CISOAdobeCharset) / sizeof(unsigned short);
} else if (topDict.charsetOffset == 1) {
charset = fofiType1CExpertCharset;
charsetLength = sizeof(fofiType1CExpertCharset) / sizeof(Gushort);
charsetLength = sizeof(fofiType1CExpertCharset) / sizeof(unsigned short);
} else if (topDict.charsetOffset == 2) {
charset = fofiType1CExpertSubsetCharset;
charsetLength = sizeof(fofiType1CExpertSubsetCharset) / sizeof(Gushort);
charsetLength = sizeof(fofiType1CExpertSubsetCharset) / sizeof(unsigned short);
} else {
charset = (Gushort *)gmallocn(nGlyphs, sizeof(Gushort));
charset = (unsigned short *)gmallocn(nGlyphs, sizeof(unsigned short));
charsetLength = nGlyphs;
for (i = 0; i < nGlyphs; ++i) {
charset[i] = 0;
......@@ -2519,7 +2519,7 @@ bool FoFiType1C::readCharset() {
charsetFormat = getU8(pos++, &parsedOk);
if (charsetFormat == 0) {
for (i = 1; i < nGlyphs; ++i) {
charset[i] = (Gushort)getU16BE(pos, &parsedOk);
charset[i] = (unsigned short)getU16BE(pos, &parsedOk);
pos += 2;
if (!parsedOk) {
break;
......@@ -2535,7 +2535,7 @@ bool FoFiType1C::readCharset() {
break;
}
for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
charset[i++] = (Gushort)c++;
charset[i++] = (unsigned short)c++;
}
}
} else if (charsetFormat == 2) {
......@@ -2549,7 +2549,7 @@ bool FoFiType1C::readCharset() {
break;
}
for (j = 0; j <= nLeft && i < nGlyphs; ++j) {
charset[i++] = (Gushort)c++;
charset[i++] = (unsigned short)c++;
}
}
}
......
......@@ -133,7 +133,7 @@ struct Type1CEexecBuf {
FoFiOutputFunc outputFunc;
void *outputStream;
bool ascii; // ASCII encoding?
Gushort r1; // eexec encryption key
unsigned short r1; // eexec encryption key
int line; // number of eexec chars left on current line
};
......@@ -247,8 +247,8 @@ private:
int nGlyphs;
int nFDs;
unsigned char *fdSelect;
Gushort *charset;
Gushort charsetLength;
unsigned short *charset;
unsigned short charsetLength;
int gsubrBias;
bool parsedOk;
......
......@@ -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 short Gushort;
typedef unsigned int Guint;
typedef unsigned long Gulong;
......
......@@ -35,7 +35,7 @@ BuiltinFontWidths::~BuiltinFontWidths() {
gfree(tab);
}
bool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
bool BuiltinFontWidths::getWidth(const char *name, unsigned short *width) {
int h;
BuiltinFontWidth *p;
......
......@@ -43,7 +43,7 @@ struct BuiltinFont {
struct BuiltinFontWidth {
const char *name;
Gushort width;
unsigned short width;
BuiltinFontWidth *next;
};
......@@ -56,7 +56,7 @@ public:
BuiltinFontWidths(const BuiltinFontWidths &) = delete;
BuiltinFontWidths& operator=(const BuiltinFontWidths &) = delete;
bool getWidth(const char *name, Gushort *width);
bool getWidth(const char *name, unsigned short *width);
private:
......
......@@ -419,7 +419,7 @@ static char *type1CStdStrings[391] = {
"Semibold"
};
static Gushort type1CISOAdobeCharset[229] = {
static unsigned short type1CISOAdobeCharset[229] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
......@@ -445,7 +445,7 @@ static Gushort type1CISOAdobeCharset[229] = {
220, 221, 222, 223, 224, 225, 226, 227, 228
};
static const Gushort type1CExpertCharset[166] = {
static const unsigned short type1CExpertCharset[166] = {
0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
......@@ -465,7 +465,7 @@ static const Gushort type1CExpertCharset[166] = {
373, 374, 375, 376, 377, 378
};
static Gushort type1CExpertSubsetCharset[87] = {
static unsigned short type1CExpertSubsetCharset[87] = {
0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
......
......@@ -960,7 +960,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA
Unicode uBuf[8];
double mul;
int firstChar, lastChar;
Gushort w;
unsigned short w;
Object obj1;
int n, i, a, b, m;
......@@ -2089,9 +2089,9 @@ const GooString *GfxCIDFont::getCollection() const {
int GfxCIDFont::mapCodeToGID(FoFiTrueType *ff, int cmapi,
Unicode unicode, bool wmode) {
Gushort gid = ff->mapCodeToGID(cmapi,unicode);
unsigned short gid = ff->mapCodeToGID(cmapi,unicode);
if (wmode) {
Gushort vgid = ff->mapToVertGID(gid);
unsigned short vgid = ff->mapToVertGID(gid);
if (vgid != 0) gid = vgid;
}
return gid;
......
......@@ -129,8 +129,8 @@ static inline unsigned char colToByte(GfxColorComp x) {
return (unsigned char)(((x << 8) - x + 0x8000) >> 16);
}
static inline Gushort colToShort(GfxColorComp x) {
return (Gushort)(x);
static inline unsigned short colToShort(GfxColorComp x) {
return (unsigned short)(x);
}
//------------------------------------------------------------------------
......
......@@ -118,7 +118,7 @@ struct JPXCodeBlock {
//----- coefficient data
int *coeffs;
char *touched; // coefficient 'touched' flags
Gushort len; // coefficient length
unsigned short len; // coefficient length
JArithmeticDecoder // arithmetic decoder
*arithDecoder;
JArithmeticDecoderStats // arithmetic decoder stats
......
......@@ -81,7 +81,7 @@ class Movie {
const GooString* getFileName() const { return fileName; }
Gushort getRotationAngle() const { return rotationAngle; }
unsigned short getRotationAngle() const { return rotationAngle; }
void getAspect (int *widthA, int *heightA) const { *widthA = width; *heightA = height; }
Object getPoster() const { return poster.copy(); }
......@@ -97,7 +97,7 @@ class Movie {
bool ok;
Gushort rotationAngle; // 0
unsigned short rotationAngle; // 0
int width; // Aspect
int height; // Aspect
......
......@@ -1223,8 +1223,8 @@ private:
//------------------------------------------------------------------------
struct T3FontCacheTag {
Gushort code;
Gushort mru; // valid bit (0x8000) and MRU index
unsigned short code;
unsigned short mru; // valid bit (0x8000) and MRU index
};
class T3FontCache {
......@@ -1314,7 +1314,7 @@ T3FontCache::~T3FontCache() {
}
struct T3GlyphStack {
Gushort code; // character code
unsigned short code; // character code
bool haveDx; // set after seeing a d0/d1 operator
bool doNotCache; // set if we see a gsave/grestore before
......
......@@ -3052,7 +3052,7 @@ bool DCTStream::readProgressiveDataUnit(DCTHuffTable *dcHuffTable,
void DCTStream::decodeImage() {
int dataIn[64];
unsigned char dataOut[64];
Gushort *quantTable;
unsigned short *quantTable;
int pY, pCb, pCr, pR, pG, pB;
int x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
int h, v, horiz, vert, hSub, vSub;
......@@ -3191,7 +3191,7 @@ void DCTStream::decodeImage() {
// 988-991.
// The stage numbers mentioned in the comments refer to Figure 1 in this
// paper.
void DCTStream::transformDataUnit(Gushort *quantTable,
void DCTStream::transformDataUnit(unsigned short *quantTable,
int dataIn[64], unsigned char dataOut[64]) {
int v0, v1, v2, v3, v4, v5, v6, v7, t;
int *p;
......@@ -3350,7 +3350,7 @@ void DCTStream::transformDataUnit(Gushort *quantTable,
}
int DCTStream::readHuffSym(DCTHuffTable *table) {
Gushort code;
unsigned short code;
int bit;
int codeBits;
......@@ -3672,7 +3672,7 @@ bool DCTStream::readHuffmanTables() {
DCTHuffTable *tbl;
int length;
int index;
Gushort code;
unsigned short code;
unsigned char sym;
int i;
int c;
......@@ -4893,8 +4893,8 @@ void FlateStream::compHuffmanCodes(int *lengths, int n, FlateHuffmanTab *tab) {
// fill in the table entries
for (i = code2; i < tabSize; i += skip) {
tab->codes[i].len = (Gushort)len;
tab->codes[i].val = (Gushort)val;
tab->codes[i].len = (unsigned short)len;
tab->codes[i].val = (unsigned short)val;
}
++code;
......
......@@ -958,8 +958,8 @@ struct DCTScanInfo {
// DCT Huffman decoding table
struct DCTHuffTable {
unsigned char firstSym[17]; // first symbol for this bit length
Gushort firstCode[17]; // first code for this bit length
Gushort numCodes[17]; // number of codes of this bit length
unsigned short firstCode[17]; // first code for this bit length
unsigned short numCodes[17]; // number of codes of this bit length
unsigned char sym[256]; // symbols
};
......@@ -995,7 +995,7 @@ private:
bool gotJFIFMarker; // set if APP0 JFIF marker was present
bool gotAdobeMarker; // set if APP14 Adobe marker was present
int restartInterval; // restart interval, in MCUs
Gushort quantTables[4][64]; // quantization tables
unsigned short quantTables[4][64]; // quantization tables
int numQuantTables; // number of quantization tables
DCTHuffTable dcHuffTables[4]; // DC Huffman tables
DCTHuffTable acHuffTables[4]; // AC Huffman tables
......@@ -1020,7 +1020,7 @@ private:
DCTHuffTable *acHuffTable,
int *prevDC, int data[64]);
void decodeImage();
void transformDataUnit(Gushort *quantTable,
void transformDataUnit(unsigned short *quantTable,
int dataIn[64], unsigned char dataOut[64]);
int readHuffSym(DCTHuffTable *table);
int readAmp(int size);
......@@ -1055,8 +1055,8 @@ private:
// Huffman code table entry
struct FlateCode {
Gushort len; // code length, in bits
Gushort val; // value represented by this code
unsigned short len; // code length, in bits
unsigned short val; // value represented by this code
};
struct FlateHuffmanTab {
......
......@@ -694,7 +694,7 @@ void ArthurOutputDev::updateFont(GfxState *state)
if (n) {
codeToGID = (int *)gmallocn(n, sizeof(int));
memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
n * sizeof(Gushort));
n * sizeof(unsigned short));
}
} else {
if (fileName)
......
......@@ -50,7 +50,7 @@ static inline int splashFloor(SplashCoord x) {
// floor() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
Gushort oldCW, newCW, t;
unsigned short oldCW, newCW, t;
int result;
__asm__ volatile("fldl %4\n"
......@@ -69,7 +69,7 @@ static inline int splashFloor(SplashCoord x) {
// floor() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
Gushort oldCW, newCW;
unsigned short oldCW, newCW;
int result;
__asm fld QWORD PTR x
......@@ -97,7 +97,7 @@ static inline int splashCeil(SplashCoord x) {
// ceil() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
Gushort oldCW, newCW, t;
unsigned short oldCW, newCW, t;
int result;
__asm__ volatile("fldl %4\n"
......@@ -116,7 +116,7 @@ static inline int splashCeil(SplashCoord x) {
// ceil() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
Gushort oldCW, newCW;
unsigned short oldCW, newCW;
int result;
__asm fld QWORD PTR x
......@@ -141,7 +141,7 @@ static inline int splashRound(SplashCoord x) {
// this could use round-to-nearest mode and avoid the "+0.5",
// but that produces slightly different results (because i+0.5
// sometimes rounds up and sometimes down using the even rule)
Gushort oldCW, newCW, t;
unsigned short oldCW, newCW, t;
int result;
x += 0.5;
......@@ -161,7 +161,7 @@ static inline int splashRound(SplashCoord x) {
// this could use round-to-nearest mode and avoid the "+0.5",
// but that produces slightly different results (because i+0.5
// sometimes rounds up and sometimes down using the even rule)
Gushort oldCW, newCW;
unsigned short oldCW, newCW;
int result;
x += 0.5;
......
......@@ -428,7 +428,7 @@ void ImageOutputDev::writeImageFile(ImgWriter *writer, ImageFormat format, const
case imgRGB48: {
p = imgStr->getLine();
Gushort *rowp16 = (Gushort*)row;
unsigned short *rowp16 = (unsigned short*)row;
for (int x = 0; x < width; ++x) {
if (p) {
colorMap->getRGB(p, &rgb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment