[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] curses ui: always initialize all curses_line fi
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] curses ui: always initialize all curses_line fields |
Date: |
Fri, 15 Mar 2019 11:02:13 +0000 |
On Fri, 15 Mar 2019 at 10:52, Samuel Thibault <address@hidden> wrote:
>
> Peter Maydell, le ven. 15 mars 2019 10:06:48 +0000, a ecrit:
> > > + curses_line[x] = (cchar_t) {};
> > > curses_line[x].chars[0] = ch;
> > > - curses_line[x].chars[1] = 0;
> > > - curses_line[x].attr = 0;
> > > }
> > > curses_line[x].attr |= at;
> >
> > Does this really need the cast ?
>
> Yes, otherwise it is refused by the compiler.
>
> > {} is supposed to be a universal initializer.
>
> When used as initialized (cchar_t foo = {}), yes. But when used in
> assignations, no, one has to cast it.
Ah -- I hadn't realized that wrinkle; thanks for the explanation.
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM