Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off_t straggers #4291

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/chunk_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2367,9 +2367,9 @@ test_chunk_address_with_userblock(hid_t fapl_id)
int data = -1;
int data_ub = -1;

if (HDlseek(fd, (off_t)(od.addresses[i]), SEEK_SET) < 0)
if (HDlseek(fd, (HDoff_t)(od.addresses[i]), SEEK_SET) < 0)
TEST_ERROR;
if (HDlseek(fd_ub, (off_t)(od_ub.addresses[i]), SEEK_SET) < 0)
if (HDlseek(fd_ub, (HDoff_t)(od_ub.addresses[i]), SEEK_SET) < 0)
TEST_ERROR;

if (HDread(fd, &data, sizeof(int)) != sizeof(int))
Expand Down
4 changes: 2 additions & 2 deletions tools/src/h5jam/h5jam.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ main(int argc, char *argv[])
hsize_t startub;
hsize_t where;
hsize_t newubsize;
off_t fsize;
HDoff_t fsize;
h5_stat_t sbuf;
h5_stat_t sbuf2;
int res;
Expand Down Expand Up @@ -253,7 +253,7 @@ main(int argc, char *argv[])
goto done;
}

fsize = (off_t)sbuf.st_size;
fsize = (HDoff_t)sbuf.st_size;

h5fid = HDopen(input_file, O_RDONLY);
if (h5fid < 0) {
Expand Down
12 changes: 6 additions & 6 deletions tools/src/h5jam/h5unjam.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ main(int argc, char *argv[])
{
hid_t ifile = H5I_INVALID_HID;
hid_t plist = H5I_INVALID_HID;
off_t fsize;
HDoff_t fsize;
hsize_t usize;
htri_t testval;
herr_t status;
Expand Down Expand Up @@ -306,9 +306,9 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)
{
static char buf[COPY_BUF_SIZE];
size_t how_much;
off_t where = (off_t)_where;
off_t to;
off_t from;
HDoff_t where = (HDoff_t)_where;
HDoff_t to;
HDoff_t from;
herr_t ret_value = 0;

/* nothing to copy */
Expand Down Expand Up @@ -349,8 +349,8 @@ copy_to_file(FILE *infid, FILE *ofid, ssize_t _where, ssize_t show_much)

/* Update positions/size */
how_much -= bytes_read;
from += (off_t)bytes_read;
to += (off_t)bytes_read;
from += (HDoff_t)bytes_read;
to += (HDoff_t)bytes_read;

/* Write nchars bytes to output file */
bytes_wrote = fwrite(buf, (size_t)1, bytes_read, ofid);
Expand Down
Loading