20 Commits

Author SHA1 Message Date
sztomi
d452625ed1 Added * and -> operators to object_handle 2017-10-09 20:23:25 +02: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
Luiz Silva
04b549a46b Replace c-Style cast with static_cast 2016-11-16 11:00:28 -02:00
Luiz Silva
4a1db60af8 Fix compilation with Gtest 1.8.0 and GCC 5.4.1 2016-11-10 10:59:26 -02: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
Takatoshi Kondo
1bfcf55469 Replaced msgpack::unpacked with msgpack::object_handle.
msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.

Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
2016-03-21 15:22:50 +09:00
Takatoshi Kondo
3c271892e3 Fixed #399
If MSGPACK_DISABLE_LEGACY_CONVERT is defined, msgpack::object::convert(T*) is removed.
Added MSGPACK_DISABLE_LEGACY_CONVERT to build system and documents.

Please define MSGPACK_DISABLE_LEGACY_CONVERT and update your code as follows:
Replace
  int i;
  obj.convert(&i); // Removed pointer version
with
  int i;
  obj.convert(i);  // Reference version
2016-01-21 22:28:53 +09:00
Takatoshi Kondo
39e7856c48 Fixed #382.
Fixed warnings on gcc 4.1.2.
Added gcc version checking for adding -std=c++03 flag.
2015-11-12 00:20:21 +09:00
Nobuyuki Kubota
b13cb13efc Fix compile errors on OS X due to signed-unsigned comparison in tests 2015-08-10 11:29:57 -07:00
Takatoshi Kondo
f75da23e1d Separated unpacked from object_handle to preserve the original ABI. 2015-05-26 09:53:55 +09:00
Takatoshi Kondo
9cb2c91d58 Fixed the lack of msgpack::move() on the self substituion test codes. 2015-05-22 09:36:21 +09:00
Takatoshi Kondo
9e18ac5d2d Reverted msgpack::move() on the C++03. Const-correntness isn't broken now.
Implemented msgpack::object_handle using the same design pattern as std::auto_ptr and std::auto_ptr_ref.
Minimized the uses of #if defined(MSGPACK_USE_CPP03) conditional macro.
2015-05-22 09:21:58 +09:00
Takatoshi Kondo
e18f5b2d52 Added a clone function for msgpack::object.
The function prepares zone's chunk that has minimal size to deep copy.
2015-05-21 14:44:40 +09:00
Takatoshi Kondo
e8d3c8d6c5 Re-designed user types dispatching mechanism.
msgpakc-c 0.5.9 or older uses ADL.
msgpack-c 1.0.x uses overloading with header files ordering.
msgpack-c 1.1.x uses functor with class template specialization.
2015-04-02 18:23:37 +09:00
Takatoshi Kondo
c4fb47c00d Fixed #204, #202.
enum support had been incomplete.
This fix made enum support complete.

Replaced int with auto on c++11 scoped enum.
Replaced template specializations with function overloads on operator<< and operator>> for enum.

enum can convert to object with and without zone.

When you want to adapt enum, you need to write as follows:

// NOT msgpack.hpp

enum yourenum {
    elem
};

MSGPACK_ADD_ENUM(yourenum);

// msgpack.hpp should be included after MSGPACK_ADD_ENUM(...)

int main() {
    msgpack::object obj(yourenum::elem);
}
2015-01-31 22:19:31 +09:00
Takatoshi Kondo
737e6703df Fixed #191.
The names of float format family are changed.

old                      new
dec                   -> f64
MSGPACK_OBJECT_DOUBLE -> MSGPACK_OBJECT_FLOAT
msgpack::type::DOUBLE -> msgpack::type::FLOAT

Client codes could have compile errors when it use dec, MSGPACK_OBJECT_DOUBLE or msgpack::type::DOUBLE.
The best way to fix such errors, update client code. If it can't, set MSGPACK_USE_LEGACY_NAME_AS_FLOAT macro.
Then both old names and new names are available.
2015-01-16 00:20:43 +09:00
Takatoshi Kondo
037b1c22dc Fixed https://github.com/msgpack/msgpack-c/issues/144
This fix is ogirinally from https://github.com/msgpack/msgpack-c/pull/133

I removed raw support and added str, bin, and ext support.
2014-11-17 12:51:34 +09:00
Takatoshi Kondo
5896ff3746 Fixed -Wextra warnings on gcc. 2014-09-02 18:15:58 +09:00
Takatoshi Kondo
8920c49597 Unified test files extension as cpp. 2014-08-11 09:01:17 +09:00