qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] glib-compat.h: change assert to g_assert
Date: Thu, 7 May 2015 15:13:41 +0200	[thread overview]
Message-ID: <CABoDooP73TndpZ9i1+u47fp=4xNL3+rNyv8nMYfMst0ubNNHEA@mail.gmail.com> (raw)
In-Reply-To: <1430995260-31458-1-git-send-email-mjt@msgid.tls.msk.ru>

Hello,

On Thu, May 7, 2015 at 12:41 PM, Michael Tokarev <mjt@tls.msk.ru> wrote:
> include/glib-compat.h defines a bunch of functions based on glib primitives,
> and uses assert() without including assert.h.  Replace assert() with
> g_assert() to make the file more self-contained, and to fix compilation
> breakage after 28507a415a9b1e.
>
> Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>

Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>

Thanks,

Laurent

> ---
>  include/glib-compat.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/glib-compat.h b/include/glib-compat.h
> index 011352b..28d9f15 100644
> --- a/include/glib-compat.h
> +++ b/include/glib-compat.h
> @@ -115,7 +115,7 @@ static inline void g_mutex_init(CompatGMutex *mutex)
>
>  static inline void g_mutex_clear(CompatGMutex *mutex)
>  {
> -    assert(mutex->once.status != G_ONCE_STATUS_PROGRESS);
> +    g_assert(mutex->once.status != G_ONCE_STATUS_PROGRESS);
>      if (mutex->once.retval) {
>          g_mutex_free((GMutex *) mutex->once.retval);
>      }
> @@ -155,7 +155,7 @@ static inline void g_cond_init(CompatGCond *cond)
>
>  static inline void g_cond_clear(CompatGCond *cond)
>  {
> -    assert(cond->once.status != G_ONCE_STATUS_PROGRESS);
> +    g_assert(cond->once.status != G_ONCE_STATUS_PROGRESS);
>      if (cond->once.retval) {
>          g_cond_free((GCond *) cond->once.retval);
>      }
> @@ -164,7 +164,7 @@ static inline void g_cond_clear(CompatGCond *cond)
>
>  static inline void (g_cond_wait)(CompatGCond *cond, CompatGMutex *mutex)
>  {
> -    assert(mutex->once.status != G_ONCE_STATUS_PROGRESS);
> +    g_assert(mutex->once.status != G_ONCE_STATUS_PROGRESS);
>      g_once(&cond->once, do_g_cond_new, NULL);
>      g_cond_wait((GCond *) cond->once.retval, (GMutex *) mutex->once.retval);
>  }
> --
> 2.1.4
>
>

      reply	other threads:[~2015-05-07 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 10:41 [Qemu-devel] [PATCH] glib-compat.h: change assert to g_assert Michael Tokarev
2015-05-07 13:13 ` Laurent Desnogues [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='CABoDooP73TndpZ9i1+u47fp=4xNL3+rNyv8nMYfMst0ubNNHEA@mail.gmail.com' \
    --to=laurent.desnogues@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).