Add some make_foo and null_foo constructors

This commit is contained in:
Nigel Tao committed 2019-03-09 14:50:32 +11:00
1 parent 32dd9fa647
commit 5a98f06cab
10 files changed
+490 -273

No files matched your search

+2 -2
View File
@@ -294,14 +294,14 @@ func (g *gen) writeVars(b *buffer, f *funk, inStructDecl bool) error {
if typ.QID()[1] == t.IDIOWriter {
typName = "writer"
}
b.printf(" = wuffs_base__utility__null_io_%s();\n", typName)
b.printf(" = wuffs_base__null_io_%s();\n", typName)
} else {
b.writes(" = {0};\n")
}
if typ.IsIOType() {
b.printf("wuffs_base__io_buffer %s%s WUFFS_BASE__POTENTIALLY_UNUSED = "+
"wuffs_base__utility__null_io_buffer();\n", uPrefix, name)
"wuffs_base__null_io_buffer();\n", uPrefix, name)
preName := vPrefix + name
// TODO: io0_etc variables?
b.printf("uint8_t* %s%s WUFFS_BASE__POTENTIALLY_UNUSED = NULL;\n", iopPrefix, preName)