[Qemu-devel] [PATCH 1/5] Convert calls to g_malloc() using casts to g_new()

2011-10-20 Thread Stuart Brady
Convert calls to g_malloc() and g_malloc0() to g_new() and g_new0() respectively, in cases where the return value is casted to the same type as specified using sizeof() in the parameter to g_malloc() and assigned to a variable of that type. This was achieved using Coccinelle with the following

Re: [Qemu-devel] [PATCH 1/5] Convert calls to g_malloc() using casts to g_new()

2011-10-20 Thread Paolo Bonzini
On 10/20/2011 10:03 AM, Stuart Brady wrote: Convert calls to g_malloc() and g_malloc0() to g_new() and g_new0() respectively, in cases where the return value is casted to the same type as specified using sizeof() in the parameter to g_malloc() and assigned to a variable of that type. This is

Re: [Qemu-devel] [PATCH 1/5] Convert calls to g_malloc() using casts to g_new()

2011-10-20 Thread Stuart Brady
On Thu, Oct 20, 2011 at 10:55:38AM +0200, Paolo Bonzini wrote: On 10/20/2011 10:03 AM, Stuart Brady wrote: Convert calls to g_malloc() and g_malloc0() to g_new() and g_new0() respectively, in cases where the return value is casted to the same type as specified using sizeof() in the parameter