From: "Timur Safin" <tsafin@tarantool.org> To: 'Aleksandr Lyapunov' <alyapunov@tarantool.org>, tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org Subject: Re: [Tarantool-patches] [PATCH 1/2] alter: use good c++ style Date: Tue, 14 Jul 2020 00:51:11 +0300 [thread overview] Message-ID: <0e5801d6595f$b935e310$2ba1a930$@tarantool.org> (raw) In-Reply-To: <1594199230-26036-2-git-send-email-alyapunov@tarantool.org> : From: Aleksandr Lyapunov : Subject: [Tarantool-patches] [PATCH 1/2] alter: use good c++ style : : @@ -1392,14 +1388,14 @@ ModifyIndex::alter(struct alter_space *alter) : } : : void : -ModifyIndex::commit(struct alter_space *alter, int64_t signature) : +ModifyIndex::commit(struct alter_space *alter, int64_t signature) : noexcept : { : (void)alter; This is C++, not C - we could simply omit argument name, and there is no need to dereference argument to make compiler shut : @@ -1475,7 +1471,7 @@ CreateIndex::prepare(struct alter_space *alter) : } : : void : -CreateIndex::commit(struct alter_space *alter, int64_t signature) : +CreateIndex::commit(struct alter_space *alter, int64_t signature) : noexcept : { : (void) alter; The same comment is applicable here - we could simply omit argument name : @@ -1627,7 +1624,7 @@ TruncateIndex::prepare(struct alter_space *alter) : } : : void : -TruncateIndex::commit(struct alter_space *alter, int64_t signature) : +TruncateIndex::commit(struct alter_space *alter, int64_t signature) : noexcept : { : (void)alter; And here... : index_commit_drop(old_index, signature); : @@ -1652,14 +1649,14 @@ class UpdateSchemaVersion: public AlterSpaceOp : public: : UpdateSchemaVersion(struct alter_space * alter) : :AlterSpaceOp(alter) {} : - virtual void alter(struct alter_space *alter); : + void alter(struct alter_space *alter) noexcept override; : }; : : void : -UpdateSchemaVersion::alter(struct alter_space *alter) : +UpdateSchemaVersion::alter(struct alter_space *alter) noexcept : { : - (void)alter; And here ... : - ++schema_version; : + (void) alter; : + ++schema_version; But here we could ask _very important question_ (:)) do we use spaces or tabs (like in C) for indenting C++ sources? Looks like Tabs are not yet used in this file, thus no need to enforce the different style. : } : : /** : @@ -1853,14 +1851,15 @@ CreateConstraintID::alter(struct alter_space : *alter) : } : : void : -CreateConstraintID::rollback(struct alter_space *alter) : +CreateConstraintID::rollback(struct alter_space *alter) noexcept : { : space_delete_constraint_id(alter->new_space, new_id->name); : new_id = NULL; : } : : void : -CreateConstraintID::commit(struct alter_space *alter, int64_t signature) : +CreateConstraintID::commit(struct alter_space *alter, : + int64_t signature) noexcept : { : (void) alter; : (void) signature; Here we could omit names of both arguments ... : -DropConstraintID::alter(struct alter_space *alter) : +DropConstraintID::alter(struct alter_space *alter) noexcept : { : old_id = space_pop_constraint_id(alter->old_space, name); : } : : void : -DropConstraintID::commit(struct alter_space *alter, int64_t signature) : +DropConstraintID::commit(struct alter_space *alter, int64_t signature) : noexcept : { : (void) alter; : (void) signature; The same comment is applicable here also... Best Regards, Timur
next prev parent reply other threads:[~2020-07-13 21:51 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-08 9:07 [Tarantool-patches] [PATCH 0/2] Simplify alter.cc Aleksandr Lyapunov 2020-07-08 9:07 ` [Tarantool-patches] [PATCH 1/2] alter: use good c++ style Aleksandr Lyapunov 2020-07-11 19:53 ` Vladislav Shpilevoy 2020-07-13 13:36 ` Aleksandr Lyapunov 2020-07-13 18:33 ` Vladislav Shpilevoy 2020-07-13 21:51 ` Timur Safin [this message] 2020-07-13 22:17 ` Vladislav Shpilevoy 2020-07-08 9:07 ` [Tarantool-patches] [PATCH 2/2] alter: use proper way to marry C and C++ Aleksandr Lyapunov 2020-07-08 10:41 ` Timur Safin 2020-07-11 19:53 ` Vladislav Shpilevoy 2020-07-08 9:13 ` [Tarantool-patches] [PATCH 0/2] Simplify alter.cc Aleksandr Lyapunov 2020-07-08 10:35 ` Timur Safin -- strict thread matches above, loose matches on Subject: below -- 2020-07-08 8:43 Aleksandr Lyapunov 2020-07-08 8:43 ` [Tarantool-patches] [PATCH 1/2] alter: use good c++ style Aleksandr Lyapunov
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='0e5801d6595f$b935e310$2ba1a930$@tarantool.org' \ --to=tsafin@tarantool.org \ --cc=alyapunov@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] alter: use good c++ style' \ /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