Skip to content

Commit 1d36528

Browse files
committed
Fix unused variable in non-NDEBUG modes
1 parent 9edf455 commit 1d36528

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/mesh/xdr_io.C

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,9 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
698698
std::vector<std::vector<dof_id_type>> recv_ids (this->n_processors());
699699
std::vector<std::vector<Real>> recv_coords(this->n_processors());
700700

701+
#ifndef NDEBUG
701702
std::size_t n_written=0;
703+
#endif
702704

703705
// Note: do not be tempted to replace the node loops below with
704706
// range-based iterators, these iterators must be defined outside
@@ -837,7 +839,9 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
837839
coords[3*local_idx+2] = 0.;
838840
#endif
839841

842+
#ifndef NDEBUG
840843
n_written++;
844+
#endif
841845
}
842846

843847
io.data_stream (coords.empty() ? nullptr : coords.data(),
@@ -864,8 +868,10 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
864868
std::vector<xdr_id_type> & unique_ids=xfer_unique_ids;
865869
std::vector<std::vector<xdr_id_type>> recv_unique_ids (this->n_processors());
866870

871+
#ifndef NDEBUG
867872
// Reset write counter
868873
n_written = 0;
874+
#endif
869875

870876
// Return node iterator to the beginning
871877
node_iter = mesh.local_nodes_begin();
@@ -976,7 +982,9 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
976982

977983
unique_ids[local_idx] = recv_unique_ids[pid][idx];
978984

985+
#ifndef NDEBUG
979986
n_written++;
987+
#endif
980988
}
981989

982990
io.data_stream (unique_ids.empty() ? nullptr : unique_ids.data(),
@@ -992,8 +1000,10 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
9921000
// Next: do "block"-based I/O for the extra node integers (if necessary)
9931001
if (n_node_integers)
9941002
{
1003+
#ifndef NDEBUG
9951004
// Reset write counter
9961005
n_written = 0;
1006+
#endif
9971007

9981008
// Return node iterator to the beginning
9991009
node_iter = mesh.local_nodes_begin();
@@ -1127,7 +1137,9 @@ void XdrIO::write_serialized_nodes (Xdr & io, const dof_id_type max_node_id,
11271137
for (unsigned int i=0; i != n_node_integers; ++i)
11281138
node_integers[n_node_integers*local_idx + i] = recv_node_integers[pid][n_node_integers*idx + i];
11291139

1140+
#ifndef NDEBUG
11301141
n_written++;
1142+
#endif
11311143
}
11321144

11331145
io.data_stream (node_integers.empty() ? nullptr : node_integers.data(),

0 commit comments

Comments
 (0)