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

OESS-168: Remove clang warnings. #1127

Merged
merged 2 commits into from
Nov 2, 2021
Merged
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
12 changes: 6 additions & 6 deletions src/H5FDcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ static const H5FD_class_t H5FD_core_g = {
};

/* Default configurations, if none provided */
static const H5FD_core_fapl_t H5FD_core_default_config_g = {H5_MB, TRUE, H5FD_CORE_WRITE_TRACKING_FLAG,
H5FD_CORE_WRITE_TRACKING_PAGE_SIZE};
static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {H5_MB, TRUE, TRUE, (size_t)4096};
static const H5FD_core_fapl_t H5FD_core_default_config_g = {
(size_t)H5_MB, TRUE, H5FD_CORE_WRITE_TRACKING_FLAG, H5FD_CORE_WRITE_TRACKING_PAGE_SIZE};
static const H5FD_core_fapl_t H5FD_core_default_paged_config_g = {(size_t)H5_MB, TRUE, TRUE, (size_t)4096};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, I guess, but I would probably create a const int H5_CORE_DEFAULT_ALLOC_SIZE or something like that and make it 1024 * 1024 instead. That's more in the spirit of what's intended and doesn't torture the floating-point H5_MB into a new use.

Also, the size_t cast for 4096 is probably superfluous.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that already and it generated more warnings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compilers are weird


/* Define a free list to manage the region type */
H5FL_DEFINE(H5FD_core_region_t);
Expand Down Expand Up @@ -398,7 +398,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size)
"write to backing store failed: time = %s, filename = '%s', file descriptor = %d, "
"errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this "
"sub-write = %llu, bytes actually written = %llu, offset = %llu",
HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr,
HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), (void *)ptr,
(unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_wrote, (unsigned long long)offset);
} /* end if */
Expand Down Expand Up @@ -952,8 +952,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
"file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, "
"error message = '%s', file->mem = %p, total read size = %llu, bytes this "
"sub-read = %llu, bytes actually read = %llu, offset = %llu",
HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem,
(unsigned long long)size, (unsigned long long)bytes_in,
HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno),
(void *)file->mem, (unsigned long long)size, (unsigned long long)bytes_in,
(unsigned long long)bytes_read, (unsigned long long)offset);
} /* end if */

Expand Down