Commit Graph
44 Commits
Author SHA1 Message Date
Patrick Georgi f563f32f82 Add SPDX identifier to license headers
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.

In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao 74a6ea2fcd all: relicense from Apache2 to dual Apache2/MIT
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).

If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.

The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c

Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao 255d3a0a29 Fix C++ "init-statement in selection" warning 2023-01-26 15:39:23 +11:00
Nigel Tao e915543f09 Fix jsonfindptrs "internal error" false positive 2022-12-08 15:07:42 +11:00
Nigel Tao ca33506c01 Add wuffs_aux::FooArgBar types for optional args
Prior to this commit, with a "wuffs_aux::Foo(x, y, 0, 0, 4, 5)" call,
with arguments after "y" optional, it was not a compile-time error to
give the wrong number of "0"s or to transpose "4" and "5".
2021-10-18 00:25:13 +11:00
Nigel Tao 7f9f37ce5a Have examples use WUFFS_CONFIG__STATIC_FUNCTIONS
Compile time:
$ time ./build-example.sh
Before: user 1m15.750s
After:  user 0m50.343s

Binary size (excluding the statically linked example-toy-genlib):
$ ls -l gen/bin/example-* | awk '{print $5 " " $9}'

Before:
212624 gen/bin/example-cbor-to-json
284192 gen/bin/example-convert-to-nia
344744 gen/bin/example-crc32
184304 gen/bin/example-gifplayer
324952 gen/bin/example-imageviewer
209632 gen/bin/example-json-to-cbor
241432 gen/bin/example-jsonfindptrs
196320 gen/bin/example-jsonptr
309768 gen/bin/example-sdl-imageviewer
200704 gen/bin/example-zcat

After:
 85280 gen/bin/example-cbor-to-json
242216 gen/bin/example-convert-to-nia
344744 gen/bin/example-crc32
 53328 gen/bin/example-gifplayer
282840 gen/bin/example-imageviewer
 95152 gen/bin/example-json-to-cbor
122720 gen/bin/example-jsonfindptrs
 60448 gen/bin/example-jsonptr
267672 gen/bin/example-sdl-imageviewer
 64792 gen/bin/example-zcat

Before total: 2508672
After  total: 1619192
2021-10-04 12:35:32 +11:00
Nigel Tao 816475b285 Add "b" (for "binary") to fopen calls
Updates #50
2021-07-07 20:28:35 +10:00
Nigel Tao a51867dc63 Fix "forseen" typo 2021-05-19 21:34:09 +10:00
Nigel Tao 041267957c Add example/json* -input-jwcc and -jwcc flags 2021-02-22 12:29:14 +11:00
Nigel Tao 2f78804e62 Use more inclusive language 2021-01-23 19:50:47 +11:00
Nigel Tao 904004e79a Let non-strict JSON Pointer syntax allow "~t" 2020-11-15 20:56:04 +11:00
Nigel Tao 8d779ae1cd Add jsonfindptrs -only-parse-dont-output flag 2020-08-29 23:10:08 +10:00
Nigel Tao 5396dbd17d Have jsonfindptrs use C++17's std::variant
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real    0m7.333s
After:
real    0m5.970s
Ratio: 1.23x

Using "/usr/bin/time -v" instead of "time"
Before this commit:
Maximum resident set size (kbytes): 2556992
After:
Maximum resident set size (kbytes): 1214812
Ratio: 2.10x
2020-08-29 22:23:15 +10:00
Nigel Tao 9d69939f2c Have jsonfindptrs factor out escape_needed
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real    0m7.550s
After:
real    0m7.333s
Ratio: 1.03x
2020-08-29 10:56:37 +10:00
Nigel Tao b6c01b3464 Have jsonfindptrs cache std::to_string(i)
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real    0m8.822s
After:
real    0m7.550s
Ratio: 1.17x
2020-08-29 10:46:04 +10:00
Nigel Tao 8098d96113 Have jsonfindptrs re-use the output string buffer
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real    0m9.774s
After:
real    0m8.822s
Ratio: 1.11x
2020-08-29 10:41:05 +10:00
Nigel Tao feded888dd Have jsonfindptrs not flush stdout after each line
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonfindptrs < citylots.json > /dev/null
Before this commit:
real	0m21.104s
After:
real	0m9.774s
Ratio: 2.16x
2020-08-29 10:33:41 +10:00
Nigel Tao 7fd3bb661a Fix -Wswitch in example/jsonfindptrs 2020-08-24 21:34:53 +10:00
Nigel Tao 0a0c7d68aa Optimize example/*json*'s indentation output
On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonptr < citylots.json > /dev/null
Before this commit:
real    0m3.612s
After:
real    0m1.949s
Ratio: 1.85x
2020-08-19 00:02:30 +10:00
Nigel Tao 2742a4f4be Have wuffs_aux take lvalue (not rvalue) references 2020-08-17 00:02:49 +10:00
Nigel Tao b3438434ca Add json QUIRK_JSON_POINTER_ALLOW_TILDE_R_TILDE_N 2020-08-13 00:06:56 +10:00
Nigel Tao 8aac6767bb Add example/jsonfindptrs -query=STR flag 2020-08-12 23:18:37 +10:00
Nigel Tao ca5da1fb9d Have example C++ programs use override specifier 2020-08-10 15:30:12 +10:00
Nigel Tao 6d81764e14 Tweak wuffs_aux::DecodeJsonCallbacks 2020-08-09 23:15:41 +10:00
Nigel Tao 0a5940d399 Tweak example/jsonfindptrs -input-etc flags 2020-08-07 13:15:41 +10:00
Nigel Tao 50bfab9998 Tweak example/*/*.cc compile instructions 2020-08-05 11:39:09 +10:00
Nigel Tao cf6c578973 Add aux library 2020-08-04 23:43:38 +10:00
Nigel Tao d6a10dfe8a Add io_buffer.{read,writ}er_slice methods 2020-07-27 11:47:47 +10:00
Nigel Tao ecadf72e6b Rename some example/json* flags 2020-07-13 08:25:59 +10:00
Nigel Tao e0ca5a4c3c Have base_16 codec return a transform__output 2020-07-09 21:09:19 +10:00
Nigel Tao c766bb72d6 Have example/jsonetc read and write extra commas 2020-07-09 13:15:36 +10:00
Nigel Tao 6b7ce30e32 Add wuffs_base__parse_number_xxx options arg 2020-07-07 16:19:46 +10:00
Nigel Tao 496e88b6c5 Remove wuffs_base__token__link_prev 2020-04-09 22:11:08 +10:00
Nigel Tao df3acfbb21 Clarify std/json quirk_allow_backslash_x semantics 2020-04-08 11:08:01 +10:00
Nigel Tao b5d6f8d038 Have example/jsonfindptrs check unpaired keys 2020-04-06 20:57:40 +10:00
Nigel Tao 345f1aa060 Remove jsonfindptrs unnecessary curly braces 2020-04-05 22:10:37 +10:00
Nigel Tao 721190afff Have example C++ program check for -std=c++11 2020-04-03 22:25:21 +11:00
Nigel Tao 94440cf6ff Rename example/json* -o flag 2020-04-02 22:28:24 +11:00
Nigel Tao 462f86675d Add an "extended token" concept 2020-04-02 11:20:45 +11:00
Nigel Tao d60815c93f Have example/* global variable names start with g_ 2020-03-26 14:32:35 +11:00
Nigel Tao f3146c2ea9 Add base.token_decoder.workbuf_len 2020-03-26 08:47:42 +11:00
Nigel Tao 502c8eff56 Add std/json quirk_allow_backslash_x 2020-03-21 21:42:30 +11:00
Nigel Tao 18ef5b458c Fix -Wswitch warnings in example/json* 2020-03-16 10:37:47 +11:00
Nigel Tao d0b16cb492 Add example/jsonfindptrs 2020-03-15 23:15:07 +11:00