mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
Drop useless casts from g_malloc() & friends to pointer
These memory allocation functions return void *, and casting to another pointer type is useless clutter. Drop these casts. If you really want another pointer type, consider g_new(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20220923120025.448759-3-armbru@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
4bb5923605
commit
0a553c12c7
10 changed files with 15 additions and 17 deletions
|
@ -133,7 +133,7 @@ static void cbus_sel(void *opaque, int line, int level)
|
|||
|
||||
CBus *cbus_init(qemu_irq dat)
|
||||
{
|
||||
CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
|
||||
CBusPriv *s = g_malloc0(sizeof(*s));
|
||||
|
||||
s->dat_out = dat;
|
||||
s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
|
||||
|
@ -388,7 +388,7 @@ static void retu_io(void *opaque, int rw, int reg, uint16_t *val)
|
|||
|
||||
void *retu_init(qemu_irq irq, int vilma)
|
||||
{
|
||||
CBusRetu *s = (CBusRetu *) g_malloc0(sizeof(*s));
|
||||
CBusRetu *s = g_malloc0(sizeof(*s));
|
||||
|
||||
s->irq = irq;
|
||||
s->irqen = 0xffff;
|
||||
|
@ -604,7 +604,7 @@ static void tahvo_io(void *opaque, int rw, int reg, uint16_t *val)
|
|||
|
||||
void *tahvo_init(qemu_irq irq, int betty)
|
||||
{
|
||||
CBusTahvo *s = (CBusTahvo *) g_malloc0(sizeof(*s));
|
||||
CBusTahvo *s = g_malloc0(sizeof(*s));
|
||||
|
||||
s->irq = irq;
|
||||
s->irqen = 0xffff;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue