mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 16:47:28 +01:00
cgen: apply disableWconversion even more often
This commit is contained in:
1 parent
9520d6de36
commit
c4d2fa13da
2 files changed
+21
-9
No files matched your search
@@ -165,20 +165,25 @@ func (g *gen) writeStatementAssign1(b *buffer, op t.ID, lhs *a.Expr, rhs *a.Expr
|
|||||||
b.printf("wuffs_private_impl__u%d__sat_%s_indirect(&", uBits, uOp)
|
b.printf("wuffs_private_impl__u%d__sat_%s_indirect(&", uBits, uOp)
|
||||||
opName, closer = ", ", ")"
|
opName, closer = ", ", ")"
|
||||||
|
|
||||||
case t.IDPlusEq, t.IDMinusEq, t.IDStarEq, t.IDShiftLEq,
|
|
||||||
t.IDTildeModPlusEq, t.IDTildeModMinusEq, t.IDTildeModStarEq, t.IDTildeModShiftLEq:
|
|
||||||
if lTyp.IsNumType() {
|
|
||||||
if u := lTyp.QID()[1]; u == t.IDU8 || u == t.IDU16 {
|
|
||||||
disableWconversion = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fallthrough
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
opName = cOpName(op)
|
opName = cOpName(op)
|
||||||
if opName == "" {
|
if opName == "" {
|
||||||
return fmt.Errorf("unrecognized operator %q", op.AmbiguousForm().Str(g.tm))
|
return fmt.Errorf("unrecognized operator %q", op.AmbiguousForm().Str(g.tm))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if op.IsAssign() {
|
||||||
|
switch op {
|
||||||
|
case t.IDAmpEq, t.IDPipeEq, t.IDHatEq, t.IDEq, t.IDEqQuestion:
|
||||||
|
// No-op.
|
||||||
|
|
||||||
|
default:
|
||||||
|
if lTyp.IsNumType() {
|
||||||
|
if u := lTyp.QID()[1]; u == t.IDU8 || u == t.IDU16 {
|
||||||
|
disableWconversion = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52324,7 +52324,14 @@ wuffs_lzma__decoder__decode_properties(
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
v_lc = ((uint32_t)(((uint8_t)(v_c8 % 9u))));
|
v_lc = ((uint32_t)(((uint8_t)(v_c8 % 9u))));
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wconversion"
|
||||||
|
#endif
|
||||||
v_c8 /= 9u;
|
v_c8 /= 9u;
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
v_lp = ((uint32_t)(((uint8_t)(v_c8 % 5u))));
|
v_lp = ((uint32_t)(((uint8_t)(v_c8 % 5u))));
|
||||||
v_pb = ((uint32_t)(((uint8_t)(v_c8 / 5u))));
|
v_pb = ((uint32_t)(((uint8_t)(v_c8 / 5u))));
|
||||||
if ((v_lc + v_lp) > 4u) {
|
if ((v_lc + v_lp) > 4u) {
|
||||||
|
|||||||
Reference in new issue
Block a user