24 Commits

Author SHA1 Message Date
83479b95ab fix(mpack): remove invalid bool definition
This causes build failures with gcc 15.

Fixes #31723
2025-01-27 16:57:23 +01:00
d6483793e1 fix: buffer overrun in lmpack_session_receive
The offset was not taken into account when calculating the remaining buffer size.
2024-02-06 01:07:54 +02:00
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
353a4be7e8 build: remove PVS
We already have an extensive suite of static analysis tools we use,
which causes a fair bit of redundancy as we get duplicate warnings. PVS
is also prone to give false warnings which creates a lot of work to
identify and disable.
2023-11-12 21:26:39 +01:00
307a7abf86 build(deps): bump libmpack-lua to 1.0.11
update vendored libmpack-lua to match

https://github.com/libmpack/libmpack-lua/releases/tag/1.0.11
2023-10-09 12:37:15 +02:00
ffaf74f147 fix(build): distinguish vim.mpack from global require'mpack'
problem: the api of vim.mpack is not compatible with a system provided mpack
solution: don't require 'mpack' directly from the system path
2023-04-20 19:00:38 +02:00
1e60e8c040 refactor(build): use vendored versions of mpack and luabitop 2023-04-19 10:44:25 +02:00
f8f82901cd fix(tests): fixes for using vim.mpack and more ASAN 2023-02-10 20:19:04 +01:00
adfad50ac0 fix(rpc): don't parse msgpack if buflen is 0 (#21899)
This prevents `buflen` from becoming a very large number when it is 0
when calling mpack_rtoken().
2023-01-19 20:38:29 +08:00
faccae47fc fix(mpack): make sure a bool always is a bool
before, RelWithDebInfo linking gave this warning:

    src/mpack/conv.h:36:16: warning: type of ‘mpack_unpack_boolean’ does not match original declaration [-Wlto-type-mismatch]
       36 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t) FUNUSED FPURE;
          |                ^
    src/mpack/conv.c:196:16: note: return value type mismatch
      196 | MPACK_API bool mpack_unpack_boolean(mpack_token_t t)
          |                ^
2022-08-10 20:36:28 +02:00
d5f047bee0 refactor(api): use a unpacker based on libmpack instead of msgpack-c
Currently this is more or less a straight off reimplementation,
but this allow further optimizations down the line, especially
for avoiding memory allocations of rpc objects.

Current score for "make functionaltest; make oldtest" on a -DEXITFREE build:

is 117 055 352 xfree(ptr != NULL) calls (that's NUMBERWANG!).
2022-06-02 16:05:24 +02:00
2ed6b99a42 refactor(PVS/V560): part of conditional expression is always true/false 2022-02-13 17:51:48 +01:00
e0750f3e8a chore: suppress -Wunused-but-set-variable warns 2021-12-19 13:20:17 +00:00
caa6992a10 chore: fix typos (#16361)
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-27 11:10:48 -05:00
a141f6e922 fix(vim.mpack): rename pack/unpack => encode/decode #16175
Problem:
1. "unpack" has an unrelated meaning in Lua:
   https://www.lua.org/manual/5.1/manual.html#pdf-unpack
2. We already have msgpackparse()/msgpackdump() and
   json_encode()/json_decode(), so introducing another name for the same
   thing is entropy.

Solution:
- Rename vim.mpack.pack/unpack => vim.mpack.encode/decode

Caveat:
This is incongruent with the `Unpacker` and `Packer` functions.
- It's probably too invasive to rename those.
- They also aren't part of our documented interface.
- This commit is "reversible" in the sense that we can always revert
  it and add `vim.mpack.encode/decode` as _aliases_ to
  `vim.mpack.pack/unpack`, at any time in the future, if we want
  stricter fidelity with upstream libmpack. Meanwhile,
  `vim.mpack.encode/decode` is currently the total _documented_
  interface of `vim.mpack`, so this change serves the purpose of
  consistent naming in the Nvim stdlib.
2021-10-30 06:59:59 -07:00
1e876bd9a8 fix(mpack): clang warning: unused variable #15968 2021-10-08 16:05:26 -07:00
d0c0878b3e fix(PVS/V1048): "variable was assigned the same value" #15870 2021-10-06 07:47:31 -07:00
a65d8c34e6 ci(PVS): PVS/V009: add required header #15751 2021-09-21 09:02:43 -07:00
ad8eda3f5b fix(ci): don't enrage the CI Gods by calling a file 'core.*' 2021-09-09 16:06:43 +02:00
0f596665cc feat(lua): make vim.mpack support vim.NIL and vim.empty_dict() 2021-09-09 16:06:43 +02:00
eaf661dacd feat(lua): add vim.mpack for msgpack support in lua 2021-09-09 16:06:43 +02:00
2a08aeff1a fix(build): make vendored libmpack and libmpack-lua build properly 2021-09-09 16:06:43 +02:00
4ef3c2c2c1 build: vendor libmpack/libmpack-lua sources from b593809d93b5299bbee4e1d18e2e2d55f9fa53a6 2021-09-09 16:06:43 +02:00
c8f46480bc build: vendor libmpack source from libmpack/libmpack 22b1fd90285117c995728511f9525d29520a8c82 2021-09-09 16:06:43 +02:00