mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 16:55:11 +01:00
cgen: allow "var x : nptr array[etc] etc"
This commit is contained in:
1 parent
dfab0d2b3d
commit
8ac22ceab2
7 files changed
+84
-31
No files matched your search
@@ -358,7 +358,14 @@ func (g *gen) writeVars(b *buffer, f *funk, inStructDecl bool) error {
|
||||
} else if typ.Eq(typeExprARMCRC32U32) {
|
||||
b.writes(" = 0;\n")
|
||||
} else {
|
||||
b.writes(" = {0};\n")
|
||||
switch typ.Decorator() {
|
||||
case t.IDNptr:
|
||||
b.writes(" = NULL;\n")
|
||||
case t.IDPtr:
|
||||
return fmt.Errorf("cannot zero-initialize a non-nullable ptr")
|
||||
default:
|
||||
b.writes(" = {0};\n")
|
||||
}
|
||||
}
|
||||
|
||||
if typ.IsIOType() {
|
||||
|
||||
Reference in new issue
Block a user