mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Rename buf1's cap to len.
This commit is contained in:
1 parent
e49ec3fd90
commit
45cecca79a
6 files changed
+15
-15
No files matched your search
+2
-2
@@ -23,8 +23,8 @@ uint8_t global_dst_buffer[BUFFER_SIZE];
|
||||
uint8_t global_src_buffer[BUFFER_SIZE];
|
||||
|
||||
void test_lzw_decode() {
|
||||
puffs_base_buf1 dst = {.ptr = global_dst_buffer, .cap = BUFFER_SIZE};
|
||||
puffs_base_buf1 src = {.ptr = global_src_buffer, .cap = BUFFER_SIZE};
|
||||
puffs_base_buf1 dst = {.ptr = global_dst_buffer, .len = BUFFER_SIZE};
|
||||
puffs_base_buf1 src = {.ptr = global_src_buffer, .len = BUFFER_SIZE};
|
||||
if (!read_file(&src, "../../testdata/bricks-nodither.giflzw")) {
|
||||
goto cleanup0;
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ bool read_file(puffs_base_buf1* dst, const char* path) {
|
||||
return false;
|
||||
}
|
||||
uint8_t* ptr = dst->ptr + dst->wi;
|
||||
size_t cap = dst->cap - dst->wi;
|
||||
size_t len = dst->len - dst->wi;
|
||||
while (true) {
|
||||
size_t n = fread(ptr, 1, cap, f);
|
||||
size_t n = fread(ptr, 1, len, f);
|
||||
ptr += n;
|
||||
cap -= n;
|
||||
len -= n;
|
||||
dst->wi += n;
|
||||
if (feof(f)) {
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user