qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [COMMIT 26d64a8] Format per CODING_STYLE
Date: Wed, 20 May 2009 09:44:48 +0200	[thread overview]
Message-ID: <4A13B4F0.3030207@redhat.com> (raw)
In-Reply-To: <200905191830.n4JIUCMB019417@d03av04.boulder.ibm.com>

Anthony Liguori schrieb:
> From: malc <av1474@comtv.ru>
> 
> Signed-off-by: malc <av1474@comtv.ru>

Is it really necessary to have commits that change nothing but style? We
could have hundreds of commits just converting all the code to the new
coding style, but in the end all you achieve is to clutter up the log
and make git blame meaningless.

I would really prefer to apply the new coding style only to new or
(semantically) changed code.

Kevin

> 
> diff --git a/qemu-malloc.c b/qemu-malloc.c
> index 5e9f47f..295d185 100644
> --- a/qemu-malloc.c
> +++ b/qemu-malloc.c
> @@ -26,8 +26,9 @@
>  
>  static void *oom_check(void *ptr)
>  {
> -    if (ptr == NULL)
> +    if (ptr == NULL) {
>          abort();
> +    }
>      return ptr;
>  }
>  
> @@ -43,18 +44,20 @@ void qemu_free(void *ptr)
>  
>  void *qemu_malloc(size_t size)
>  {
> -    if (!size)
> +    if (!size) {
>          abort();
> +    }
>      return oom_check(malloc(size));
>  }
>  
>  void *qemu_realloc(void *ptr, size_t size)
>  {
> -    if (size)
> +    if (size) {
>          return oom_check(realloc(ptr, size));
> -    else {
> -        if (ptr)
> +    } else {
> +        if (ptr) {
>              return realloc(ptr, size);
> +        }
>      }
>      abort();
>  }
> @@ -81,8 +84,9 @@ char *qemu_strndup(const char *str, size_t size)
>      const char *end = memchr(str, 0, size);
>      char *new;
>  
> -    if (end)
> +    if (end) {
>          size = end - str;
> +    }
>  
>      new = qemu_malloc(size + 1);
>      new[size] = 0;
> 
> 

           reply	other threads:[~2009-05-20  7:45 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200905191830.n4JIUCMB019417@d03av04.boulder.ibm.com>]

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=4A13B4F0.3030207@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-devel@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).