From 64477bb2138fb2096f225e281ec7858a90cd55ab Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 14 Feb 2014 14:31:23 -0800 Subject: Reapply 612785f39e325b0578be89e09b0e32d7d08d471e fixing GCC warnings See 612785f39e325b0578be89e09b0e32d7d08d471e for details. The warning is exactly the same as before, with the exact same solution as before. Change-Id: I2f6cbc64234696f1d240611f376ab5daf8d0f89c Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4instr_moth_p.h | 4 ++++ src/qml/compiler/qv4isel_moth_p.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index e3e227796e..89fcafe921 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -825,6 +825,10 @@ struct InstrMeta { typedef Instr::instr_##FMT DataType; \ static const DataType &data(const Instr &instr) { return instr.FMT; } \ static void setData(Instr &instr, const DataType &v) { instr.FMT = v; } \ + static void setDataNoCommon(Instr &instr, const DataType &v) \ + { memcpy(reinterpret_cast(&instr.FMT) + sizeof(Instr::instr_common), \ + reinterpret_cast(&v) + sizeof(Instr::instr_common), \ + Size - sizeof(Instr::instr_common)); } \ }; FOR_EACH_MOTH_INSTR(MOTH_INSTR_META_TEMPLATE); #undef MOTH_INSTR_META_TEMPLATE diff --git a/src/qml/compiler/qv4isel_moth_p.h b/src/qml/compiler/qv4isel_moth_p.h index b43868d186..41f839600f 100644 --- a/src/qml/compiler/qv4isel_moth_p.h +++ b/src/qml/compiler/qv4isel_moth_p.h @@ -202,7 +202,7 @@ template ptrdiff_t InstructionSelection::addInstruction(const InstrData &data) { Instr genericInstr; - InstrMeta::setData(genericInstr, data); + InstrMeta::setDataNoCommon(genericInstr, data); return addInstructionHelper(static_cast(InstrT), genericInstr); } -- cgit v1.2.3