Commit Graph
499 Commits
Author SHA1 Message Date
Rosen Penev a1fb5c7337 [clang-tidy] Changes suffixes to uppercase
Found with hicpp-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-08 09:35:26 +00:00
daniel f1559e1d56 Use grouping() from locale for specifier 'n' 2019-11-05 07:22:12 +00:00
Victor Zverovich ffd05e65ed basic_parse_context -> basic_format_parse_context per standard and document 2019-11-05 07:13:58 +00:00
Attila Tajti 0889856d61 Fix UTF-8 truncation 2019-11-03 11:53:15 +00:00
Victor Zverovich d6eede9e08 Remove redundant ctor 2019-11-01 12:09:04 -07:00
Victor Zverovich 213e09644f Workaround X11 madness (#1388) 2019-11-01 08:47:11 -07:00
Victor Zverovich 3487f1b9cd Always inline grisu_gen_digits and disable grisu2 by default 2019-10-30 16:52:00 -07:00
Victor Zverovich 8e700619b7 Simplify format_handler 2019-10-30 07:02:38 -07:00
Victor Zverovich 58c6f8c7f5 Make unsigned-integer-overflow sanitizer happy (#1377) 2019-10-28 14:41:09 -07:00
Victor Zverovich 40414b3446 Don't emit trailing zeros in exponential notation (#1376) 2019-10-28 12:31:00 -07:00
Victor Zverovich b7a157401e Simplify grisu_writer 2019-10-23 13:52:09 -07:00
Victor Zverovich ce4d87acd4 Remove obsolete comment and clang-format 2019-10-23 11:15:43 -07:00
Ivan Shynkarenka 21acc2af43 Fix more Visual Studio 2019 pedantic warnings (#1371)
* format-inl.h(444,1): warning C4804: '>>': unsafe use of type 'bool' in operation
format.h(2808,1): warning C4127: conditional expression is constant

* More fixes for VS2019 pedantic warnings

* Fix "conditional expression is constant" VS2019 warning in more specific way

* Use const_check to silence constexpr warning
2019-10-22 17:13:03 -07:00
Victor Zverovich d39ebf3ff2 Optimize counting 2019-10-21 06:57:42 -07:00
Victor Zverovich 6498bc6d31 Simplify grisu_writer 2019-10-20 19:29:24 -07:00
Victor Zverovich a967dcbe20 Improve handling of signs 2019-10-20 19:05:38 -07:00
Victor Zverovich 8498bc97dd Initialize all the things 2019-10-20 17:53:18 -07:00
Victor Zverovich 36d1390e67 Implement round half to even 2019-10-18 07:21:12 -07:00
Orivej Desh 599e0aef45 Support single precision floats in grisu formatting
Fixes #1336
2019-10-18 07:08:41 -07:00
Victor Zverovich 1cbc5fa6cb Handle negative exponent and rename value/pow10 to numerator/denominator 2019-10-13 12:50:48 -07:00
Victor Zverovich 0e94b931a2 Fix a linkage error introduced by #1360 (#1362) 2019-10-13 08:23:47 -07:00
Orivej Desh 3a15ea3ea5 Rename write_double to write_fp
It handles all floating point types, not just doubles.
2019-10-12 11:41:24 -07:00
Orivej Desh b87ac4d840 Distinguish float from double 2019-10-12 11:41:24 -07:00
Deniz Evrenci 96f91428c6 Add defaulted copy and move operations to format_error and system_error (#1347)
* Avoid weak vtables by providing a private virtual member function

* Add warning Wweak-vtables to clang when FMT_PEDANTIC is on

* Add defaulted copy and move operations to format_error and system_error

Compiler generated copy operations are deprecated and move operations
are not generated altogether.

* Add warning Wdeprecated to clang when FMT_PEDANTIC is on
2019-10-11 10:44:20 -07:00
Victor Zverovich 758446c80d Fix a warning (#1319) and simplify code 2019-09-19 16:00:40 -07:00
Victor Zverovich c85ae23c73 Add max_value 2019-09-08 09:21:30 -07:00
Victor Zverovich 56b5c192a0 Add a bigint stub and reenable grisu 2019-09-07 13:50:22 -07:00
Victor Zverovich 3d9f3c163b Integrate new format string compilation 2019-09-07 07:01:51 -07:00
gabime df4dcf2ece Fixed vs 2015 warning about unused variable when grisu is off 2019-09-06 11:29:56 -07:00
Victor Zverovich f7a4b4ab91 Make numeric alignment optional 2019-09-06 09:43:53 -07:00
Victor Zverovich 611cf0b3c6 Format octal 0 as 0 2019-09-06 07:03:47 -07:00
Victor Zverovich 1882b9687b Reduce the numer of ifdefs with an empty (u)int128_t fallback 2019-09-05 18:03:47 -07:00
Deniz Evrenci 6de0454b42 Add support for built-in __int128 when available 2019-09-04 07:05:08 -07:00
Deniz Evrenci 16e3c48bb0 Move definition of FMT_USE_INT128 to core.h 2019-09-04 07:05:08 -07:00
Deniz Evrenci 8ce5f680f2 Rename internal::is_integral and internal::is_arithmetic
To reserve space for the type traits sharing the same name as the ones
from standard library.
2019-09-04 07:05:08 -07:00
Victor Zverovich 466128de00 Remove unused code and refactor 2019-09-01 13:08:53 -07:00
Victor Zverovich f18a3f36a7 Remove string_view_metadata
string_view_metadata was introduced to make compiled format relocatable.
However, format string compilation is an optimization and therefore
adding overhead and extra complexity for relocation is undesirable.
In most cases the string will be either static or outlive compilation
and formatting and if it doesn't, it's possible to make compiled
representation relocatale by other means.
2019-09-01 11:10:49 -07:00
Victor Zverovich 422e7b9d70 Fix compile-time checks for user-defined types (#1292) 2019-08-31 08:35:38 -07:00
Victor Zverovich 3f75e2b69e Make buffer_range public and update custom formatting docs (#1281) 2019-08-28 06:50:20 -07:00
Victor Zverovich 744302add0 Workaround broken [[deprecated]] in Intel compiler (#1273) 2019-08-28 05:58:09 -07:00
Greg Sjaardema f5556225a4 Eliminate shadow variable warning
gcc-9 gives the following shadow warning:
```
In file included from /Users/libraries/ioss/src/fmt/ostream.h:12,
                 from /Users/libraries/ioss/src/Ioss_DatabaseIO.C:59:
/Users/libraries/ioss/src/fmt/format.h: In function 'void fmt::v6::internal::parse_format_string(fmt::v6::basic_string_view<Char>, Handler&&)':
/Users/libraries/ioss/src/fmt/format.h:2442:10: warning: declaration of 'struct fmt::v6::internal::parse_format_string(fmt::v6::basic_string_view<Char>, Handler&&)::writer' shadows a global declaration [-Wshadow]
 2442 |   struct writer {
      |          ^~~~~~
/Users/libraries/ioss/src/fmt/format.h:1703:7: note: shadowed declaration is here
 1703 | using writer = basic_writer<buffer_range<char>>;
      |       ^~~~~~
```

Since the `writer` struct is only used internally in the `parse_format_string` function, its name can be changed somewhat aribtrarily to avoid conflicts with names in an outer scope.

Note that this warning is also present in the 6.0.0 release.
2019-08-27 14:29:39 -07:00
Victor Zverovich 9bd2f1f9af Temporarily disable Grisu 2019-08-26 06:11:44 -07:00
Victor Zverovich 45dc3486fe Update license 2019-08-22 08:37:36 -07:00
Victor Zverovich c1e97392be Fix warnings 2019-08-11 08:44:12 -07:00
Victor Zverovich 5360ab0b59 Fix iteration over named arguments (#1168) 2019-08-09 11:53:07 -07:00
Victor Zverovich ba63ac8c18 Make format_to a non-member 2019-08-04 06:47:49 -07:00
Victor Zverovich 3fe49163bd Revert "Make format_to a non-member"
This reverts commit a5bd3ddb28.
2019-08-03 16:12:34 -07:00
Victor Zverovich a5bd3ddb28 Make format_to a non-member 2019-08-03 08:36:53 -07:00
Charles Milette 1dfa2591b3 Make operator _a constexpr 2019-08-01 16:56:49 -07:00
Charles Milette 6f2dd30e38 Simplify udl_formatter return type 2019-08-01 16:56:49 -07:00