Commit Graph

158 Commits

Author SHA1 Message Date
Takatoshi Kondo
36a87b6968 Replaced C-style casts with C++ stype casts in C++ codes. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
e0b42939ba Cleaned up include guards. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
7d731f83a4 Moved the codes in pack_template.h to pack.hpp.
pack_template.h is still needed for the C version of msgpack.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
40ad7da455 Moved gcc atomic functions from source file to header file.
Moved ostream operator << from object.cpp to object.hpp
Removed object.cpp
Modernize configure.in
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
5b3a168b86 Supported C++03. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
11afd4820f Modified unpack functions to class member functions. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
ec5c1194fc Removed redundant namespace scope resolutions. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
7eccd1029a Modified from ::msgpack to msgpack 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
c2ca709d68 Added header files that use c++11 variadic templates instead of ruby code generation.
When the compiler configured to support C++11 (e.g. CXXFLAG contains -std=c++11 is given),
those files are used.
Decoupled unpacker and msgpack_unpacker.
This modification introduced C++11 dependency such as nullptr and unique_ptr.
I will support C++11 and C++03, finally.

Decoupled msgpack.hpp and msgpack.h.

Decoupled sbuffer from msgpack_sbuffer.

Decoupled vrefbuffer from msgpack_vrefbuffer.

Decoupled zbuffer from msgpack_zbuffer.

Added some z_stream initialization.

Removed unpack macros.

Removed CTX_CAST and CTX_REFERENCED.

Embed ctx_ as a member variable (not a pointer).

Modified zone free using C++ way.
2014-07-07 16:16:29 +09:00
Nobuyuki Kubota
f50148a9cc Merge branch 'fbuffer' 2014-07-02 17:53:18 +09:00
Takatoshi Kondo
751a6f98fe Moved bool and inline definition from msgpack.h to sysdep.h.
Set compile settiong on MSVC. ".c" files are compliled as C, not C++. (msgpack_vc8.vcproj, CMakeLists.txt)
Fixed msgpack root object initialization problem on MSVC. {} initialization is not supported on MSVC.
2014-07-02 17:43:07 +09:00
Nobuyuki Kubota
c868da2879 Fix Makefile.am to install fbuffer.h and fbuffer.hpp 2014-07-02 17:32:41 +09:00
tbeu
e0c40c1c59 fix type bool and inline specifier
For a pure C compilation with MSVC type bool is not available. Not tested with other targets (Mingw, cygwin). Thats why only active of ```_MSC_VER``` is defined. So not sure if the bool fix should be also applied to other targets.

For MSVC the inline specifier is not valid and must be named __inline (or _inline).
2014-07-02 17:13:31 +09:00
Nobuyuki Kubota
f185284776 Merge branch 'mpapierski-cmake' 2014-07-02 16:22:33 +09:00
tbeu
3cb2e4f7c6 Fix pure C compilation 2014-06-23 13:55:25 +02:00
Takatoshi Kondo
06930616b2 Added cmake files.
https://github.com/msgpack/msgpack-c/pull/20
Removed 'preprocess' from original CMakeLists.txt.
Removed file copy from original CMakeLists.txt.

Removed 'preprocess' from bootstrap.
Removed file copy from bootstrap.

Added erb generated files. Ruby is no longer required.
Moved cases.mpac, cases_compact.mpa, pack_define.h,
pack_template.h, unpack_define.h, unpack_template.h,
and sysdep.h to apropriate location.

If you want to re-generate zone.hpp, define.hpp, and tuple.hpp,
then you execute preprocess.
2014-06-05 20:49:15 +00:00
Felipe Oliveira Carvalho
8e0137e1d2 Fix to allow projects to compile with -Wconversion
Projects that use -Wconversion don't compile due to errors in msgpack header
files. This commit fixes all the errors in msgpack-c for when -Wconversion is
enabled.

Now I can even compile msgpack-c itself with -Wconversion and all my projects:

    CFLAGS=-Wconversion ./configure
		make
