From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH 1/5] clang-format: guard various declarations
Date: Fri, 30 Oct 2020 14:43:48 +0300 [thread overview]
Message-ID: <9b64f1b480d15fa627882544ff2a8758f914ecc3.1604057827.git.kyukhin@tarantool.org> (raw)
In-Reply-To: <cover.1604057827.git.kyukhin@tarantool.org>
In-Reply-To: <cover.1604057827.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 0946d77..0f3f18b 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
next prev parent reply other threads:[~2020-10-30 11:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 11:43 [Tarantool-patches] [PATCH 0/5] Add clang format Kirill Yukhin
2020-10-30 11:43 ` Kirill Yukhin [this message]
2020-11-08 15:09 ` [Tarantool-patches] [PATCH 1/5] clang-format: guard various declarations Vladislav Shpilevoy
2020-10-30 11:43 ` [Tarantool-patches] [PATCH 2/5] Add .clang-format for src/box/ Kirill Yukhin
2020-10-30 11:43 ` [Tarantool-patches] [PATCH 3/5] build: add clang-format rules Kirill Yukhin
2020-11-08 15:09 ` Vladislav Shpilevoy
2020-10-30 11:43 ` [Tarantool-patches] [PATCH 4/5] gitlab-ci: add code style check Kirill Yukhin
2020-10-30 11:43 ` [Tarantool-patches] [PATCH 5/5] Apply Clang formatter Kirill Yukhin
2020-10-30 13:42 ` Konstantin Osipov
2020-10-30 23:04 ` Vladislav Shpilevoy
2020-11-01 21:40 ` Konstantin Osipov
2020-11-02 7:35 ` Kirill Yukhin
2020-11-02 21:05 ` Vladislav Shpilevoy
2020-11-10 14:16 ` Kirill Yukhin
2020-11-10 20:38 ` Vladislav Shpilevoy
2020-11-11 8:23 ` Kirill Yukhin
2020-11-08 15:11 ` Vladislav Shpilevoy
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=9b64f1b480d15fa627882544ff2a8758f914ecc3.1604057827.git.kyukhin@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH 1/5] 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