Commit 1b4a75fd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Code formatting, comments style and correct type for the returned value of H5Lexists().

parent 0e8d87ef
...@@ -325,7 +325,8 @@ int main(int argc, char *argv[]) { ...@@ -325,7 +325,8 @@ int main(int argc, char *argv[]) {
/* Let's pin the main thread, now we know if affinity will be used. */ /* Let's pin the main thread, now we know if affinity will be used. */
#if defined(HAVE_SETAFFINITY) && defined(HAVE_LIBNUMA) && defined(_GNU_SOURCE) #if defined(HAVE_SETAFFINITY) && defined(HAVE_LIBNUMA) && defined(_GNU_SOURCE)
if (with_aff && ((ENGINE_POLICY)&engine_policy_setaffinity) == engine_policy_setaffinity) if (with_aff &&
((ENGINE_POLICY)&engine_policy_setaffinity) == engine_policy_setaffinity)
engine_pin(); engine_pin();
#endif #endif
......
...@@ -299,8 +299,9 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str) { ...@@ -299,8 +299,9 @@ void io_write_attribute_s(hid_t grp, const char* name, const char* str) {
* If the 'Units' group does not exist in the ICs, cgs units will be assumed * If the 'Units' group does not exist in the ICs, cgs units will be assumed
*/ */
void io_read_unit_system(hid_t h_file, struct unit_system* us) { void io_read_unit_system(hid_t h_file, struct unit_system* us) {
// First check if it exists as this is *not* required.
int exists = H5Lexists(h_file, "/Units", H5P_DEFAULT); /* First check if it exists as this is *not* required. */
const htri_t exists = H5Lexists(h_file, "/Units", H5P_DEFAULT);
if (exists == 0) { if (exists == 0) {
message("'Units' group not found in ICs. Assuming CGS unit system."); message("'Units' group not found in ICs. Assuming CGS unit system.");
...@@ -314,11 +315,11 @@ void io_read_unit_system(hid_t h_file, struct unit_system* us) { ...@@ -314,11 +315,11 @@ void io_read_unit_system(hid_t h_file, struct unit_system* us) {
return; return;
} else if (exists < 0) { } else if (exists < 0) {
error("Serious problem with 'Units' group in your ICs. H5Lexists gives %d", error("Serious problem with 'Units' group your ICs. H5Lexists gives %d",
exists); exists);
} }
message("Reading units from your ICs."); message("Reading IC units from ICs.");
hid_t h_grp = H5Gopen(h_file, "/Units", H5P_DEFAULT); hid_t h_grp = H5Gopen(h_file, "/Units", H5P_DEFAULT);
/* Ok, Read the damn thing */ /* Ok, Read the damn thing */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment