[Mesa-dev] [PATCH 1/4] nv50ir: fix memset on non trivial types warning

Rhys Kidd rhyskidd at gmail.com
Sun Sep 22 10:12:59 UTC 2019


On Sat, 21 Sep 2019 at 04:27, Karol Herbst <kherbst at redhat.com> wrote:

> Signed-off-by: Karol Herbst <kherbst at redhat.com>
>

Reviewed-by: Rhys Kidd <rhyskidd at gmail.com>


> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir.cpp        | 4 +---
>  src/gallium/drivers/nouveau/codegen/nv50_ir.h          | 2 +-
>  src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp | 2 +-
>  3 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> index a181a13a3b1..45ee95bb103 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
> @@ -903,10 +903,8 @@ Instruction::isCommutationLegal(const Instruction *i)
> const
>  }
>
>  TexInstruction::TexInstruction(Function *fn, operation op)
> -   : Instruction(fn, op, TYPE_F32)
> +   : Instruction(fn, op, TYPE_F32), tex()
>  {
> -   memset(&tex, 0, sizeof(tex));
> -
>     tex.rIndirectSrc = -1;
>     tex.sIndirectSrc = -1;
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h
> b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
> index b19751ab372..5163e1a7ec2 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h
> @@ -957,7 +957,7 @@ public:
>     class Target
>     {
>     public:
> -      Target(TexTarget targ = TEX_TARGET_2D) : target(targ) { }
> +      Target(TexTarget targ = TEX_TARGET_1D) : target(targ) { }
>
>        const char *getName() const { return descTable[target].name; }
>        unsigned int getArgCount() const { return descTable[target].argc; }
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> index 5c6d0570ae2..609e7b89290 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp
> @@ -455,7 +455,7 @@ CodeEmitter::addInterp(int ipa, int reg, FixupApply
> apply)
>        if (!fixupInfo)
>           return false;
>        if (n == 0)
> -         memset(fixupInfo, 0, sizeof(FixupInfo));
> +         fixupInfo->count = 0;
>     }
>     ++fixupInfo->count;
>
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190922/3b2a4487/attachment.html>


More information about the mesa-dev mailing list