Skip to content

Commit

Permalink
fix(32bit arches): use explicit casts
Browse files Browse the repository at this point in the history
Explicitly casts long long unsigned int to size_t

Fixes BlueBrain#443
  • Loading branch information
sanjayankur31 authored and musicinmybrain committed Aug 26, 2021
1 parent a01ee6b commit d4ae490
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/highfive/bits/H5Attribute_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace HighFive {

inline std::string Attribute::getName() const {
return details::get_name([&](char *buffer, hsize_t length) {
return H5Aget_name(_hid, length, buffer);
return H5Aget_name(_hid, static_cast<size_t>(length), buffer);
});
}

Expand Down
2 changes: 1 addition & 1 deletion include/highfive/bits/H5File_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ inline File::File(const std::string& filename, unsigned openFlags,
inline const std::string& File::getName() const noexcept {
if (_filename.empty()) {
_filename = details::get_name([this](char* buffer, hsize_t length) {
return H5Fget_name(getId(), buffer, length);
return H5Fget_name(getId(), buffer, static_cast<size_t>(length));
});
}
return _filename;
Expand Down
2 changes: 1 addition & 1 deletion include/highfive/bits/H5Node_traits_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ inline std::string NodeTraits<Derivate>::getObjectName(size_t index) const {
return details::get_name([&](char* buffer, hsize_t length) {
return H5Lget_name_by_idx(
static_cast<const Derivate*>(this)->getId(), ".", H5_INDEX_NAME, H5_ITER_INC,
index, buffer, length, H5P_DEFAULT);
index, buffer, static_cast<size_t>(length), H5P_DEFAULT);
});
}

Expand Down
2 changes: 1 addition & 1 deletion include/highfive/bits/H5Path_traits_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inline PathTraits<Derivate>::PathTraits() {
template <typename Derivate>
inline std::string PathTraits<Derivate>::getPath() const {
return details::get_name([this](char* buffer, hsize_t length) {
return H5Iget_name(static_cast<const Derivate*>(this)->getId(), buffer, length);
return H5Iget_name(static_cast<const Derivate*>(this)->getId(), buffer, static_cast<size_t>(length));
});
}

Expand Down
2 changes: 1 addition & 1 deletion include/highfive/bits/H5Reference_misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace HighFive {
inline Reference::Reference(const Object& location, const Object& object)
: parent_id(location.getId()) {
obj_name = details::get_name([&](char *buffer, hsize_t length) {
return H5Iget_name(object.getId(), buffer, length); });
return H5Iget_name(object.getId(), buffer, static_cast<size_t>(length)); });
}

inline void Reference::create_ref(hobj_ref_t* refptr) const {
Expand Down

0 comments on commit d4ae490

Please sign in to comment.