From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Ostanevich <sergos@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 4/5] decimal: introduce decimal_to_string
Date: Sun, 1 Aug 2021 17:04:06 +0200 [thread overview]
Message-ID: <030ca5d7-9dc9-84b6-0e4f-554629777b5b@tarantool.org> (raw)
In-Reply-To: <C9242794-10C8-406A-8098-B021AA707BFF@tarantool.org>
Thanks for the review!
On 29.07.2021 13:52, Sergey Ostanevich wrote:
> Hi! Thanks for the patch, my 2 cents below.
>
> Otherwise - LGTM.
>
> Regards,
> Sergos
>
>
>> On 28 Jul 2021, at 00:24, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> wrote:
>>
>> It saves decimal as a string into an externally passed buffer.
>
> Please mention decimal_to_string() introduction.
It is in the commit title already. I don't want to duplicate the title
in the message.
>> diff --git a/src/lib/core/decimal.c b/src/lib/core/decimal.c
>> index 4befbda37..6d2ccb96f 100644
>> --- a/src/lib/core/decimal.c
>> +++ b/src/lib/core/decimal.c
>> @@ -175,6 +175,14 @@ decimal_str(const decimal_t *dec)
>> return buf;
>> }
>>
>> +void
>> +decimal_to_string(const decimal_t *dec, char *str)
>> +{
>> + char *tmp = decNumberToString(dec, str);
>> + assert(str == tmp);
>
> Why? The decToString() doesn't touch original string pointer, working on
> a local copy.
Yes, this is why there is the assertion. Also to be consistent with
decimal_str() which has the same assert.
>> + (void)tmp;
>> +}
next prev parent reply other threads:[~2021-08-01 15:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 21:24 [Tarantool-patches] [PATCH 0/5] Static buf in Lua, part 3 Vladislav Shpilevoy via Tarantool-patches
2021-07-27 21:24 ` [Tarantool-patches] [PATCH 1/5] uuid: introduce and use luaL_pushuuidstr() Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:30 ` Sergey Ostanevich via Tarantool-patches
2021-07-27 21:24 ` [Tarantool-patches] [PATCH 2/5] info: use luaL_pushuuidstr() for box.info uuids Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:38 ` Sergey Ostanevich via Tarantool-patches
2021-08-01 15:03 ` Vladislav Shpilevoy via Tarantool-patches
2021-08-01 17:01 ` Sergey Ostanevich via Tarantool-patches
2021-07-27 21:24 ` [Tarantool-patches] [PATCH 3/5] decimal: rename decimal_to_string to decimal_str Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:41 ` Sergey Ostanevich via Tarantool-patches
2021-08-01 15:03 ` Vladislav Shpilevoy via Tarantool-patches
2021-08-01 17:01 ` Sergey Ostanevich via Tarantool-patches
2021-07-27 21:24 ` [Tarantool-patches] [PATCH 4/5] decimal: introduce decimal_to_string Vladislav Shpilevoy via Tarantool-patches
2021-07-29 11:52 ` Sergey Ostanevich via Tarantool-patches
2021-08-01 15:04 ` Vladislav Shpilevoy via Tarantool-patches [this message]
2021-08-01 17:06 ` Sergey Ostanevich via Tarantool-patches
2021-07-27 21:24 ` [Tarantool-patches] [PATCH 5/5] decimal: introduce and use lua_pushdecimalstr() Vladislav Shpilevoy via Tarantool-patches
2021-07-29 12:28 ` Sergey Ostanevich via Tarantool-patches
2021-08-01 15:04 ` Vladislav Shpilevoy via Tarantool-patches
2021-07-27 21:39 ` [Tarantool-patches] [PATCH 0/5] Static buf in Lua, part 3 Cyrill Gorcunov via Tarantool-patches
2021-08-02 19:45 ` Vladislav Shpilevoy via Tarantool-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=030ca5d7-9dc9-84b6-0e4f-554629777b5b@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=sergos@tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 4/5] decimal: introduce decimal_to_string' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox