[Tarantool-patches] [PATCH] Add const qualifier to mp_encode_ext argument

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 5 22:38:30 MSK 2020


LGTM.

On 04/04/2020 01:01, Serge Petrenko wrote:
> ---
> This is a fix needed in scope of tarantool#4268 (UUID type indices introduction)
> 
> https://github.com/tarantool/tarantool/issues/4268
> https://github.com/tarantool/msgpuck/tree/sp/ext-type-fix
> 
>  msgpuck.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/msgpuck.h b/msgpuck.h
> index 59fc1ee..5dfbbd9 100644
> --- a/msgpuck.h
> +++ b/msgpuck.h
> @@ -570,7 +570,7 @@ mp_encode_extl(char *data, int8_t type, uint32_t len);
>   * \sa mp_encode_strl
>   */
>  MP_PROTO char *
> -mp_encode_ext(char *data, int8_t type, char *str, uint32_t len);
> +mp_encode_ext(char *data, int8_t type, const char *str, uint32_t len);
>  
>  /**
>   * \brief Check that \a cur buffer has enough bytes to decode an ext header.
> @@ -1577,7 +1577,7 @@ mp_encode_extl(char *data, int8_t type, uint32_t len)
>  }
>  
>  MP_IMPL char *
> -mp_encode_ext(char *data, int8_t type, char *str, uint32_t len)
> +mp_encode_ext(char *data, int8_t type, const char *str, uint32_t len)
>  {
>  	data = mp_encode_extl(data, type, len);
>  	memcpy(data, str, len);
> 


More information about the Tarantool-patches mailing list