]> Git Repo - qemu.git/commitdiff
qemu-char: Use g_new() & friends where that makes obvious sense
authorMarkus Armbruster <[email protected]>
Mon, 14 Sep 2015 11:54:03 +0000 (13:54 +0200)
committerPaolo Bonzini <[email protected]>
Wed, 16 Sep 2015 15:33:33 +0000 (17:33 +0200)
g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).  Same Coccinelle semantic patch as in commit b45c03f.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <1442231643[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>

No differences found
This page took 0.024466 seconds and 4 git commands to generate.