Commit Graph

225 Commits

Author SHA1 Message Date
Victor Zverovich
6732ea5000 Make symbols readable 2020-06-07 07:49:11 -07:00
Victor Zverovich
0f3eaeac0a Fix a warning 2020-06-04 06:33:11 -07:00
Victor Zverovich
8069265373 internal -> detail (#1538) 2020-05-10 07:34:30 -07:00
Victor Zverovich
7f723fbcb8 Consistently namespace qualify size_t 2020-05-07 15:59:46 -07:00
Victor Zverovich
2f05054dd3 Purge basic_writer 2020-05-07 11:35:41 -07:00
James Beach
7e57cace5d
Exclude std::abort from compilation when compiling CUDA with Clang (#1661) 2020-05-04 06:21:21 -07:00
Victor Zverovich
8efd1a8ef6 Improve handling of alignment 2020-05-03 10:08:57 -07:00
Victor Zverovich
d6abb2fa03 Reduce library size 2020-05-01 17:23:45 -07:00
Victor Zverovich
3e69847616 Reduce branching in write_padded 2020-04-30 06:33:45 -07:00
asraa
e2ff910675
Replace FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION with fmt-specific macro (#1650)
Signed-off-by: Asra Ali <asraa@google.com>
2020-04-29 09:12:43 -07:00
Greg Sjaardema
34b3f7b7aa Avoid windows issue with min() max() macros
Including the ``windows.h`` file without defining ``NOMINMAX`` will define the `min()` and `max()` macros which will result in issues compiling any C++ code that uses any variant of `max`, for example `std::numeric_limits<std::streamsize>::max()` and many others.  Although max() isn't used in Fmt anywhere, it is often used in codes that include a format include file so simply upgrading to the current version of lib::fmt will break the windows build which worked prior to the update...
2020-04-07 08:34:34 -07:00
Scott Ramsby
770a94edef Use FMT_THROW macro where applicable 2020-03-27 12:17:22 -07:00
Victor Zverovich
21a295c272 Undo comment change 2020-03-25 08:14:31 -07:00
Victor Zverovich
96c68afe69 Fix -Wsign-conversion warnings 2020-03-25 07:46:00 -07:00
Dair Grant
02bfd8a9a5 Add FMT_HAS_CPP14_ATTRIBUTE / FMT_HAS_CPP17_ATTRIBUTE to test for language-specific attributes.
FMT_DEPRECATED is now defined as FMT_HAS_CPP14_ATTRIBUTE(deprecated), as this attribute was introduced in C++14.

FMT_FALLTHROUGH is now defined as FMT_HAS_CPP17_ATTRIBUTE(fallthrough), as this attribute was introduced in C++17.

FMT_MAYBE_UNUSED is defined as FMT_HAS_CPP17_ATTRIBUTE(maybe_unused), as this attribute was introduced in C++17.

FMT_MAYBE_UNUSED has been applied to fix a couple of -Wunused-member-function warnings from clang.
2020-03-13 09:03:52 -07:00
Victor Zverovich
197a5c3721 Apply clang-format 2020-03-04 08:37:00 -08:00
refnum
68742e1d87
Fix clang -Wsign-conversion warning in grisu_count_digits. (#1573)
grisu_count_digits is only used by grisu_gen_digits, which assigns the unsigned result to a (signed) int.

Although grisu_count_digits always returns a positive integer this keeps its return type in sync with the type its result is assigned to.
2020-03-04 06:48:41 -08:00
refnum
58e6c84f5a
Fix simple -Wsign-conversion cases. (#1571)
* Fix -Wsign-conversion in bigint::subtract_aligned.

n is assigned a size_t, and only used for comparisons with j.

j is assigned 0, compared to n (size_t), and passed to basic_memory_buffer::operator[] (size_t).

* Fix -Wsign-conversion in bigint::assign.

num_bigits is initialised to 0, is only ever incremented, and is passed to basic_memory_buffer::operator[] (size_t) and basic_memory_buffer::resize (size_t).
2020-03-01 07:22:15 -08:00
Victor Zverovich
bed134a4aa Tentative fix for default template param in friend error 2020-02-27 15:29:46 -08:00
dspc-douglas
9fc4161f5e fix interal compiler error when building with mingw 2020-01-22 18:14:46 -08:00
Victor Zverovich
75765bfad5 Avoid unnecessary unsigned overflows (#1515) 2020-01-18 08:19:27 -08:00
Greg Sjaardema
40638a75b3 Use C++11 compatible std::is_same operations
The `operator()` member function of `std::is_same` was added in C++14.  For C++11, the `::value` needs to be used instead.
2020-01-15 11:20:47 -08:00
Victor Zverovich
c8dd9cc99d Use type_identity to block unnecessary template argument deduction (thanks Tim Song) 2020-01-15 10:27:50 -08:00
Victor Zverovich
cef1e4354b Optimize grisu_gen_digits 2020-01-07 16:11:18 -10:00
Victor Zverovich
0201c8db21 Restructure float_format 2020-01-07 14:41:30 -10:00
Victor Zverovich
aa07c57654 Move vprint_mojibake to the internal namespace 2020-01-04 08:31:18 -10:00
Victor Zverovich
c85efef312 More showpoint fixes and tests (#1498) 2019-12-30 13:08:35 -10:00
Ivan Shynkarenka
d2d1c9c560 warning C4267: 'argument': conversion from 'size_t' to 'DWORD', possible loss of data 2019-12-26 08:07:24 -08:00
Victor Zverovich
5390e29d42 Enable mojibake 2019-12-24 08:42:29 -08:00
Victor Zverovich
9f6434dcde Improve UTF-8 handling on Windows 2019-12-23 16:19:11 -08:00
Victor Zverovich
dac9a7f99d Improve UTF-8 handling on Windows 2019-12-22 12:05:28 -08:00
Victor Zverovich
7eec036d9a Improve UTF-8 support 2019-12-21 19:53:52 -08:00
Victor Zverovich
e6b37b4aff Handle block boundaries in utf8_to_utf16 2019-12-21 16:33:34 -08:00
Victor Zverovich
b308159be5 Make round_direction a scoped enum 2019-12-21 09:24:42 -08:00
Victor Zverovich
1b1c70108a trailing_zeros -> showpoint 2019-12-18 12:12:09 -08:00
Victor Zverovich
1afe201ae8 Handle block boundaries in utf8_to_utf16 2019-12-18 10:35:51 -08:00
Victor Zverovich
35959a31d7 Move OS-specific APIs to a separate header 2019-12-15 11:46:45 -08:00
Victor Zverovich
ec2463c905 Implement utf8_to_utf16 using utf8_decode 2019-12-15 09:35:26 -08:00
Victor Zverovich
0012917f69 Add a UTF-8 decoder 2019-12-15 07:28:19 -08:00
Egor Pugin
a64f60c849 Remove unneeded FMT_API. 2019-12-03 05:55:04 -08:00
Egor Pugin
1a599117d8 Export assert_fail with FMT_API. This fixes dll build. 2019-12-03 05:55:04 -08:00
Victor Zverovich
62da1db62a Avoid wchar_t instantiations 2019-12-01 07:34:09 -08:00
Victor Zverovich
2f9acd1838 Remove dependency on <cassert> 2019-11-29 09:37:18 -08:00
Victor Zverovich
b994a0ab13 Fix handling of missing fraction in snprintf_float 2019-11-29 06:17:29 -08:00
Victor Zverovich
bb205d940d Fix fallback pointer formatting on big endian 2019-11-29 05:15:59 -08:00
Victor Zverovich
c3be0f593d Refactor floating-point formatting 2019-11-27 08:08:22 -08:00
Victor Zverovich
c68703c9f4 float_spec -> float_specs 2019-11-26 15:53:24 -08:00
Victor Zverovich
7ffa62db18 Fix precision handling in snprintf_float 2019-11-25 20:00:10 -08:00
Victor Zverovich
d19ed6716d Fix hexfloat buffer reallocation 2019-11-25 15:54:04 -08:00
Victor Zverovich
57cd3f72e9 Update comment 2019-11-24 15:34:33 -08:00