diff --git a/example/library/library.c b/example/library/library.c index 61c647bf..7a61eea4 100644 --- a/example/library/library.c +++ b/example/library/library.c @@ -53,7 +53,7 @@ uint8_t lgtm_ptr[] = { }; size_t lgtm_len = 20; -#define WORK_BUFFER_SIZE WUFFS_DEFLATE__DECODER_WORKBUF_LEN_MAX_INCL +#define WORK_BUFFER_SIZE WUFFS_DEFLATE__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE uint8_t work_buffer[WORK_BUFFER_SIZE]; // ignore_return_value suppresses errors from -Wall -Werror. diff --git a/example/zcat/zcat.c b/example/zcat/zcat.c index 8706072d..1443157a 100644 --- a/example/zcat/zcat.c +++ b/example/zcat/zcat.c @@ -69,7 +69,7 @@ for a C compiler $CC, such as clang or gcc. #define SRC_BUFFER_SIZE (128 * 1024) #endif -#define WORK_BUFFER_SIZE WUFFS_GZIP__DECODER_WORKBUF_LEN_MAX_INCL +#define WORK_BUFFER_SIZE WUFFS_GZIP__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE uint8_t dst_buffer[DST_BUFFER_SIZE]; uint8_t src_buffer[SRC_BUFFER_SIZE]; diff --git a/fuzz/c/std/zlib_fuzzer.c b/fuzz/c/std/zlib_fuzzer.c index dc04971a..9455adbe 100644 --- a/fuzz/c/std/zlib_fuzzer.c +++ b/fuzz/c/std/zlib_fuzzer.c @@ -48,7 +48,7 @@ It should print "PASS", amongst other information, and exit(0). #include "../../../release/c/wuffs-unsupported-snapshot.c" #include "../fuzzlib/fuzzlib.c" -#define WORK_BUFFER_SIZE WUFFS_ZLIB__DECODER_WORKBUF_LEN_MAX_INCL +#define WORK_BUFFER_SIZE WUFFS_ZLIB__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE uint8_t work_buffer[WORK_BUFFER_SIZE]; const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) { diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index f93fd9ab..336744b3 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -2639,10 +2639,10 @@ extern const char* wuffs_deflate__error__no_huffman_codes; // ---------------- Public Consts -#define WUFFS_DEFLATE__DECODER_WORKBUF_LEN_MAX_INCL 33280 +#define WUFFS_DEFLATE__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 33280 -static const uint64_t // - wuffs_deflate__decoder_workbuf_len_max_incl // +static const uint64_t // + wuffs_deflate__decoder_workbuf_len_max_incl_worst_case // WUFFS_BASE__POTENTIALLY_UNUSED = 33280; // ---------------- Struct Declarations @@ -2820,10 +2820,10 @@ extern const char* wuffs_lzw__error__bad_code; // ---------------- Public Consts -#define WUFFS_LZW__DECODER_WORKBUF_LEN_MAX_INCL 0 +#define WUFFS_LZW__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 0 -static const uint64_t // - wuffs_lzw__decoder_workbuf_len_max_incl // +static const uint64_t // + wuffs_lzw__decoder_workbuf_len_max_incl_worst_case // WUFFS_BASE__POTENTIALLY_UNUSED = 0; // ---------------- Struct Declarations @@ -2994,10 +2994,10 @@ extern const char* wuffs_gif__error__too_much_pixel_data; // ---------------- Public Consts -#define WUFFS_GIF__DECODER_WORKBUF_LEN_MAX_INCL 65535 +#define WUFFS_GIF__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 65535 -static const uint64_t // - wuffs_gif__decoder_workbuf_len_max_incl // +static const uint64_t // + wuffs_gif__decoder_workbuf_len_max_incl_worst_case // WUFFS_BASE__POTENTIALLY_UNUSED = 65535; // ---------------- Struct Declarations @@ -3289,10 +3289,10 @@ extern const char* wuffs_gzip__error__bad_header; // ---------------- Public Consts -#define WUFFS_GZIP__DECODER_WORKBUF_LEN_MAX_INCL 33280 +#define WUFFS_GZIP__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 33280 -static const uint64_t // - wuffs_gzip__decoder_workbuf_len_max_incl // +static const uint64_t // + wuffs_gzip__decoder_workbuf_len_max_incl_worst_case // WUFFS_BASE__POTENTIALLY_UNUSED = 33280; // ---------------- Struct Declarations @@ -3441,10 +3441,10 @@ extern const char* wuffs_zlib__error__bad_parity_check; // ---------------- Public Consts -#define WUFFS_ZLIB__DECODER_WORKBUF_LEN_MAX_INCL 33280 +#define WUFFS_ZLIB__DECODER_WORKBUF_LEN_MAX_INCL_WORST_CASE 33280 -static const uint64_t // - wuffs_zlib__decoder_workbuf_len_max_incl // +static const uint64_t // + wuffs_zlib__decoder_workbuf_len_max_incl_worst_case // WUFFS_BASE__POTENTIALLY_UNUSED = 33280; // ---------------- Struct Declarations diff --git a/std/deflate/decode_deflate.wuffs b/std/deflate/decode_deflate.wuffs index f1e4956d..06a857e4 100644 --- a/std/deflate/decode_deflate.wuffs +++ b/std/deflate/decode_deflate.wuffs @@ -31,7 +31,7 @@ pri status "?internal error: inconsistent I/O" pri status "?internal error: inconsistent distance" pri status "?internal error: inconsistent n_bits" -pub const decoder_workbuf_len_max_incl base.u64 = 32768 + 512 +pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 32768 + 512 // The next two tables were created by script/print-deflate-magic-numbers.go. // @@ -127,8 +127,8 @@ pub struct decoder?( pub func decoder.workbuf_len() base.range_ii_u64 { return this.util.make_range_ii_u64( - min_incl:decoder_workbuf_len_max_incl, - max_incl:decoder_workbuf_len_max_incl) + min_incl:decoder_workbuf_len_max_incl_worst_case, + max_incl:decoder_workbuf_len_max_incl_worst_case) } pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workbuf slice base.u8) { diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index b0e4327d..4d4c3056 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -24,8 +24,8 @@ pub status "?too much pixel data" pri status "?internal error: inconsistent ri/wi" -// TODO: reference lzw.decoder_workbuf_len_max_incl. -pub const decoder_workbuf_len_max_incl base.u64 = 0xFFFF +// TODO: reference lzw.decoder_workbuf_len_max_incl_worst_case. +pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 0xFFFF // See the spec appendix E "Interlaced Images" on page 29. The first element // represents either that the frame was non-interlaced, or that all interlace diff --git a/std/gzip/decode_gzip.wuffs b/std/gzip/decode_gzip.wuffs index a1e84377..9bad0a45 100644 --- a/std/gzip/decode_gzip.wuffs +++ b/std/gzip/decode_gzip.wuffs @@ -20,8 +20,8 @@ pub status "?bad compression method" pub status "?bad encoding flags" pub status "?bad header" -// TODO: reference deflate.decoder_workbuf_len_max_incl. -pub const decoder_workbuf_len_max_incl base.u64 = 32768 + 512 +// TODO: reference deflate.decoder_workbuf_len_max_incl_worst_case. +pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 32768 + 512 pub struct decoder?( flate deflate.decoder, @@ -36,8 +36,8 @@ pub func decoder.set_ignore_checksum!(ic base.bool) { pub func decoder.workbuf_len() base.range_ii_u64 { return this.util.make_range_ii_u64( - min_incl:decoder_workbuf_len_max_incl, - max_incl:decoder_workbuf_len_max_incl) + min_incl:decoder_workbuf_len_max_incl_worst_case, + max_incl:decoder_workbuf_len_max_incl_worst_case) } pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workbuf slice base.u8) { diff --git a/std/lzw/decode_lzw.wuffs b/std/lzw/decode_lzw.wuffs index 038448a7..d1aebb8f 100644 --- a/std/lzw/decode_lzw.wuffs +++ b/std/lzw/decode_lzw.wuffs @@ -24,7 +24,7 @@ pri status "?internal error: inconsistent I/O" // - 85be5b9 Delete the obsolete lzw.decoder.suffixes array // and the roll back has combined numbers: // - 3056a84 Roll back 3 recent lzw.decoder.suffixes commits -pub const decoder_workbuf_len_max_incl base.u64 = 0 +pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 0 pub struct decoder?( // The value passed to set_literal_width. This lw field is copied to the diff --git a/std/zlib/decode_zlib.wuffs b/std/zlib/decode_zlib.wuffs index f7d749d0..ad2e345a 100644 --- a/std/zlib/decode_zlib.wuffs +++ b/std/zlib/decode_zlib.wuffs @@ -22,8 +22,8 @@ pub status "?bad parity check" pri status "?TODO: unsupported preset dictionary" -// TODO: reference deflate.decoder_workbuf_len_max_incl. -pub const decoder_workbuf_len_max_incl base.u64 = 32768 + 512 +// TODO: reference deflate.decoder_workbuf_len_max_incl_worst_case. +pub const decoder_workbuf_len_max_incl_worst_case base.u64 = 32768 + 512 pub struct decoder?( flate deflate.decoder, @@ -38,8 +38,8 @@ pub func decoder.set_ignore_checksum!(ic base.bool) { pub func decoder.workbuf_len() base.range_ii_u64 { return this.util.make_range_ii_u64( - min_incl:decoder_workbuf_len_max_incl, - max_incl:decoder_workbuf_len_max_incl) + min_incl:decoder_workbuf_len_max_incl_worst_case, + max_incl:decoder_workbuf_len_max_incl_worst_case) } pub func decoder.decode_io_writer?(dst base.io_writer, src base.io_reader, workbuf slice base.u8) {