qemu-devel
[Top][All Lists]
Advanced

[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: Samuel Thibault
Subject: Re: [Qemu-devel] [PATCH] curses ui: always initialize all curses_line fields
Date: Fri, 15 Mar 2019 11:52:21 +0100
User-agent: NeoMutt/20170113 (1.7.2)

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.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]