qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Jun Koi <junkoi2004@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()
Date: Fri, 16 Dec 2011 10:26:33 +0100	[thread overview]
Message-ID: <4EEB0EC9.6030705@redhat.com> (raw)
In-Reply-To: <CA+g7VZ3qPRf-18+dY2GkAJVXnxB1eqq4a2TnqjWoxdJW7cbAuQ@mail.gmail.com>

On 12/16/2011 09:07 AM, Jun Koi wrote:
> This patch replaces all the strdup() with g_strdup()
>
> Signed-off-by: Jun Koi<junkoi2004@gmail.com>
>
> $ diffstat strdup.diff
>   cmd.c               |    4 ++--
>   envlist.c           |    6 +++---
>   exec.c              |    2 +-
>   hw/isa-bus.c        |    2 +-
>   hw/pc.c             |    2 +-
>   hw/pci.c            |    2 +-
>   hw/qdev.c           |    2 +-
>   hw/scsi-bus.c       |    2 +-
>   hw/sun4m.c          |    6 +++---
>   hw/sun4u.c          |    2 +-
>   hw/usb-msd.c        |    2 +-
>   hw/virtio-blk.c     |    2 +-
>   ia64-dis.c          |    2 +-
>   microblaze-dis.c    |   18 +++++++++---------
>   path.c              |    2 +-
>   readline.c          |    2 +-
>   test-qmp-commands.c |   12 ++++++------
>   17 files changed, 35 insertions(+), 35 deletions(-)

You cannot do this unless you also convert all free to g_free.  So you 
also cannot do this when you are passing strings to libraries that take 
ownership of the strings.  A search-and-replace conversion is not possible.

Paolo

  parent reply	other threads:[~2011-12-16  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16  8:07 [Qemu-devel] [patch] replace all strdup() with g_strdup() Jun Koi
2011-12-16  8:44 ` 陳韋任
2011-12-16  9:26 ` Peter Maydell
2011-12-16  9:26 ` Paolo Bonzini [this message]
2011-12-16  9:41   ` Daniel P. Berrange
2011-12-16 10:21     ` Paolo Bonzini

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=4EEB0EC9.6030705@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=junkoi2004@gmail.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).