From df96e483419a156b5fdcea4974ffd23896bc8efd Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 10 Jun 2018 09:37:30 +1000 Subject: [PATCH] Rename some #ifndef WUFFS_BASE_HEADER_H guards --- cmd/wuffs-c/internal/cgen/base/base-public.h | 6 +++--- cmd/wuffs-c/internal/cgen/cgen.go | 18 +++++++++--------- cmd/wuffs-c/internal/cgen/data.go | 4 ++-- fuzz/c/fuzzlib/fuzzlib.c | 2 +- gen/c/base.c | 6 +++--- gen/c/std/adler32.c | 12 ++++++------ gen/c/std/crc32.c | 12 ++++++------ gen/c/std/deflate.c | 12 ++++++------ gen/c/std/gif.c | 12 ++++++------ gen/c/std/gzip.c | 12 ++++++------ gen/c/std/lzw.c | 12 ++++++------ gen/c/std/zlib.c | 12 ++++++------ gen/h/std/adler32.h | 6 +++--- gen/h/std/crc32.h | 6 +++--- gen/h/std/deflate.h | 6 +++--- gen/h/std/gif.h | 6 +++--- gen/h/std/gzip.h | 6 +++--- gen/h/std/lzw.h | 6 +++--- gen/h/std/zlib.h | 6 +++--- lang/check/optimize.go | 4 ++-- lang/generate/generate.go | 2 +- test/c/testlib/testlib.c | 6 +++--- 22 files changed, 87 insertions(+), 87 deletions(-) diff --git a/cmd/wuffs-c/internal/cgen/base/base-public.h b/cmd/wuffs-c/internal/cgen/base/base-public.h index 4621a5eb..990c4790 100644 --- a/cmd/wuffs-c/internal/cgen/base/base-public.h +++ b/cmd/wuffs-c/internal/cgen/base/base-public.h @@ -1,7 +1,7 @@ // After editing this file, run "go generate" in the parent directory. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1211,4 +1211,4 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H diff --git a/cmd/wuffs-c/internal/cgen/cgen.go b/cmd/wuffs-c/internal/cgen/cgen.go index fcc4343a..f28a2dd0 100644 --- a/cmd/wuffs-c/internal/cgen/cgen.go +++ b/cmd/wuffs-c/internal/cgen/cgen.go @@ -351,7 +351,7 @@ func (g *gen) genHeader(b *buffer) error { } func (g *gen) genImpl(b *buffer) error { - b.writes("#ifndef WUFFS_BASE_IMPL_H\n#define WUFFS_BASE_IMPL_H\n\n") + b.writes("#ifndef WUFFS_BASE_PRIVATE_H\n#define WUFFS_BASE_PRIVATE_H\n\n") b.writes(basePrivateH) b.writes("\n") b.printf("static const char* wuffs_base__status__strings[%d] = {\n", len(builtin.StatusList)) @@ -359,7 +359,7 @@ func (g *gen) genImpl(b *buffer) error { b.printf("%q,", z.Message) } b.writes("};\n\n") - b.writes("#endif // WUFFS_BASE_IMPL_H\n\n") + b.writes("#endif // WUFFS_BASE_PRIVATE_H\n\n") b.writes("// ---------------- Status Codes Implementations\n\n") b.printf("bool %sstatus__is_error(%sstatus s) { return s < 0; }\n\n", g.pkgPrefix, g.pkgPrefix) @@ -651,8 +651,8 @@ func (g *gen) writeStruct(b *buffer, n *a.Struct) error { } var ( - wuffsBaseHeaderHStart = []byte("#ifndef WUFFS_BASE_HEADER_H\n") - wuffsBaseHeaderHEnd = []byte("#endif // WUFFS_BASE_HEADER_H\n") + wuffsBasePublicHStart = []byte("#ifndef WUFFS_BASE_PUBLIC_H\n") + wuffsBasePublicHEnd = []byte("#endif // WUFFS_BASE_PUBLIC_H\n") ) func (g *gen) writeUse(b *buffer, n *a.Use) error { @@ -686,17 +686,17 @@ func (g *gen) writeUse(b *buffer, n *a.Use) error { b.printf("// ---------------- BEGIN USE %q\n\n", useDirname) // Inline the previously generated .h file, stripping out the redundant - // copy of the WUFFS_BASE_HEADER_H code. - if i := bytes.Index(hdr, wuffsBaseHeaderHStart); i < 0 { + // copy of the WUFFS_BASE_PUBLIC_H code. + if i := bytes.Index(hdr, wuffsBasePublicHStart); i < 0 { return fmt.Errorf("use %q: previously generated header %q could not be inlined", useDirname, hdrFilename) } else { b.Write(hdr[:i]) - hdr = hdr[i+len(wuffsBaseHeaderHStart):] + hdr = hdr[i+len(wuffsBasePublicHStart):] } - if i := bytes.Index(hdr, wuffsBaseHeaderHEnd); i < 0 { + if i := bytes.Index(hdr, wuffsBasePublicHEnd); i < 0 { return fmt.Errorf("use %q: previously generated header %q could not be inlined", useDirname, hdrFilename) } else { - b.Write(hdr[i+len(wuffsBaseHeaderHEnd):]) + b.Write(hdr[i+len(wuffsBasePublicHEnd):]) } b.writeb('\n') diff --git a/cmd/wuffs-c/internal/cgen/data.go b/cmd/wuffs-c/internal/cgen/data.go index e247e9db..d859d960 100644 --- a/cmd/wuffs-c/internal/cgen/data.go +++ b/cmd/wuffs-c/internal/cgen/data.go @@ -17,7 +17,7 @@ package cgen const basePublicH = "" + - "#ifndef WUFFS_BASE_HEADER_H\n#define WUFFS_BASE_HEADER_H\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#include \n#include \n#include \n\n// 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#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size of either 32 or 64 bits\"\n#endif\n\n// WUFFS_VERSION is the major.minor.patch version, " + + "#ifndef WUFFS_BASE_PUBLIC_H\n#define WUFFS_BASE_PUBLIC_H\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#include \n#include \n#include \n\n// 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#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size of either 32 or 64 bits\"\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 version extension\n// (such as \"\", \"beta\" or \"rc.1\") is part of the string representation (such as\n// \"1.2.3-beta\") but not the uint64_t representation.\n//\n// All three of major, minor and patch being zero means that this is a\n// work-in-progress version, not a release version, and has no backwards or\n// forwards compatibility guarantees.\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_EXTENSION \"\"\n#define WUFFS_VERSION_STRING \"0.0.0\"\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} wuffs_base__empty_struct;\n\n" + "" + @@ -87,7 +87,7 @@ const basePublicH = "" + "he image bounds.\n dirty_rect.max_exclusive_x = wuffs_base__u32__min(\n dirty_rect.max_exclusive_x, b->private_impl.config.private_impl.width);\n dirty_rect.max_exclusive_y = wuffs_base__u32__min(\n dirty_rect.max_exclusive_y, b->private_impl.config.private_impl.height);\n b->private_impl.dirty_rect = dirty_rect;\n\n b->private_impl.duration = duration;\n b->private_impl.blend = blend;\n b->private_impl.disposal = disposal;\n b->private_impl.palette_changed = palette.ptr && (palette.len == 1024);\n if (b->private_impl.palette_changed) {\n memmove(b->private_impl.palette, palette.ptr, 1024);\n }\n}\n\n// wuffs_base__image_buffer__loop returns whether the image decoder should loop\n// back to the beginning of the animation, assuming that we've reached the end\n// of the encoded stream. If so, it increments b's count of the animation loops\n// played so far.\nstatic inline bool wuffs_base__image_buffer__loop(wuffs_base__image_buffer* b) {\n if (!b) {\n return false;\n }\n uint32_t n = b->private_impl.config." + "private_impl.num_loops;\n if (n == 0) {\n return true;\n }\n if (b->private_impl.loop_count < n - 1) {\n b->private_impl.loop_count++;\n return true;\n }\n return false;\n}\n\n// wuffs_base__image_config returns the overall configuration for this frame.\nstatic inline wuffs_base__image_config* wuffs_base__image_buffer__image_config(\n wuffs_base__image_buffer* b) {\n return b ? &b->private_impl.config : NULL;\n}\n\n// wuffs_base__image_buffer__dirty_rect returns an upper bound for what part of\n// this frame's pixels differs from the previous frame.\nstatic inline wuffs_base__rect_ie_u32 wuffs_base__image_buffer__dirty_rect(\n wuffs_base__image_buffer* b) {\n return b ? b->private_impl.dirty_rect : ((wuffs_base__rect_ie_u32){0});\n}\n\n// wuffs_base__image_buffer__duration returns the amount of time to display\n// this frame. Zero means to display forever - a still (non-animated) image.\nstatic inline wuffs_base__flicks wuffs_base__image_buffer__duration(\n wuffs_base__image_buffer* b) {\n return b ? b->private" + "_impl.duration : 0;\n}\n\n// wuffs_base__image_buffer__blend returns, for a transparent image, whether to\n// blend this frame with the existing canvas.\n//\n// In Porter-Duff compositing operator terminology, false means \"src\" and true\n// means \"src over dst\".\nstatic inline bool wuffs_base__image_buffer__blend(\n wuffs_base__image_buffer* b) {\n return b && b->private_impl.blend;\n}\n\n// wuffs_base__image_buffer__disposal returns, for an animated image, how to\n// dispose of this frame after displaying it.\nstatic inline wuffs_base__animation_disposal wuffs_base__image_buffer__disposal(\n wuffs_base__image_buffer* b) {\n return b ? b->private_impl.disposal : 0;\n}\n\n// wuffs_base__image_buffer__palette_changed returns whether this frame's\n// palette differs from the previous frame. It is conservative and may return\n// false positives (but never false negatives).\nstatic inline bool wuffs_base__image_buffer__palette_changed(\n wuffs_base__image_buffer* b) {\n return b && b->private_impl.palette_changed;\n}\n\n// wuffs_" + - "base__image_buffer__palette returns the palette that the pixel data\n// can index. The backing array is inside b and has length 1024.\nstatic inline wuffs_base__slice_u8 wuffs_base__image_buffer__palette(\n wuffs_base__image_buffer* b) {\n return b ? ((wuffs_base__slice_u8){.ptr = b->private_impl.palette,\n .len = 1024})\n : ((wuffs_base__slice_u8){});\n}\n\nstatic inline wuffs_base__table_u8 wuffs_base__image_buffer__plane(\n wuffs_base__image_buffer* b,\n uint32_t p) {\n return (b && (p < WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX))\n ? b->private_impl.pixbuf.planes[p]\n : ((wuffs_base__table_u8){});\n}\n\n#endif // WUFFS_BASE_HEADER_H\n" + + "base__image_buffer__palette returns the palette that the pixel data\n// can index. The backing array is inside b and has length 1024.\nstatic inline wuffs_base__slice_u8 wuffs_base__image_buffer__palette(\n wuffs_base__image_buffer* b) {\n return b ? ((wuffs_base__slice_u8){.ptr = b->private_impl.palette,\n .len = 1024})\n : ((wuffs_base__slice_u8){});\n}\n\nstatic inline wuffs_base__table_u8 wuffs_base__image_buffer__plane(\n wuffs_base__image_buffer* b,\n uint32_t p) {\n return (b && (p < WUFFS_BASE__PIXEL_FORMAT__NUM_PLANES_MAX))\n ? b->private_impl.pixbuf.planes[p]\n : ((wuffs_base__table_u8){});\n}\n\n#endif // WUFFS_BASE_PUBLIC_H\n" + "" const basePrivateH = "" + diff --git a/fuzz/c/fuzzlib/fuzzlib.c b/fuzz/c/fuzzlib/fuzzlib.c index afd8f183..0627fb59 100644 --- a/fuzz/c/fuzzlib/fuzzlib.c +++ b/fuzz/c/fuzzlib/fuzzlib.c @@ -16,7 +16,7 @@ #include #include -#ifndef WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H #error "Wuffs' .c or .h files need to be included before this file" #endif diff --git a/gen/c/base.c b/gen/c/base.c index 2ff2c5c1..f2cab935 100644 --- a/gen/c/base.c +++ b/gen/c/base.c @@ -14,8 +14,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1225,7 +1225,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H const char* wuffs_base__status__string(int32_t s) { return "unknown status"; diff --git a/gen/c/std/adler32.c b/gen/c/std/adler32.c index 643dfa6a..a5d0a11d 100644 --- a/gen/c/std/adler32.c +++ b/gen/c/std/adler32.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1305,8 +1305,8 @@ uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self, // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -1871,7 +1871,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/crc32.c b/gen/c/std/crc32.c index 594d0b58..dec7c034 100644 --- a/gen/c/std/crc32.c +++ b/gen/c/std/crc32.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1304,8 +1304,8 @@ uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self, // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -1870,7 +1870,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/deflate.c b/gen/c/std/deflate.c index 5c29cf8b..c87f4a3e 100644 --- a/gen/c/std/deflate.c +++ b/gen/c/std/deflate.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1395,8 +1395,8 @@ wuffs_deflate__status wuffs_deflate__decoder__decode( // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -1961,7 +1961,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/gif.c b/gen/c/std/gif.c index cdd4ed26..fd3366aa 100644 --- a/gen/c/std/gif.c +++ b/gen/c/std/gif.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1534,8 +1534,8 @@ wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1( // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -2100,7 +2100,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/gzip.c b/gen/c/std/gzip.c index 72d70bea..72e8f4a9 100644 --- a/gen/c/std/gzip.c +++ b/gen/c/std/gzip.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1607,8 +1607,8 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self, // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -2173,7 +2173,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/lzw.c b/gen/c/std/lzw.c index 8e253352..60794350 100644 --- a/gen/c/std/lzw.c +++ b/gen/c/std/lzw.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1328,8 +1328,8 @@ wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self, // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -1894,7 +1894,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/c/std/zlib.c b/gen/c/std/zlib.c index 25d31fce..bdf841a7 100644 --- a/gen/c/std/zlib.c +++ b/gen/c/std/zlib.c @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations @@ -1606,8 +1606,8 @@ wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self, // C HEADER ENDS HERE. -#ifndef WUFFS_BASE_IMPL_H -#define WUFFS_BASE_IMPL_H +#ifndef WUFFS_BASE_PRIVATE_H +#define WUFFS_BASE_PRIVATE_H // Copyright 2017 The Wuffs Authors. // @@ -2172,7 +2172,7 @@ static const char* wuffs_base__status__strings[15] = { "end of data", }; -#endif // WUFFS_BASE_IMPL_H +#endif // WUFFS_BASE_PRIVATE_H // ---------------- Status Codes Implementations diff --git a/gen/h/std/adler32.h b/gen/h/std/adler32.h index 979b5179..1fc09faa 100644 --- a/gen/h/std/adler32.h +++ b/gen/h/std/adler32.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/crc32.h b/gen/h/std/crc32.h index 044c91d6..80e6c945 100644 --- a/gen/h/std/crc32.h +++ b/gen/h/std/crc32.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/deflate.h b/gen/h/std/deflate.h index b7e3f16d..e23b6ecc 100644 --- a/gen/h/std/deflate.h +++ b/gen/h/std/deflate.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/gif.h b/gen/h/std/gif.h index ebfb699d..4b345e46 100644 --- a/gen/h/std/gif.h +++ b/gen/h/std/gif.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/gzip.h b/gen/h/std/gzip.h index 3910c2f4..009db986 100644 --- a/gen/h/std/gzip.h +++ b/gen/h/std/gzip.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/lzw.h b/gen/h/std/lzw.h index 1148403a..d31c076e 100644 --- a/gen/h/std/lzw.h +++ b/gen/h/std/lzw.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/gen/h/std/zlib.h b/gen/h/std/zlib.h index b9063f14..5af0a45c 100644 --- a/gen/h/std/zlib.h +++ b/gen/h/std/zlib.h @@ -3,8 +3,8 @@ // Code generated by wuffs-c. DO NOT EDIT. -#ifndef WUFFS_BASE_HEADER_H -#define WUFFS_BASE_HEADER_H +#ifndef WUFFS_BASE_PUBLIC_H +#define WUFFS_BASE_PUBLIC_H // Copyright 2017 The Wuffs Authors. // @@ -1214,7 +1214,7 @@ static inline wuffs_base__table_u8 wuffs_base__image_buffer__plane( : ((wuffs_base__table_u8){}); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H // ---------------- Use Declarations diff --git a/lang/check/optimize.go b/lang/check/optimize.go index 8b909868..b5344725 100644 --- a/lang/check/optimize.go +++ b/lang/check/optimize.go @@ -71,8 +71,8 @@ func (q *checker) optimizeNonSuspendible(n *a.Expr) error { } // optimizeCopyFromHistory32 checks if the code generator can call the Bounds -// Check Optimized version of CopyFromHistory32. As per cgen/base-impl.h, the -// conditions are: +// Check Optimized version of CopyFromHistory32. As per cgen's base-private.h, +// the conditions are: // - distance > 0 // - distance <= (*ptr_ptr - start) // - length <= (end - *ptr_ptr) diff --git a/lang/generate/generate.go b/lang/generate/generate.go index 85ba38ed..1c45dfab 100644 --- a/lang/generate/generate.go +++ b/lang/generate/generate.go @@ -91,7 +91,7 @@ func checkPackageName(s string) string { s = strings.ToLower(s) // Blacklist certain package names. switch s { - case "base", "base_header", "base_impl", "config", "version": + case "base", "base_private_header", "base_public_header", "config", "version": return "" } return s diff --git a/test/c/testlib/testlib.c b/test/c/testlib/testlib.c index 80728c46..97db7ca9 100644 --- a/test/c/testlib/testlib.c +++ b/test/c/testlib/testlib.c @@ -288,8 +288,8 @@ int test_main(int argc, char** argv, proc* tests, proc* benches) { return 0; } -// WUFFS_BASE_HEADER_H is where wuffs_base__foo_bar are defined. -#ifdef WUFFS_BASE_HEADER_H +// WUFFS_BASE_PUBLIC_H is where wuffs_base__foo_bar are defined. +#ifdef WUFFS_BASE_PUBLIC_H wuffs_base__rect_ie_u32 make_rect_ie_u32(uint32_t x0, uint32_t y0, @@ -609,4 +609,4 @@ bool do_test_io_buffers(const char* (*codec_func)(wuffs_base__io_buffer*, return proc_io_buffers(codec_func, tc_neither, gt, wlimit, rlimit, 1, false); } -#endif // WUFFS_BASE_HEADER_H +#endif // WUFFS_BASE_PUBLIC_H