mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
deps: Update to the experimental msgpack v5 branch
Using msgpack v5 will let nvim be more compatible with msgpack libraries for other platforms. This also replaces "raw" references by "bin" which is the new name for msgpack binary data type
This commit is contained in:
@@ -109,8 +109,8 @@ void msgpack_rpc_error(char *msg, msgpack_packer *res)
|
||||
size_t len = strlen(msg);
|
||||
|
||||
// error message
|
||||
msgpack_pack_raw(res, len);
|
||||
msgpack_pack_raw_body(res, msg, len);
|
||||
msgpack_pack_bin(res, len);
|
||||
msgpack_pack_bin_body(res, msg, len);
|
||||
// Nil result
|
||||
msgpack_pack_nil(res);
|
||||
}
|
||||
@@ -132,8 +132,8 @@ WBuffer *serialize_request(uint64_t request_id,
|
||||
msgpack_pack_uint64(&pac, request_id);
|
||||
}
|
||||
|
||||
msgpack_pack_raw(&pac, method.size);
|
||||
msgpack_pack_raw_body(&pac, method.data, method.size);
|
||||
msgpack_pack_bin(&pac, method.size);
|
||||
msgpack_pack_bin_body(&pac, method.data, method.size);
|
||||
msgpack_rpc_from_array(args, &pac);
|
||||
WBuffer *rv = wstream_new_buffer(xmemdup(sbuffer->data, sbuffer->size),
|
||||
sbuffer->size,
|
||||
@@ -160,8 +160,8 @@ WBuffer *serialize_response(uint64_t response_id,
|
||||
if (err_msg) {
|
||||
String err = {.size = strlen(err_msg), .data = err_msg};
|
||||
// error message
|
||||
msgpack_pack_raw(&pac, err.size);
|
||||
msgpack_pack_raw_body(&pac, err.data, err.size);
|
||||
msgpack_pack_bin(&pac, err.size);
|
||||
msgpack_pack_bin_body(&pac, err.data, err.size);
|
||||
// Nil result
|
||||
msgpack_pack_nil(&pac);
|
||||
} else {
|
||||
@@ -195,8 +195,8 @@ WBuffer *serialize_metadata(uint64_t id,
|
||||
// The result is the [channel_id, metadata] array
|
||||
msgpack_pack_array(&pac, 2);
|
||||
msgpack_pack_uint64(&pac, channel_id);
|
||||
msgpack_pack_raw(&pac, msgpack_metadata_size);
|
||||
msgpack_pack_raw_body(&pac, msgpack_metadata, msgpack_metadata_size);
|
||||
msgpack_pack_bin(&pac, msgpack_metadata_size);
|
||||
msgpack_pack_bin_body(&pac, msgpack_metadata, msgpack_metadata_size);
|
||||
WBuffer *rv = wstream_new_buffer(xmemdup(sbuffer->data, sbuffer->size),
|
||||
sbuffer->size,
|
||||
1,
|
||||
@@ -235,7 +235,7 @@ static char *msgpack_rpc_validate(uint64_t *response_id, msgpack_object *req)
|
||||
}
|
||||
|
||||
if (req->via.array.ptr[2].type != MSGPACK_OBJECT_POSITIVE_INTEGER
|
||||
&& req->via.array.ptr[2].type != MSGPACK_OBJECT_RAW) {
|
||||
&& req->via.array.ptr[2].type != MSGPACK_OBJECT_BIN) {
|
||||
return "Method must be a positive integer or a string";
|
||||
}
|
||||
|
||||
|
@@ -81,12 +81,12 @@ bool msgpack_rpc_to_float(msgpack_object *obj, Float *arg)
|
||||
|
||||
bool msgpack_rpc_to_string(msgpack_object *obj, String *arg)
|
||||
{
|
||||
if (obj->type != MSGPACK_OBJECT_RAW) {
|
||||
if (obj->type != MSGPACK_OBJECT_BIN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
arg->data = xmemdupz(obj->via.raw.ptr, obj->via.raw.size);
|
||||
arg->size = obj->via.raw.size;
|
||||
arg->data = xmemdupz(obj->via.bin.ptr, obj->via.bin.size);
|
||||
arg->size = obj->via.bin.size;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ bool msgpack_rpc_to_object(msgpack_object *obj, Object *arg)
|
||||
arg->type = kObjectTypeFloat;
|
||||
return msgpack_rpc_to_float(obj, &arg->data.floating);
|
||||
|
||||
case MSGPACK_OBJECT_RAW:
|
||||
case MSGPACK_OBJECT_BIN:
|
||||
arg->type = kObjectTypeString;
|
||||
return msgpack_rpc_to_string(obj, &arg->data.string);
|
||||
|
||||
@@ -200,8 +200,8 @@ void msgpack_rpc_from_float(Float result, msgpack_packer *res)
|
||||
|
||||
void msgpack_rpc_from_string(String result, msgpack_packer *res)
|
||||
{
|
||||
msgpack_pack_raw(res, result.size);
|
||||
msgpack_pack_raw_body(res, result.data, result.size);
|
||||
msgpack_pack_bin(res, result.size);
|
||||
msgpack_pack_bin_body(res, result.data, result.size);
|
||||
}
|
||||
|
||||
void msgpack_rpc_from_object(Object result, msgpack_packer *res)
|
||||
|
Reference in New Issue
Block a user