Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: Konstantin Osipov <kostja@tarantool.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>,
	tarantool-patches@freelists.org
Subject: Re: [PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack
Date: Tue, 13 Aug 2019 17:01:48 +0300	[thread overview]
Message-ID: <A9106CB2-19A2-4135-80F3-0D7026CF9A0F@tarantool.org> (raw)
In-Reply-To: <20190812213454.GI32337@atlas>


> 13 авг. 2019 г., в 0:34, Konstantin Osipov <kostja@tarantool.org> написал(а):
> 
> * Serge Petrenko <sergepetrenko@tarantool.org> [19/08/08 15:01]:
>> index d84748b71..89ea26b41 100644
>> --- a/src/lib/core/mp_user_types.h
>> +++ b/src/lib/core/mp_user_types.h
>> @@ -31,6 +31,12 @@
>>  * SUCH DAMAGE.
>>  */
>> 
>> +#include "msgpuck.h"
> 
> why this include?

For mp_type in msgpack_to_field_type() and field_type_to_msgpack().

> 
> 
> What is this header file standing (mp_user_tpyes.h) for? 
> 
> User types are enum field_type. What other user types do you have
> in mind? Perhaps you mean user-defined types? Well, decimal is not
> a user defined type, it's built-in. The fact that it has to use
> mp_ext format type in msgpack is just a coincidence of Tarantool
> using msgpack for its internal data representation.

Ok, we may name the file extension_types or ext_types or mp_ext_types.

> 
>> +++ b/src/lib/core/mpstream.h
>> @@ -32,6 +32,7 @@
>>  */
>> 
>> #include "diag.h"
>> +#include "decimal.h"
>> 
> 
> why this include?

For decimal_t. Because
decimal_t is a typedef for decNumber, and decNumber is a typedef
for an anonymous struct.

I can patch decNumber so that we have a struct decNumber. Then we
will be able to get away with typedef struct decNumber decimal_t in
such headers.

> 
> Please, please, C is not PHP, you don't include everything around
> just because it was a bad day.
> 
>> index 6fc2b8278..2e6b5c163 100644
>> --- a/src/lua/msgpack.c
>> +++ b/src/lua/msgpack.c
>> @@ -41,6 +41,11 @@
>> #include <small/region.h>
>> #include <small/ibuf.h>
>> 
>> +#include "lua/decimal.h"
>> +#include "lib/core/decimal.h"
>> +#include "lib/core/mp_decimal.h"
>> +#include "lib/core/mp_user_types.h"
>> +
> 
> This is a dependency hell.
> 
> Why did you add a separate header for decimal encoding/encoding if
> you have to include *everything* in here anyway? Noone will ever
> be able to understand why you decided to include all of these
> here.

Do you want me to add comments describing why we need each header?

> 
> 
> 
> -- 
> Konstantin Osipov, Moscow, Russia


--
Serge Petrenko
sergepetrenko@tarantool.org

  reply	other threads:[~2019-08-13 14:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 11:55 [PATCH v2 0/8] Decimal indices Serge Petrenko
2019-08-08 11:55 ` [PATCH v2 1/8] lua: fix decimal comparison with nil Serge Petrenko
2019-08-12 21:16   ` Konstantin Osipov
2019-08-14 11:00   ` Vladimir Davydov
2019-08-14 22:17     ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 2/8] decimal: fix encoding numbers with positive exponent Serge Petrenko
2019-08-12 21:18   ` Konstantin Osipov
2019-08-13  9:00     ` [tarantool-patches] " Serge Petrenko
2019-08-14 22:21       ` Konstantin Osipov
2019-08-14 11:56   ` Vladimir Davydov
2019-08-08 11:55 ` [PATCH v2 3/8] lua/pickle: fix a typo Serge Petrenko
2019-08-12 21:18   ` Konstantin Osipov
2019-08-14 11:12   ` Vladimir Davydov
2019-08-14 11:15     ` Serge Petrenko
2019-08-08 11:55 ` [PATCH v2 4/8] lua: rework luaL_field types to support msgpack extensions Serge Petrenko
2019-08-12 21:23   ` Konstantin Osipov
2019-08-13 13:15     ` [tarantool-patches] " Serge Petrenko
2019-08-14 22:23       ` Konstantin Osipov
2019-08-15  8:27         ` Serge Petrenko
2019-08-16  8:06           ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 5/8] box: rework field_def and tuple_compare to work with mp_field_type instead of mp_type Serge Petrenko
2019-08-12 21:28   ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack Serge Petrenko
2019-08-12 21:29   ` Konstantin Osipov
2019-08-12 21:34   ` Konstantin Osipov
2019-08-13 14:01     ` Serge Petrenko [this message]
2019-08-14 22:25       ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 7/8] decimal: add conversions to (u)int64_t Serge Petrenko
2019-08-12 21:39   ` Konstantin Osipov
2019-08-13 14:18     ` Serge Petrenko
2019-08-14 22:26       ` Konstantin Osipov
2019-08-14 22:29         ` Konstantin Osipov
2019-08-08 11:55 ` [PATCH v2 8/8] decimal: allow to index decimals Serge Petrenko
2019-08-08 13:42   ` Serge Petrenko
2019-08-12 21:41   ` Konstantin Osipov

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=A9106CB2-19A2-4135-80F3-0D7026CF9A0F@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=vdavydov.dev@gmail.com \
    --subject='Re: [PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack' \
    /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