forked from qt-creator/qt-creator
QByteArray::toLong() does not auto-detect the base and also fixed a typo in
the evaluator of bit-or expressions.
This commit is contained in:
@@ -164,7 +164,15 @@ protected:
|
||||
bool process_primary()
|
||||
{
|
||||
if ((*_lex)->is(T_INT_LITERAL)) {
|
||||
_value.set_long(tokenSpell().toLong());
|
||||
int base = 10;
|
||||
const QByteArray spell = tokenSpell();
|
||||
if (spell.at(0) == '0') {
|
||||
if (spell.size() > 1 && (spell.at(1) == 'x' || spell.at(1) == 'X'))
|
||||
base = 16;
|
||||
else
|
||||
base = 8;
|
||||
}
|
||||
_value.set_long(tokenSpell().toLong(0, base));
|
||||
++(*_lex);
|
||||
return true;
|
||||
} else if (isTokenDefined()) {
|
||||
@@ -367,7 +375,7 @@ protected:
|
||||
{
|
||||
process_xor();
|
||||
|
||||
while ((*_lex)->is(T_CARET)) {
|
||||
while ((*_lex)->is(T_PIPE)) {
|
||||
const Token op = *(*_lex);
|
||||
++(*_lex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user