From a177e798f4e1e3d7aa20cc7e7797cfe98edd1a3e Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 10 Jun 2018 08:11:38 +1000 Subject: [PATCH] Delete some obsolete base-private comments --- cmd/wuffs-c/internal/cgen/base/base-private.h | 17 ++++------------- cmd/wuffs-c/internal/cgen/data.go | 8 ++++---- gen/c/std/adler32.c | 17 ++++------------- gen/c/std/crc32.c | 17 ++++------------- gen/c/std/deflate.c | 17 ++++------------- gen/c/std/gif.c | 17 ++++------------- gen/c/std/gzip.c | 17 ++++------------- gen/c/std/lzw.c | 17 ++++------------- gen/c/std/zlib.c | 17 ++++------------- 9 files changed, 36 insertions(+), 108 deletions(-) diff --git a/cmd/wuffs-c/internal/cgen/base/base-private.h b/cmd/wuffs-c/internal/cgen/base/base-private.h index 4c8c0edd..991417d3 100644 --- a/cmd/wuffs-c/internal/cgen/base/base-private.h +++ b/cmd/wuffs-c/internal/cgen/base/base-private.h @@ -14,10 +14,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -68,18 +64,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -87,6 +74,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/cmd/wuffs-c/internal/cgen/data.go b/cmd/wuffs-c/internal/cgen/data.go index ff222a4a..9a4201b2 100644 --- a/cmd/wuffs-c/internal/cgen/data.go +++ b/cmd/wuffs-c/internal/cgen/data.go @@ -91,10 +91,10 @@ const basePublicH = "" + "" const basePrivateH = "" + - "// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nstatic inline wuffs_base__empty_struct wuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)\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, base" + - "d on md5sum(\"wuffs\").\n#define WUFFS_BASE__MAGIC ((uint32_t)0x3CCB6C71)\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 < 0) { \\\n goto exit; \\\n } else if (status == 0) { \\\n goto ok; \\\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// Uncomment this #include for printf-debugging.\n// #include \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 a" + - "re in base-impl.h and hence copy/pasted into every generated C file,\n// instead of being in some \"base.c\" file, since a design goal is that users of\n// the generated C code can often just #include a single .c file, such as\n// \"gif.c\", without having to additionally include or otherwise build and link\n// a \"base.c\" file.\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\n" + + "// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x)\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// Denote intentional fallthroughs for -Wimplic" + + "it-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 < 0) { \\\n goto exit; " + + " \\\n } else if (status == 0) { \\\n goto ok; \\\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// i" + + "nline 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 wuffs_base__return_empty_struct() {\n return ((wuffs_base__empty_struct){});\n}\n\n" + "" + "// ---------------- Numeric Types\n\nstatic inline uint16_t wuffs_base__load_u16be(uint8_t* p) {\n return ((uint16_t)(p[0]) << 8) | ((uint16_t)(p[1]) << 0);\n}\n\nstatic inline uint16_t wuffs_base__load_u16le(uint8_t* p) {\n return ((uint16_t)(p[0]) << 0) | ((uint16_t)(p[1]) << 8);\n}\n\nstatic inline uint32_t wuffs_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 wuffs_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 wuffs_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 wuffs_base__load_u32le(uint8_t* p) {\n return ((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8) |\n ((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24);\n}\n\nstatic inline uint64_t wuffs_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 wuffs_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 wuffs_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 wuffs_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 uint64_t wuffs_base__load_u56be(uint8_t* p) {\n return ((uint64_t)(p[0]) << 48) | ((uint64_t)(p[1]) << 40) |\n ((u" + diff --git a/gen/c/std/adler32.c b/gen/c/std/adler32.c index cfb71480..643dfa6a 100644 --- a/gen/c/std/adler32.c +++ b/gen/c/std/adler32.c @@ -1322,10 +1322,6 @@ uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self, // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1376,18 +1372,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1395,6 +1382,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/crc32.c b/gen/c/std/crc32.c index 5bc70924..594d0b58 100644 --- a/gen/c/std/crc32.c +++ b/gen/c/std/crc32.c @@ -1321,10 +1321,6 @@ uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self, // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1375,18 +1371,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1394,6 +1381,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/deflate.c b/gen/c/std/deflate.c index 57cc5e06..5c29cf8b 100644 --- a/gen/c/std/deflate.c +++ b/gen/c/std/deflate.c @@ -1412,10 +1412,6 @@ wuffs_deflate__status wuffs_deflate__decoder__decode( // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1466,18 +1462,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1485,6 +1472,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/gif.c b/gen/c/std/gif.c index 6e3e28ca..cdd4ed26 100644 --- a/gen/c/std/gif.c +++ b/gen/c/std/gif.c @@ -1551,10 +1551,6 @@ wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1( // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1605,18 +1601,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1624,6 +1611,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/gzip.c b/gen/c/std/gzip.c index b6b8993e..72d70bea 100644 --- a/gen/c/std/gzip.c +++ b/gen/c/std/gzip.c @@ -1624,10 +1624,6 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self, // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1678,18 +1674,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1697,6 +1684,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/lzw.c b/gen/c/std/lzw.c index e7d43626..8e253352 100644 --- a/gen/c/std/lzw.c +++ b/gen/c/std/lzw.c @@ -1345,10 +1345,6 @@ wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self, // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1399,18 +1395,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1418,6 +1405,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) { diff --git a/gen/c/std/zlib.c b/gen/c/std/zlib.c index 9eabafb9..25d31fce 100644 --- a/gen/c/std/zlib.c +++ b/gen/c/std/zlib.c @@ -1623,10 +1623,6 @@ wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self, // See the License for the specific language governing permissions and // limitations under the License. -static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { - return ((wuffs_base__empty_struct){}); -} - #define WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(x) (void)(x) // WUFFS_BASE__MAGIC is a magic number to check that initializers are called. @@ -1677,18 +1673,9 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { #define WUFFS_BASE__UNLIKELY(expr) (expr) #endif -// Uncomment this #include for printf-debugging. -// #include - // The helpers below are functions, instead of macros, because their arguments // can be an expression that we shouldn't evaluate more than once. // -// They are in base-impl.h and hence copy/pasted into every generated C file, -// instead of being in some "base.c" file, since a design goal is that users of -// the generated C code can often just #include a single .c file, such as -// "gif.c", without having to additionally include or otherwise build and link -// a "base.c" file. -// // They are static, so that linking multiple wuffs .o files won't complain about // duplicate function definitions. // @@ -1696,6 +1683,10 @@ static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { // inline attribute to guide optimizations such as inlining, to avoid the // -Wunused-function warning, and we like to compile with -Wall -Werror. +static inline wuffs_base__empty_struct wuffs_base__return_empty_struct() { + return ((wuffs_base__empty_struct){}); +} + // ---------------- Numeric Types static inline uint16_t wuffs_base__load_u16be(uint8_t* p) {