2014-05-19 15:30:14 -03:00
Frank Watson Song
d8c7fd5161 fix compile error on Linux by gcc 4.7 2014-04-01 17:34:28 +08:00
Takatoshi Kondo
22703d2cdb Fixed https://github.com/msgpack/msgpack-c/issues/77 2014-03-30 18:42:15 +00:00
Vladimir Volodko
c9f342f4b2 Make fbuffer's constructor explicit. 2014-03-03 10:21:03 +07:00
Nobuyuki Kubota
862f04104d Changed the format a little 2014-02-28 16:14:49 +09:00
Vladimir Volodko
d47f72be0c Refactor define::msgpack_unpack() to use 'switch' instead of several if's.
convert.benchmark test show some improvement.
2014-02-28 16:14:33 +09:00
Nobuyuki Kubota
98c5767372 Merge branch 'redboltz/add_integer_to_float_conv' 2014-02-28 15:53:11 +09:00
Takatoshi Kondo
b8076fa71f Supported VC++. Fixed testing macro for tr1 containers. 2014-02-27 23:54:48 +00:00
Takatoshi Kondo
2360466aa9 Added unordered containers support for libc++. 2014-02-22 20:43:18 +00:00
Nobuyuki Kubota
9d82356ea9 Merge pull request #62 from redboltz/remove_redundant_null_check
Removed a redundant null check.
2014-02-07 20:05:49 +09:00
Nobuyuki Kubota
ca24e040c4 Merge pull request #61 from redboltz/fix_delete_free_mismatch
Fixed the free and delete mismatch problem.
2014-02-07 20:04:57 +09:00
Takatoshi Kondo
0fd629857d Removed a redundant null check. 2014-02-03 09:34:48 +00:00
Takatoshi Kondo
8eff14db11 Removed redundant null check. 2014-02-02 16:22:07 +00:00
Takatoshi Kondo
81e26fe9b9 Fixed the free and delete mismatch problem.
https://github.com/msgpack/msgpack-c/issues/52
2014-02-02 00:07:45 +00:00
Takatoshi Kondo
9eb4583dd5 Merge pull request #59 from redboltz/add_null_check
Added null pointer check.
2014-01-27 17:53:19 -08:00
Takatoshi Kondo
5a23c86dc1 Added null pointer check. 2014-01-28 10:54:57 +09:00
Takatoshi Kondo
ffd0525607 Replaced types of length from unsigned int to size_t. 2014-01-26 11:29:19 +00:00
Drew Crawford
3dc636bf3e This patch fixes a type conversion warning in clang 5 when compiling for arm64 targets.
```
$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

In file included from /Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack.h:120:
/Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack_template.h:773:57: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
        msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/objectc.c:19:
/Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack.h:118:61: note: expanded from macro 'msgpack_pack_append_buffer'
        return (*(user)->callback)((user)->data, (const char*)buf, len)
                                                                   ^
1 warning generated.
```

This patch is provided under the Apache License version 2.
2014-01-24 12:41:13 -06:00
Takatoshi Kondo
260ce4aa1d Added object that has integer to float and double converter. 2014-01-21 21:12:13 +00:00
xunzhang
a97f764088 update type.hpp, support std::tr1::unordered_map and std::tr1::unordered_set 2014-01-13 14:12:17 +08:00
Nobuyuki Kubota
27777dcd31 Merge pull request #46 from redboltz/fixed_size_type
Fixed size types based on snej's pull request.
2013-12-22 11:55:05 -08:00
Nobuyuki Kubota
bdb397e043 Merge pull request #36 from redboltz/support_plain_char
Supported 'plain' char.
2013-12-22 11:19:19 -08:00
Takatoshi Kondo
cb4d851761 Fixed size types based on snej's pull request.
1784e7a3f3
2013-12-22 15:13:48 +00:00
Takatoshi Kondo
7ac16f4834 Replaced const [un]signed long long int& with [un]signed long long int in sevral function's arguments to unify the interface. No performance issue is observed. 2013-12-16 13:39:12 +09:00
Takatoshi Kondo
c04ef9efe5 Merge pull request #38 from redboltz/copy_msgpack_object_by_memcpy
Fixed issue #37.
2013-12-15 20:25:15 -08:00
Takatoshi Kondo
b774c07d19 When the compiler is gcc, use memcpy, otherwise use an assignment operator.
The memcpy approach is a workaround for gcc's bug. The speed performance on gcc is the same between both approach. But on clang, the memcpy approach is 10% slower than an assignment approach. Hence I added the switching approach code using compiler checked macro.

Note: __GNUC__ is defined both gcc and clang. So I use __GNUC__ && !__clang__
2013-12-16 13:25:09 +09:00
Takatoshi Kondo
be67d3e362 Fixed an unused function warning.
This fix is a part of issue #33.
35ba41c245
2013-11-27 10:33:52 +09:00
Vladimir Volodko
2c1a1fd4f8 Add C/C++ FILE* buffer adaptor.
* add function msgpack_fbuffer_write();
* add class msgpack::fbuffer;
* add tests buffer.fbuffer and buffer.fbuffer_c .
2013-11-22 12:57:30 +07:00
Takatoshi Kondo
3e2ae7cc78 Fixed issue #37.
It seems to be gcc's bug.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416
2013-11-11 09:51:04 +00:00
Takatoshi Kondo
09d90e1231 Supported 'plain' char.
Note: char, signed char, and unsigned char are three different types.
2013-10-31 13:19:22 +09:00
Jens Alfke
6f56345dd8 Fixed unused-function warnings
The function bodies in header files should be declared static inline.
2013-10-22 21:52:13 +00:00
Takatoshi Kondo
9fc196e750 Fixed freed memory accessing bug.
(Issue #32)
2013-10-22 12:46:06 +00:00
Takatoshi Kondo
53ded063a0 Fixed buffer leak bug. 2013-10-15 11:03:47 +09:00
Takatoshi Kondo
172105828c Added copyright. 2013-08-30 13:07:42 +09:00