summaryrefslogtreecommitdiff
path: root/poppler/Lexer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'poppler/Lexer.cc')
-rw-r--r--poppler/Lexer.cc56
1 files changed, 28 insertions, 28 deletions
diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index 3fe75763..a6433bb6 100644
--- a/poppler/Lexer.cc
+++ b/poppler/Lexer.cc
@@ -73,7 +73,7 @@ Lexer::Lexer(XRef *xrefA, Stream *str) {
streams = new Array(xref);
streams->add(curStr.copy());
strPtr = 0;
- freeArray = gTrue;
+ freeArray = true;
curStr.streamReset();
}
@@ -83,11 +83,11 @@ Lexer::Lexer(XRef *xrefA, Object *obj) {
if (obj->isStream()) {
streams = new Array(xref);
- freeArray = gTrue;
+ freeArray = true;
streams->add(obj->copy());
} else {
streams = obj->getArray();
- freeArray = gFalse;
+ freeArray = false;
}
strPtr = 0;
if (streams->getLength() > 0) {
@@ -107,7 +107,7 @@ Lexer::~Lexer() {
}
}
-int Lexer::getChar(GBool comesFromLook) {
+int Lexer::getChar(bool comesFromLook) {
int c;
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
@@ -118,7 +118,7 @@ int Lexer::getChar(GBool comesFromLook) {
c = EOF;
while (curStr.isStream() && (c = curStr.streamGetChar()) == EOF) {
- if (comesFromLook == gTrue) {
+ if (comesFromLook == true) {
return EOF;
} else {
curStr.streamClose();
@@ -140,7 +140,7 @@ int Lexer::lookChar() {
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
return lookCharLastValueCached;
}
- lookCharLastValueCached = getChar(gTrue);
+ lookCharLastValueCached = getChar(true);
if (lookCharLastValueCached == EOF) {
lookCharLastValueCached = LOOK_VALUE_NOT_CACHED;
return EOF;
@@ -152,7 +152,7 @@ int Lexer::lookChar() {
Object Lexer::getObj(int objNum) {
char *p;
int c, c2;
- GBool comment, neg, done, overflownInteger, overflownLongLong;
+ bool comment, neg, done, overflownInteger, overflownLongLong;
int numParen;
int xi;
long long xll = 0;
@@ -161,16 +161,16 @@ Object Lexer::getObj(int objNum) {
int n, m;
// skip whitespace and comments
- comment = gFalse;
+ comment = false;
while (1) {
if ((c = getChar()) == EOF) {
return Object(objEOF);
}
if (comment) {
if (c == '\r' || c == '\n')
- comment = gFalse;
+ comment = false;
} else if (c == '%') {
- comment = gTrue;
+ comment = true;
} else if (specialChars[c] != 1) {
break;
}
@@ -183,12 +183,12 @@ Object Lexer::getObj(int objNum) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case '+': case '-': case '.':
- overflownInteger = gFalse;
- overflownLongLong = gFalse;
- neg = gFalse;
+ overflownInteger = false;
+ overflownLongLong = false;
+ neg = false;
xi = 0;
if (c == '-') {
- neg = gTrue;
+ neg = true;
} else if (c == '.') {
goto doReal;
} else if (c != '+') {
@@ -203,7 +203,7 @@ Object Lexer::getObj(int objNum) {
} else if (unlikely (overflownInteger)) {
if (unlikely(xll > LongLongSafeLimit) &&
(xll > (LLONG_MAX - (c - '0')) / 10)) {
- overflownLongLong = gTrue;
+ overflownLongLong = true;
xf = xll * 10.0 + (c - '0');
} else {
xll = xll * 10 + (c - '0');
@@ -211,7 +211,7 @@ Object Lexer::getObj(int objNum) {
} else {
if (unlikely(xi > IntegerSafeLimit) &&
(xi > (INT_MAX - (c - '0')) / 10.0)) {
- overflownInteger = gTrue;
+ overflownInteger = true;
xll = xi * 10LL + (c - '0');
} else {
xi = xi * 10 + (c - '0');
@@ -277,7 +277,7 @@ Object Lexer::getObj(int objNum) {
p = tokBuf;
n = 0;
numParen = 1;
- done = gFalse;
+ done = false;
s = nullptr;
do {
c2 = EOF;
@@ -290,7 +290,7 @@ Object Lexer::getObj(int objNum) {
case '\n':
#endif
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
break;
case '(':
@@ -300,7 +300,7 @@ Object Lexer::getObj(int objNum) {
case ')':
if (--numParen == 0) {
- done = gTrue;
+ done = true;
} else {
c2 = c;
}
@@ -352,7 +352,7 @@ Object Lexer::getObj(int objNum) {
break;
case EOF:
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
break;
default:
c2 = c;
@@ -381,7 +381,7 @@ Object Lexer::getObj(int objNum) {
if (newObjNum != objNum)
{
error(errSyntaxError, getPos(), "Unterminated string");
- done = gTrue;
+ done = true;
delete s;
n = -2;
}
@@ -563,9 +563,9 @@ Object Lexer::getObj(int objNum) {
}
*p = '\0';
if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {
- return Object(gTrue);
+ return Object(true);
} else if (tokBuf[0] == 'f' && !strcmp(tokBuf, "false")) {
- return Object(gFalse);
+ return Object(false);
} else if (tokBuf[0] == 'n' && !strcmp(tokBuf, "null")) {
return Object(objNull);
} else {
@@ -580,11 +580,11 @@ Object Lexer::getObj(int objNum) {
Object Lexer::getObj(const char *cmdA, int objNum) {
char *p;
int c;
- GBool comment;
+ bool comment;
int n;
// skip whitespace and comments
- comment = gFalse;
+ comment = false;
const char *cmd1 = tokBuf;
*tokBuf = 0;
while (strcmp(cmdA, cmd1) && (objNum < 0 || (xref && xref->getNumEntry(getPos()) == objNum))) {
@@ -594,10 +594,10 @@ Object Lexer::getObj(const char *cmdA, int objNum) {
}
if (comment) {
if (c == '\r' || c == '\n') {
- comment = gFalse;
+ comment = false;
}
} else if (c == '%') {
- comment = gTrue;
+ comment = true;
} else if (specialChars[c] != 1) {
break;
}
@@ -635,6 +635,6 @@ void Lexer::skipToNextLine() {
}
}
-GBool Lexer::isSpace(int c) {
+bool Lexer::isSpace(int c) {
return c >= 0 && c <= 0xff && specialChars[c] == 1;
}