[Nouveau] [PATCH v2] nv50/ir: Initialize all members of GCRA (trivial)

Pierre Moreau pierre.morrow at free.fr
Sat Dec 30 15:03:27 UTC 2017


On 2017-12-30 — 15:21, Tobias Klausmann wrote:
> v2: use initialization list (Pierre)
> 
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> Reviewed-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
> index 361918a161..a70a54f6b8 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp
> @@ -1144,7 +1144,9 @@ GCRA::RIG_Node::addRegPreference(RIG_Node *node)
>  GCRA::GCRA(Function *fn, SpillCodeInserter& spill) :
>     func(fn),
>     regs(fn->getProgram()->getTarget()),
> -   spill(spill)
> +   spill(spill),
> +   nodeCount(0),
> +   nodes(NULL)

The order in the member initialisation list should be the same as the order in
which the attributes are declared within the class, so you should have:

   nodes(NULL)
   nodeCount(0),
   func(fn),
   regs(fn->getProgram()->getTarget()),
   spill(spill)

>  {
>     prog = func->getProgram();
>  
> -- 
> 2.15.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20171230/3f551ef5/attachment.sig>


More information about the Nouveau mailing list