Commit graph

34 commits

Author SHA1 Message Date
Thomas Braun 6ce2f35ba8 Fix outputting extreme integer values in edge cases
For some gcc version (Ubuntu 5.5.0-12ubuntu1~16.04) the existing code
crashes when the minimum value of int64_t is outputted.

Resurrect the code from before 546e2cbf (🚨 fixed some warnings,
2019-03-13) but delegate the sign removal so that the compilers don't
complain about taking the negative value of an unsigned value.

In addition we also rewrite the expression so that we first increment
and then negate.

The definition of remove_sign(number_unsigned_t) is never called as
unsigned values are never negative.
2019-09-03 13:55:15 +02:00
Niels Lohmann 90798caa62
🚚 rename Hedley macros 2019-07-01 22:37:30 +02:00
Niels Lohmann 897362191d
🔨 add NLOHMANN_JSON prefix and undef macros 2019-07-01 22:24:39 +02:00
Niels Lohmann 1720bfedd1
⚗️ add Hedley annotations 2019-06-30 22:14:02 +02:00
Niels Lohmann 8d3f4f21bc
🔨 clean up 2019-03-18 13:53:48 +01:00
Niels Lohmann 56f6d1d68e
💚 fix CI and #1521 2019-03-17 15:20:22 +01:00
Niels Lohmann b8451c236f
🚨 fixed warnings 2019-03-17 12:01:49 +01:00
Niels Lohmann 34f8b4f711
🚨 fixed more warnings 2019-03-17 00:27:44 +01:00
Niels Lohmann 27011e3718
🚨 fixed warnings 2019-03-15 14:55:13 +01:00
Niels Lohmann 546e2cbf5e
🚨 fixed some warnings 2019-03-13 22:14:53 +01:00
Niels Lohmann 6de4df23e4
🐛 fixed integer overflow in dump function #1447
Closes #1447.
2019-01-20 12:26:01 +01:00
scinart 899bd94b43 flush buffer in serializer::dump_escaped case UTF8_REJECT
serializer use fixed buffer. Whenever it is nearly full, it is flushed to `output_adapter_t<char> o`
But the code forgets to flush when there is a invalid utf8 code point
So there will be buffer overflow.
2019-01-18 20:35:48 -05:00
Patrick Boettcher d0c0d16110 🚨 fixed unused variable warning
Since 6503e83e74 "Improve dump_integer performance by implementing a more efficient int2ascii"
an unused variable and thus a warning existed.
2019-01-15 15:21:02 +01:00
Isaac Nickaein 6503e83e74 Improve dump_integer performance by implementing a more efficient int2ascii
This commits implements a faster int2ascii inspired by "Fastware" talk given
by Andrei Alexandrescu.
See: https://www.youtube.com/watch?v=o4-CwDo2zpg
2019-01-12 08:58:30 -08:00
Niels Lohmann da81e7be22
🏁 adding parentheses around std::snprintf calls #1337 2018-11-09 21:18:02 +01:00
Niels Lohmann d2e4f0b0d9
✏️ fixed some typos 2018-10-28 14:20:20 +01:00
Niels Lohmann 544150d5a5
🚨 fixed another linter warning 2018-10-26 11:10:49 +02:00
Niels Lohmann 7ce720b700
🚨 fixed coverage 2018-10-25 18:21:50 +02:00
Niels Lohmann 19647e083c
🚨 fixed compiler warnings 2018-10-25 14:27:55 +02:00
Niels Lohmann 87ef3f25f2
✏️ fixed a typo #1314 2018-10-23 22:56:10 +02:00
Niels Lohmann c51b1e6fab
🚧 fixed an issue with ensure_ascii #1198 2018-10-22 15:53:36 +02:00
Niels Lohmann c7af027cbb
🚧 respect ensure_ascii parameter #1198 2018-10-22 09:18:16 +02:00
Niels Lohmann e5dce64115
💚 added tests #1198
Test every prefix of Unicode sequences against the different dump functions.
2018-10-21 23:26:25 +02:00
Niels Lohmann c5821d91e5
🚧 overworked error handlers #1198 2018-10-21 11:49:37 +02:00
Niels Lohmann 0671e92ced
🚧 proposal for different error handlers #1198
Proof of concept; currently only as parameter to the internal dump_escaped function; that is, not yet exposed to the dump function.
2018-10-16 20:38:50 +02:00
Niels Lohmann 6e49d9f5ff
🚑 fixed compilation error 2018-10-07 21:34:40 +02:00
Niels Lohmann 858e75c4df
🚨 fixed some clang-tidy warnings 2018-10-07 18:39:18 +02:00
Niels Lohmann ec95438a59
🚨 fixed some linter warnings 2018-10-06 13:49:02 +02:00
Niels Lohmann c61a9071ae
🚨 fixed a compilation issue with ICPC #755
Closes #1222
2018-09-29 11:50:14 +02:00
Théo DELRIEU f6febbe359
split meta.hpp, add detected_t (used to define concepts) 2018-08-16 11:58:42 +02:00
Théo DELRIEU 2c920a1032
run make amalgamate 2018-06-18 15:14:10 +02:00
Matthias Möller ecadcdb593 added char cast
should fix the GCC unittest
2018-05-31 16:36:16 +02:00
Matthias Möller 64acb42aa7 remove stringstream dependency 2018-05-31 13:45:58 +02:00
Théo DELRIEU 14cd019861
fix cmake install directory (for real this time)
* Rename 'develop' folder to 'include/nlohmann'
* Rename 'src' folder to 'single_include/nlohmann'
* Use <nlohmann/*> headers in sources and tests
* Change amalgamate config file
2018-02-01 11:06:51 +01:00
Renamed from develop/detail/output/serializer.hpp (Browse further)