mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b69ebf4606 | ||
|
|
5527993842 | ||
|
|
32a23a9bb5 |
No files matched your search
@@ -276,14 +276,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
uint8_t* q = s.ptr + s.len;
|
uint8_t* q = s.ptr + s.len;
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse sign.
|
// Parse sign.
|
||||||
do {
|
do {
|
||||||
@@ -296,14 +294,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
||||||
@@ -355,9 +351,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
||||||
h->digits[nd++] = (uint8_t)(*p - '0');
|
h->digits[nd++] = (uint8_t)(*p - '0');
|
||||||
dp = (int32_t)nd;
|
dp = (int32_t)nd;
|
||||||
} else if ('0' != *p) {
|
} else {
|
||||||
// Long-tail non-zeroes set the truncated bit.
|
dp++;
|
||||||
h->truncated = true;
|
if ('0' != *p) {
|
||||||
|
// Long-tail non-zeroes set the truncated bit.
|
||||||
|
h->truncated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (*p ==
|
} else if (*p ==
|
||||||
((options &
|
((options &
|
||||||
@@ -417,14 +416,12 @@ after_sep:
|
|||||||
after_exp:
|
after_exp:
|
||||||
do {
|
do {
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t exp_sign = +1;
|
int32_t exp_sign = +1;
|
||||||
if (*p == '+') {
|
if (*p == '+') {
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto hexadecimal;
|
goto hexadecimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
|
|
||||||
} else if ((*p == 'd') || (*p == 'D')) {
|
} else if ((*p == 'd') || (*p == 'D')) {
|
||||||
p++;
|
p++;
|
||||||
@@ -229,6 +230,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto decimal;
|
goto decimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import (
|
|||||||
"github.com/google/wuffs/lib/litonlylzma"
|
"github.com/google/wuffs/lib/litonlylzma"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleRoundTripLZMA() {
|
func Example_roundTripLZMA() {
|
||||||
original := []byte("Hello world.\n")
|
original := []byte("Hello world.\n")
|
||||||
compressed, err := litonlylzma.FileFormatLZMA.Encode(nil, original)
|
compressed, err := litonlylzma.FileFormatLZMA.Encode(nil, original)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -49,7 +49,7 @@ func ExampleRoundTripLZMA() {
|
|||||||
// Hello world.
|
// Hello world.
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleRoundTripXz() {
|
func Example_roundTripXz() {
|
||||||
original := []byte("Hello world.\n")
|
original := []byte("Hello world.\n")
|
||||||
compressed, err := litonlylzma.FileFormatXz.Encode(nil, original)
|
compressed, err := litonlylzma.FileFormatXz.Encode(nil, original)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import (
|
|||||||
"github.com/google/wuffs/lib/zlibcut"
|
"github.com/google/wuffs/lib/zlibcut"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleCut() {
|
func Example() {
|
||||||
const sonnet18 = "" +
|
const sonnet18 = "" +
|
||||||
"Shall I compare thee to a summer’s day?\n" +
|
"Shall I compare thee to a summer’s day?\n" +
|
||||||
"Thou art more lovely and more temperate.\n" +
|
"Thou art more lovely and more temperate.\n" +
|
||||||
|
|||||||
@@ -13793,14 +13793,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
uint8_t* q = s.ptr + s.len;
|
uint8_t* q = s.ptr + s.len;
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse sign.
|
// Parse sign.
|
||||||
do {
|
do {
|
||||||
@@ -13813,14 +13811,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
||||||
@@ -13872,9 +13868,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
||||||
h->digits[nd++] = (uint8_t)(*p - '0');
|
h->digits[nd++] = (uint8_t)(*p - '0');
|
||||||
dp = (int32_t)nd;
|
dp = (int32_t)nd;
|
||||||
} else if ('0' != *p) {
|
} else {
|
||||||
// Long-tail non-zeroes set the truncated bit.
|
dp++;
|
||||||
h->truncated = true;
|
if ('0' != *p) {
|
||||||
|
// Long-tail non-zeroes set the truncated bit.
|
||||||
|
h->truncated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (*p ==
|
} else if (*p ==
|
||||||
((options &
|
((options &
|
||||||
@@ -13934,14 +13933,12 @@ after_sep:
|
|||||||
after_exp:
|
after_exp:
|
||||||
do {
|
do {
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t exp_sign = +1;
|
int32_t exp_sign = +1;
|
||||||
if (*p == '+') {
|
if (*p == '+') {
|
||||||
@@ -15750,6 +15747,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto hexadecimal;
|
goto hexadecimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
|
|
||||||
} else if ((*p == 'd') || (*p == 'D')) {
|
} else if ((*p == 'd') || (*p == 'D')) {
|
||||||
p++;
|
p++;
|
||||||
@@ -15760,6 +15758,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto decimal;
|
goto decimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
||||||
|
|||||||
+26
-27
@@ -85,15 +85,15 @@ extern "C" {
|
|||||||
// each major.minor branch, the commit count should increase monotonically.
|
// each major.minor branch, the commit count should increase monotonically.
|
||||||
//
|
//
|
||||||
// WUFFS_VERSION was overridden by "wuffs gen -version" based on revision
|
// WUFFS_VERSION was overridden by "wuffs gen -version" based on revision
|
||||||
// 40445d992b97be816cd09b0460c55e6a160389f6 committed on 2026-07-11.
|
// 55279938422060f30cd487173b98a651da075e3a committed on 2026-10-20.
|
||||||
#define WUFFS_VERSION 0x000030005
|
#define WUFFS_VERSION 0x000030006
|
||||||
#define WUFFS_VERSION_MAJOR 0
|
#define WUFFS_VERSION_MAJOR 0
|
||||||
#define WUFFS_VERSION_MINOR 3
|
#define WUFFS_VERSION_MINOR 3
|
||||||
#define WUFFS_VERSION_PATCH 5
|
#define WUFFS_VERSION_PATCH 6
|
||||||
#define WUFFS_VERSION_PRE_RELEASE_LABEL ""
|
#define WUFFS_VERSION_PRE_RELEASE_LABEL ""
|
||||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 3404
|
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 3407
|
||||||
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20260711
|
#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 20261020
|
||||||
#define WUFFS_VERSION_STRING "0.3.5+3404.20260711"
|
#define WUFFS_VERSION_STRING "0.3.6+3407.20261020"
|
||||||
|
|
||||||
// ---------------- Configuration
|
// ---------------- Configuration
|
||||||
|
|
||||||
@@ -13794,14 +13794,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
uint8_t* q = s.ptr + s.len;
|
uint8_t* q = s.ptr + s.len;
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
// Parse sign.
|
// Parse sign.
|
||||||
do {
|
do {
|
||||||
@@ -13814,14 +13812,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
// Parse digits, up to (and including) a '.', 'E' or 'e'. Examples for each
|
||||||
@@ -13873,9 +13869,12 @@ wuffs_base__private_implementation__high_prec_dec__parse(
|
|||||||
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
if (nd < WUFFS_BASE__PRIVATE_IMPLEMENTATION__HPD__DIGITS_PRECISION) {
|
||||||
h->digits[nd++] = (uint8_t)(*p - '0');
|
h->digits[nd++] = (uint8_t)(*p - '0');
|
||||||
dp = (int32_t)nd;
|
dp = (int32_t)nd;
|
||||||
} else if ('0' != *p) {
|
} else {
|
||||||
// Long-tail non-zeroes set the truncated bit.
|
dp++;
|
||||||
h->truncated = true;
|
if ('0' != *p) {
|
||||||
|
// Long-tail non-zeroes set the truncated bit.
|
||||||
|
h->truncated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (*p ==
|
} else if (*p ==
|
||||||
((options &
|
((options &
|
||||||
@@ -13935,14 +13934,12 @@ after_sep:
|
|||||||
after_exp:
|
after_exp:
|
||||||
do {
|
do {
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_UNDERSCORES) {
|
||||||
for (;; p++) {
|
for (; (p < q) && (*p == '_'); p++) {
|
||||||
if (p >= q) {
|
|
||||||
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
|
||||||
} else if (*p != '_') {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (p >= q) {
|
||||||
|
return wuffs_base__make_status(wuffs_base__error__bad_argument);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t exp_sign = +1;
|
int32_t exp_sign = +1;
|
||||||
if (*p == '+') {
|
if (*p == '+') {
|
||||||
@@ -15751,6 +15748,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto hexadecimal;
|
goto hexadecimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
|
|
||||||
} else if ((*p == 'd') || (*p == 'D')) {
|
} else if ((*p == 'd') || (*p == 'D')) {
|
||||||
p++;
|
p++;
|
||||||
@@ -15761,6 +15759,7 @@ wuffs_base__parse_number_u64(wuffs_base__slice_u8 s, uint32_t options) {
|
|||||||
if (p < q) {
|
if (p < q) {
|
||||||
goto decimal;
|
goto decimal;
|
||||||
}
|
}
|
||||||
|
goto fail_bad_argument;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
if (options & WUFFS_BASE__PARSE_NUMBER_XXX__ALLOW_MULTIPLE_LEADING_ZEROES) {
|
||||||
|
|||||||
Reference in new issue
Block a user