435 Commits

Author SHA1 Message Date
James McCoy
304ff96d04 Comment the intentional fallthrough to default from _fixed_trail_again
GCC 7 added a new diagnostic, -Wimplicit-fallthrough, which is enabled
with -Wextra that warns about implicitly falling through a case
statement.

    [  4%] Building C object CMakeFiles/msgpackc-static.dir/src/unpack.c.o
    /usr/lib/gcc-snapshot/bin/gcc   -I/home/jamessan/src/msgpack-c/. -I/home/jamessan/src/msgpack-c/include -I/home/jamessan/src/msgpack-c/build/include  -g -O2 -fdebug-prefix-map=/home/jamessan/src/msgpack-c=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -Wall -Wextra -Werror -g -O3 -o CMakeFiles/msgpackc-static.dir/src/unpack.c.o   -c /home/jamessan/src/msgpack-c/src/unpack.c
    In file included from /home/jamessan/src/msgpack-c/src/unpack.c:283:0:
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h: In function 'template_execute':
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h:238:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     ++p;
                     ^~~
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h:240:13: note: here
                 default:
                 ^~~~~~~
    cc1: all warnings being treated as errors

Adding the comment makes it explicit that the fallthrough is
intentional, so gcc doesn't complain.
2017-04-13 11:43:27 -04:00
Takatoshi Kondo
10c1917f22 Merge pull request #582 from qehgt/fix-winsock-already-included
Fix 'WinSock.h has already been included' compiler error.
2017-04-12 20:44:56 +09:00
Takatoshi Kondo
d431e25257 Fixed #584.
Reset m_cs to MSGPACK_CS_HEADER after visitor called.
2017-04-11 12:29:12 +09:00
Vasily Titskiy
2cbaa3a7db Fix 'WinSock.h has already been included' compiler error.
Fix compiler error if Boost.Asio & msgpack are used together on Windows
Platform
2017-03-29 11:48:29 -04:00
Stefan Herbrechtsmeier
9ed842c014 Detect POSIX compatiblity explicit
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-03-22 13:03:33 +01:00
Takatoshi Kondo
4df2bdecda Fixed #536.
Replaced __GNUC_MINOR__ 6 with 7 for suppress maybe-uninitialized.
2017-03-15 21:30:07 +09:00
Dan L. Stahlke
e58b00016b Fixed spurious start_map_key/start_array_item calls 2017-03-03 09:00:15 -08:00
Takatoshi Kondo
53e4bb92fe Updated the version to 2.1.1. 2017-02-04 19:04:14 +09:00
Takatoshi Kondo
088ce946b9 Fixed #561
Fixed unpacker's buffer expansion logic.
2017-02-03 17:11:51 +09:00
Takatoshi Kondo
dc86adbf8e Merge pull request #558 from redboltz/add_boost_string_view
Added boost string_view adaptor.
2017-01-20 09:33:23 +09:00
raeraex2
b7543e1386 Fix compilation warnings about possible loss of data 2017-01-17 22:16:05 +01:00
Takatoshi Kondo
1f515b3ae7 Added boost string_view adaptor. 2017-01-15 19:09:31 +09:00
Takatoshi Kondo
5be2757216 Updated the version to 2.1.0. 2017-01-10 17:17:24 +09:00
Takatoshi Kondo
c704d4bfab Added new example. 2017-01-09 16:18:35 +09:00
Takatoshi Kondo
84ad9a2634 Added Spirit.X3 based parse.
It uses iterator pair instead of data and size.
2017-01-05 21:24:25 +09:00
Takatoshi Kondo
9b141fa9b6 Separated parse and unpack on v2. 2017-01-04 11:45:51 +09:00
Takatoshi Kondo
c55f778198 Fixed #534.
Added conditional [[deprecated]] attribute.
Updated zlib version.
2017-01-02 20:40:34 +09:00
Takatoshi Kondo
7e139125e2 Fixed array and map size overflow. 2016-12-29 12:13:14 +09:00
Takatoshi Kondo
9a113bb0ca Fixed C unpack return code. 2016-12-14 00:07:43 +09:00
Takatoshi Kondo
e61cd76310 Supported any names for MSGPACK_DEFINE_MAP using MSGPACK_NVP. 2016-10-30 16:25:19 +09:00
Takatoshi Kondo
2f34d22bf5 Merge pull request #533 from Kronuz/patch-1
Save the flags of the stream
2016-10-29 13:28:10 +09:00
Germán M. Bravo
03b770fdf2 Save the flags of the stream
Changing the stream to `std::hex` mode should only affect the current character; otherwise printing some msgpack with a list like this: `[123, "string\\u0003", 123]` (123 decimal) ends up printing `[123, "string\\u0003", 7b]`, as `std::hex` is sticky.
2016-10-28 15:27:03 -05:00
Beilu Shao
b4786711df alignment: use proper alignment size
Pass proper alignment size when use allocate_align(). This will
fix alignment trap issues on ARM.

