n->src[0] = n->src[2];
n->bc.src[0] = n->bc.src[2];
n->src[1] = sh.get_const_value(cr);
- memset(&n->bc.src[1], 0, sizeof(bc_alu_src));
+ n->bc.src[1].clear();
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
n->bc.src[0] = a->bc.src[last_arg];
n->bc.src[0].neg ^= cur_neg;
n->src[1] = sh.get_const_value(cr);
- memset(&n->bc.src[1], 0, sizeof(bc_alu_src));
+ n->bc.src[1].clear();
}
return false;
case ALU_OP2_ADD: // (ADD x, x) => (MUL x, 2)
if (!sh.safe_math) {
n.src[1] = sh.get_const_value(2.0f);
- memset(&n.bc.src[1], 0, sizeof(bc_alu_src));
+ n.bc.src[1].clear();
n.bc.set_op(ALU_OP2_MUL);
return fold_alu_op2(n);
}
}
n.src[1] = t;
- memset(&n.bc.src[1], 0, sizeof(bc_alu_src));
+ n.bc.src[1].clear();
n.src.resize(2);
dv = cv0.f * cv1.f;
n.bc.set_op(ALU_OP2_ADD);
n.src[0] = sh.get_const_value(dv);
- memset(&n.bc.src[0], 0, sizeof(bc_alu_src));
+ n.bc.src[0].clear();
n.src[1] = n.src[2];
n.bc.src[1] = n.bc.src[2];
n.src.resize(2);
a->src[0] = cnd;
a->src[1] = sh.get_const_value(0);
// clear modifiers
- memset(&a->bc.src[0], 0, sizeof(bc_alu_src));
- memset(&a->bc.src[1], 0, sizeof(bc_alu_src));
+ a->bc.src[0].clear();
+ a->bc.src[1].clear();
} else {
// kill with constant 'false' condition, this shouldn't happen
// but remove it anyway
class alu_node : public node {
protected:
- alu_node() : node(NT_OP, NST_ALU_INST) { memset(&bc, 0, sizeof(bc_alu)); }
+ alu_node() : node(NT_OP, NST_ALU_INST) { }
public:
bc_alu bc;
std::swap(a->src[0],a->src[1]);
swapped = true;
// clear modifiers
- memset(&a->bc.src[0], 0, sizeof(bc_alu_src));
- memset(&a->bc.src[1], 0, sizeof(bc_alu_src));
+ a->bc.src[0].clear();
+ a->bc.src[1].clear();
}
if (swapped || (a->src[1]->is_const() &&