From 8478adfb5eee8e1d5825b580a61778c94467ac4d Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:21:21 -0500 Subject: [PATCH] fixup: unused return in fread --- src/cabanamd_impl.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cabanamd_impl.h b/src/cabanamd_impl.h index 12f7c60..a2c743d 100644 --- a/src/cabanamd_impl.h +++ b/src/cabanamd_impl.h @@ -494,7 +494,7 @@ void CbnMD::check_correctness( int step ) log_err( err, "Cannot open input file: ", filename ); } - (void)fread( &ntmp, sizeof( T_INT ), 1, fpref ); + T_INT n_ret = fread( &ntmp, sizeof( T_INT ), 1, fpref ); if ( ntmp != n ) { log_err( err, "Mismatch in current and reference atom counts" ); @@ -511,12 +511,15 @@ void CbnMD::check_correctness( int step ) Kokkos::View fref( "Correctness::f", 3, n ); - (void)fread( idref.data(), sizeof( T_INT ), n, fpref ); - (void)fread( typeref.data(), sizeof( T_INT ), n, fpref ); - (void)fread( qref.data(), sizeof( T_FLOAT ), n, fpref ); - (void)fread( xref.data(), sizeof( T_X_FLOAT ), 3 * n, fpref ); - (void)fread( vref.data(), sizeof( T_V_FLOAT ), 3 * n, fpref ); - (void)fread( fref.data(), sizeof( T_F_FLOAT ), 3 * n, fpref ); + T_INT id_ret = fread( idref.data(), sizeof( T_INT ), n, fpref ); + T_INT type_ret = fread( typeref.data(), sizeof( T_INT ), n, fpref ); + T_INT q_ret = fread( qref.data(), sizeof( T_FLOAT ), n, fpref ); + T_INT x_ret = fread( xref.data(), sizeof( T_X_FLOAT ), 3 * n, fpref ); + T_INT v_ret = fread( vref.data(), sizeof( T_V_FLOAT ), 3 * n, fpref ); + T_INT f_ret = fread( fref.data(), sizeof( T_F_FLOAT ), 3 * n, fpref ); + if ( id_ret != n || type_ret != n || q_ret != n || x_ret != 3 * n || + v_ret != 3 * n || f_ret != 3 * n || n_ret != 1 ) + log_err( err, "Error reading reference data." ); T_FLOAT sumdelrsq = 0.0; T_FLOAT sumdelvsq = 0.0;