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
+10 -15

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 {
if n.Public() {
b.writes("WUFFS_BASE__MAYBE_STATIC ")
} else {
b.writes("static ")
}
b.writes("const ")
b.writes("static const ")
if err := g.writeCTypeName(b, n.XType(), "//\n"+g.pkgPrefix, n.QID()[1].Str(g.tm)); err != nil {
return err
}
+9 -9
View File
@@ -2647,7 +2647,7 @@ extern const char* wuffs_deflate__error__no_huffman_codes;
// ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t //
static const uint64_t //
wuffs_deflate__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280;
@@ -2818,8 +2818,8 @@ extern const char* wuffs_lzw__error__bad_code;
// ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t //
wuffs_lzw__max_incl_workbuf_len //
static const uint64_t //
wuffs_lzw__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 0;
// ---------------- Struct Declarations
@@ -2982,8 +2982,8 @@ extern const char* wuffs_gif__error__too_much_pixel_data;
// ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t //
wuffs_gif__max_incl_workbuf_len //
static const uint64_t //
wuffs_gif__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 65535;
// ---------------- Struct Declarations
@@ -3276,8 +3276,8 @@ extern const char* wuffs_gzip__error__bad_header;
// ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t //
wuffs_gzip__max_incl_workbuf_len //
static const uint64_t //
wuffs_gzip__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280;
// ---------------- Struct Declarations
@@ -3418,8 +3418,8 @@ extern const char* wuffs_zlib__error__bad_parity_check;
// ---------------- Public Consts
WUFFS_BASE__MAYBE_STATIC const uint64_t //
wuffs_zlib__max_incl_workbuf_len //
static const uint64_t //
wuffs_zlib__max_incl_workbuf_len //
WUFFS_BASE__POTENTIALLY_UNUSED = 33280;
// ---------------- Struct Declarations