diff options
Diffstat (limited to 'src/mpack')
-rw-r--r-- | src/mpack/conv.c | 4 | ||||
-rw-r--r-- | src/mpack/lmpack.c | 9 | ||||
-rw-r--r-- | src/mpack/mpack_core.c | 3 | ||||
-rw-r--r-- | src/mpack/object.c | 3 | ||||
-rw-r--r-- | src/mpack/rpc.c | 3 |
5 files changed, 17 insertions, 5 deletions
diff --git a/src/mpack/conv.c b/src/mpack/conv.c index 203b13fadb..6bd446ca49 100644 --- a/src/mpack/conv.c +++ b/src/mpack/conv.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include "conv.h" static int mpack_fits_single(double v); @@ -298,7 +301,6 @@ MPACK_API double mpack_unpack_number(mpack_token_t t) */ if (!hi) { assert(t.length <= 4); - hi = 0; lo = (~lo & (((mpack_uint32_t)1 << ((t.length * 8) - 1)) - 1)); } else { hi = ~hi; diff --git a/src/mpack/lmpack.c b/src/mpack/lmpack.c index 99207246c8..24d27fd17a 100644 --- a/src/mpack/lmpack.c +++ b/src/mpack/lmpack.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * This module exports three classes, and each instance of those classes has its * own private registry for temporary reference storage(keeping state between @@ -201,14 +204,14 @@ static void lmpack_pushnil(lua_State *L) static mpack_uint32_t lmpack_objlen(lua_State *L, int *is_array) { size_t len, max; - int isarr, type; + int isarr; lua_Number n; #ifndef NDEBUG int top = lua_gettop(L); assert(top); #endif - if ((type = lua_type(L, -1)) != LUA_TTABLE) { + if ((lua_type(L, -1)) != LUA_TTABLE) { #if LUA_VERSION_NUM >= 502 len = lua_rawlen(L, -1); #elif LUA_VERSION_NUM == 501 @@ -442,7 +445,6 @@ static int lmpack_unpacker_unpack_str(lua_State *L, Unpacker *unpacker, if (rv == MPACK_NOMEM) { unpacker->parser = lmpack_grow_parser(unpacker->parser); if (!unpacker->parser) { - unpacker->unpacking = 0; return luaL_error(L, "failed to grow Unpacker capacity"); } } @@ -796,7 +798,6 @@ static int lmpack_packer_pack(lua_State *L) if (result == MPACK_NOMEM) { packer->parser = lmpack_grow_parser(packer->parser); if (!packer->parser) { - packer->packing = 0; return luaL_error(L, "Failed to grow Packer capacity"); } } diff --git a/src/mpack/mpack_core.c b/src/mpack/mpack_core.c index 0ad09bd46a..f8ca63b7a3 100644 --- a/src/mpack/mpack_core.c +++ b/src/mpack/mpack_core.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <string.h> #include "mpack_core.h" diff --git a/src/mpack/object.c b/src/mpack/object.c index 0c7759ee51..e2d893bc88 100644 --- a/src/mpack/object.c +++ b/src/mpack/object.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <string.h> #include "object.h" diff --git a/src/mpack/rpc.c b/src/mpack/rpc.c index 3b2b328065..2d251284ba 100644 --- a/src/mpack/rpc.c +++ b/src/mpack/rpc.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <string.h> #include "rpc.h" |