From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 09FF8469719 for ; Wed, 19 Feb 2020 21:37:28 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id r19so1459315ljg.3 for ; Wed, 19 Feb 2020 10:37:27 -0800 (PST) From: Cyrill Gorcunov Date: Wed, 19 Feb 2020 21:37:00 +0300 Message-Id: <20200219183713.17646-2-gorcunov@gmail.com> In-Reply-To: <20200219183713.17646-1-gorcunov@gmail.com> References: <20200219183713.17646-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 01/14] box/txn: fix void args mess List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Using void explicitly in functions which take no arguments allows to optimize code a bit and don't assume if there might be variable args. Moreover in commit e070cc4d9 we dropped arguments from txn_begin but didn't update vy_scheduler.c. The compiler didn't complain because it assumed there are vargs. Acked-by: Konstantin Osipov Signed-off-by: Cyrill Gorcunov --- src/box/txn.c | 14 +++++++------- src/box/txn.h | 4 ++-- src/box/vy_scheduler.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/box/txn.c b/src/box/txn.c index 30ec586ba..5dadf4985 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -173,7 +173,7 @@ txn_rollback_to_svp(struct txn *txn, struct stailq_entry *svp) * Return a txn from cache or create a new one if cache is empty. */ inline static struct txn * -txn_new() +txn_new(void) { if (!stailq_empty(&txn_cache)) return stailq_shift_entry(&txn_cache, struct txn, in_txn_cache); @@ -209,7 +209,7 @@ txn_free(struct txn *txn) } struct txn * -txn_begin() +txn_begin(void) { static int64_t tsn = 0; assert(! in_txn()); @@ -670,13 +670,13 @@ box_txn_id(void) } bool -box_txn() +box_txn(void) { return in_txn() != NULL; } int -box_txn_begin() +box_txn_begin(void) { if (in_txn()) { diag_set(ClientError, ER_ACTIVE_TRANSACTION); @@ -688,7 +688,7 @@ box_txn_begin() } int -box_txn_commit() +box_txn_commit(void) { struct txn *txn = in_txn(); /** @@ -709,7 +709,7 @@ box_txn_commit() } int -box_txn_rollback() +box_txn_rollback(void) { struct txn *txn = in_txn(); if (txn == NULL) @@ -788,7 +788,7 @@ txn_savepoint_by_name(struct txn *txn, const char *name) } box_txn_savepoint_t * -box_txn_savepoint() +box_txn_savepoint(void) { struct txn *txn = in_txn(); if (txn == NULL) { diff --git a/src/box/txn.h b/src/box/txn.h index 97d7b5de5..ae2c3a58f 100644 --- a/src/box/txn.h +++ b/src/box/txn.h @@ -251,7 +251,7 @@ txn_clear_flag(struct txn *txn, enum txn_flag flag) /* Pointer to the current transaction (if any) */ static inline struct txn * -in_txn() +in_txn(void) { return fiber()->storage.txn; } @@ -261,7 +261,7 @@ in_txn() * @pre no transaction is active */ struct txn * -txn_begin(); +txn_begin(void); /** * Commit a transaction. diff --git a/src/box/vy_scheduler.c b/src/box/vy_scheduler.c index 86bed8013..acc909d09 100644 --- a/src/box/vy_scheduler.c +++ b/src/box/vy_scheduler.c @@ -895,7 +895,7 @@ vy_deferred_delete_batch_process_f(struct cmsg *cmsg) deferred_delete_space = space_by_id(BOX_VINYL_DEFERRED_DELETE_ID); assert(deferred_delete_space != NULL); - struct txn *txn = txn_begin(false); + struct txn *txn = txn_begin(); if (txn == NULL) goto fail; -- 2.20.1