Make cgen's public constants' always static

This commit is contained in:
Nigel Tao committed 2019-02-02 16:02:38 +11:00
1 parent e45baffd51
commit 4af1b88ef8
2 files changed
+6 -11

No files matched your search

+1 -6
View File
@@ -681,12 +681,7 @@ func (g *gen) gatherScalarConsts(b *buffer, n *a.Const) error {
} }
func (g *gen) writeConst(b *buffer, n *a.Const) error { func (g *gen) writeConst(b *buffer, n *a.Const) error {
if n.Public() { b.writes("static const ")
b.writes("WUFFS_BASE__MAYBE_STATIC ")
} else {
b.writes("static ")
}
b.writes("const ")
if err := g.writeCTypeName(b, n.XType(), "//\n"+g.pkgPrefix, n.QID()[1].Str(g.tm)); err != nil { if err := g.writeCTypeName(b, n.XType(), "//\n"+g.pkgPrefix, n.QID()[1].Str(g.tm)); err != nil {
return err return err
} }
+5 -5
View File
@@ -2647,7 +2647,7 @@ extern const char* wuffs_deflate__error__no_huffman_codes;
// ---------------- Public Consts // ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t // static const uint64_t //
wuffs_deflate__max_incl_workbuf_len // wuffs_deflate__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280; WUFFS_BASE__POTENTIALLY_UNUSED = 33280;
@@ -2818,7 +2818,7 @@ extern const char* wuffs_lzw__error__bad_code;
// ---------------- Public Consts // ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t // static const uint64_t //
wuffs_lzw__max_incl_workbuf_len // wuffs_lzw__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 0; WUFFS_BASE__POTENTIALLY_UNUSED = 0;
@@ -2982,7 +2982,7 @@ extern const char* wuffs_gif__error__too_much_pixel_data;
// ---------------- Public Consts // ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t // static const uint64_t //
wuffs_gif__max_incl_workbuf_len // wuffs_gif__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 65535; WUFFS_BASE__POTENTIALLY_UNUSED = 65535;
@@ -3276,7 +3276,7 @@ extern const char* wuffs_gzip__error__bad_header;
// ---------------- Public Consts // ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t // static const uint64_t //
wuffs_gzip__max_incl_workbuf_len // wuffs_gzip__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280; WUFFS_BASE__POTENTIALLY_UNUSED = 33280;
@@ -3418,7 +3418,7 @@ extern const char* wuffs_zlib__error__bad_parity_check;
// ---------------- Public Consts // ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t // static const uint64_t //
wuffs_zlib__max_incl_workbuf_len // wuffs_zlib__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280; WUFFS_BASE__POTENTIALLY_UNUSED = 33280;