Skip to content

Commit

Permalink
chore: optimize documents
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Apr 6, 2024
1 parent c64fdb6 commit 4ff107e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base16384.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ typedef ssize_t(*base16384_reader_t)(const void *client_data, void *buffer, size
typedef ssize_t(*base16384_writer_t)(const void *client_data, const void *buffer, size_t count);

struct base16384_stream_t {
union {
const union {
base16384_reader_t reader;
base16384_writer_t writer;
} f;
Expand Down
6 changes: 4 additions & 2 deletions test/file_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ static ssize_t base16384_test_file_reader(const void *client_data, void *buffer,
int fd = (int)((uintptr_t)client_data);
ssize_t ret = read(fd, buffer, count);
if(ret < 0) return ret;
for(ssize_t i = 0; i < ret; i++) {
ssize_t i;
for(i = 0; i < ret; i++) {
((uint8_t*)(buffer))[i] = ~((uint8_t*)(buffer))[i];
}
return ret;
Expand All @@ -114,7 +115,8 @@ static ssize_t base16384_test_file_writer(const void *client_data, const void *b
}
uint8_t* wbuf = (uint8_t*)malloc(count);
if(!wbuf) return -200;
for(ssize_t i = 0; i < count; i++) {
ssize_t i;
for(i = 0; i < count; i++) {
wbuf[i] = ~((uint8_t*)(buffer))[i];
}
ssize_t ret = write(fd, buffer, count);
Expand Down

0 comments on commit 4ff107e

Please sign in to comment.