Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 1/3] clang-format: guard various declarations
Date: Wed,  7 Oct 2020 16:24:08 +0300	[thread overview]
Message-ID: <849d969bcf1fba3d892b29e3d225e055e073da46.1602076356.git.kyukhin@tarantool.org> (raw)
In-Reply-To: <cover.1602076356.git.kyukhin@tarantool.org>
In-Reply-To: <cover.1602076356.git.kyukhin@tarantool.org>

Disable clang-formatter for:
- iproto_constants.c
- constants in vy_log.c
- key comparator definitions.
- for field_def's types compatibility
---
 src/box/errcode.h          | 4 +++-
 src/box/field_def.c        | 2 ++
 src/box/iproto_constants.c | 4 ++++
 src/box/tuple_compare.cc   | 4 ++++
 src/box/vy_log.c           | 2 ++
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/box/errcode.h b/src/box/errcode.h
index e6957d6..244bda1 100644
--- a/src/box/errcode.h
+++ b/src/box/errcode.h
@@ -51,7 +51,8 @@ struct errcode_record {
  * Please don't forget to do it!
  */
 
-#define ERROR_CODES(_)					    \
+/* clang-format off */
+#define ERROR_CODES(_)						 \
 	/*  0 */_(ER_UNKNOWN,			"Unknown error") \
 	/*  1 */_(ER_ILLEGAL_PARAMS,		"Illegal parameters, %s") \
 	/*  2 */_(ER_MEMORY_ISSUE,		"Failed to allocate %u bytes in %s for %s") \
@@ -273,6 +274,7 @@ struct errcode_record {
 	/*218 */_(ER_TUPLE_METADATA_IS_TOO_BIG,	"Can't create tuple: metadata size %u is too big") \
 	/*219 */_(ER_XLOG_GAP,			"%s") \
 	/*220 */_(ER_TOO_EARLY_SUBSCRIBE,	"Can't subscribe non-anonymous replica %s until join is done") \
+/* clang-format on */
 
 /*
  * !IMPORTANT! Please follow instructions at start of the file
diff --git a/src/box/field_def.c b/src/box/field_def.c
index 213e916..34cecfa 100644
--- a/src/box/field_def.c
+++ b/src/box/field_def.c
@@ -127,6 +127,7 @@ field_type_by_name_wrapper(const char *str, uint32_t len)
  * For an i row and j column the value is true, if the i type
  * values can be stored in the j type.
  */
+/* clang-format off */
 static const bool field_type_compatibility[] = {
 	   /*   ANY   UNSIGNED  STRING   NUMBER  DOUBLE  INTEGER  BOOLEAN VARBINARY SCALAR  DECIMAL   UUID    ARRAY    MAP  */
 /*   ANY    */ true,   false,   false,   false,   false,   false,   false,   false,  false,  false,  false,   false,   false,
@@ -143,6 +144,7 @@ static const bool field_type_compatibility[] = {
 /*   ARRAY  */ true,   false,   false,   false,   false,   false,   false,   false,  false,  false,  false,   true,    false,
 /*    MAP   */ true,   false,   false,   false,   false,   false,   false,   false,  false,  false,  false,   false,   true,
 };
+/* clang-format on */
 
 bool
 field_type1_contains_type2(enum field_type type1, enum field_type type2)
diff --git a/src/box/iproto_constants.c b/src/box/iproto_constants.c
index 029d988..af3ab60 100644
--- a/src/box/iproto_constants.c
+++ b/src/box/iproto_constants.c
@@ -30,6 +30,8 @@
  */
 #include "iproto_constants.h"
 
+/* clang-format off */
+
 const unsigned char iproto_key_type[IPROTO_KEY_MAX] =
 {
 	/* {{{ header */
@@ -226,3 +228,5 @@ const char *vy_row_index_key_strs[VY_ROW_INDEX_KEY_MAX] = {
 	NULL,
 	"row index",
 };
+
+/* clang-format on */
diff --git a/src/box/tuple_compare.cc b/src/box/tuple_compare.cc
index d059c70..bb786cc 100644
--- a/src/box/tuple_compare.cc
+++ b/src/box/tuple_compare.cc
@@ -1144,6 +1144,7 @@ struct comparator_signature {
 /**
  * field1 no, field1 type, field2 no, field2 type, ...
  */
+/* clang-format off */
 static const comparator_signature cmp_arr[] = {
 	COMPARATOR(0, FIELD_TYPE_UNSIGNED)
 	COMPARATOR(0, FIELD_TYPE_STRING)
@@ -1160,6 +1161,7 @@ static const comparator_signature cmp_arr[] = {
 	COMPARATOR(0, FIELD_TYPE_UNSIGNED, 1, FIELD_TYPE_STRING  , 2, FIELD_TYPE_STRING)
 	COMPARATOR(0, FIELD_TYPE_STRING  , 1, FIELD_TYPE_STRING  , 2, FIELD_TYPE_STRING)
 };
+/* clang-format on */
 
 #undef COMPARATOR
 
@@ -1330,6 +1332,7 @@ struct comparator_with_key_signature
 #define KEY_COMPARATOR(...) \
 	{ TupleCompareWithKey<0, __VA_ARGS__>::compare, { __VA_ARGS__ } },
 
+/* clang-format off */
 static const comparator_with_key_signature cmp_wk_arr[] = {
 	KEY_COMPARATOR(0, FIELD_TYPE_UNSIGNED, 1, FIELD_TYPE_UNSIGNED, 2, FIELD_TYPE_UNSIGNED)
 	KEY_COMPARATOR(0, FIELD_TYPE_STRING  , 1, FIELD_TYPE_UNSIGNED, 2, FIELD_TYPE_UNSIGNED)
@@ -1345,6 +1348,7 @@ static const comparator_with_key_signature cmp_wk_arr[] = {
 	KEY_COMPARATOR(1, FIELD_TYPE_UNSIGNED, 2, FIELD_TYPE_STRING)
 	KEY_COMPARATOR(1, FIELD_TYPE_STRING  , 2, FIELD_TYPE_STRING)
 };
+/* clang-format on */
 
 /**
  * A functional index tuple compare.
diff --git a/src/box/vy_log.c b/src/box/vy_log.c
index d23b1c1..06b2596 100644
--- a/src/box/vy_log.c
+++ b/src/box/vy_log.c
@@ -68,6 +68,7 @@
  * Integer key of a field in the vy_log_record structure.
  * Used for packing a record in MsgPack.
  */
+/* clang-format off */
 enum vy_log_key {
 	VY_LOG_KEY_LSM_ID		= 0,
 	VY_LOG_KEY_RANGE_ID		= 1,
@@ -130,6 +131,7 @@ static const char *vy_log_type_name[] = {
 	[VY_LOG_REBOOTSTRAP]		= "rebootstrap",
 	[VY_LOG_ABORT_REBOOTSTRAP]	= "abort_rebootstrap",
 };
+/* clang-format on */
 
 /** Batch of vylog records that must be written in one go. */
 struct vy_log_tx {
-- 
1.8.3.1

  reply	other threads:[~2020-10-07 13:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 13:24 [Tarantool-patches] [PATCH 0/3] Add clang format Kirill Yukhin
2020-10-07 13:24 ` Kirill Yukhin [this message]
2020-10-07 13:24 ` [Tarantool-patches] [PATCH 2/3] Add .clang-format for src/box/ Kirill Yukhin
2020-10-07 14:11 ` [Tarantool-patches] [PATCH 3/3] Apply clang-format Kirill Yukhin

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=849d969bcf1fba3d892b29e3d225e055e073da46.1602076356.git.kyukhin@tarantool.org \
    --to=kyukhin@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/3] clang-format: guard various declarations' \
    /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