Commit 5164c9b3b67cb039ce74d3a541a1cac6978bc90b
- Diff rendering mode:
- inline
- side by side
src/json_scanner.cpp
(2 / 2)
|   | |||
| 278 | 278 | } | |
| 279 | 279 | } | |
| 280 | 280 | else if (isdigit(ch) != 0 && m_quotmarkClosed) { | |
| 281 | qint64 number = atoll(&ch); | ||
| 281 | quint64 number = atoll(&ch); | ||
| 282 | 282 | char nextCh; | |
| 283 | 283 | qint64 ret = m_io->peek(&nextCh, 1); | |
| 284 | 284 | while (ret == 1 && isdigit(nextCh)) { | |
| 285 | 285 | m_io->read(1); //consume | |
| 286 | 286 | yylloc->columns(1); | |
| 287 | number = number *10 + atoll(&nextCh); | ||
| 287 | number = number * 10 + atoll(&nextCh); | ||
| 288 | 288 | ret = m_io->peek(&nextCh, 1); | |
| 289 | 289 | } | |
| 290 | 290 |
tests/parser/testparser.cpp
(2 / 2)
|   | |||
| 280 | 280 | QTest::newRow("simple ulonglong") << input << output << QVariant::ULongLong; | |
| 281 | 281 | ||
| 282 | 282 | // big number | |
| 283 | input = QByteArray("128708157440"); | ||
| 283 | input = QByteArray("12345678901234567890"); | ||
| 284 | 284 | output = QVariant(QVariant::ULongLong); | |
| 285 | output.setValue(128708157440ull); | ||
| 285 | output.setValue(12345678901234567890ull); | ||
| 286 | 286 | ||
| 287 | 287 | QTest::newRow("big number") << input << output << QVariant::ULongLong; | |
| 288 | 288 |

