From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4BA9D26C75 for ; Fri, 22 Feb 2019 13:01:08 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cyRoi2wGH3il for ; Fri, 22 Feb 2019 13:01:08 -0500 (EST) Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 0165E25A90 for ; Fri, 22 Feb 2019 13:01:07 -0500 (EST) Date: Fri, 22 Feb 2019 21:01:01 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH v1 1/4] box: introduce new helpers in column_mask.h Message-ID: <20190222180101.GB12852@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: v.shpilevoy@tarantool.org, Kirill Shcherbatov * Kirill Shcherbatov [19/02/08 16:22]: > Refactored column_mask.h definitions: introduced a new routine > column_mask_is_overflowed, column_mask_is_set and macro > COLUMN_MASK_BIT, COLUMN_MASK_SIZE. > We need this helpers in further refactoring. > > Needed for #3571 > --- > src/box/column_mask.h | 39 +++++++++++++++++++++++++++++++++------ > 1 file changed, 33 insertions(+), 6 deletions(-) > > diff --git a/src/box/column_mask.h b/src/box/column_mask.h > index d71911d46..6e9c0f81a 100644 > --- a/src/box/column_mask.h > +++ b/src/box/column_mask.h > @@ -50,7 +50,9 @@ > * in such case we set not one bit, but a range of bits. > */ > > -#define COLUMN_MASK_FULL UINT64_MAX > +#define COLUMN_MASK_FULL UINT64_MAX > +#define COLUMN_MASK_BIT(n) (((uint64_t)1)<<(n)) > +#define COLUMN_MASK_SIZE ((int)(sizeof(uint64_t)*8)) Please use CHAR_BIT constant instead of 8. The patch otherwise looks good to me. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov