mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 09:01:35 +01:00
Prepare for implicit io_{reader,writer} bounds
This commit is contained in:
1 parent
8984662d36
commit
628c283192
15 files changed
+141
-138
No files matched your search
@@ -239,6 +239,8 @@ static inline bool wuffs_base__io_buffer__is_valid(wuffs_base__io_buffer buf) {
|
||||
|
||||
static inline bool wuffs_base__io_reader__is_valid(wuffs_base__io_reader o) {
|
||||
wuffs_base__io_buffer* buf = o.private_impl.buf;
|
||||
// Note: if making this function public (i.e. moving it to base-header.h), it
|
||||
// also needs to allow NULL (i.e. implicit, callee-calculated) bounds.
|
||||
return buf ? ((buf->ptr <= o.private_impl.bounds[0]) &&
|
||||
(o.private_impl.bounds[0] <= o.private_impl.bounds[1]) &&
|
||||
(o.private_impl.bounds[1] <= buf->ptr + buf->len))
|
||||
@@ -248,6 +250,8 @@ static inline bool wuffs_base__io_reader__is_valid(wuffs_base__io_reader o) {
|
||||
|
||||
static inline bool wuffs_base__io_writer__is_valid(wuffs_base__io_writer o) {
|
||||
wuffs_base__io_buffer* buf = o.private_impl.buf;
|
||||
// Note: if making this function public (i.e. moving it to base-header.h), it
|
||||
// also needs to allow NULL (i.e. implicit, callee-calculated) bounds.
|
||||
return buf ? ((buf->ptr <= o.private_impl.bounds[0]) &&
|
||||
(o.private_impl.bounds[0] <= o.private_impl.bounds[1]) &&
|
||||
(o.private_impl.bounds[1] <= buf->ptr + buf->len))
|
||||
|
||||
Reference in new issue
Block a user