CHECKS="-*,
cppcoreguidelines-pro-type-static-cast-downcast,
google-readability-casting,
- modernize-use-emplace,
modernize-deprecated-headers,
+ modernize-use-emplace,
+ modernize-use-nullptr,
modernize-use-using,
mpi-*,
performance-*,
*
* When reading a hyperslab, HDF5 also allows to provide "stride" and
* "block" parameters (see the [HDF5 documentation](https://support.hdfgroup.org/HDF5/doc1.8/RM/RM_H5S.html#Dataspace-SelectHyperslab)).
- * These are not used by the current function and set to `NULL`. However
+ * These are not used by the current function and set to `nullptr`. However
* these parameters can be used with the function
* read_hyperslab(const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &)
*
*
* When writing a hyperslab, HDF5 also allows to provide "stride" and
* "block" parameters (see the [HDF5 documentation](https://support.hdfgroup.org/HDF5/doc1.8/RM/RM_H5S.html#Dataspace-SelectHyperslab)).
- * These are not used by the current function and set to `NULL`. However
+ * These are not used by the current function and set to `nullptr`. However
* these parameters can be used with the function
* write_hyperslab(const Container &data, const std::vector<hsize_t> &data_dimensions, const std::vector<hsize_t> &offset, const std::vector<hsize_t> &stride, const std::vector<hsize_t> &count, const std::vector<hsize_t> &block).
*
// given FEs
unsigned int n_shape_functions = 0;
for (unsigned int i = 0; i < fes.size(); ++i)
- if (multiplicities[i] > 0) // check needed as fe might be NULL
+ if (multiplicities[i] > 0) // check needed as fe might be nullptr
n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
// generate the array that will hold the output
// given FEs
unsigned int n_shape_functions = 0;
for (unsigned int i = 0; i < fes.size(); ++i)
- if (multiplicities[i] > 0) // needed because fe might be NULL
+ if (multiplicities[i] > 0) // needed because fe might be nullptr
n_shape_functions += fes[i]->dofs_per_cell * multiplicities[i];
unsigned int n_components = 0;
if (do_tensor_product)
{
for (unsigned int i = 0; i < fes.size(); ++i)
- if (multiplicities[i] > 0) // needed because fe might be NULL
+ if (multiplicities[i] > 0) // needed because fe might be nullptr
n_components += fes[i]->n_components() * multiplicities[i];
}
else
{
for (unsigned int i = 0; i < fes.size(); ++i)
- if (multiplicities[i] > 0) // needed because fe might be NULL
+ if (multiplicities[i] > 0) // needed because fe might be nullptr
{
n_components = fes[i]->n_components();
break;
}
// Now check that all FEs have the same number of components:
for (unsigned int i = 0; i < fes.size(); ++i)
- if (multiplicities[i] > 0) // needed because fe might be NULL
+ if (multiplicities[i] > 0) // needed because fe might be nullptr
Assert(n_components == fes[i]->n_components(),
ExcDimensionMismatch(n_components,
fes[i]->n_components()));
FEEvaluationBase<dim, n_components_, Number, is_face>::
get_mapping_data_index_offset() const
{
- if (matrix_info == 0)
+ if (matrix_info == nullptr)
return 0;
else
{
* point to the first entry of the array to which the data should be
* written. This function is meant for serializing all particle properties
* and later de-serializing the properties by calling the appropriate
- * constructor Particle(void *&data, PropertyPool *property_pool = NULL);
+ * constructor Particle(void *&data, PropertyPool *property_pool = nullptr);
*
* @param [in,out] data The memory location to write particle data
* into. This pointer points to the begin of the memory, in which the
* point to the first element in which the data should be written. This
* function is meant for serializing all particle properties and
* afterwards de-serializing the properties by calling the appropriate
- * constructor Particle(void *&data, PropertyPool *property_pool = NULL);
+ * constructor Particle(void *&data, PropertyPool *property_pool = nullptr);
*
* @param [in,out] data The memory location to write particle data
* into. This pointer points to the begin of the memory, in which the
// later
char *file_name = (char *)flags.tecplot_binary_file_name;
- if (file_name == NULL)
+ if (file_name == nullptr)
{
// At least in debug mode we should tell users why they don't get
// tecplot binary output
// As we don't do anything else with tec_var_names following const_cast is
// ok
char *var_names = const_cast<char *>(tec_var_names.c_str());
- ierr = TECINI(NULL, var_names, file_name, dot, &tec_debug, &is_double);
+ ierr = TECINI(nullptr, var_names, file_name, dot, &tec_debug, &is_double);
Assert(ierr == 0, ExcErrorOpeningTecplotFile(file_name));
char FEBLOCK[] = {'F', 'E', 'B', 'L', 'O', 'C', 'K', 0};
- ierr = TECZNE(NULL, &num_nodes, &num_cells, &cell_type, FEBLOCK, NULL);
+ ierr =
+ TECZNE(nullptr, &num_nodes, &num_cells, &cell_type, FEBLOCK, nullptr);
Assert(ierr == 0, ExcTecplotAPIError());
ExceptionBase::~ExceptionBase() noexcept
{
- free(stacktrace); // free(NULL) is allowed
+ free(stacktrace); // free(nullptr) is allowed
stacktrace = nullptr;
}
// backtrace_symbols.
// first delete old stacktrace if necessary
- free(stacktrace); // free(NULL) is allowed
+ free(stacktrace); // free(nullptr) is allowed
stacktrace = backtrace_symbols(raw_stacktrace, n_stacktrace_frames);
#endif
Assert(rank_ret >= 0, ExcInternalError());
rank = rank_ret;
dimensions.resize(rank);
- rank_ret = H5Sget_simple_extent_dims(*dataspace, dimensions.data(), NULL);
+ rank_ret =
+ H5Sget_simple_extent_dims(*dataspace, dimensions.data(), nullptr);
AssertDimension(rank_ret, static_cast<int>(rank));
size = 1;
delete pointer;
});
- *dataspace = H5Screate_simple(rank, dimensions.data(), NULL);
+ *dataspace = H5Screate_simple(rank, dimensions.data(), nullptr);
Assert(*dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
*hdf5_reference = H5Dcreate2(parent_group_id,
Container data = internal::initialize_container<Container>(data_dimensions);
- memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
+ memory_dataspace = H5Screate_simple(1, data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_elements(*dataspace,
H5S_SELECT_SET,
Container data = internal::initialize_container<Container>(data_dimensions);
memory_dataspace =
- H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
+ H5Screate_simple(data_dimensions.size(), data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
- ret = H5Sselect_hyperslab(
- *dataspace, H5S_SELECT_SET, offset.data(), NULL, count.data(), NULL);
+ ret = H5Sselect_hyperslab(*dataspace,
+ H5S_SELECT_SET,
+ offset.data(),
+ nullptr,
+ count.data(),
+ nullptr);
Assert(ret >= 0, ExcMessage("Error at H5Sselect_hyperslab"));
internal::set_plist(plist, mpi);
Container data = internal::initialize_container<Container>(data_dimensions);
memory_dataspace =
- H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
+ H5Screate_simple(data_dimensions.size(), data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_hyperslab(*dataspace,
H5S_SELECT_SET,
hid_t plist;
herr_t ret;
- memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
+ memory_dataspace = H5Screate_simple(1, data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_none(*dataspace);
Assert(ret >= 0, ExcMessage("H5Sselect_none"));
internal::set_plist(plist, mpi);
- // The pointer of data can safely be NULL, see the discussion at the HDF5
+ // The pointer of data can safely be nullptr, see the discussion at the HDF5
// forum:
// https://forum.hdfgroup.org/t/parallel-i-o-does-not-support-filters-yet/884/17
ret = H5Dread(
- *hdf5_reference, *t_type, memory_dataspace, *dataspace, plist, NULL);
+ *hdf5_reference, *t_type, memory_dataspace, *dataspace, plist, nullptr);
Assert(ret >= 0, ExcMessage("Error at H5Dread"));
internal::release_plist(plist,
herr_t ret;
- memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
+ memory_dataspace = H5Screate_simple(1, data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_elements(*dataspace,
H5S_SELECT_SET,
herr_t ret;
memory_dataspace =
- H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
+ H5Screate_simple(data_dimensions.size(), data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
- ret = H5Sselect_hyperslab(
- *dataspace, H5S_SELECT_SET, offset.data(), NULL, count.data(), NULL);
+ ret = H5Sselect_hyperslab(*dataspace,
+ H5S_SELECT_SET,
+ offset.data(),
+ nullptr,
+ count.data(),
+ nullptr);
Assert(ret >= 0, ExcMessage("Error at H5Sselect_hyperslab"));
internal::set_plist(plist, mpi);
herr_t ret;
memory_dataspace =
- H5Screate_simple(data_dimensions.size(), data_dimensions.data(), NULL);
+ H5Screate_simple(data_dimensions.size(), data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_hyperslab(*dataspace,
H5S_SELECT_SET,
hid_t plist;
herr_t ret;
- memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
+ memory_dataspace = H5Screate_simple(1, data_dimensions.data(), nullptr);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
ret = H5Sselect_none(*dataspace);
Assert(ret >= 0, ExcMessage("Error at H5PSselect_none"));
internal::set_plist(plist, mpi);
- // The pointer of data can safely be NULL, see the discussion at the HDF5
+ // The pointer of data can safely be nullptr, see the discussion at the HDF5
// forum:
// https://forum.hdfgroup.org/t/parallel-i-o-does-not-support-filters-yet/884/17
ret = H5Dwrite(
- *hdf5_reference, *t_type, memory_dataspace, *dataspace, plist, NULL);
+ *hdf5_reference, *t_type, memory_dataspace, *dataspace, plist, nullptr);
Assert(ret >= 0, ExcMessage("Error at H5Dwrite"));
internal::release_plist(plist,
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
len = sizeof(n_cpus);
- sysctl(mib, 2, &n_cpus, &len, NULL, 0);
+ sysctl(mib, 2, &n_cpus, &len, nullptr, 0);
return n_cpus;
}
object_info = &typeid(*this);
++counter;
- const char *const name = (id != 0) ? id : unknown_subscriber;
+ const char *const name = (id != nullptr) ? id : unknown_subscriber;
map_iterator it = counter_map.find(name);
if (it == counter_map.end())
continue;
Assert(enrichments[base_no - 1][m](cell) != nullptr,
- ExcMessage("The pointer to the enrichment function is NULL"));
+ ExcMessage(
+ "The pointer to the enrichment function is not set"));
Assert(enrichments[base_no - 1][m](cell)->n_components == 1,
ExcMessage(
&data) const
{
// Convert to the correct internal data class for this FE class.
- Assert(dynamic_cast<const InternalData *>(&fe_internal) != 0,
+ Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
// data for this class. fails with
// an exception if that is not
// possible
- Assert(dynamic_cast<const InternalData *>(&fe_internal) != 0,
+ Assert(dynamic_cast<const InternalData *>(&fe_internal) != nullptr,
ExcInternalError());
const InternalData &fe_data = static_cast<const InternalData &>(fe_internal);
// then restore the matrix and return the number of columns in this row as
// queried previously. Starting with PETSc 3.4, MatRestoreRow actually
- // resets the last three arguments to zero/NULL, to avoid abuse of pointers
+ // resets the last three arguments to nullptr, to avoid abuse of pointers
// now dangling. as a consequence, we need to save the size of the array
// and return the saved value.
const PetscInt ncols_saved = ncols;
// somewhere. This can happen when a vector lives in GrowingVectorMemory
// data structures. Thus, the following code is commented out.
//
- // if (my_comm != NULL && v_comm != NULL && my_comm->DataPtr() !=
- // v_comm->DataPtr())
+ // if (my_comm != nullptr &&
+ // v_comm != nullptr &&
+ // my_comm->DataPtr() != v_comm->DataPtr())
// {
// int communicators_same = 0;
// const int ierr = MPI_Comm_compare (my_comm->GetMpiComm(),