From: Karol Herbst Date: Fri, 20 Sep 2019 17:45:02 +0000 (+0200) Subject: nv50/ir: fix memset on non trivial types warning X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02a57896f66186eb31cd1da476e14e1910bf12b3;p=mesa.git nv50/ir: fix memset on non trivial types warning Signed-off-by: Karol Herbst Reviewed-by: Rhys Kidd Part-of: --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp index c65853578f6..d4bed4e7720 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp @@ -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; diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.h b/src/gallium/drivers/nouveau/codegen/nv50_ir.h index d58c0d206ec..a0b545fd24d 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.h @@ -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; } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp index 765375a47df..00e6f787be3 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp @@ -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;