mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
Simplify some testlib set_limit methods
This commit is contained in:
1 parent
bf4aa38a84
commit
23fff7f841
1 file changed
+4
-8
@@ -290,9 +290,8 @@ int test_main(int argc, char** argv, proc* tests, proc* benches) {
|
||||
// WUFFS_BASE_HEADER_H is where wuffs_base__io_buffer is defined.
|
||||
#ifdef WUFFS_BASE_HEADER_H
|
||||
|
||||
static inline wuffs_base__empty_struct wuffs_base__io_reader__set_limit(
|
||||
wuffs_base__io_reader* o,
|
||||
uint64_t limit) {
|
||||
void wuffs_base__io_reader__set_limit(wuffs_base__io_reader* o,
|
||||
uint64_t limit) {
|
||||
if (o && o->private_impl.buf) {
|
||||
uint8_t* p = o->private_impl.buf->ptr + o->private_impl.buf->ri;
|
||||
uint8_t* q = o->private_impl.buf->ptr + o->private_impl.buf->wi;
|
||||
@@ -304,12 +303,10 @@ static inline wuffs_base__empty_struct wuffs_base__io_reader__set_limit(
|
||||
o->private_impl.bounds[1] = p + limit;
|
||||
}
|
||||
}
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
static inline wuffs_base__empty_struct wuffs_base__io_writer__set_limit(
|
||||
wuffs_base__io_writer* o,
|
||||
uint64_t limit) {
|
||||
void wuffs_base__io_writer__set_limit(wuffs_base__io_writer* o,
|
||||
uint64_t limit) {
|
||||
if (o && o->private_impl.buf) {
|
||||
uint8_t* p = o->private_impl.buf->ptr + o->private_impl.buf->wi;
|
||||
uint8_t* q = o->private_impl.buf->ptr + o->private_impl.buf->len;
|
||||
@@ -321,7 +318,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_limit(
|
||||
o->private_impl.bounds[1] = p + limit;
|
||||
}
|
||||
}
|
||||
return ((wuffs_base__empty_struct){});
|
||||
}
|
||||
|
||||
bool read_file(wuffs_base__io_buffer* dst, const char* path) {
|
||||
|
||||
Reference in new issue
Block a user