Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Sergey Bronnikov <estetus@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once
Date: Thu, 30 Jan 2025 16:55:36 +0300	[thread overview]
Message-ID: <fe9d4774-6302-4a67-b2e9-db955a1a3032@tarantool.org> (raw)
In-Reply-To: <Z5pBVDYaRHaRom7Z@root>

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]

Hi, Sergey,

thanks for review! Changes force-pushed.

Sergey

On 29.01.2025 17:55, Sergey Kaplun via Tarantool-patches wrote:
> Hi, Sergey!
> Thanks for the patch!
> LGTM, with a minor comment below.
>
> On 29.01.25, Sergey Bronnikov wrote:
>> The macros `UNUSED` is widely used across the suite
> Typo: s/macros/macro/
Fixed.
>
>> `tarantool-c-tests`. The patch defines macros only once in
> Typo: s/macros/macro/
Fixed.
>
>> `test.h` to reuse it in other tests and removes definitions in
>> tests.
>> ---
>>
>> Branch:https://github.com/tarantool/luajit/tree/ligurio/gh-xxxx-define-unused
>>
> <snipped>
>
>> diff --git a/test/tarantool-c-tests/test.h b/test/tarantool-c-tests/test.h
>> index 3b22fb92..c1717932 100644
>> --- a/test/tarantool-c-tests/test.h
>> +++ b/test/tarantool-c-tests/test.h
>> @@ -4,6 +4,8 @@
>>   #include <stdio.h>
>>   #include <stdlib.h>
>>   
>> +#define UNUSED(x) ((void)(x))
> Minor: I suggest to wrapping this into the `#ifndef`, since the
> `UNUSED()` is a very common macro. The same one is used in the LuaJIT.
> For now these macros are the same [1] but to avoid rewriting code in the
> case of the changes, it is better to use `#ifndef` directive here.

Updated:

--- a/test/tarantool-c-tests/test.h
+++ b/test/tarantool-c-tests/test.h
@@ -4,7 +4,9 @@
  #include <stdio.h>
  #include <stdlib.h>

+#ifndef UNUSED
  #define UNUSED(x) ((void)(x))
+#endif

  /*
   * Test module, based on TAP 14 specification [1].

>
>> +
>>   /*
>>    * Test module, based on TAP 14 specification [1].
>>    * [1]:https://testanything.org/tap-version-14-specification.html
> <snipped>
>
> [1]:https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html
>

[-- Attachment #2: Type: text/html, Size: 3697 bytes --]

      reply	other threads:[~2025-01-30 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29  9:39 Sergey Bronnikov via Tarantool-patches
2025-01-29 14:55 ` Sergey Kaplun via Tarantool-patches
2025-01-30 13:55   ` Sergey Bronnikov via Tarantool-patches [this message]

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=fe9d4774-6302-4a67-b2e9-db955a1a3032@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] test: define UNUSED macros only once' \
    /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