nv50/ir: fix memset on non trivial types warning
authorKarol Herbst <kherbst@redhat.com>
Fri, 20 Sep 2019 17:45:02 +0000 (19:45 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 9 Jul 2020 02:11:02 +0000 (12:11 +1000)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Rhys Kidd <rhyskidd@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>

src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir.h
src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp

index c65853578f662c832e13c4ab2a202198b0eb265d..d4bed4e772097e964ff048e769de44df5669e1aa 100644 (file)
@@ -905,10 +905,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;
 
index d58c0d206ec93742c2b44ab4bd3a6c0f3d4f6aea..a0b545fd24d2c50c7a9240517bf1e749100d4f5f 100644 (file)
@@ -983,7 +983,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; }
index 765375a47dfb0ea052e7fcd5dade6a3c6ca4548e..00e6f787be376b527d3a6b810a7867d4bb143a89 100644 (file)
@@ -463,7 +463,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;