mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Use more inclusive language
This commit is contained in:
1 parent
07b5e017e1
commit
2f78804e62
46 files changed
+101
-101
No files matched your search
+2
-2
@@ -15,8 +15,8 @@
|
||||
|
||||
# ----------------
|
||||
|
||||
# This script, build-all.sh, is a simple sanity check that the tests pass and
|
||||
# the example programs (including fuzz programs) compile.
|
||||
# This script, build-all.sh, is a simple coherence check that the tests pass
|
||||
# and the example programs (including fuzz programs) compile.
|
||||
#
|
||||
# If you're just looking to get started with Wuffs, running this script isn't
|
||||
# necessary (as Wuffs doesn't have the "configure; make; make install" dance or
|
||||
|
||||
+2
-2
@@ -461,8 +461,8 @@ func decode(inFile *os.File) error {
|
||||
|
||||
if !*singlethreadedFlag {
|
||||
n := runtime.NumCPU()
|
||||
// After 16 workers, we seem to hit diminishing speed returns, but
|
||||
// still face increasing memory costs.
|
||||
// After 16 workers, we see diminishing speed returns, but still face
|
||||
// increasing memory costs.
|
||||
if n > 16 {
|
||||
n = 16
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ libpng for PNG, etc.
|
||||
|
||||
If your library change is an optimization, run `wuffs bench` or `wuffs bench
|
||||
-mimic` both before and after your change to quantify the improvement. The
|
||||
mimic benchmark numbers shouldn't change if you're only changing `.wuffs`
|
||||
code, but seeing zero change in those numbers is a sanity check on any
|
||||
unrelated system variance, such as software updates or virus checkers running
|
||||
in the background.
|
||||
mimic benchmark numbers shouldn't change if you're only changing `.wuffs` code,
|
||||
but seeing zero change in those numbers is a coherence check on any unrelated
|
||||
system variance, such as software updates or virus checkers running in the
|
||||
background.
|
||||
@@ -79,13 +79,13 @@ code](https://github.com/google/wuffs/blob/master/doc/benchmarks.md) (albeit
|
||||
requiring re-writing those libraries).
|
||||
|
||||
|
||||
## Termination
|
||||
## Halting
|
||||
|
||||
Wuffs functions are not guaranteed to terminate. We do not solve the [Halting
|
||||
Wuffs functions are not guaranteed to halt. We do not solve the [Halting
|
||||
Problem](https://en.wikipedia.org/wiki/Halting_problem). Furthermore, while
|
||||
there is a difference in theory between a function that doesn't terminate and
|
||||
one that terminates in 99 years, in practice there is not. Systems that already
|
||||
need to cope with the latter can also cope with the former.
|
||||
there is a difference in theory between a function that doesn't halt and one
|
||||
that halts in 99 years, in practice there is not. Systems that already need to
|
||||
cope with the latter can also cope with the former.
|
||||
|
||||
|
||||
## Timing and Other Attacks
|
||||
|
||||
@@ -47,8 +47,8 @@ for a C++ compiler $CXX, such as clang++ or g++.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -40,8 +40,8 @@ https://skia-review.googlesource.com/c/skia/+/290618
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -72,8 +72,8 @@ micros_since_start(struct timespec* now) {
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -45,8 +45,8 @@ The Escape key quits.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -47,8 +47,8 @@ for a C++ compiler $CXX, such as clang++ or g++.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -79,8 +79,8 @@ for a C++ compiler $CXX, such as clang++ or g++.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -115,8 +115,8 @@ for a C++ compiler $CXX, such as clang++ or g++.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ for a C compiler $CC, such as clang or gcc.
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN bmp_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN cbor_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
@@ -401,7 +401,7 @@ fuzz(wuffs_base__io_buffer* full_src, uint64_t hash) {
|
||||
//
|
||||
// The fuzz_simple implementation shows how easy decoding with Wuffs is when
|
||||
// all you want is to run LLVMFuzzerTestOneInput's built-in (Wuffs API
|
||||
// agnostic) checks (e.g. the ASan address sanitizer) and you don't really
|
||||
// independent) checks (e.g. the ASan address sanitizer) and you don't really
|
||||
// care what the output is, just that it doesn't crash.
|
||||
//
|
||||
// The fuzz_complex implementation adds many more Wuffs API specific checks
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN gif_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN json_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
@@ -421,7 +421,7 @@ fuzz(wuffs_base__io_buffer* full_src, uint64_t hash) {
|
||||
//
|
||||
// The fuzz_simple implementation shows how easy decoding with Wuffs is when
|
||||
// all you want is to run LLVMFuzzerTestOneInput's built-in (Wuffs API
|
||||
// agnostic) checks (e.g. the ASan address sanitizer) and you don't really
|
||||
// independent) checks (e.g. the ASan address sanitizer) and you don't really
|
||||
// care what the output is, just that it doesn't crash.
|
||||
//
|
||||
// The fuzz_complex implementation adds many more Wuffs API specific checks
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN png_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
This fuzzer (the fuzz function) is typically run indirectly, by a framework
|
||||
such as https://github.com/google/oss-fuzz calling LLVMFuzzerTestOneInput.
|
||||
|
||||
When working on the fuzz implementation, or as a sanity check, defining
|
||||
When working on the fuzz implementation, or as a coherence check, defining
|
||||
WUFFS_CONFIG__FUZZLIB_MAIN will let you manually run fuzz over a set of files:
|
||||
|
||||
gcc -DWUFFS_CONFIG__FUZZLIB_MAIN zlib_fuzzer.c
|
||||
@@ -43,8 +43,8 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -678,7 +678,7 @@ func (g *gen) genIncludes(b *buffer) error {
|
||||
useDirname := g.tm.ByID(tld.AsUse().Path())
|
||||
useDirname, _ = t.Unescape(useDirname)
|
||||
|
||||
// TODO: sanity check useDirname via commonflags.IsValidUsePath?
|
||||
// TODO: coherence check useDirname via commonflags.IsValidUsePath?
|
||||
|
||||
if _, ok := usesMap[useDirname]; ok {
|
||||
continue
|
||||
|
||||
@@ -86,7 +86,7 @@ func checkPackageName(s string) string {
|
||||
return ""
|
||||
}
|
||||
s = strings.ToLower(s)
|
||||
// Blacklist certain package names.
|
||||
// Deny certain package names.
|
||||
switch s {
|
||||
case "base", "base_private", "base_private_header", "base_public", "base_public_header",
|
||||
"config", "implementation", "include_guard", "initialize", "version":
|
||||
|
||||
+1
-1
@@ -808,7 +808,7 @@ var builtInsByID = [nBuiltInIDs]string{
|
||||
// specifically non-ASCII so that no user-defined (non built-in) identifier
|
||||
// will conflict with them.
|
||||
|
||||
// IDDaggerN is used by the type checker as a dummy-valued built-in ID to
|
||||
// IDDaggerN is used by the type checker as a placeholder built-in ID to
|
||||
// represent a generic type.
|
||||
IDT1: "T1",
|
||||
IDT2: "T2",
|
||||
|
||||
@@ -75,7 +75,7 @@ const (
|
||||
gap = 1 << 10
|
||||
)
|
||||
|
||||
// Interpolate translates from Level (a codec-agnostic concept) to a
|
||||
// Interpolate translates from Level (a codec-independent concept) to a
|
||||
// codec-specific compression level numbering scheme. For exampe, a zlib
|
||||
// package might translate LevelFastest to 1 and LevelSmallest to 9 by calling
|
||||
// Interpolate(1, 2, 6, 9, 9).
|
||||
|
||||
+1
-1
@@ -114,7 +114,7 @@ type Reader struct {
|
||||
//
|
||||
// - "State B" (decompressor is non-zero, inImplicitZeroes is zero): a RAC
|
||||
// chunk is loaded, but not fully exhausted: decompressing the e.g. zlib
|
||||
// stream has not hit io.EOF yet.
|
||||
// stream has not seen io.EOF yet.
|
||||
//
|
||||
// - "State C" (decompressor is zero, inImplicitZeroes is non-zero): a RAC
|
||||
// chunk was exhausted, and we now serve the implicit NUL bytes after a
|
||||
|
||||
@@ -98,7 +98,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn decode(dst: &mut [u8], src: &[u8]) {
|
||||
// Set up the hard-coded sanity check, executed below.
|
||||
// Set up the hard-coded coherence check, executed below.
|
||||
dst[0] = 0xFE;
|
||||
dst[NUM_BYTES - 1] = 0xFE;
|
||||
|
||||
@@ -123,7 +123,7 @@ fn decode(dst: &mut [u8], src: &[u8]) {
|
||||
panic!("wrong num_bytes")
|
||||
}
|
||||
|
||||
// A hard-coded sanity check that we decoded the pixel data correctly.
|
||||
// A hard-coded coherence check that we decoded the pixel data correctly.
|
||||
if (dst[0] != FIRST_PIXEL) || (dst[NUM_BYTES - 1] != LAST_PIXEL) {
|
||||
panic!("wrong dst pixels")
|
||||
}
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ func main1() error {
|
||||
urlsChan <- u
|
||||
}
|
||||
close(urlsChan)
|
||||
log.Printf("master: no more work (inlimit is %d)", *inlimitFlag)
|
||||
log.Printf("controller: no more work (inlimit is %d)", *inlimitFlag)
|
||||
wg.Wait()
|
||||
|
||||
return flush(global.manifest.m)
|
||||
|
||||
@@ -110,7 +110,7 @@ func decode(filename string) error {
|
||||
return fmt.Errorf("TODO: support gzip HCRC flag")
|
||||
}
|
||||
|
||||
// As a sanity check, the result should be valid deflate.
|
||||
// As a coherence check, the result should be valid deflate.
|
||||
uncompressed, err := checkDeflate(src[i:])
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -161,7 +161,7 @@ func doWriteZlib(deflateCompressed []byte, uncompressed []byte, filename string)
|
||||
|
||||
asZlib := buf.Bytes()
|
||||
|
||||
// As a sanity check, the result should be valid zlib.
|
||||
// As a coherence check, the result should be valid zlib.
|
||||
if _, err := checkZlib(asZlib); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -453,7 +453,7 @@ func (a *nAssignedCodes) fillPrimaryValues(primLen uint32) {
|
||||
panic("did not finish with one unassigned zero-length code")
|
||||
}
|
||||
|
||||
// As a sanity check of the "negative two's complement" theory, loop
|
||||
// As a coherence check of the "negative two's complement" theory, loop
|
||||
// forwards to calculate the number of unassigned primLen length codes,
|
||||
// which should match nUnassignedPrimLen.
|
||||
nUnassigned := uint32(1)
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -1157,8 +1157,8 @@ pub func decoder.tell_me_more?(dst: base.io_writer, minfo: nptr base.more_inform
|
||||
y: this.io_redirect_pos,
|
||||
z: 0xFFFF_FFFF_FFFF_FFFF)
|
||||
}
|
||||
// Setting io_redirect_fourcc to a dummy value of 1 will cause future calls
|
||||
// to return an error.
|
||||
// Setting io_redirect_fourcc to a placeholder value of 1 will cause future
|
||||
// calls to return an error.
|
||||
this.io_redirect_fourcc = 1
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ When copying the suffix to a buffer (either an intermediate buffer or a final
|
||||
buffer), it is often unnecessary to copy *exactly* suffix length bytes,
|
||||
provided that there is enough destination buffer space for all Q bytes. Even if
|
||||
we write excess bytes, decoding subsequent codes will overwrite the excess, or
|
||||
else we'll hit an end code and the excess will be ignored. Again, on modern
|
||||
else we'll get an end code and the excess will be ignored. Again, on modern
|
||||
CPUs, it can be faster to write *at least 7* bytes (i.e. *exactly 8*) than to
|
||||
write *exactly 7*.
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+2
-2
@@ -52,8 +52,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
+5
-5
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
@@ -107,7 +107,7 @@ test_wuffs_pixel_swizzler_swizzle() {
|
||||
|
||||
const uint32_t width = 22;
|
||||
const uint32_t height = 5;
|
||||
uint8_t dummy_palette_array[1024];
|
||||
uint8_t fallback_palette_array[1024];
|
||||
wuffs_base__pixel_swizzler swizzler;
|
||||
|
||||
const struct {
|
||||
@@ -221,8 +221,8 @@ test_wuffs_pixel_swizzler_swizzle() {
|
||||
wuffs_base__pixel_buffer__palette(&dst_pixbuf);
|
||||
if (dst_palette.len == 0) {
|
||||
dst_palette = wuffs_base__make_slice_u8(
|
||||
&dummy_palette_array[0],
|
||||
WUFFS_TESTLIB_ARRAY_SIZE(dummy_palette_array));
|
||||
&fallback_palette_array[0],
|
||||
WUFFS_TESTLIB_ARRAY_SIZE(fallback_palette_array));
|
||||
}
|
||||
|
||||
int b;
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ the first "./a.out" with "./a.out -bench". Combine these changes with the
|
||||
#define WUFFS_IMPLEMENTATION
|
||||
|
||||
// Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users of
|
||||
// release/c/etc.c whitelist which parts of Wuffs to build. That file contains
|
||||
// the entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// release/c/etc.c choose which parts of Wuffs to build. That file contains the
|
||||
// entire Wuffs standard library, implementing a variety of codecs and file
|
||||
// formats. Without this macro definition, an optimizing compiler or linker may
|
||||
// very well discard Wuffs code for unused codecs, but listing the Wuffs
|
||||
// modules we use makes that process explicit. Preprocessing means that such
|
||||
|
||||
@@ -677,18 +677,18 @@ read_file(wuffs_base__io_buffer* dst, const char* path) {
|
||||
errno);
|
||||
}
|
||||
|
||||
uint8_t dummy[1];
|
||||
uint8_t placeholder[1];
|
||||
uint8_t* ptr = dst->data.ptr + dst->meta.wi;
|
||||
size_t len = dst->data.len - dst->meta.wi;
|
||||
while (true) {
|
||||
if (!len) {
|
||||
// We have read all that dst can hold. Check that we have read the full
|
||||
// file by trying to read one more byte, which should fail with EOF.
|
||||
ptr = dummy;
|
||||
ptr = placeholder;
|
||||
len = 1;
|
||||
}
|
||||
size_t n = fread(ptr, 1, len, f);
|
||||
if (ptr != dummy) {
|
||||
if (ptr != placeholder) {
|
||||
ptr += n;
|
||||
len -= n;
|
||||
dst->meta.wi += n;
|
||||
|
||||
Reference in new issue
Block a user