276 Commits

Author SHA1 Message Date
yuangongji
b1725d4007 vrefbuffer: set default ref_size and chunk_size 2020-04-30 19:26:07 +08:00
Igor Sadchenko
9a3cd0c951 Fixed many warnings/errors with macro __GNUC__(issue #850) 2020-03-26 02:03:25 +03:00
yuangongji
d9c5978958 add MSGPACK_CXX_ONLY option to build c++ libraries only 2020-02-19 09:07:16 +08:00
Takatoshi Kondo
0d7caecdb5 Fixed cmake condition.
If MSGPACK_CXX17 is ON then build MSGPACK_CXX11 target.
2020-01-06 13:04:14 +09:00
James McCoy
f8b0ad1766
Skip timespec_pack_convert_64bit_sec_max_nano on systems where tv_sec <= 32-bit 2020-01-05 21:38:52 -05:00
James McCoy
7ed7af90b6
Fix timespec_object.*_32bit_sec tests on 32-bit platforms
On 32-bit unix platforms, 0xffffffffUL is a 32-bit value so the compiler
complains about converting it to a signed value.

    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: error: constant expression evaluates to 4294967295 which cannot be narrowed to type '__time_t' (aka 'long') [-Wc++11-narrowing]
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: note: insert an explicit cast to silence this issue
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
                       static_cast<__time_t>( )
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: warning: implicit conversion changes signedness: 'unsigned long' to '__time_t' (aka 'long') [-Wsign-conversion]
        timespec val1{ 0xffffffffUL, 0 };
                     ~ ^~~~~~~~~~~~

Since we're trying to test how the maximum 32-bit value that fits in
timespec.tv_sec is handled, directly use the maximum 32-bit value for
the appropriate (un)signed type used for timespec.tv_sec.

We don't just cast to the value, as the compiler suggests, because that
would result in an extremely negative value.
2020-01-05 21:38:45 -05:00
Takatoshi Kondo
befc3cdd0c Supressed C4309 on MSVC. 2019-12-25 14:59:40 +09:00
Takatoshi Kondo
2e2e93ba2e Added compiler checking to pragma. 2019-12-25 14:39:57 +09:00
Takatoshi Kondo
3b2bb56243 Fixed #825.
Added verbose option to windows CIs.
Added C compiler flag operation for MSVC.
Fixed invalid /WX flag matching on MSVC at test.
2019-12-25 14:24:24 +09:00
Takatoshi Kondo
f89f05b883
Merge pull request #821 from tsundre/fix-msgpack_checked_call
Correctly check return value of snprintf
2019-12-09 15:19:42 +09:00
Torleiv Sundre
a6bf728a5c Correctly check return value of snprintf
In MSGPACK_CHECKED_CALL, the return value of snprintf is incorrectly
assumed to mean success if it is less than or equal to the buffer size.
The call should only be considered a success if the return value is less
than the buffer size.

This commit adds two unit tests that illustrates the issue and fixes the
issue, making the unit tests pass.
2019-12-04 14:20:12 +01:00
David Carlier
698a482b67 c++11 unit tests silent warning fixes proposal. 2019-11-16 13:36:37 +00:00
Takatoshi Kondo
70f950ac05 Fixed #806.
Removed `ss.str().data()` (the type of ss is std::stringstream).
Introduced variable that is const reference of `ss.str()`.
2019-08-29 20:22:10 +09:00
Takatoshi Kondo
de99222801 Fixed warnings. 2019-05-27 17:35:22 +09:00
Takatoshi Kondo
d3fecce359 Added timespec support for C++11 or later. 2019-05-09 14:46:45 +09:00
Takatoshi Kondo
17267ed475 Added -Wconversion support for C++. 2019-03-25 19:48:39 +09:00
Takatoshi Kondo
530561eec0 Added tests for msgpack::object::clone().
Converting C++ types from cloned object after original zone is destroyed.
2019-02-12 12:53:00 +09:00
Takatoshi Kondo
709d6f4fdd Fixed #754.
Fixed `msgpack::object` packing visitor and equal comparison visitor.

NOTE:
In the function `visit_ext(const char* v, uint32_t size)`, v contains
type and size means buffer `v` size. See #175.
2019-01-05 09:41:58 +09:00
Takatoshi Kondo
4f9ec65713 Fixed #741.
Fixed msgpack::type::tuple base class conversion.
Fixed C++03 msgpack::type::make_tuple.
2018-10-16 22:42:50 +09:00
Takatoshi Kondo
1155babda8 Added wstring adaptor. 2018-09-12 16:17:14 +09:00
jwang
349c133171 Fix malloc size 2018-09-05 10:28:22 +02:00
tbeu
c056026dad Fix memory leaks 2018-09-04 22:24:40 +02:00
jwang
0421dabc1e removing unused vars 2018-09-03 22:23:54 +02:00
jwang
60930f4b12 adding unit tests and fixing same overflow issue in hpp files 2018-09-03 22:23:53 +02:00
tbeu
92d34cbd79 Fix VS2010 warning C4309: 'static_cast' : truncation of constant value 2018-09-02 20:36:48 +02:00
Takatoshi Kondo
f1726cef0d Updated travis-ci environment. 2018-08-12 18:31:44 +09:00
Takatoshi Kondo
8a788f3a48 Added C++17 std::byte support.
`std::byte` is mapped to
https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family.

`std::vector<std::byte>` and `std::byte[]` are mapped to https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family.
2018-08-12 16:23:39 +09:00
Kazuhiro Sera
0b53833856 Fix misspelled words in comments, detected by github.com/client9/misspell 2018-08-11 11:28:40 +09:00
Takatoshi Kondo
eebdc007a9 Added timestamp minimal support for C. 2018-07-22 20:38:36 +09:00
Takatoshi Kondo
cb2dcb19b9 Implemented #638.
Added Time Stamp support.
2018-07-22 16:25:23 +09:00
Takatoshi Kondo
e3f5281903 Removed recursion from msgpack::object packing and stringize.
Changed json expected strings.

Before this commit, json output has redundant white space.
The commit remove it. Semantically no difference.
2018-04-26 19:36:48 +09:00
Takatoshi Kondo
4cb938ed18
Merge pull request #673 from redboltz/fix_671
Fixed #671.
2018-04-25 12:52:12 +09:00
Takatoshi Kondo
ec239933db Fixed #671.
Added STR type check to define_map.
2018-04-25 10:43:26 +09:00
Chris Wolfe
de59b393c7 conform to project norms and naming conventions 2018-04-24 20:04:54 -05:00
Chris Wolfe
b02371efe5 no reason to have this declaration 2018-04-24 18:09:15 -05:00
Chris Wolfe
f34289fdfd
remove newline that I accidentally added 2018-04-24 17:17:49 -05:00
Chris Wolfe
584478a4f1 fuzzers are cpp11 only at the moment 2018-04-24 15:22:20 -05:00
Chris Wolfe
700ec688f7 add the fuzzer from oss-fuzz and a test that exercises it 2018-04-24 15:05:09 -05:00
Takatoshi Kondo
f8dc0f0d04 Fixed #663. 2018-04-08 22:29:36 +09:00
Takatoshi Kondo
347658cdc1 Updated the version to 3.0.0.
See https://github.com/msgpack/msgpack-c/pull/639#issuecomment-353786498
So I updated the version to 3.0.0.
In the version 2.x, it keeps the original behavior.
2018-04-08 22:27:45 +09:00
Takatoshi Kondo
427a6e7313 Revert "Fixed #637."
This reverts commit 5ece2ef2c7e62f77b4d68e1665022c5b0cdbce3d.
2018-04-06 07:38:58 +09:00
Takatoshi Kondo
423eaf25fb Removed -O3 -g -Werror options from CmakeLists.txt.
Added -g -Werror options to .travis.yml.
2018-04-04 13:07:21 +09:00
Takatoshi Kondo
5ece2ef2c7 Fixed #637.
<<< Breaking change >>>
In the functions unpack() and parse(),
Old behavior: If any parse error is happend, offset is NOT updated.
New behavior: If any parse error is happend, offset is updated to the
position the error happened.

It helps MessagePack format error analysis.

If you want to old behavior, copy the original value of offset and then call unpack()
and/or parse().
2017-10-22 18:22:41 +09:00
sztomi
d452625ed1 Added * and -> operators to object_handle 2017-10-09 20:23:25 +02:00
Takatoshi Kondo
7ad743f2da Fixed conflict between boost fusion sequence and std::tuple/std::pair. 2017-07-26 10:24:17 +09:00
Takatoshi Kondo
354ee5b9a3 Merge branch 'alignment' of https://github.com/chshaob1/msgpack-c into chshaob1-alignment 2017-07-22 15:28:12 +09:00
Takatoshi Kondo
56db4475f2 Fixed msvc2015. 2017-07-04 07:44:03 +09:00
Takatoshi Kondo
7024a1ec2c Merge pull request #607 from redboltz/fix_597
Solved #597.
2017-06-15 20:38:22 +09:00
Takatoshi Kondo
ca4a425a52 Merge pull request #602 from redboltz/fix_600
Fixed #600.
2017-06-15 16:08:24 +09:00
Takatoshi Kondo
a502097fd0 Solved #597.
Added `std::optional` and `std::string_view` adaptors.
2017-06-13 18:22:48 +09:00