mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
cgen: remove unnecessary parens for ptr-to-array
This commit is contained in:
1 parent
43beae1d3d
commit
724aec33df
2 files changed
+11
-5
No files matched your search
@@ -586,7 +586,11 @@ func (g *gen) writeCTypeName(b *buffer, n *a.TypeExpr, varNamePrefix string, var
|
||||
}
|
||||
|
||||
if isPointerToArray {
|
||||
b.writes("(*")
|
||||
if x.Inner().Inner().IsNumType() {
|
||||
b.writes("*")
|
||||
} else {
|
||||
b.writes("(*")
|
||||
}
|
||||
} else {
|
||||
for i := 0; i < numPointers; i++ {
|
||||
b.writeb('*')
|
||||
@@ -601,8 +605,10 @@ func (g *gen) writeCTypeName(b *buffer, n *a.TypeExpr, varNamePrefix string, var
|
||||
|
||||
x = n
|
||||
if isPointerToArray {
|
||||
b.writes(")")
|
||||
x = x.Inner().Inner()
|
||||
if !x.IsNumType() {
|
||||
b.writes(")")
|
||||
}
|
||||
}
|
||||
for ; x != nil && x.IsEitherArrayType(); x = x.Inner() {
|
||||
b.writeb('[')
|
||||
|
||||
Reference in new issue
Block a user