* [Qemu-devel] [PATCH] Remove wrong semicolon in macro definition
@ 2010-09-13 19:21 Stefan Weil
2010-09-14 15:19 ` Edgar E. Iglesias
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2010-09-13 19:21 UTC (permalink / raw)
To: QEMU Developers
Macros normally should not end with a semicolon,
otherwise their usage results in two statements
where only one statement was expected.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/serial.c | 4 ++--
tests/cris/check_swap.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/serial.c b/hw/serial.c
index 49431b2..f09ce0a 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -101,10 +101,10 @@
#ifdef DEBUG_SERIAL
#define DPRINTF(fmt, ...) \
-do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0);
+do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0)
#else
#define DPRINTF(fmt, ...) \
-do {} while(0);
+do {} while (0)
#endif
typedef struct SerialFIFO {
diff --git a/tests/cris/check_swap.c b/tests/cris/check_swap.c
index 743cfc5..824a685 100644
--- a/tests/cris/check_swap.c
+++ b/tests/cris/check_swap.c
@@ -41,7 +41,7 @@ do { \
cris_tst_mov_cc(n, z); \
if (r != expected) \
err(); \
-} while(0);
+} while(0)
void check_swap(void)
{
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] Remove wrong semicolon in macro definition
2010-09-13 19:21 [Qemu-devel] [PATCH] Remove wrong semicolon in macro definition Stefan Weil
@ 2010-09-14 15:19 ` Edgar E. Iglesias
0 siblings, 0 replies; 2+ messages in thread
From: Edgar E. Iglesias @ 2010-09-14 15:19 UTC (permalink / raw)
To: Stefan Weil; +Cc: QEMU Developers
On Mon, Sep 13, 2010 at 09:21:57PM +0200, Stefan Weil wrote:
> Macros normally should not end with a semicolon,
> otherwise their usage results in two statements
> where only one statement was expected.
Applied
>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
> hw/serial.c | 4 ++--
> tests/cris/check_swap.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/serial.c b/hw/serial.c
> index 49431b2..f09ce0a 100644
> --- a/hw/serial.c
> +++ b/hw/serial.c
> @@ -101,10 +101,10 @@
>
> #ifdef DEBUG_SERIAL
> #define DPRINTF(fmt, ...) \
> -do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0);
> +do { fprintf(stderr, "serial: " fmt , ## __VA_ARGS__); } while (0)
> #else
> #define DPRINTF(fmt, ...) \
> -do {} while(0);
> +do {} while (0)
> #endif
>
> typedef struct SerialFIFO {
> diff --git a/tests/cris/check_swap.c b/tests/cris/check_swap.c
> index 743cfc5..824a685 100644
> --- a/tests/cris/check_swap.c
> +++ b/tests/cris/check_swap.c
> @@ -41,7 +41,7 @@ do { \
> cris_tst_mov_cc(n, z); \
> if (r != expected) \
> err(); \
> -} while(0);
> +} while(0)
>
> void check_swap(void)
> {
> --
> 1.7.0.4
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-14 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 19:21 [Qemu-devel] [PATCH] Remove wrong semicolon in macro definition Stefan Weil
2010-09-14 15:19 ` Edgar E. Iglesias
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).