Commit Graph

566 Commits

Author SHA1 Message Date
vitaut
7dcf05108e Move cstddef include to format.cc and refactor Buffer::append 2015-11-13 06:52:13 -08:00
Sean L
32f0295460 Fix warning when using Intel C++ on OS X
Unfortunately, Intel's C++ compiler defines `__clang__` which means that
some of the pragmas in use that Intel C++ doesn't use will cause
warnings to be generated.
2015-11-13 08:01:59 -05:00
vitaut
0550f1217c Store unsigned char value in uint_value instead of int_value 2015-11-11 06:45:27 -08:00
vitaut
8b86a74ad5 Allow formatting C strings as pointers (#223) 2015-11-09 07:17:36 -08:00
vitaut
7c24973637 Format (un)signed char as integer by default (#217) 2015-11-05 20:46:22 -05:00
Ingo van Lil
9954aa064b Disable GCC sign-compare warning in the header file 2015-11-03 11:14:48 +01:00
Ingo van Lil
f4d8884af1 Add casts to fix warnings with -Wconversion 2015-11-02 19:14:47 +01:00
Ingo van Lil
fe34b2f357 Fix bogus warning when compiling with -Wctor-dtor-privacy 2015-11-02 18:33:35 +01:00
vitaut
8af9bf1d06 Use FMT_SECURE_SCL instead of _SECURE_SCL 2015-11-02 09:22:59 -05:00
Ingo van Lil
27c2e880d0 Fix warning when building with -Wfloat-equal 2015-11-02 14:44:27 +01:00
Ingo van Lil
b4b13ee2b8 Fix warnings when compiling with -Wundef 2015-11-02 13:55:31 +01:00
vitaut
82acd483ae Fix warnings (#216) 2015-10-30 07:54:55 -07:00
vitaut
2d727e7d0e Suppress bogus coverity warnings 2015-10-28 07:01:28 -07:00
Dmitriy
b92c60c171 MSVC 2015 supports noexcept 2015-10-26 13:11:04 +03:00
vitaut
acfa858e3c Disable wchar_t instead of unsigned short overload
if _NATIVE_WCHAR_T_DEFINED is defined
2015-10-25 07:13:45 -07:00
Vyacheslav Napadovsky
4e9faed8f9 MS Visual Studio "/Zc:wchar_t-" compiler parameter support added 2015-10-25 14:37:31 +03:00
vitaut
f080b62047 Implement StringRef comparison operators
and use lexicographical comparison (#183)
2015-10-22 08:41:42 -07:00
vitaut
b2714f83cc FMT_NO_STREAM_LIBRARIES -> FMT_USE_IOSTREAMS
for consistency with similar macros and removed unnecessary
checks.
2015-10-18 08:50:35 -07:00
Victor Zverovich
6049fd9d66 Merge pull request #208 from JodiTheTigger/Make-streams-optional
Issue 205: Make iostream support optional.
2015-10-18 08:40:01 -07:00
vitaut
77b32006a3 Workaround a bug in MSVC when _CRTDBG_MAP_ALLOC is defined 2015-10-18 06:42:24 -07:00
Richard Maxwell
2cca51c744 Issue 205: Make iostream support optional. 2015-10-16 08:04:53 +13:00
Dean Moldovan
358ae822bb Update Sphinx with C++11 literals fix and add fmt::literals API docs 2015-10-13 00:35:22 +02:00
Dean Moldovan
bc6010cc21 Add _a literal for named arguments 2015-09-27 04:09:37 +02:00
Dean Moldovan
a63a24f2d7 Add _format literal 2015-09-27 04:00:24 +02:00
vitaut
ef710dee6c Add sprintf overload for wide strings
and fix an issue in formatting user-defined objects.
Thanks to @ScottLangham
2015-09-18 16:26:41 -07:00
vitaut
59155abbf3 Remove extra newline 2015-09-08 08:16:12 -07:00
jkflying
11395c4f09 Fix warnings
Child attribute was being instantiated before parent attribute, gives warnings under GCC 4.9.1
2015-08-17 13:59:45 +02:00
vitaut
58fcf0c0da Optimize format_decimal 2015-08-05 07:50:29 -07:00
Radu Popescu
0affb23560 fixed #190 Argument shadowing and Clang pedantic support 2015-08-04 12:52:44 +02:00
vitaut
922fe90ac3 Improve integer formatting performance
and fix bogus Coverity warning about uncaught exception in
format_error_code (via write_int).
2015-07-31 08:02:38 -07:00
vitaut
200037683e Initialize next_arg_index_ in ctor (#187) 2015-07-28 08:10:46 -07:00
vitaut
0eac037416 Get rid of the BasicFormatter::start_ 2015-07-28 06:46:41 -07:00
vitaut
76d1218345 Workaround a bug in MSVC2010 (#188)
Due to broken lookup rules, MSVC finds fmt::internal::check
instead of IsConvertibleToInt::check.
2015-07-10 07:58:27 -07:00
vitaut
4f7ad14c2b Fix MSVC warning 2015-07-08 07:52:03 -07:00
vitaut
c669cbedf8 Rename None to Null because of conflict with an xlib.h macro 2015-07-07 07:05:17 -07:00
vitaut
ba09c1b56e Fix windows build 2015-06-26 09:23:11 -07:00
vitaut
438bd9b0e6 Add BasicCStringRef to represent a null-termated string (#100)
and use it instead of BasicStringRef in cases that assume that the
string is null-terminated such as POSIX function and format string
parser.
2015-06-26 07:43:54 -07:00
vitaut
abcc2d96f0 Fix assertion tests 2015-06-22 09:24:54 -07:00
vitaut
8ab665afbc Only use death tests if available 2015-06-22 08:17:23 -07:00
vitaut
a0ed6bfe4f Break long line 2015-06-17 08:07:05 -07:00
vitaut
e39490500c Replace implicit conversion to std::string with to_string 2015-06-17 07:59:41 -07:00
vitaut
147e5ebbbc Move casts to CharTraits for custom character types 2015-06-17 07:21:16 -07:00
vitaut
270069beda Use arg visitor when formatting printf argument
and get rid of ignore_incompatible_str.
2015-06-16 07:36:32 -07:00
vitaut
9b6b3382e3 Don't use ignore_incompatible_str in ArgFormatter 2015-06-15 07:15:28 -07:00
vitaut
24c309fbfa Don't use windows.h if FMT_USE_WINDOWS_H is set to 0 2015-06-12 07:15:57 -07:00
vitaut
9d09214e7a Use textual representation for bool by default (#170) 2015-06-11 09:00:06 -07:00
vitaut
fccff7be5f Minor tweaks to the named arguments support code
* Restore privacy of FormatterBase
* Pass BasicStringRef by value
* Comment on why some overloads of arg are deleted
* Set next_arg_index_ in check_no_auto_index
* A few minor stylistic changes for simplicity & consistency with other code
2015-06-11 07:19:00 -07:00
vitaut
a98583dde3 Move ArgList::Map to the internal namespace and rename to ArgMap
since it shouldn't be a part of the public API. Also break long lines.
2015-06-10 08:49:22 -07:00
vitaut
4325c155f7 Improve documentation
* Fix formatting in `fmt::arg` apidoc
* Use production syntax instead of regex
* Rename arg_field to arg_id because the term "field" denotes the whole replacement field
* Define `integer`
2015-06-10 07:33:17 -07:00
jamboree
7487bde587 Support named arguments 2015-06-10 09:32:59 +08:00
vitaut
ed2dfe5124 Implement writing narrow strings into a wide writer 2015-06-09 08:20:44 -07:00
vitaut
d311927c64 Update Breathe and document BasicArrayWriter(Char (&array)[SIZE])
Fixes #125
2015-06-03 18:21:01 -07:00
vitaut
4d521064cf Give an error if fill is not convertible to Char in StrFormatSpec 2015-06-03 08:39:43 -07:00
vitaut
63572da4e7 Fix formatting 2015-05-22 07:22:55 -07:00
vitaut
78936ad6d7 Fix formatting 2015-05-22 07:08:16 -07:00
vitaut
c150722945 Fix compiler warnings about unused parameter (#158)
Thanks to @fmatthew5876
2015-05-08 11:20:56 -07:00
vitaut
11464343a9 Fix handling of exactly MAX_PACKED_ARGS arguments 2015-05-05 10:00:11 -07:00
vitaut
3c388185c0 Remove old TODO 2015-05-05 07:25:42 -07:00
vitaut
f5b3c9cbec Simplify construction of ArgList objects 2015-05-05 07:23:32 -07:00
vitaut
de994a27a7 Remove internal::NonZero 2015-05-01 07:58:32 -07:00
vitaut
e515e5f14e Simplify construction of argument lists 2015-05-01 07:35:28 -07:00
vitaut
87cb2935f8 Test and fix handling of exactly MAX_PACKED_ARGS arguments 2015-05-01 06:55:26 -07:00
vitaut
969d1cdbdc Break long line 2015-04-30 08:41:17 -07:00
vitaut
f44666aac6 Remove extra parentheses 2015-04-30 07:35:04 -07:00
vitaut
926b7680ea Cleanup 2015-04-21 07:17:00 -07:00
vitaut
8d2559bd96 Reduce compiled code size
If the number of arguments is less than MAX_PACKED_ARGS, pass
the arguments as a Value array rather than Arg array.
2015-04-20 10:02:41 -07:00
vitaut
fd53bb6fb8 Fix bogus "conditional expression is constant" MSVC warnings 2015-04-05 11:27:07 -07:00
vitaut
d2387999ec Try fixing a bogus MSVC warning about buffer overrun (#145) 2015-03-28 17:52:17 -07:00
vitaut
3a5573ac6e Revert commit 3c3ae4e319 2015-03-27 07:36:26 -07:00
vitaut
d4ea2d7fcb Add ArgVisitor::report_unhandled_arg
and get rid of FMT_RETURN_AFTER_THROW.
2015-03-26 08:55:20 -07:00
vitaut
d618f8baac Fix NonZero 2015-03-25 09:29:40 -07:00
vitaut
885d1a1c64 Simplify NonZero 2015-03-25 08:50:48 -07:00
vitaut
2ba3988da3 Reduce compiled code size when using variadic templates 2015-03-25 08:29:55 -07:00
vitaut
3c3ae4e319 MakeValue -> MakeArg 2015-03-25 07:04:16 -07:00
vitaut
00df5c91f3 Merge Value into Arg 2015-03-25 06:48:21 -07:00
vitaut
cf04d98d06 Pass as many types as possible in a single integer to reduce code bloat 2015-03-24 08:55:40 -07:00
Shauren
a445e727c2 Added support to format more than 16 arguments with printf API when using variadic templates 2015-03-20 21:31:10 +01:00
vitaut
906432161b Make Buffer part of the public API 2015-03-20 06:31:24 -07:00
vitaut
b9f4668855 Add missing pragma diagnostic push for clang
Thanks to @ido
2015-03-19 08:04:31 -07:00
vitaut
0e8fcd47a0 Silence warnings about convering float to int 2015-03-18 18:59:09 -07:00
vitaut
bf8636c959 Fix compile error on clang when formatting a C++11-style enum
Thanks to @Naios.
2015-03-18 11:08:34 -07:00
vitaut
33ec5b16d8 Don't match bool because it causes undesirable conversions 2015-03-17 20:51:29 -07:00
vitaut
275d1ab423 Fix warnings on lesser compilers 2015-03-17 20:43:55 -07:00
vitaut
3d4af9cd65 Use `long double instead of int` to avoid warnings 2015-03-17 20:12:36 -07:00
vitaut
357950e06b Fix warnings on braindamaged compilers (aka MSVC) 2015-03-16 19:02:25 -07:00
vitaut
4825fb4a0d Add default value for None's template argument 2015-03-16 08:43:33 -07:00
Victor Zverovich
5821aec7b9 Implement printing of values that are convertible to int such as enums 2015-03-10 07:53:46 -07:00
Victor Zverovich
7c0a23329e Update copyright notices 2015-03-03 21:04:45 -08:00
Victor Zverovich
103530d407 Fix formatting 2015-03-01 20:58:45 -08:00
Victor Zverovich
efc42fbd4e Temporary exclude fancy ctor from the docs 2015-03-01 18:25:40 -08:00
Victor Zverovich
7c0d5756ff Fix clang build 2015-03-01 18:19:56 -08:00
Victor Zverovich
beaf6f7436 Add a fixed-size array writer 2015-03-01 18:08:24 -08:00
Victor Zverovich
a8a7534f78 Reorder function declarations
Obey your inner OCD
2015-02-26 06:54:12 -08:00
Victor Zverovich
110d4c0ab0 Replace CharTraits::UnsupportedStrType with WCharHelper::Unsupported 2015-02-26 06:32:00 -08:00
Victor Zverovich
17b9e4db8c Improve error reporting when trying to write wchar_t with a char writer 2015-02-26 06:21:54 -08:00
Victor Zverovich
52f44bf114 Fix clang warning
warning: unknown warning group '-Wdocumentation-unknown-command',
ignored [-Wunknown-pragmas]
2015-02-25 17:32:32 -08:00
Victor Zverovich
ed490145d8 Improve error reporting when trying to format wide char into narrow string 2015-02-25 16:03:00 -08:00
Victor Zverovich
d5602d9fb6 Remove unnecessary call to convert 2015-02-25 09:50:39 -08:00
Victor Zverovich
e70af5b99e Merge branch 'better-errors' 2015-02-25 08:00:46 -08:00
Victor Zverovich
f014d32147 Improve error reporting when formatting wide into narrow strings 2015-02-25 07:58:49 -08:00