Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@dev.tarantool.org>
Subject: [Tarantool-patches] [PATCH 01/14] box/txn: fix void args mess
Date: Wed, 19 Feb 2020 21:37:00 +0300	[thread overview]
Message-ID: <20200219183713.17646-2-gorcunov@gmail.com> (raw)
In-Reply-To: <20200219183713.17646-1-gorcunov@gmail.com>

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 <kostja.osipov@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 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

  reply	other threads:[~2020-02-19 18:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19 18:36 [Tarantool-patches] [PATCH 00/14] rework async and sync transactions Cyrill Gorcunov
2020-02-19 18:37 ` Cyrill Gorcunov [this message]
2020-02-20 14:10   ` [Tarantool-patches] [PATCH 01/14] box/txn: fix void args mess Nikita Pettik
2020-02-20 14:16     ` Cyrill Gorcunov
2020-02-20 14:34       ` Nikita Pettik
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 02/14] box/journal: use plain int for return value Cyrill Gorcunov
2020-02-20 14:11   ` Nikita Pettik
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 03/14] box/journal: sanitize completion naming Cyrill Gorcunov
2020-02-20 14:12   ` Nikita Pettik
2020-02-20 14:15     ` Nikita Pettik
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 04/14] box/txn: rename txn_entry_done_cb to txn_entry_complete_cb Cyrill Gorcunov
2020-02-20 14:15   ` Nikita Pettik
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 05/14] box/txn: rename txn_write_to_wal to txn_write_to_wal_async Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 06/14] box/journal: supersede journal_write with journal_write_async Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 07/14] box/txn: rename txn_write to txn_commit_async Cyrill Gorcunov
2020-02-22 20:28   ` Georgy Kirichenko
2020-02-22 21:00     ` Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 08/14] box/txn: move setup of transaction start time to txn_prepare Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 09/14] box/txn: make txn nop processing a separate routine Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 10/14] box/txn: move journal entry allocation into " Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 11/14] box/txn: merge txn_write_to_wal_async to txn_commit_async Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 12/14] box/txn: do not use journal_write_async under the hood Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 13/14] box/journal: introduce journal_write Cyrill Gorcunov
2020-02-19 18:37 ` [Tarantool-patches] [PATCH 14/14] box/txn: use journal_write in txn_commit Cyrill Gorcunov
2020-02-19 19:09   ` Konstantin Osipov
2020-02-19 20:01     ` Cyrill Gorcunov

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=20200219183713.17646-2-gorcunov@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 01/14] box/txn: fix void args mess' \
    /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