mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Ensure that you cannot return a suspension
This commit is contained in:
1 parent
ed9025c8dd
commit
6c83516afa
5 files changed
+65
-13
No files matched your search
@@ -7400,10 +7400,7 @@ struct wuffs_zlib__decoder__struct {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static inline wuffs_base__empty_struct //
|
||||
wuffs_base__ignore_status(wuffs_base__status z) {
|
||||
return wuffs_base__make_empty_struct();
|
||||
}
|
||||
// ---------------- Fundamentals
|
||||
|
||||
// WUFFS_BASE__MAGIC is a magic number to check that initializers are called.
|
||||
// It's not foolproof, given C doesn't automatically zero memory before use,
|
||||
@@ -7459,6 +7456,21 @@ wuffs_base__ignore_status(wuffs_base__status z) {
|
||||
#define WUFFS_BASE__UNLIKELY(expr) (expr)
|
||||
#endif
|
||||
|
||||
// --------
|
||||
|
||||
static inline wuffs_base__empty_struct //
|
||||
wuffs_base__ignore_status(wuffs_base__status z) {
|
||||
return wuffs_base__make_empty_struct();
|
||||
}
|
||||
|
||||
static inline wuffs_base__status //
|
||||
wuffs_base__status__ensure_not_a_suspension(wuffs_base__status z) {
|
||||
if (z.repr && (*z.repr == '$')) {
|
||||
z.repr = wuffs_base__error__cannot_return_a_suspension;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
|
||||
// ---------------- Numeric Types
|
||||
|
||||
extern const uint8_t wuffs_base__low_bits_mask__u8[9];
|
||||
|
||||
Reference in new issue
Block a user