Hi,
Just for your information,
I applied the static code analysis tool 'cppcheck' to msgpack c++ code of version 0.5.7.
cppcheck reported some issues:
| object.hpp:229
| inline bool operator==(const object x, const object y)
| > Function parameter 'x' and 'y' should be passed by reference.
It could be following.
--> inline bool operator==(const object& x, const object& y)
| object.hpp:242
| inline bool operator!=(const object x, const object y)
| > Function parameter 'x' and 'y' should be passed by reference.
It could be following.
--> inline bool operator!=(const object& x, const object& y)
| object.cpp: 23
| std::ostream& operator<< (std::ostream& s, const object o)
| > Function parameter 'o' should be passed by reference.
It could be following.
--> std::ostream& operator<< (std::ostream& s, const object& o)
XXX| objectc.c: 171
XXX| bool msgpack_object_equal(const msgpack_object x, const msgpack_object y)
XXX| > Function parameter 'x' and 'y' should be passed by reference.
It could not be following.
--> bool msgpack_object_equal(const msgpack_object& x, const msgpack_object& y)
(compile error. Because function msgpack_object_equal is c code, so cannot use reference.)
Hi,
> XXX| objectc.c: 171
> XXX| bool msgpack_object_equal(const msgpack_object x, const msgpack_object y)
> XXX| > Function parameter 'x' and 'y' should be passed by reference.
>
> It could not be following.
> --> bool msgpack_object_equal(const msgpack_object& x, const msgpack_object& y)
> (compile error. Because function msgpack_object_equal is c code, so cannot use reference.)
Also, I show the example corrected about this point.
(See attached file)
The function msgpack_object_equal is c language interface, so I used pointer instead of reference.