Signed-off-by: Beilu Shao <beilushao@gmail.com>
2016-10-16 23:59:13 +02:00
Takatoshi Kondo
ccc9ac5538 Fixed #521.
Introduced new object type `FLOAT32` and `FLOAT64`.
`FLOAT64` is equivalent to `FLOAT`.
The both internal expressions are f64(double).
2016-10-11 23:23:06 +09:00
Marc Bodmer
8d09b7090d Removed MSGPACK_ENABLE_GCC_CXX_ATOMIC macro since this does not exist in user code and this code would not be active then. 2016-10-11 10:33:08 +02:00
Marc Bodmer
e7eae65ab7 Fixed path of gcc_atomic.h and gcc_atomic.hpp in definition of _msgpack_atomic_counter_header 2016-10-10 10:42:08 +02:00
Marc Bodmer
4e663609ca Fixed name of define as evaluated in CMakeLists.txt 2016-10-10 10:40:45 +02:00
Takatoshi Kondo
87ff7e4ccc Merge pull request #515 from edsiper/unpacker_size
unpack: new msgpack_unpacker_next_with_size() function
2016-09-11 19:32:48 +09:00
Takatoshi Kondo
c1f19c0e47 Merge pull request #504 from redboltz/fix_503
Fixed #503.
2016-09-06 23:00:17 +09:00
Eduardo Silva
d9a77e220a unpack: new msgpack_unpacker_next_with_size() function
This new function is an extension of the original msgpack_unpacker_next()
where it now adds third argument to store the number of parsed bytes for
the returned buffer upon a MSGPACK_UNPACK_SUCCESS case.

This is useful for cases where the caller needs to optimize memory usage
in the original buffer,s so upon success retrieval of the object, it can
later deprecate the already 'parsed' bytes.

For more details about the origins of this function please refer to the
following issue on github:

  https://github.com/msgpack/msgpack-c/issues/514

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-08-31 16:49:14 -06:00
Takatoshi Kondo
3a87cc8826 Merge branch 'VariadicC11Fix' of https://github.com/pkrenz/msgpack-c-1 into pkrenz-VariadicC11Fix 2016-08-30 00:04:09 +09:00
Takatoshi Kondo
5d69c22bf9 Use OR instead of AND for all classes that have multiple types.
Revert example. Combination of has_as and not has_as are move to tests.
2016-08-29 22:12:01 +09:00
Philipp
a9caff538e Fix warning in versioning 2016-08-26 16:56:01 +02:00
Martin C Drohmann
7191a3b014 enable as<map<...> > implementation when the key OR the value have as() 2016-08-23 15:03:14 -07:00
Takatoshi Kondo
b9bc9d4195 Replaced uint32_t with size_t.
User buffer size is not limited by msgpack-c so size_t is the
appropriate type.
2016-07-16 09:32:19 +09:00
Takatoshi Kondo
aa790ba785 Merge branch 'master' of https://github.com/smititelu/msgpack-c into smititelu-master 2016-07-16 09:20:39 +09:00
Takatoshi Kondo
d7a656523b Fixed #503.
Fixed fwrite return value comparison.
2016-07-11 19:34:10 +09:00
Stefan Mititelu
4fa661a63d Add msgpack_object_print_buffer() function
In order to print the msgpack object in a memory buffer.
2016-07-07 22:43:48 +03:00
Takatoshi Kondo
2e4de8b65c Fixed #498.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
2016-07-06 21:52:08 +09:00
Takatoshi Kondo
3c997edd71 Merge pull request #489 from redboltz/fix_390
Fix 390
2016-06-21 21:07:29 +09:00
Takatoshi Kondo
523e986077 Added size_equal_only support for C++03 msgpack::type::tuple. 2016-06-20 18:39:04 +09:00
Takatoshi Kondo
4ffdc01135 Added converting support for different size tuples. 2016-06-20 17:12:53 +09:00
Takatoshi Kondo
1b87018a0a Fixed #390.
Added size_equal_only class template to check converted container size
strictly.
Relaxed std::array size checking by default.
Fixed std::tuple and msgpack::type::tuple size checking problem.
2016-06-20 15:32:24 +09:00
Takatoshi Kondo
755342bb25 Improved C-Style array support.
In the case the target type is char[] or const char[],

If the array is '\0' teminated, msgpack-c packs the characters before
'\0', otherwise packs all characters.

When converting, the array has the size that is greater than
msgpack::object STR's size, msgpack-c adds '\0' to just after converted
characters. Otherwise msgpack-c doesn't add '\0'.
2016-06-19 20:47:42 +09:00
Takatoshi Kondo
0f66e144ab Support MSVC cli.
MSVC CLI defined their own nullptr and provides for __nullptr for standard C++11.
https://msdn.microsoft.com/en-us/library/4ex65770.aspx
msgpack-c introduce MSGPACK_NULLPTR for internal use, it is defined as __nullptr only if compiled on C++ CLI otherwise defined as nullptr.
2016-06-08 18:03:51 +09:00
Takatoshi Kondo
89faf6ee9f Updated boost predef and preprocessor from 1.58.0 to 1.61.0 2016-05-30 13:20:58 +09:00
Takatoshi Kondo
b68c073d1b Moved gcc_atomic.hpp location. 2016-05-30 09:55:16 +09:00
Takatoshi Kondo
22613d4dd0 Merge pull request #464 from redboltz/fix_463
Fixed #463.
2016-05-24 08:22:50 +09:00
Takatoshi Kondo
d15d9220ff Merge pull request #461 from redboltz/add_unpack_visitor_api
Added a visitor version of unpack API,
2016-05-22 22:50:44 +09:00
Takatoshi Kondo
cc02da0ccf Fixed #465
Added C-Style array support.

Existing mapping:
  convert:
  pack:
    char[N]       => STR
    const char[N] => STR
  object:
    char[N]       => STR (v1 only)
    const char[N] => STR (v1 only)
  object_with_zone:
    char[N]       => STR
    const char[N] => STR

Additional mapping:

  convert:
    STR        => char[N]
    ARRAY      => T[N]
  pack:
    T[N]       => ARRAY
    const T[N] => ARRAY
  object:
  object_with_zone:
    T[N]       => ARRAY
    const T[N] => ARRAY
2016-05-16 23:00:30 +09:00