From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 7C1C4469719 for ; Mon, 17 Feb 2020 19:00:08 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id x7so19441838ljc.1 for ; Mon, 17 Feb 2020 08:00:08 -0800 (PST) From: Cyrill Gorcunov Date: Mon, 17 Feb 2020 18:59:50 +0300 Message-Id: <20200217155953.25803-2-gorcunov@gmail.com> In-Reply-To: <20200217155953.25803-1-gorcunov@gmail.com> References: <20200217155953.25803-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/4] 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. 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