mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Add wuffs_foo__bar__initialize methods
This commit is contained in:
1 parent
10ead58e2e
commit
8794a586ac
10 files changed
+348
-103
No files matched your search
@@ -14,8 +14,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
static inline void wuffs_base__ignore_check_wuffs_version_status(
|
||||
wuffs_base__status z) {}
|
||||
static inline void //
|
||||
wuffs_base__ignore_status(wuffs_base__status z) {}
|
||||
|
||||
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
|
||||
// It's not foolproof, given C doesn't automatically zero memory before use,
|
||||
@@ -438,6 +438,7 @@ wuffs_base__acknowledge_potentially_unused_functions__core_private()
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__core_private() {
|
||||
(void)(wuffs_base__ignore_status);
|
||||
(void)(wuffs_base__load_u16be);
|
||||
(void)(wuffs_base__load_u16le);
|
||||
(void)(wuffs_base__load_u24be);
|
||||
|
||||
@@ -66,6 +66,14 @@
|
||||
#define WUFFS_BASE__WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
// Flags for wuffs_foo__bar__initialize functions.
|
||||
|
||||
// WUFFS_INITIALIZE__ALREADY_ZEROED means that the "self" receiver struct value
|
||||
// has already been set to all zeroes.
|
||||
#define WUFFS_INITIALIZE__ALREADY_ZEROED ((uint32_t)0x00000001)
|
||||
|
||||
// --------
|
||||
|
||||
// wuffs_base__empty_struct is used when a Wuffs function returns an empty
|
||||
// struct. In C, if a function f returns void, you can't say "x = f()", but in
|
||||
// Wuffs, if a function g returns empty, you can say "y = g()".
|
||||
|
||||
@@ -470,6 +470,11 @@ func (g *gen) genHeader(b *buffer) error {
|
||||
}
|
||||
|
||||
b.writes("// ---------------- Public Initializer Prototypes\n\n")
|
||||
b.writes("// For any given \"wuffs_foo__bar* self\", \"wuffs_foo__bar__initialize(self,\n")
|
||||
b.writes("// etc)\" should be called before any other \"wuffs_foo__bar__xxx(self, etc)\".\n")
|
||||
b.writes("//\n")
|
||||
b.writes("// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.\n")
|
||||
b.writes("// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.\n\n")
|
||||
for _, n := range g.structList {
|
||||
if n.Public() {
|
||||
if err := g.writeInitializerPrototype(b, n); err != nil {
|
||||
@@ -853,9 +858,16 @@ func (g *gen) writeCppMethods(b *buffer, n *a.Struct) error {
|
||||
|
||||
// The empty // comment makes clang-format place the function name
|
||||
// at the start of a line.
|
||||
b.writes("inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //\n" +
|
||||
"initialize(size_t sizeof_star_self, uint64_t wuffs_version, uint32_t initialize_flags) {\n")
|
||||
b.printf("return %s%s__initialize(this, sizeof_star_self, wuffs_version, initialize_flags);\n}\n\n",
|
||||
g.pkgPrefix, structName)
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
b.writes("inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //\n" +
|
||||
"check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {\n")
|
||||
b.printf("return %s%s__check_wuffs_version(this, sizeof_star_self, wuffs_version);\n}\n\n",
|
||||
b.printf("return %s%s__initialize(this, sizeof_star_self, wuffs_version, WUFFS_INITIALIZE__ALREADY_ZEROED);\n}\n\n",
|
||||
g.pkgPrefix, structName)
|
||||
|
||||
structID := n.QID()[1]
|
||||
@@ -904,15 +916,8 @@ var (
|
||||
|
||||
func (g *gen) writeInitializerSignature(b *buffer, n *a.Struct, public bool) error {
|
||||
structName := n.QID().Str(g.tm)
|
||||
if public {
|
||||
b.printf("// %s%s__check_wuffs_version is an initializer function.\n", g.pkgPrefix, structName)
|
||||
b.printf("//\n")
|
||||
b.printf("// It should be called before any other %s%s__* function.\n", g.pkgPrefix, structName)
|
||||
b.printf("//\n")
|
||||
b.printf("// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.\n")
|
||||
}
|
||||
b.printf("wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //\n"+
|
||||
"%s%s__check_wuffs_version(%s%s *self, size_t sizeof_star_self, uint64_t wuffs_version)",
|
||||
"%s%s__initialize(%s%s *self, size_t sizeof_star_self, uint64_t wuffs_version, uint32_t initialize_flags)",
|
||||
g.pkgPrefix, structName, g.pkgPrefix, structName)
|
||||
return nil
|
||||
}
|
||||
@@ -930,6 +935,13 @@ func (g *gen) writeInitializerPrototype(b *buffer, n *a.Struct) error {
|
||||
return err
|
||||
}
|
||||
b.writes(";\n\n")
|
||||
|
||||
b.writes("// Deprecated: use wuffs_foo__bar__initialize instead of\n")
|
||||
b.writes("// wuffs_foo__bar__check_wuffs_version.\n")
|
||||
b.printf("wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //\n"+
|
||||
"%s%s__check_wuffs_version(%s%s *self, size_t sizeof_star_self, uint64_t wuffs_version);\n\n",
|
||||
g.pkgPrefix, n.QID().Str(g.tm), g.pkgPrefix, n.QID().Str(g.tm))
|
||||
|
||||
if n.Public() {
|
||||
if err := g.writeSizeofSignature(b, n); err != nil {
|
||||
return err
|
||||
@@ -960,6 +972,8 @@ func (g *gen) writeInitializerImpl(b *buffer, n *a.Struct) error {
|
||||
b.writes("return wuffs_base__error__check_wuffs_version_not_applicable;\n")
|
||||
b.writes("}\n")
|
||||
|
||||
// TODO: examine (initialize_flags & WUFFS_INITIALIZE__ALREADY_ZEROED).
|
||||
|
||||
// Call any ctors on sub-structs.
|
||||
for _, f := range n.Fields() {
|
||||
f := f.AsField()
|
||||
@@ -983,8 +997,8 @@ func (g *gen) writeInitializerImpl(b *buffer, n *a.Struct) error {
|
||||
}
|
||||
|
||||
b.printf("{\n")
|
||||
b.printf("wuffs_base__status z = %s%s__check_wuffs_version("+
|
||||
"&self->private_impl.%s%s, sizeof(self->private_impl.%s%s), WUFFS_VERSION);\n",
|
||||
b.printf("wuffs_base__status z = %s%s__initialize("+
|
||||
"&self->private_impl.%s%s, sizeof(self->private_impl.%s%s), WUFFS_VERSION, initialize_flags);\n",
|
||||
prefix, qid[1].Str(g.tm), fPrefix, f.Name().Str(g.tm), fPrefix, f.Name().Str(g.tm))
|
||||
b.printf("if (z) { return z; }\n")
|
||||
b.printf("}\n")
|
||||
@@ -994,6 +1008,15 @@ func (g *gen) writeInitializerImpl(b *buffer, n *a.Struct) error {
|
||||
b.writes("return NULL;\n")
|
||||
b.writes("}\n\n")
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
b.printf("wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //\n"+
|
||||
"%s%s__check_wuffs_version(%s%s *self, size_t sizeof_star_self, uint64_t wuffs_version) {",
|
||||
g.pkgPrefix, n.QID().Str(g.tm), g.pkgPrefix, n.QID().Str(g.tm))
|
||||
b.printf("return %s%s__initialize(self, sizeof_star_self, wuffs_version, WUFFS_INITIALIZE__ALREADY_ZEROED);\n",
|
||||
g.pkgPrefix, n.QID().Str(g.tm))
|
||||
b.writes("}\n\n")
|
||||
|
||||
if n.Public() {
|
||||
if err := g.writeSizeofSignature(b, n); err != nil {
|
||||
return err
|
||||
|
||||
@@ -32,9 +32,9 @@ const baseImageImplC = "" +
|
||||
""
|
||||
|
||||
const baseCorePrivateH = "" +
|
||||
"static inline void wuffs_base__ignore_check_wuffs_version_status(\n wuffs_base__status z) {}\n\n// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.\n// It's not foolproof, given C doesn't automatically zero memory before use,\n// but it should catch 99.99% of cases.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\n\n// WUFFS_BASE__DISABLED is a magic number to indicate that a non-recoverable\n// error was previously encountered.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"disabled\").\n#define WUFFS_BASE__DISABLED ((uint32_t)0x075AE3D2)\n\n// Denote intentional fallthroughs for -Wimplicit-fallthrough.\n//\n// The order matters here. Clang also defines \"__GNUC__\".\n#if defined(__clang__) && __cplusplus >= 201103L\n#define WUFFS_BASE__FALLTHROUGH [[clang::fallthrough]]\n#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 7)\n#define WUFFS_BASE__FALLTHROUGH __attribute__((fallthrough))\n#else\n#define WUFFS_BASE" +
|
||||
"__FALLTHROUGH\n#endif\n\n// Use switch cases for coroutine suspension points, similar to the technique\n// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html\n//\n// We use trivial macros instead of an explicit assignment and case statement\n// so that clang-format doesn't get confused by the unusual \"case\"s.\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0 case 0:;\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT(n) \\\n coro_susp_point = n; \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (!status) { \\\n goto ok; \\\n } else if (*status != '$') { \\\n goto exit; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; " +
|
||||
" \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluate more than once.\n//\n// They are static, so that linking multiple wuffs .o files won't complain about\n// duplicate function definitions.\n//\n// They are explicitly marked inline, even if modern compilers don't use the\n// inline attribute to guide optimizations such as inlining, to avoid the\n// -Wunused-function warning, and we like to compile with -Wall -Werror.\n\nstatic inline wuffs_base__empty_struct //\nwuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n" +
|
||||
"static inline void //\nwuffs_base__ignore_status(wuffs_base__status z) {}\n\n// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.\n// It's not foolproof, given C doesn't automatically zero memory before use,\n// but it should catch 99.99% of cases.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\n\n// WUFFS_BASE__DISABLED is a magic number to indicate that a non-recoverable\n// error was previously encountered.\n//\n// Its (non-zero) value is arbitrary, based on md5sum(\"disabled\").\n#define WUFFS_BASE__DISABLED ((uint32_t)0x075AE3D2)\n\n// Denote intentional fallthroughs for -Wimplicit-fallthrough.\n//\n// The order matters here. Clang also defines \"__GNUC__\".\n#if defined(__clang__) && __cplusplus >= 201103L\n#define WUFFS_BASE__FALLTHROUGH [[clang::fallthrough]]\n#elif !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 7)\n#define WUFFS_BASE__FALLTHROUGH __attribute__((fallthrough))\n#else\n#define WUFFS_BASE__FALLTHROUGH\n#endif\n" +
|
||||
"\n// Use switch cases for coroutine suspension points, similar to the technique\n// in https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html\n//\n// We use trivial macros instead of an explicit assignment and case statement\n// so that clang-format doesn't get confused by the unusual \"case\"s.\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_0 case 0:;\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT(n) \\\n coro_susp_point = n; \\\n WUFFS_BASE__FALLTHROUGH; \\\n case n:;\n\n#define WUFFS_BASE__COROUTINE_SUSPENSION_POINT_MAYBE_SUSPEND(n) \\\n if (!status) { \\\n goto ok; \\\n } else if (*status != '$') { \\\n goto exit; \\\n } \\\n coro_susp_point = n; \\\n goto suspend; " +
|
||||
" \\\n case n:;\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__LIKELY(expr) (__builtin_expect(!!(expr), 1))\n#define WUFFS_BASE__UNLIKELY(expr) (__builtin_expect(!!(expr), 0))\n#else\n#define WUFFS_BASE__LIKELY(expr) (expr)\n#define WUFFS_BASE__UNLIKELY(expr) (expr)\n#endif\n\n// The helpers below are functions, instead of macros, because their arguments\n// can be an expression that we shouldn't evaluate more than once.\n//\n// They are static, so that linking multiple wuffs .o files won't complain about\n// duplicate function definitions.\n//\n// They are explicitly marked inline, even if modern compilers don't use the\n// inline attribute to guide optimizations such as inlining, to avoid the\n// -Wunused-function warning, and we like to compile with -Wall -Werror.\n\nstatic inline wuffs_base__empty_struct //\nwuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n" +
|
||||
"" +
|
||||
"// ---------------- Numeric Types\n\nstatic inline uint8_t //\nwuffs_base__load_u8be(uint8_t* p) {\n return p[0];\n}\n\nstatic inline uint16_t //\nwuffs_base__load_u16be(uint8_t* p) {\n return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);\n}\n\nstatic inline uint16_t //\nwuffs_base__load_u16le(uint8_t* p) {\n return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u24be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 16) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 0);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u24le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 16);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u32be(uint8_t* p) {\n return ((uint32_t)(p[0]) << 24) | ((uint32_t)(p[1]) << 16) |\n ((uint32_t)(p[2]) << 8) | ((uint32_t)(p[3]) << 0);\n}\n\nstatic inline uint32_t //\nwuffs_base__load_u32le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uin" +
|
||||
"t32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);\n}\n\nstatic inline uint64_t //\nwuffs_base__load_u40be(uint8_t* p) {\n return ((uint64_t)(p[0]) << 32) | ((uint64_t)(p[1]) << 24) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 8) |\n ((uint64_t)(p[4]) << 0);\n}\n\nstatic inline uint64_t //\nwuffs_base__load_u40le(uint8_t* p) {\n return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |\n ((uint64_t)(p[4]) << 32);\n}\n\nstatic inline uint64_t //\nwuffs_base__load_u48be(uint8_t* p) {\n return ((uint64_t)(p[0]) << 40) | ((uint64_t)(p[1]) << 32) |\n ((uint64_t)(p[2]) << 24) | ((uint64_t)(p[3]) << 16) |\n ((uint64_t)(p[4]) << 8) | ((uint64_t)(p[5]) << 0);\n}\n\nstatic inline uint64_t //\nwuffs_base__load_u48le(uint8_t* p) {\n return ((uint64_t)(p[0]) << 0) | ((uint64_t)(p[1]) << 8) |\n ((uint64_t)(p[2]) << 16) | ((uint64_t)(p[3]) << 24) |\n ((uint64_t)(p[4]) << 32) | ((uint64_t)(p[5]) << 40);\n}\n\nstatic inline u" +
|
||||
@@ -56,15 +56,17 @@ const baseCorePrivateH = "" +
|
||||
"" +
|
||||
"// ---------------- Slices and Tables (Utility)\n\nstatic inline wuffs_base__slice_u8 //\nwuffs_base__utility__null_slice_u8() {\n return ((wuffs_base__slice_u8){});\n}\n\n" +
|
||||
"" +
|
||||
"// ---------------- Bureaucracy re -Wunused-function\n\nstatic inline void\nwuffs_base__acknowledge_potentially_unused_functions__core_private()\n WUFFS_BASE__POTENTIALLY_UNUSED;\n\nstatic inline void\nwuffs_base__acknowledge_potentially_unused_functions__core_private() {\n (void)(wuffs_base__load_u16be);\n (void)(wuffs_base__load_u16le);\n (void)(wuffs_base__load_u24be);\n (void)(wuffs_base__load_u24le);\n (void)(wuffs_base__load_u32be);\n (void)(wuffs_base__load_u32le);\n (void)(wuffs_base__load_u40be);\n (void)(wuffs_base__load_u40le);\n (void)(wuffs_base__load_u48be);\n (void)(wuffs_base__load_u48le);\n (void)(wuffs_base__load_u56be);\n (void)(wuffs_base__load_u56le);\n (void)(wuffs_base__load_u64be);\n (void)(wuffs_base__load_u64le);\n (void)(wuffs_base__load_u8be);\n (void)(wuffs_base__return_empty_struct);\n (void)(wuffs_base__slice_u8__copy_from_slice);\n (void)(wuffs_base__slice_u8__prefix);\n (void)(wuffs_base__slice_u8__suffix);\n (void)(wuffs_base__store_u16be);\n (void)(wuffs_base__store_u16le);\n (v" +
|
||||
"oid)(wuffs_base__store_u24be);\n (void)(wuffs_base__store_u24le);\n (void)(wuffs_base__store_u32be);\n (void)(wuffs_base__store_u32le);\n (void)(wuffs_base__store_u40be);\n (void)(wuffs_base__store_u40le);\n (void)(wuffs_base__store_u48be);\n (void)(wuffs_base__store_u48le);\n (void)(wuffs_base__store_u56be);\n (void)(wuffs_base__store_u56le);\n (void)(wuffs_base__store_u64be);\n (void)(wuffs_base__store_u64le);\n (void)(wuffs_base__store_u8be);\n (void)(wuffs_base__table_u8__row);\n (void)(wuffs_base__u16__sat_add_indirect);\n (void)(wuffs_base__u16__sat_sub_indirect);\n (void)(wuffs_base__u32__sat_add_indirect);\n (void)(wuffs_base__u32__sat_sub_indirect);\n (void)(wuffs_base__u64__sat_add_indirect);\n (void)(wuffs_base__u64__sat_sub_indirect);\n (void)(wuffs_base__u8__sat_add_indirect);\n (void)(wuffs_base__u8__sat_sub_indirect);\n (void)(wuffs_base__utility__null_slice_u8);\n}\n" +
|
||||
"// ---------------- Bureaucracy re -Wunused-function\n\nstatic inline void\nwuffs_base__acknowledge_potentially_unused_functions__core_private()\n WUFFS_BASE__POTENTIALLY_UNUSED;\n\nstatic inline void\nwuffs_base__acknowledge_potentially_unused_functions__core_private() {\n (void)(wuffs_base__ignore_status);\n (void)(wuffs_base__load_u16be);\n (void)(wuffs_base__load_u16le);\n (void)(wuffs_base__load_u24be);\n (void)(wuffs_base__load_u24le);\n (void)(wuffs_base__load_u32be);\n (void)(wuffs_base__load_u32le);\n (void)(wuffs_base__load_u40be);\n (void)(wuffs_base__load_u40le);\n (void)(wuffs_base__load_u48be);\n (void)(wuffs_base__load_u48le);\n (void)(wuffs_base__load_u56be);\n (void)(wuffs_base__load_u56le);\n (void)(wuffs_base__load_u64be);\n (void)(wuffs_base__load_u64le);\n (void)(wuffs_base__load_u8be);\n (void)(wuffs_base__return_empty_struct);\n (void)(wuffs_base__slice_u8__copy_from_slice);\n (void)(wuffs_base__slice_u8__prefix);\n (void)(wuffs_base__slice_u8__suffix);\n (void)(wuffs_base__store_u16be);\n " +
|
||||
"(void)(wuffs_base__store_u16le);\n (void)(wuffs_base__store_u24be);\n (void)(wuffs_base__store_u24le);\n (void)(wuffs_base__store_u32be);\n (void)(wuffs_base__store_u32le);\n (void)(wuffs_base__store_u40be);\n (void)(wuffs_base__store_u40le);\n (void)(wuffs_base__store_u48be);\n (void)(wuffs_base__store_u48le);\n (void)(wuffs_base__store_u56be);\n (void)(wuffs_base__store_u56le);\n (void)(wuffs_base__store_u64be);\n (void)(wuffs_base__store_u64le);\n (void)(wuffs_base__store_u8be);\n (void)(wuffs_base__table_u8__row);\n (void)(wuffs_base__u16__sat_add_indirect);\n (void)(wuffs_base__u16__sat_sub_indirect);\n (void)(wuffs_base__u32__sat_add_indirect);\n (void)(wuffs_base__u32__sat_sub_indirect);\n (void)(wuffs_base__u64__sat_add_indirect);\n (void)(wuffs_base__u64__sat_sub_indirect);\n (void)(wuffs_base__u8__sat_add_indirect);\n (void)(wuffs_base__u8__sat_sub_indirect);\n (void)(wuffs_base__utility__null_slice_u8);\n}\n" +
|
||||
""
|
||||
|
||||
const baseCorePublicH = "" +
|
||||
"// Wuffs assumes that:\n// - converting a uint32_t to a size_t will never overflow.\n// - converting a size_t to a uint64_t will never overflow.\n#ifdef __WORDSIZE\n#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size of either 32 or 64 bits\"\n#endif\n#endif\n\n// WUFFS_VERSION is the major.minor.patch version, as per https://semver.org/,\n// as a uint64_t. The major number is the high 32 bits. The minor number is the\n// middle 16 bits. The patch number is the low 16 bits. The pre-release label\n// and build metadata are part of the string representation (such as\n// \"1.2.3-beta+456.20181231\") but not the uint64_t representation.\n//\n// WUFFS_VERSION_PRE_RELEASE_LABEL (such as \"\", \"beta\" or \"rc.1\") being\n// non-empty denotes a developer preview, not a release version, and has no\n// backwards or forwards compatibility guarantees.\n//\n// WUFFS_VERSION_BUILD_METADATA_XXX, if non-zero, are the number of commits and\n// the last commit date in the repository used to build this library. Within\n// eac" +
|
||||
"h major.minor branch, the commit count should increase monotonically.\n//\n// !! Some code generation programs can override WUFFS_VERSION.\n#define WUFFS_VERSION ((uint64_t)0)\n#define WUFFS_VERSION_MAJOR ((uint64_t)0)\n#define WUFFS_VERSION_MINOR ((uint64_t)0)\n#define WUFFS_VERSION_PATCH ((uint64_t)0)\n#define WUFFS_VERSION_PRE_RELEASE_LABEL \"work.in.progress\"\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 0\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 0\n#define WUFFS_VERSION_STRING \"0.0.0+0.00000000\"\n\n// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have\n// static storage. The motivation is discussed in the \"ALLOW STATIC\n// IMPLEMENTATION\" section of\n// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt\n#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS\n#define WUFFS_BASE__MAYBE_STATIC static\n#else\n#define WUFFS_BASE__MAYBE_STATIC\n#endif\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__POTENTIALLY_UNUSED __attribute__((unused))\n#define WUFFS_BASE" +
|
||||
"__WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n#else\n#define WUFFS_BASE__POTENTIALLY_UNUSED\n#define WUFFS_BASE__WARN_UNUSED_RESULT\n#endif\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, you can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__empty_struct;\n\n// wuffs_base__utility is a placeholder" +
|
||||
" receiver type. It enables what Java\n// calls static methods, as opposed to regular methods.\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" +
|
||||
"__WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n#else\n#define WUFFS_BASE__POTENTIALLY_UNUSED\n#define WUFFS_BASE__WARN_UNUSED_RESULT\n#endif\n\n// Flags for wuffs_foo__bar__initialize functions.\n\n// WUFFS_INITIALIZE__ALREADY_ZEROED means that the \"self\" receiver struct value\n// has already been set to all zeroes.\n#define WUFFS_INITIALIZE__ALREADY_ZEROED ((uint32_t)0x00000001)\n\n" +
|
||||
"" +
|
||||
"// --------\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, you can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__empty_struct;\n\n// wuffs_base__utility is a placeholder receiver type. It enables what Java\n// calls static methods, as opposed to regular methods.\ntypedef struct {\n // private_impl is a pla" +
|
||||
"ceholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" +
|
||||
"" +
|
||||
"// --------\n\n// A status is either NULL (meaning OK) or a string message. That message is\n// human-readable, for programmers, but it is not for end users. It is not\n// localized, and does not contain additional contextual information such as a\n// source filename.\n//\n// Status strings are statically allocated and should never be free'd. They can\n// be compared by the == operator and not just by strcmp.\n//\n// Statuses come in four categories:\n// - OK: the request was completed, successfully.\n// - Warnings: the request was completed, unsuccessfully.\n// - Suspensions: the request was not completed, but can be re-tried.\n// - Errors: the request was not completed, permanently.\n//\n// When a function returns an incomplete status, a suspension means that that\n// function should be called again within a new context, such as after flushing\n// or re-filling an I/O buffer. An error means that an irrecoverable failure\n// state was reached.\ntypedef const char* wuffs_base__status;\n\n// !! INSERT wuffs_bas" +
|
||||
"e__status names.\n\nstatic inline bool //\nwuffs_base__status__is_complete(wuffs_base__status z) {\n return (z == NULL) || ((*z != '$') && (*z != '?'));\n}\n\nstatic inline bool //\nwuffs_base__status__is_error(wuffs_base__status z) {\n return z && (*z == '?');\n}\n\nstatic inline bool //\nwuffs_base__status__is_ok(wuffs_base__status z) {\n return z == NULL;\n}\n\nstatic inline bool //\nwuffs_base__status__is_suspension(wuffs_base__status z) {\n return z && (*z == '$');\n}\n\nstatic inline bool //\nwuffs_base__status__is_warning(wuffs_base__status z) {\n return z && (*z != '$') && (*z != '?');\n}\n\n" +
|
||||
|
||||
@@ -116,6 +116,8 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, depth uint32) error {
|
||||
// The middle part, the check_wuffs_version call, is optional, for
|
||||
// some built-in types.
|
||||
|
||||
// TODO: drop the memset and the WUFFS_INITIALIZE__ALREADY_ZEROED.
|
||||
|
||||
b.printf("(memset(%s", addr)
|
||||
// TODO: ensure that the recv expression is idempotent.
|
||||
if err := g.writeExpr(b, recv, depth); err != nil {
|
||||
@@ -124,14 +126,16 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, depth uint32) error {
|
||||
b.printf(", 0, sizeof ((%s%s){}))", g.packagePrefix(qid), qid[1].Str(g.tm))
|
||||
|
||||
if !isBaseRangeType(qid) {
|
||||
b.printf(", wuffs_base__ignore_check_wuffs_version_status("+
|
||||
"%s%s__check_wuffs_version(%s", g.packagePrefix(qid), qid[1].Str(g.tm), addr)
|
||||
b.printf(", wuffs_base__ignore_status("+
|
||||
"%s%s__initialize(%s", g.packagePrefix(qid), qid[1].Str(g.tm), addr)
|
||||
if err := g.writeExpr(b, recv, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.printf(", sizeof ((%s%s){}), WUFFS_VERSION))", g.packagePrefix(qid), qid[1].Str(g.tm))
|
||||
b.printf(", sizeof ((%s%s){}), WUFFS_VERSION, WUFFS_INITIALIZE__ALREADY_ZEROED))",
|
||||
g.packagePrefix(qid), qid[1].Str(g.tm))
|
||||
}
|
||||
|
||||
// TODO: wuffs_base__ignore_status could return an empty_struct.
|
||||
b.writes(", wuffs_base__return_empty_struct())")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -138,7 +138,9 @@ func (c *Checker) parseBuiltInFuncs(ss []string, generic bool) (map[t.QQID]*a.Fu
|
||||
}
|
||||
}
|
||||
}
|
||||
file, err := parse.Parse(c.tm, filename, tokens, nil)
|
||||
file, err := parse.Parse(c.tm, filename, tokens, &parse.Options{
|
||||
AllowBuiltInNames: true,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("check: parsing %q: could not parse built-in funcs: %v", s, err)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ func checkPackageName(s string) string {
|
||||
// Blacklist certain package names.
|
||||
switch s {
|
||||
case "base", "base_private", "base_private_header", "base_public", "base_public_header",
|
||||
"config", "implementation", "include_guard", "version":
|
||||
"config", "implementation", "include_guard", "initialize", "version":
|
||||
return ""
|
||||
}
|
||||
return s
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
AllowBuiltInNames bool
|
||||
AllowDoubleUnderscoreNames bool
|
||||
}
|
||||
|
||||
@@ -156,6 +157,13 @@ func (p *parser) parseTopLevelDecl() (*a.Node, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !p.opts.AllowBuiltInNames {
|
||||
switch id1 {
|
||||
case t.IDInitialize, t.IDReset:
|
||||
return nil, fmt.Errorf(`parse: cannot have a method named %q at %s:%d`,
|
||||
id1.Str(p.tm), p.filename, p.line())
|
||||
}
|
||||
}
|
||||
// TODO: should we require id0 != 0? In other words, always methods
|
||||
// (attached to receivers) and never free standing functions?
|
||||
if !p.opts.AllowDoubleUnderscoreNames && isDoubleUnderscore(p.tm.ByID(id1)) {
|
||||
|
||||
+8
-6
@@ -578,9 +578,10 @@ const (
|
||||
|
||||
// -------- 0x200 block.
|
||||
|
||||
IDReset = ID(0x200)
|
||||
IDSet = ID(0x201)
|
||||
IDUnroll = ID(0x202)
|
||||
IDInitialize = ID(0x200)
|
||||
IDReset = ID(0x201)
|
||||
IDSet = ID(0x202)
|
||||
IDUnroll = ID(0x203)
|
||||
|
||||
// TODO: range/rect methods like intersection and contains?
|
||||
|
||||
@@ -906,9 +907,10 @@ var builtInsByID = [nBuiltInIDs]string{
|
||||
|
||||
// -------- 0x200 block.
|
||||
|
||||
IDReset: "reset",
|
||||
IDSet: "set",
|
||||
IDUnroll: "unroll",
|
||||
IDInitialize: "initialize",
|
||||
IDReset: "reset",
|
||||
IDSet: "set",
|
||||
IDUnroll: "unroll",
|
||||
|
||||
IDHighBits: "high_bits",
|
||||
IDLowBits: "low_bits",
|
||||
|
||||
@@ -82,6 +82,14 @@ extern "C" {
|
||||
#define WUFFS_BASE__WARN_UNUSED_RESULT
|
||||
#endif
|
||||
|
||||
// Flags for wuffs_foo__bar__initialize functions.
|
||||
|
||||
// WUFFS_INITIALIZE__ALREADY_ZEROED means that the "self" receiver struct value
|
||||
// has already been set to all zeroes.
|
||||
#define WUFFS_INITIALIZE__ALREADY_ZEROED ((uint32_t)0x00000001)
|
||||
|
||||
// --------
|
||||
|
||||
// wuffs_base__empty_struct is used when a Wuffs function returns an empty
|
||||
// struct. In C, if a function f returns void, you can't say "x = f()", but in
|
||||
// Wuffs, if a function g returns empty, you can say "y = g()".
|
||||
@@ -2422,11 +2430,20 @@ typedef struct wuffs_adler32__hasher__struct wuffs_adler32__hasher;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_adler32__hasher__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_adler32__hasher__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_adler32__hasher__initialize(wuffs_adler32__hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -2492,10 +2509,19 @@ struct wuffs_adler32__hasher__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_adler32__hasher__initialize(this, sizeof_star_self,
|
||||
wuffs_version, initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_adler32__hasher__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_adler32__hasher__initialize(this, sizeof_star_self,
|
||||
wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline uint32_t //
|
||||
@@ -2534,11 +2560,20 @@ typedef struct wuffs_crc32__ieee_hasher__struct wuffs_crc32__ieee_hasher;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_crc32__ieee_hasher__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_crc32__ieee_hasher__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_crc32__ieee_hasher__initialize(wuffs_crc32__ieee_hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_crc32__ieee_hasher__check_wuffs_version(wuffs_crc32__ieee_hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -2603,10 +2638,19 @@ struct wuffs_crc32__ieee_hasher__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_crc32__ieee_hasher__initialize(
|
||||
this, sizeof_star_self, wuffs_version, initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_crc32__ieee_hasher__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_crc32__ieee_hasher__initialize(
|
||||
this, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline uint32_t //
|
||||
@@ -2666,11 +2710,20 @@ typedef struct wuffs_deflate__decoder__struct wuffs_deflate__decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_deflate__decoder__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_deflate__decoder__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_deflate__decoder__initialize(wuffs_deflate__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -2787,10 +2840,19 @@ struct wuffs_deflate__decoder__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_deflate__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version, initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_deflate__decoder__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_deflate__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline wuffs_base__range_ii_u64 //
|
||||
@@ -2846,11 +2908,20 @@ typedef struct wuffs_lzw__decoder__struct wuffs_lzw__decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_lzw__decoder__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_lzw__decoder__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_lzw__decoder__initialize(wuffs_lzw__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -2944,10 +3015,18 @@ struct wuffs_lzw__decoder__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_lzw__decoder__initialize(this, sizeof_star_self, wuffs_version,
|
||||
initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_lzw__decoder__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_lzw__decoder__initialize(this, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline wuffs_base__empty_struct //
|
||||
@@ -3017,11 +3096,20 @@ typedef struct wuffs_gif__decoder__struct wuffs_gif__decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_gif__decoder__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_gif__decoder__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gif__decoder__initialize(wuffs_gif__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -3204,10 +3292,18 @@ struct wuffs_gif__decoder__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_gif__decoder__initialize(this, sizeof_star_self, wuffs_version,
|
||||
initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_gif__decoder__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_gif__decoder__initialize(this, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline wuffs_base__status //
|
||||
@@ -3303,11 +3399,20 @@ typedef struct wuffs_gzip__decoder__struct wuffs_gzip__decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_gzip__decoder__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_gzip__decoder__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gzip__decoder__initialize(wuffs_gzip__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -3391,10 +3496,19 @@ struct wuffs_gzip__decoder__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_gzip__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version, initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_gzip__decoder__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_gzip__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline wuffs_base__empty_struct //
|
||||
@@ -3456,11 +3570,20 @@ typedef struct wuffs_zlib__decoder__struct wuffs_zlib__decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_zlib__decoder__check_wuffs_version is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_zlib__decoder__* function.
|
||||
// For any given "wuffs_foo__bar* self", "wuffs_foo__bar__initialize(self,
|
||||
// etc)" should be called before any other "wuffs_foo__bar__xxx(self, etc)".
|
||||
//
|
||||
// Pass sizeof(*self) and WUFFS_VERSION for sizeof_star_self and wuffs_version.
|
||||
// Pass 0 (or some combination of WUFFS_INITIALIZE__XXX) for initialize_flags.
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_zlib__decoder__initialize(wuffs_zlib__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags);
|
||||
|
||||
// Deprecated: use wuffs_foo__bar__initialize instead of
|
||||
// wuffs_foo__bar__check_wuffs_version.
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
@@ -3541,10 +3664,19 @@ struct wuffs_zlib__decoder__struct {
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
initialize(size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
return wuffs_zlib__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version, initialize_flags);
|
||||
}
|
||||
|
||||
inline wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
check_wuffs_version(size_t sizeof_star_self, uint64_t wuffs_version) {
|
||||
return wuffs_zlib__decoder__check_wuffs_version(this, sizeof_star_self,
|
||||
wuffs_version);
|
||||
return wuffs_zlib__decoder__initialize(this, sizeof_star_self,
|
||||
wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
inline wuffs_base__empty_struct //
|
||||
@@ -3588,8 +3720,8 @@ struct wuffs_zlib__decoder__struct {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static inline void wuffs_base__ignore_check_wuffs_version_status(
|
||||
wuffs_base__status z) {}
|
||||
static inline void //
|
||||
wuffs_base__ignore_status(wuffs_base__status z) {}
|
||||
|
||||
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
|
||||
// It's not foolproof, given C doesn't automatically zero memory before use,
|
||||
@@ -4012,6 +4144,7 @@ wuffs_base__acknowledge_potentially_unused_functions__core_private()
|
||||
|
||||
static inline void
|
||||
wuffs_base__acknowledge_potentially_unused_functions__core_private() {
|
||||
(void)(wuffs_base__ignore_status);
|
||||
(void)(wuffs_base__load_u16be);
|
||||
(void)(wuffs_base__load_u16le);
|
||||
(void)(wuffs_base__load_u24be);
|
||||
@@ -4717,9 +4850,10 @@ wuffs_base__pixel_swizzler__swizzle_packed(wuffs_base__pixel_swizzler* p,
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_adler32__hasher__initialize(wuffs_adler32__hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -4737,6 +4871,14 @@ wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_adler32__hasher__initialize(
|
||||
self, sizeof_star_self, wuffs_version, WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_adler32__hasher() {
|
||||
return sizeof((wuffs_adler32__hasher){});
|
||||
@@ -5705,9 +5847,10 @@ static const uint32_t //
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_crc32__ieee_hasher__check_wuffs_version(wuffs_crc32__ieee_hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_crc32__ieee_hasher__initialize(wuffs_crc32__ieee_hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -5725,6 +5868,14 @@ wuffs_crc32__ieee_hasher__check_wuffs_version(wuffs_crc32__ieee_hasher* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_crc32__ieee_hasher__check_wuffs_version(wuffs_crc32__ieee_hasher* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_crc32__ieee_hasher__initialize(
|
||||
self, sizeof_star_self, wuffs_version, WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_crc32__ieee_hasher() {
|
||||
return sizeof((wuffs_crc32__ieee_hasher){});
|
||||
@@ -5972,9 +6123,10 @@ wuffs_deflate__decoder__decode_huffman_slow(wuffs_deflate__decoder* self,
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_deflate__decoder__initialize(wuffs_deflate__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -5992,6 +6144,14 @@ wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_deflate__decoder__initialize(
|
||||
self, sizeof_star_self, wuffs_version, WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_deflate__decoder() {
|
||||
return sizeof((wuffs_deflate__decoder){});
|
||||
@@ -7744,9 +7904,10 @@ wuffs_lzw__decoder__write_to(wuffs_lzw__decoder* self,
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_lzw__decoder__initialize(wuffs_lzw__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -7764,6 +7925,14 @@ wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_lzw__decoder__initialize(self, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_lzw__decoder() {
|
||||
return sizeof((wuffs_lzw__decoder){});
|
||||
@@ -8308,9 +8477,10 @@ wuffs_gif__decoder__copy_to_image_buffer(wuffs_gif__decoder* self,
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_gif__decoder__initialize(wuffs_gif__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -8325,9 +8495,9 @@ wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
return wuffs_base__error__check_wuffs_version_not_applicable;
|
||||
}
|
||||
{
|
||||
wuffs_base__status z = wuffs_lzw__decoder__check_wuffs_version(
|
||||
wuffs_base__status z = wuffs_lzw__decoder__initialize(
|
||||
&self->private_impl.f_lzw, sizeof(self->private_impl.f_lzw),
|
||||
WUFFS_VERSION);
|
||||
WUFFS_VERSION, initialize_flags);
|
||||
if (z) {
|
||||
return z;
|
||||
}
|
||||
@@ -8336,6 +8506,14 @@ wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_gif__decoder__initialize(self, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_gif__decoder() {
|
||||
return sizeof((wuffs_gif__decoder){});
|
||||
@@ -10050,10 +10228,9 @@ wuffs_gif__decoder__decode_id_part1(wuffs_gif__decoder* self,
|
||||
}));
|
||||
if (self->private_impl.f_previous_lzw_decode_ended_abruptly) {
|
||||
(memset(&self->private_impl.f_lzw, 0, sizeof((wuffs_lzw__decoder){})),
|
||||
wuffs_base__ignore_check_wuffs_version_status(
|
||||
wuffs_lzw__decoder__check_wuffs_version(
|
||||
&self->private_impl.f_lzw, sizeof((wuffs_lzw__decoder){}),
|
||||
WUFFS_VERSION)),
|
||||
wuffs_base__ignore_status(wuffs_lzw__decoder__initialize(
|
||||
&self->private_impl.f_lzw, sizeof((wuffs_lzw__decoder){}),
|
||||
WUFFS_VERSION, WUFFS_INITIALIZE__ALREADY_ZEROED)),
|
||||
wuffs_base__return_empty_struct());
|
||||
}
|
||||
{
|
||||
@@ -10456,9 +10633,10 @@ const char* wuffs_gzip__error__bad_header = "?gzip: bad header";
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_gzip__decoder__initialize(wuffs_gzip__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -10473,17 +10651,17 @@ wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
return wuffs_base__error__check_wuffs_version_not_applicable;
|
||||
}
|
||||
{
|
||||
wuffs_base__status z = wuffs_crc32__ieee_hasher__check_wuffs_version(
|
||||
wuffs_base__status z = wuffs_crc32__ieee_hasher__initialize(
|
||||
&self->private_impl.f_checksum, sizeof(self->private_impl.f_checksum),
|
||||
WUFFS_VERSION);
|
||||
WUFFS_VERSION, initialize_flags);
|
||||
if (z) {
|
||||
return z;
|
||||
}
|
||||
}
|
||||
{
|
||||
wuffs_base__status z = wuffs_deflate__decoder__check_wuffs_version(
|
||||
wuffs_base__status z = wuffs_deflate__decoder__initialize(
|
||||
&self->private_impl.f_flate, sizeof(self->private_impl.f_flate),
|
||||
WUFFS_VERSION);
|
||||
WUFFS_VERSION, initialize_flags);
|
||||
if (z) {
|
||||
return z;
|
||||
}
|
||||
@@ -10492,6 +10670,14 @@ wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_gzip__decoder__initialize(self, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_gzip__decoder() {
|
||||
return sizeof((wuffs_gzip__decoder){});
|
||||
@@ -10918,9 +11104,10 @@ const char* wuffs_zlib__error__todo_unsupported_preset_dictionary =
|
||||
// ---------------- Initializer Implementations
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
wuffs_zlib__decoder__initialize(wuffs_zlib__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version,
|
||||
uint32_t initialize_flags) {
|
||||
if (!self) {
|
||||
return wuffs_base__error__bad_receiver;
|
||||
}
|
||||
@@ -10935,17 +11122,17 @@ wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
return wuffs_base__error__check_wuffs_version_not_applicable;
|
||||
}
|
||||
{
|
||||
wuffs_base__status z = wuffs_adler32__hasher__check_wuffs_version(
|
||||
wuffs_base__status z = wuffs_adler32__hasher__initialize(
|
||||
&self->private_impl.f_checksum, sizeof(self->private_impl.f_checksum),
|
||||
WUFFS_VERSION);
|
||||
WUFFS_VERSION, initialize_flags);
|
||||
if (z) {
|
||||
return z;
|
||||
}
|
||||
}
|
||||
{
|
||||
wuffs_base__status z = wuffs_deflate__decoder__check_wuffs_version(
|
||||
wuffs_base__status z = wuffs_deflate__decoder__initialize(
|
||||
&self->private_impl.f_flate, sizeof(self->private_impl.f_flate),
|
||||
WUFFS_VERSION);
|
||||
WUFFS_VERSION, initialize_flags);
|
||||
if (z) {
|
||||
return z;
|
||||
}
|
||||
@@ -10954,6 +11141,14 @@ wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wuffs_base__status WUFFS_BASE__WARN_UNUSED_RESULT //
|
||||
wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
size_t sizeof_star_self,
|
||||
uint64_t wuffs_version) {
|
||||
return wuffs_zlib__decoder__initialize(self, sizeof_star_self, wuffs_version,
|
||||
WUFFS_INITIALIZE__ALREADY_ZEROED);
|
||||
}
|
||||
|
||||
size_t //
|
||||
sizeof__wuffs_zlib__decoder() {
|
||||
return sizeof((wuffs_zlib__decoder){});
|
||||
|
||||
Reference in new issue
Block a user