mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
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".
This commit is contained in:
1 parent
0460bfcd7a
commit
ca33506c01
10 files changed
+354
-51
No files matched your search
@@ -133,8 +133,10 @@ load_image(const char* filename) {
|
||||
callbacks, input,
|
||||
// Use PIXEL_BLEND__SRC_OVER, not the default PIXEL_BLEND__SRC, because
|
||||
// we also pass a background color.
|
||||
WUFFS_BASE__PIXEL_BLEND__SRC_OVER,
|
||||
g_background_colors[g_background_color_index], MAX_INCL_DIMENSION);
|
||||
wuffs_aux::DecodeImageArgPixelBlend(WUFFS_BASE__PIXEL_BLEND__SRC_OVER),
|
||||
wuffs_aux::DecodeImageArgBackgroundColor(
|
||||
g_background_colors[g_background_color_index]),
|
||||
wuffs_aux::DecodeImageArgMaxInclDimension(MAX_INCL_DIMENSION));
|
||||
if (filename) {
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@ main1(int argc, char** argv) {
|
||||
wuffs_aux::sync_io::FileInput input(in);
|
||||
return wuffs_aux::DecodeJson(
|
||||
callbacks, input,
|
||||
wuffs_base__make_slice_u32(g_quirks.data(), g_quirks.size()))
|
||||
wuffs_aux::DecodeJsonArgQuirks(g_quirks.data(), g_quirks.size()))
|
||||
.error_message;
|
||||
}
|
||||
|
||||
|
||||
@@ -568,8 +568,9 @@ main1(int argc, char** argv) {
|
||||
wuffs_aux::sync_io::FileInput input(in);
|
||||
return wuffs_aux::DecodeJson(
|
||||
callbacks, input,
|
||||
wuffs_base__make_slice_u32(g_quirks.data(), g_quirks.size()),
|
||||
(g_flags.query_c_string ? g_flags.query_c_string : ""))
|
||||
wuffs_aux::DecodeJsonArgQuirks(g_quirks.data(), g_quirks.size()),
|
||||
wuffs_aux::DecodeJsonArgJsonPointer(
|
||||
g_flags.query_c_string ? g_flags.query_c_string : ""))
|
||||
.error_message;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user