mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
Don't use designated initializers
Some C/C++ compilers, such as MSVC, don't always support them. They're also not supported by GCC's "g++ -std=c++11 -Wpedantic".
This commit is contained in:
1 parent
ef7aa0d980
commit
c4b8a6a4cc
19 files changed
+639
-516
No files matched your search
@@ -116,7 +116,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, depth uint32) error {
|
||||
if err := g.writeExpr(b, recv, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.printf(", 0, sizeof (%s%s)), wuffs_base__return_empty_struct())",
|
||||
b.printf(", 0, sizeof (%s%s)), wuffs_base__make_empty_struct())",
|
||||
g.packagePrefix(qid), qid[1].Str(g.tm))
|
||||
} else {
|
||||
b.printf("wuffs_base__ignore_status("+
|
||||
@@ -165,13 +165,13 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, depth uint32) error {
|
||||
lhsIsArray := lhs.MType().IsArrayType()
|
||||
if lhsIsArray {
|
||||
// TODO: don't assume that the slice is a slice of base.u8.
|
||||
b.writes("((wuffs_base__slice_u8){.ptr=")
|
||||
b.writes("wuffs_base__make_slice_u8(")
|
||||
}
|
||||
if err := g.writeExpr(b, lhs, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
if lhsIsArray {
|
||||
b.printf(",.len=%v,})", lhs.MType().ArrayLength().ConstValue())
|
||||
b.printf(", %v)", lhs.MType().ArrayLength().ConstValue())
|
||||
}
|
||||
|
||||
if mhs != nil {
|
||||
|
||||
Reference in new issue
Block a user