Tidy: modernize-use-nullptr
authorRoland Schulz <roland.schulz@intel.com>
Tue, 10 Jan 2017 20:01:23 +0000 (15:01 -0500)
committerErik Lindahl <erik.lindahl@gmail.com>
Wed, 11 Jan 2017 07:41:07 +0000 (08:41 +0100)
Result of:
run-clang-tidy.py -checks=modernize-use-nullptr -header-filter=.* -fix -j80
git checkout src/external src/gromacs/selection/scanner.cpp src/gromacs/selection/parser.cpp

Fixed in fft5d that MPI_COMM_NULL is used.

Details of check:
http://llvm.org/releases/3.9.0/tools/clang/tools/extra/docs/clang-tidy/checks/modernize-use-nullptr.html

Change-Id: If9f5c6c553659b0ddcc44ac9399d141b21f6f22f

430 files changed:
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/analysisdata.h
src/gromacs/analysisdata/dataproxy.cpp
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/modules/displacement.cpp
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/analysisdata/tests/mock_datamodule.cpp
src/gromacs/commandline/cmdlinehelpcontext.cpp
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinehelpwriter.cpp
src/gromacs/commandline/cmdlineinit.cpp
src/gromacs/commandline/cmdlinemodule.cpp
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlineoptionsmodule.cpp
src/gromacs/commandline/cmdlineparser.cpp
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/commandline/filenm.cpp
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/shellcompletions.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/commandline/tests/cmdlinemodulemanager.cpp
src/gromacs/commandline/tests/cmdlineparser.cpp
src/gromacs/commandline/tests/cmdlineprogramcontext.cpp
src/gromacs/commandline/tests/pargs.cpp
src/gromacs/commandline/viewit.cpp
src/gromacs/correlationfunctions/autocorr.cpp
src/gromacs/correlationfunctions/expfit.cpp
src/gromacs/correlationfunctions/tests/autocorr.cpp
src/gromacs/correlationfunctions/tests/correlationdataset.cpp
src/gromacs/correlationfunctions/tests/expfit.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_box.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/domdec/domdec_specatomcomm.cpp
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/domdec/domdec_vsite.cpp
src/gromacs/domdec/hash.h
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/pme-grid.cpp
src/gromacs/ewald/pme-load-balancing.cpp
src/gromacs/ewald/pme-only.cpp
src/gromacs/ewald/pme-pp.cpp
src/gromacs/ewald/pme-solve.cpp
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme.cpp
src/gromacs/fft/calcgrid.cpp
src/gromacs/fft/fft.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/fft_fftpack.cpp
src/gromacs/fft/fft_fftw3.cpp
src/gromacs/fft/parallel_3dfft.cpp
src/gromacs/fft/tests/fft.cpp
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/confio.cpp
src/gromacs/fileio/enxio.cpp
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/filetypes.cpp
src/gromacs/fileio/g96io.cpp
src/gromacs/fileio/gmxfio-xdr.cpp
src/gromacs/fileio/gmxfio.cpp
src/gromacs/fileio/groio.cpp
src/gromacs/fileio/libxdrf.cpp
src/gromacs/fileio/matio.cpp
src/gromacs/fileio/mtxio.cpp
src/gromacs/fileio/oenv.cpp
src/gromacs/fileio/pdbio.cpp
src/gromacs/fileio/readinp.cpp
src/gromacs/fileio/tests/confio.cpp
src/gromacs/fileio/tests/readinp.cpp
src/gromacs/fileio/tests/tngio.cpp
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tpxio.cpp
src/gromacs/fileio/trxio.cpp
src/gromacs/fileio/vmdio.cpp
src/gromacs/fileio/warninp.cpp
src/gromacs/fileio/writeps.cpp
src/gromacs/fileio/xvgr.cpp
src/gromacs/gmxana/anadih.cpp
src/gromacs/gmxana/cmat.cpp
src/gromacs/gmxana/eigio.cpp
src/gromacs/gmxana/fitahx.cpp
src/gromacs/gmxana/gmx_anadock.cpp
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_analyze.cpp
src/gromacs/gmxana/gmx_angle.cpp
src/gromacs/gmxana/gmx_bar.cpp
src/gromacs/gmxana/gmx_bundle.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_cluster.cpp
src/gromacs/gmxana/gmx_clustsize.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_covar.cpp
src/gromacs/gmxana/gmx_current.cpp
src/gromacs/gmxana/gmx_density.cpp
src/gromacs/gmxana/gmx_densmap.cpp
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dielectric.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/gmx_dos.cpp
src/gromacs/gmxana/gmx_dyecoupl.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_editconf.cpp
src/gromacs/gmxana/gmx_eneconv.cpp
src/gromacs/gmxana/gmx_enemat.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_filter.cpp
src/gromacs/gmxana/gmx_genion.cpp
src/gromacs/gmxana/gmx_genpr.cpp
src/gromacs/gmxana/gmx_gyrate.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_helix.cpp
src/gromacs/gmxana/gmx_helixorient.cpp
src/gromacs/gmxana/gmx_hydorder.cpp
src/gromacs/gmxana/gmx_lie.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mdmat.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_mk_angndx.cpp
src/gromacs/gmxana/gmx_morph.cpp
src/gromacs/gmxana/gmx_msd.cpp
src/gromacs/gmxana/gmx_nmeig.cpp
src/gromacs/gmxana/gmx_nmens.cpp
src/gromacs/gmxana/gmx_nmtraj.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_polystat.cpp
src/gromacs/gmxana/gmx_potential.cpp
src/gromacs/gmxana/gmx_principal.cpp
src/gromacs/gmxana/gmx_rama.cpp
src/gromacs/gmxana/gmx_rms.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_rotacf.cpp
src/gromacs/gmxana/gmx_rotmat.cpp
src/gromacs/gmxana/gmx_saltbr.cpp
src/gromacs/gmxana/gmx_sans.cpp
src/gromacs/gmxana/gmx_saxs.cpp
src/gromacs/gmxana/gmx_sham.cpp
src/gromacs/gmxana/gmx_sigeps.cpp
src/gromacs/gmxana/gmx_sorient.cpp
src/gromacs/gmxana/gmx_spatial.cpp
src/gromacs/gmxana/gmx_spol.cpp
src/gromacs/gmxana/gmx_tcaf.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_trjcat.cpp
src/gromacs/gmxana/gmx_trjconv.cpp
src/gromacs/gmxana/gmx_trjorder.cpp
src/gromacs/gmxana/gmx_tune_pme.cpp
src/gromacs/gmxana/gmx_vanhove.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/gmx_wham.cpp
src/gromacs/gmxana/gmx_wheel.cpp
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/princ.cpp
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/gmxlib/nonbonded/nb_generic.cpp
src/gromacs/gmxlib/nonbonded/nb_generic_cg.cpp
src/gromacs/gmxlib/nonbonded/nb_kernel.cpp
src/gromacs/gmxlib/nonbonded/nonbonded.cpp
src/gromacs/gmxlib/nrnb.cpp
src/gromacs/gmxpreprocess/add_par.cpp
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gen_ad.cpp
src/gromacs/gmxpreprocess/gen_vsite.cpp
src/gromacs/gmxpreprocess/genconf.cpp
src/gromacs/gmxpreprocess/genhydro.cpp
src/gromacs/gmxpreprocess/gmxcpp.cpp
src/gromacs/gmxpreprocess/gpp_atomtype.cpp
src/gromacs/gmxpreprocess/gpp_bond_atomtype.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/h_db.cpp
src/gromacs/gmxpreprocess/hackblock.cpp
src/gromacs/gmxpreprocess/insert-molecules.cpp
src/gromacs/gmxpreprocess/nm2type.cpp
src/gromacs/gmxpreprocess/pdb2gmx.cpp
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/gmxpreprocess/pgutil.cpp
src/gromacs/gmxpreprocess/read-conformation.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/gmxpreprocess/readpull.cpp
src/gromacs/gmxpreprocess/readrot.cpp
src/gromacs/gmxpreprocess/resall.cpp
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/specbond.cpp
src/gromacs/gmxpreprocess/ter_db.cpp
src/gromacs/gmxpreprocess/tomorse.cpp
src/gromacs/gmxpreprocess/topdirs.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toputil.cpp
src/gromacs/gmxpreprocess/vsite_parm.cpp
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/gmxpreprocess/xlate.cpp
src/gromacs/gpu_utils/gpu_utils.cpp
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/detecthardware.cpp
src/gromacs/hardware/hardwareassign.cpp
src/gromacs/hardware/hardwaretopology.cpp
src/gromacs/imd/imd.cpp
src/gromacs/imd/imdsocket.cpp
src/gromacs/linearalgebra/eigensolver.cpp
src/gromacs/linearalgebra/matrix.cpp
src/gromacs/linearalgebra/sparsematrix.cpp
src/gromacs/listed-forces/bonded.cpp
src/gromacs/listed-forces/disre.cpp
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/listed-forces/listed-internal.cpp
src/gromacs/listed-forces/manage-threading.cpp
src/gromacs/listed-forces/orires.cpp
src/gromacs/listed-forces/pairs.cpp
src/gromacs/listed-forces/position-restraints.cpp
src/gromacs/listed-forces/tests/bonded.cpp
src/gromacs/math/do_fit.cpp
src/gromacs/math/units.cpp
src/gromacs/math/vecdump.cpp
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/calc_verletbuf.cpp
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/compute_io.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdlib/csettle.cpp
src/gromacs/mdlib/ebin.cpp
src/gromacs/mdlib/expanded.cpp
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/genborn.cpp
src/gromacs/mdlib/genborn_allvsall.cpp
src/gromacs/mdlib/gmx_omp_nthreads.cpp
src/gromacs/mdlib/groupcoord.cpp
src/gromacs/mdlib/main.cpp
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/mdatoms.cpp
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/mdebin_bar.cpp
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdsetup.cpp
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_grid.cpp
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_gpu_ref.cpp
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_ref_outer.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/ns.cpp
src/gromacs/mdlib/nsgrid.cpp
src/gromacs/mdlib/perf_est.cpp
src/gromacs/mdlib/qm_orca.cpp
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/shakef.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/sighandler.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/splitter.cpp
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/tpi.cpp
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdrunutility/handlerestart.cpp
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/mdtypes/state.cpp
src/gromacs/onlinehelp/helpformat.cpp
src/gromacs/onlinehelp/helpmanager.cpp
src/gromacs/onlinehelp/helptopic.cpp
src/gromacs/onlinehelp/helpwritercontext.cpp
src/gromacs/onlinehelp/tests/helpformat.cpp
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/onlinehelp/tests/helpwritercontext.cpp
src/gromacs/onlinehelp/tests/mock_helptopic.cpp
src/gromacs/options/abstractoption.cpp
src/gromacs/options/abstractoption.h
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptions.h
src/gromacs/options/filenameoption.cpp
src/gromacs/options/filenameoption.h
src/gromacs/options/optionmanagercontainer.h
src/gromacs/options/options.cpp
src/gromacs/options/optionsassigner.cpp
src/gromacs/options/optionstoragetemplate.h
src/gromacs/options/optionsvisitor.h
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/timeunitmanager.cpp
src/gromacs/pbcutil/boxutilities.cpp
src/gromacs/pbcutil/mshift.cpp
src/gromacs/pbcutil/pbc-simd.cpp
src/gromacs/pbcutil/pbc.cpp
src/gromacs/pbcutil/rmpbc.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pullutil.cpp
src/gromacs/selection/compiler.cpp
src/gromacs/selection/evaluate.cpp
src/gromacs/selection/indexutil.cpp
src/gromacs/selection/mempool.cpp
src/gromacs/selection/nbsearch.cpp
src/gromacs/selection/nbsearch.h
src/gromacs/selection/params.cpp
src/gromacs/selection/parser_internal.h
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/poscalc.cpp
src/gromacs/selection/position.cpp
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selection.cpp
src/gromacs/selection/selection.h
src/gromacs/selection/selectioncollection.cpp
src/gromacs/selection/selectionoption.cpp
src/gromacs/selection/selectionoptionbehavior.cpp
src/gromacs/selection/selelem.cpp
src/gromacs/selection/selelem.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/selmethod.cpp
src/gromacs/selection/selvalue.cpp
src/gromacs/selection/sm_compare.cpp
src/gromacs/selection/sm_distance.cpp
src/gromacs/selection/sm_insolidangle.cpp
src/gromacs/selection/sm_keywords.cpp
src/gromacs/selection/sm_merge.cpp
src/gromacs/selection/sm_permute.cpp
src/gromacs/selection/sm_position.cpp
src/gromacs/selection/sm_same.cpp
src/gromacs/selection/sm_simple.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/tests/indexutil.cpp
src/gromacs/selection/tests/nbsearch.cpp
src/gromacs/selection/tests/poscalc.cpp
src/gromacs/selection/tests/selectioncollection.cpp
src/gromacs/selection/tests/selectionoption.cpp
src/gromacs/selection/tests/toputils.cpp
src/gromacs/statistics/statistics.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/tables/forcetable.cpp
src/gromacs/timing/cyclecounter.cpp
src/gromacs/timing/wallcycle.cpp
src/gromacs/tools/check.cpp
src/gromacs/tools/convert_tpr.cpp
src/gromacs/tools/dump.cpp
src/gromacs/topology/atomprop.cpp
src/gromacs/topology/atoms.cpp
src/gromacs/topology/atomsbuilder.cpp
src/gromacs/topology/block.cpp
src/gromacs/topology/index.cpp
src/gromacs/topology/mtop_lookup.h
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/residuetypes.cpp
src/gromacs/topology/symtab.cpp
src/gromacs/topology/topology.cpp
src/gromacs/topology/topsort.cpp
src/gromacs/trajectoryanalysis/analysismodule.cpp
src/gromacs/trajectoryanalysis/analysissettings.cpp
src/gromacs/trajectoryanalysis/analysissettings.h
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/distance.cpp
src/gromacs/trajectoryanalysis/modules/freevolume.cpp
src/gromacs/trajectoryanalysis/modules/sasa.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp
src/gromacs/trajectoryanalysis/modules/surfacearea.cpp
src/gromacs/trajectoryanalysis/runnercommon.cpp
src/gromacs/trajectoryanalysis/tests/moduletest.cpp
src/gromacs/trajectoryanalysis/tests/surfacearea.cpp
src/gromacs/utility/alignedallocator.h
src/gromacs/utility/arrayref.h
src/gromacs/utility/coolstuff.cpp
src/gromacs/utility/cstringutil.cpp
src/gromacs/utility/datafilefinder.cpp
src/gromacs/utility/directoryenumerator.cpp
src/gromacs/utility/errorformat.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/filestream.cpp
src/gromacs/utility/futil.cpp
src/gromacs/utility/gmxomp.cpp
src/gromacs/utility/gmxregex.cpp
src/gromacs/utility/int64_to_int.cpp
src/gromacs/utility/logger.h
src/gromacs/utility/path.cpp
src/gromacs/utility/pleasecite.cpp
src/gromacs/utility/programcontext.cpp
src/gromacs/utility/qsort_threadsafe.cpp
src/gromacs/utility/smalloc.cpp
src/gromacs/utility/strdb.cpp
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/stringutil.h
src/gromacs/utility/sysinfo.cpp
src/gromacs/utility/tests/stringutil.cpp
src/gromacs/utility/txtdump.cpp
src/programs/legacymodules.cpp
src/programs/mdrun/md.cpp
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/membed.cpp
src/programs/mdrun/repl_ex.cpp
src/programs/mdrun/resource-division.cpp
src/programs/mdrun/runner.cpp
src/programs/view/fgrid.cpp
src/programs/view/filter.cpp
src/programs/view/logo.cpp
src/programs/view/manager.cpp
src/programs/view/nleg.cpp
src/programs/view/nmol.cpp
src/programs/view/popup.cpp
src/programs/view/view.cpp
src/programs/view/x11.cpp
src/programs/view/xdlg.cpp
src/programs/view/xdlghi.cpp
src/programs/view/xdlgitem.cpp
src/programs/view/xmb.cpp
src/programs/view/xutil.cpp
src/testutils/cmdlinetest.cpp
src/testutils/integrationtests.cpp
src/testutils/refdata-impl.h
src/testutils/refdata.cpp
src/testutils/refdata.h
src/testutils/testfilemanager.cpp
src/testutils/testfileredirector.cpp
src/testutils/testinit.cpp
src/testutils/tests/refdata_tests.cpp
src/testutils/xvgtest.cpp

index be081ad7656348dd48257e7938c8c7deeb389f09..9ad7136a43893b73beb42ebe0fbc011fc485ab2c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,7 +71,7 @@ class AnalysisDataHandleImpl
     public:
         //! Creates a handle associated with the given data object.
         explicit AnalysisDataHandleImpl(AnalysisData *data)
-            : data_(*data), currentFrame_(NULL)
+            : data_(*data), currentFrame_(nullptr)
         {
         }
 
@@ -227,7 +227,7 @@ AnalysisData::requestStorageInternal(int nframes)
  */
 
 AnalysisDataHandle::AnalysisDataHandle()
-    : impl_(NULL)
+    : impl_(nullptr)
 {
 }
 
@@ -241,8 +241,8 @@ AnalysisDataHandle::AnalysisDataHandle(internal::AnalysisDataHandleImpl *impl)
 void
 AnalysisDataHandle::startFrame(int index, real x, real dx)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ == NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ == nullptr,
                        "startFrame() called twice without calling finishFrame()");
     impl_->currentFrame_ =
         &impl_->data_.impl_->storage_.startFrame(index, x, dx);
@@ -252,8 +252,8 @@ AnalysisDataHandle::startFrame(int index, real x, real dx)
 void
 AnalysisDataHandle::selectDataSet(int index)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "selectDataSet() called without calling startFrame()");
     impl_->currentFrame_->selectDataSet(index);
 }
@@ -262,8 +262,8 @@ AnalysisDataHandle::selectDataSet(int index)
 void
 AnalysisDataHandle::setPoint(int column, real value, bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoint() called without calling startFrame()");
     impl_->currentFrame_->setValue(column, value, bPresent);
 }
@@ -272,8 +272,8 @@ AnalysisDataHandle::setPoint(int column, real value, bool bPresent)
 void
 AnalysisDataHandle::setPoint(int column, real value, real error, bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoint() called without calling startFrame()");
     impl_->currentFrame_->setValue(column, value, error, bPresent);
 }
@@ -283,8 +283,8 @@ void
 AnalysisDataHandle::setPoints(int firstColumn, int count, const real *values,
                               bool bPresent)
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "setPoints() called without calling startFrame()");
     for (int i = 0; i < count; ++i)
     {
@@ -296,10 +296,10 @@ AnalysisDataHandle::setPoints(int firstColumn, int count, const real *values,
 void
 AnalysisDataHandle::finishPointSet()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
     GMX_RELEASE_ASSERT(impl_->data_.isMultipoint(),
                        "finishPointSet() called for non-multipoint data");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "finishPointSet() called without calling startFrame()");
     impl_->currentFrame_->finishPointSet();
 }
@@ -308,11 +308,11 @@ AnalysisDataHandle::finishPointSet()
 void
 AnalysisDataHandle::finishFrame()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
-    GMX_RELEASE_ASSERT(impl_->currentFrame_ != NULL,
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_->currentFrame_ != nullptr,
                        "finishFrame() called without calling startFrame()");
     AnalysisDataStorageFrame *frame = impl_->currentFrame_;
-    impl_->currentFrame_ = NULL;
+    impl_->currentFrame_ = nullptr;
     frame->finishFrame();
 }
 
@@ -320,10 +320,10 @@ AnalysisDataHandle::finishFrame()
 void
 AnalysisDataHandle::finishData()
 {
-    GMX_RELEASE_ASSERT(impl_ != NULL, "Invalid data handle used");
+    GMX_RELEASE_ASSERT(impl_ != nullptr, "Invalid data handle used");
     // Deletes the implementation pointer.
     impl_->data_.finishData(*this);
-    impl_ = NULL;
+    impl_ = nullptr;
 }
 
 } // namespace gmx
index bb135990e1edf737d204262ee9cc715c0acf3ca6..09e8733da10cc089ead0bbe8e77d169d4d0b4b7f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -260,7 +260,7 @@ class AnalysisDataHandle
         AnalysisDataHandle();
 
         //! Returns whether this data handle is valid.
-        bool isValid() const { return impl_ != NULL; }
+        bool isValid() const { return impl_ != nullptr; }
 
         /*! \brief
          * Start data for a new frame.
index c495aa93989a7968c098d47a79dba8e6e9726b53..614f84d00efbfa5cea3db891572d83169bfcb86b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,7 +55,7 @@ AnalysisDataProxy::AnalysisDataProxy(int firstColumn, int columnSpan,
     : source_(*data), firstColumn_(firstColumn), columnSpan_(columnSpan),
       bParallel_(false)
 {
-    GMX_RELEASE_ASSERT(data != NULL, "Source data must not be NULL");
+    GMX_RELEASE_ASSERT(data != nullptr, "Source data must not be NULL");
     GMX_RELEASE_ASSERT(firstColumn >= 0 && columnSpan > 0, "Invalid proxy column");
     setMultipoint(source_.isMultipoint());
 }
index 8eb79be9884a2b9a074db12022a18ee66b5586c0..dc3db91b02f0d81c8fba2eff2ba0beb7cf85941c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -399,7 +399,7 @@ class AnalysisDataStorageFrameData
  */
 
 AnalysisDataStorageImpl::AnalysisDataStorageImpl()
-    : data_(NULL), modules_(NULL),
+    : data_(nullptr), modules_(nullptr),
       storageLimit_(0), pendingLimit_(1),
       firstFrameLocation_(0), firstUnnotifiedIndex_(0), nextIndex_(0)
 {
@@ -564,7 +564,7 @@ AnalysisDataStorageFrameData::AnalysisDataStorageFrameData(
         int                      index)
     : storageImpl_(*storageImpl), header_(index, 0.0, 0.0), status_(eMissing)
 {
-    GMX_RELEASE_ASSERT(storageImpl->data_ != NULL,
+    GMX_RELEASE_ASSERT(storageImpl->data_ != nullptr,
                        "Storage frame constructed before data started");
     // With non-multipoint data, the point set structure is static,
     // so initialize it only once here.
@@ -675,7 +675,7 @@ AnalysisDataStorageFrameData::pointSet(int index) const
 
 AnalysisDataStorageFrame::AnalysisDataStorageFrame(
         const AbstractAnalysisData &data)
-    : data_(NULL), currentDataSet_(0), currentOffset_(0),
+    : data_(nullptr), currentDataSet_(0), currentOffset_(0),
       columnCount_(data.columnCount(0)), bPointSetInProgress_(false)
 {
     int totalColumnCount = 0;
@@ -710,7 +710,7 @@ AnalysisDataStorageFrame::clearValues()
 void
 AnalysisDataStorageFrame::selectDataSet(int index)
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     const AbstractAnalysisData &baseData = data_->baseData();
     GMX_RELEASE_ASSERT(index >= 0 && index < baseData.dataSetCount(),
                        "Out of range data set index");
@@ -730,7 +730,7 @@ AnalysisDataStorageFrame::selectDataSet(int index)
 void
 AnalysisDataStorageFrame::finishPointSet()
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     GMX_RELEASE_ASSERT(data_->baseData().isMultipoint(),
                        "Should not be called for non-multipoint data");
     if (bPointSetInProgress_)
@@ -762,7 +762,7 @@ AnalysisDataStorageFrame::finishPointSet()
 void
 AnalysisDataStorageFrame::finishFrame()
 {
-    GMX_RELEASE_ASSERT(data_ != NULL, "Invalid frame accessed");
+    GMX_RELEASE_ASSERT(data_ != nullptr, "Invalid frame accessed");
     data_->storageImpl().finishFrame(data_->frameIndex());
 }
 
index 586357097dd9571340d7c76736bc03e94ce4df97..d8db1660c3f5d1de8f4adf718a128dc994e590e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -103,8 +103,8 @@ class AnalysisDataDisplacementModule::Impl
 AnalysisDataDisplacementModule::Impl::Impl()
     : nmax(0), tmax(0.0), ndim(3),
       bFirst(true), t0(0.0), dt(0.0), t(0.0), ci(0),
-      max_store(-1), nstored(0), oldval(NULL),
-      histm(NULL)
+      max_store(-1), nstored(0), oldval(nullptr),
+      histm(nullptr)
 {
 }
 
@@ -140,7 +140,7 @@ void
 AnalysisDataDisplacementModule::setMSDHistogram(
         AnalysisDataBinAverageModulePointer histm)
 {
-    GMX_RELEASE_ASSERT(_impl->histm == NULL, "Can only set MSD histogram once");
+    GMX_RELEASE_ASSERT(_impl->histm == nullptr, "Can only set MSD histogram once");
     _impl->histm = histm.get();
     addModule(histm);
 }
index d44a240479fc9ecca5bdace17104d1ad93d86157..f61b34e366d86f9971b04d98aa8ef87e47804c9d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,7 +82,7 @@ namespace gmx
  */
 
 AnalysisDataPlotSettings::AnalysisDataPlotSettings()
-    : selections_(NULL), timeUnit_(TimeUnit_Default), plotFormat_(1)
+    : selections_(nullptr), timeUnit_(TimeUnit_Default), plotFormat_(1)
 {
 }
 
@@ -132,7 +132,7 @@ class AbstractPlotModule::Impl
 };
 
 AbstractPlotModule::Impl::Impl(const AnalysisDataPlotSettings &settings)
-    : settings_(settings), fp_(NULL), bPlain_(false), bOmitX_(false),
+    : settings_(settings), fp_(nullptr), bPlain_(false), bOmitX_(false),
       bErrorsAsSeparateColumn_(false), xscale_(1.0)
 {
     strcpy(xformat_, "%11.3f");
@@ -148,7 +148,7 @@ AbstractPlotModule::Impl::~Impl()
 void
 AbstractPlotModule::Impl::closeFile()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         if (bPlain_)
         {
@@ -158,7 +158,7 @@ AbstractPlotModule::Impl::closeFile()
         {
             xvgrclose(fp_);
         }
-        fp_ = NULL;
+        fp_ = nullptr;
     }
 }
 
@@ -299,7 +299,7 @@ AbstractPlotModule::setXFormat(int width, int precision, char format)
     GMX_RELEASE_ASSERT(width >= 0 && precision >= 0
                        && width <= 99 && precision <= 99,
                        "Invalid width or precision");
-    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != NULL,
+    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != nullptr,
                        "Invalid format specifier");
     sprintf(impl_->xformat_, "%%%d.%d%c", width, precision, format);
 }
@@ -311,7 +311,7 @@ AbstractPlotModule::setYFormat(int width, int precision, char format)
     GMX_RELEASE_ASSERT(width >= 0 && precision >= 0
                        && width <= 99 && precision <= 99,
                        "Invalid width or precision");
-    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != NULL,
+    GMX_RELEASE_ASSERT(strchr("eEfFgG", format) != nullptr,
                        "Invalid format specifier");
     sprintf(impl_->yformat_, " %%%d.%d%c", width, precision, format);
 }
@@ -350,7 +350,7 @@ AbstractPlotModule::dataStarted(AbstractAnalysisData * /* data */)
                                   oenv);
             const SelectionCollection *selections
                 = impl_->settings_.selectionCollection();
-            if (selections != NULL && output_env_get_xvg_format(oenv) != exvgNONE)
+            if (selections != nullptr && output_env_get_xvg_format(oenv) != exvgNONE)
             {
                 selections->printXvgrInfo(impl_->fp_);
             }
@@ -409,7 +409,7 @@ AbstractPlotModule::dataFinished()
 bool
 AbstractPlotModule::isFileOpen() const
 {
-    return impl_->fp_ != NULL;
+    return impl_->fp_ != nullptr;
 }
 
 
index 1871e0537014279af1969e75cfa95cd9f29e119d..7fdd647eb6349137bad72480e0ec616da13fecd9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,7 +143,7 @@ namespace
 void checkReferenceDataPoint(TestReferenceChecker    *checker,
                              const AnalysisDataValue &value)
 {
-    TestReferenceChecker compound(checker->checkCompound("DataValue", NULL));
+    TestReferenceChecker compound(checker->checkCompound("DataValue", nullptr));
     compound.checkReal(value.value(), "Value");
     if (compound.checkPresent(value.hasError(), "Error"))
     {
@@ -158,7 +158,7 @@ void checkReferenceDataPoint(TestReferenceChecker    *checker,
 }       // namespace
 
 MockAnalysisDataModule::Impl::Impl(int flags)
-    : source_(NULL), flags_(flags), frameIndex_(0)
+    : source_(nullptr), flags_(flags), frameIndex_(0)
 {
 }
 
@@ -192,7 +192,7 @@ MockAnalysisDataModule::Impl::checkReferencePoints(
     if (frameChecker_)
     {
         TestReferenceChecker checker(
-                frameChecker_.checkCompound("DataValues", NULL));
+                frameChecker_.checkCompound("DataValues", nullptr));
         checker.checkInteger(points.columnCount(), "Count");
         if (checker.checkPresent(source_->dataSetCount() > 1, "DataSet"))
         {
index 59d776e4d10f9ba12462d96d521f142190dbe840..5d81d9a878bd052c9c3806128c05eed6eff6854e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,7 +61,7 @@ namespace
  *
  * \ingroup module_commandline
  */
-const CommandLineHelpContext *g_globalContext = NULL;
+const CommandLineHelpContext *g_globalContext = nullptr;
 
 }   // namespace
 
@@ -77,13 +77,13 @@ class CommandLineHelpContext::Impl
         Impl(TextWriter *writer, HelpOutputFormat format,
              const HelpLinks *links)
             : writerContext_(writer, format, links), moduleDisplayName_("gmx"),
-              completionWriter_(NULL), bHidden_(false)
+              completionWriter_(nullptr), bHidden_(false)
         {
         }
         //! Creates an implementation class from a low-level context.
         explicit Impl(const HelpWriterContext &writerContext)
             : writerContext_(writerContext),
-              completionWriter_(NULL), bHidden_(false)
+              completionWriter_(nullptr), bHidden_(false)
         {
         }
 
@@ -113,7 +113,7 @@ CommandLineHelpContext::CommandLineHelpContext(
 
 CommandLineHelpContext::CommandLineHelpContext(
         ShellCompletionWriter *writer)
-    : impl_(new Impl(&writer->outputWriter(), eHelpOutputFormat_Other, NULL))
+    : impl_(new Impl(&writer->outputWriter(), eHelpOutputFormat_Other, nullptr))
 {
     impl_->completionWriter_ = writer;
 }
@@ -173,7 +173,7 @@ bool CommandLineHelpContext::showHidden() const
 
 bool CommandLineHelpContext::isCompletionExport() const
 {
-    return impl_->completionWriter_ != NULL;
+    return impl_->completionWriter_ != nullptr;
 }
 
 ShellCompletionWriter &CommandLineHelpContext::shellCompletionWriter() const
@@ -196,14 +196,14 @@ const CommandLineHelpContext *GlobalCommandLineHelpContext::get()
 GlobalCommandLineHelpContext::GlobalCommandLineHelpContext(
         const CommandLineHelpContext &context)
 {
-    GMX_RELEASE_ASSERT(g_globalContext == NULL,
+    GMX_RELEASE_ASSERT(g_globalContext == nullptr,
                        "Global context set more than once");
     g_globalContext = &context;
 }
 
 GlobalCommandLineHelpContext::~GlobalCommandLineHelpContext()
 {
-    g_globalContext = NULL;
+    g_globalContext = nullptr;
 }
 
 } // namespace gmx
index 0a2ceac2ec1e64441020e7ff76bb2caba326739e..3341491f4bf8e4e6db6adeec11f5c95563eb7ff6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -277,7 +277,7 @@ void RootHelpTopic::exportHelp(IHelpExport *exporter)
          ++topicName)
     {
         const IHelpTopic *topic = findSubTopic(topicName->c_str());
-        GMX_RELEASE_ASSERT(topic != NULL, "Exported help topic no longer found");
+        GMX_RELEASE_ASSERT(topic != nullptr, "Exported help topic no longer found");
         exporter->exportTopic(*topic);
     }
     // For now, the title is only set for the export to make it not appear in
@@ -331,7 +331,7 @@ void RootHelpTopic::writeHelp(const HelpWriterContext &context) const
 CommandLineHelpContext
 RootHelpTopic::createContext(const HelpWriterContext &context) const
 {
-    if (helpModule_.context_ != NULL)
+    if (helpModule_.context_ != nullptr)
     {
         return CommandLineHelpContext(*helpModule_.context_);
     }
@@ -370,7 +370,7 @@ class CommandsHelpTopic : public IHelpTopic
         virtual bool hasSubTopics() const { return false; }
         virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
         {
-            return NULL;
+            return nullptr;
         }
 
         virtual void writeHelp(const HelpWriterContext &context) const;
@@ -394,7 +394,7 @@ void CommandsHelpTopic::writeHelp(const HelpWriterContext &context) const
     for (module = modules.begin(); module != modules.end(); ++module)
     {
         int nameLength = static_cast<int>(module->first.length());
-        if (module->second->shortDescription() != NULL
+        if (module->second->shortDescription() != nullptr
             && nameLength > maxNameLength)
         {
             maxNameLength = nameLength;
@@ -405,14 +405,14 @@ void CommandsHelpTopic::writeHelp(const HelpWriterContext &context) const
             "Available commands:");
     TextWriter        &file = context.outputFile();
     TextTableFormatter formatter;
-    formatter.addColumn(NULL, maxNameLength + 1, false);
-    formatter.addColumn(NULL, 72 - maxNameLength, true);
+    formatter.addColumn(nullptr, maxNameLength + 1, false);
+    formatter.addColumn(nullptr, 72 - maxNameLength, true);
     formatter.setFirstColumnIndent(4);
     for (module = modules.begin(); module != modules.end(); ++module)
     {
         const char *name        = module->first.c_str();
         const char *description = module->second->shortDescription();
-        if (description != NULL)
+        if (description != nullptr)
         {
             formatter.clear();
             formatter.addColumnLine(0, name);
@@ -448,11 +448,11 @@ class ModuleHelpTopic : public IHelpTopic
         }
 
         virtual const char *name() const { return module_.name(); }
-        virtual const char *title() const { return NULL; }
+        virtual const char *title() const { return nullptr; }
         virtual bool hasSubTopics() const { return false; }
         virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
         {
-            return NULL;
+            return nullptr;
         }
         virtual void writeHelp(const HelpWriterContext &context) const;
 
@@ -495,7 +495,7 @@ void initProgramLinks(HelpLinks *links, const CommandLineHelpModuleImpl &helpMod
          module != helpModule.modules_.end();
          ++module)
     {
-        if (module->second->shortDescription() != NULL)
+        if (module->second->shortDescription() != nullptr)
         {
             std::string linkName("[gmx-" + module->first + "]");
             const char *name = module->first.c_str();
@@ -774,7 +774,7 @@ CommandLineHelpModuleImpl::CommandLineHelpModuleImpl(
         const CommandLineModuleGroupList &groups)
     : rootTopic_(*this), programContext_(programContext),
       binaryName_(binaryName), modules_(modules), groups_(groups),
-      context_(NULL), moduleOverride_(NULL), bHidden_(false),
+      context_(nullptr), moduleOverride_(nullptr), bHidden_(false),
       outputRedirector_(&defaultFileOutputRedirector())
 {
 }
@@ -806,7 +806,7 @@ void CommandLineHelpModuleImpl::exportHelp(IHelpExport *exporter)
     CommandLineModuleMap::const_iterator module;
     for (module = modules_.begin(); module != modules_.end(); ++module)
     {
-        if (module->second->shortDescription() != NULL)
+        if (module->second->shortDescription() != nullptr)
         {
             const char *const moduleName = module->first.c_str();
             std::string       tag(formatString("%s-%s", program, moduleName));
@@ -969,7 +969,7 @@ int CommandLineHelpModule::run(int argc, char *argv[])
     CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, &links,
                                    impl_->binaryName_);
     context.setShowHidden(impl_->bHidden_);
-    if (impl_->moduleOverride_ != NULL)
+    if (impl_->moduleOverride_ != nullptr)
     {
         context.setModuleDisplayName(impl_->programContext_.displayName());
         impl_->moduleOverride_->writeHelp(context);
index 4756ebe4a8b2524ba2b24ef553214c5568bec63c..43151ce5fc4145451ff5ddc88b829d8474a22816 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,7 +120,7 @@ class OptionsFilter : public OptionsVisitor
          * Does not throw.
          */
         OptionsFilter()
-            : formatter_(NULL), filterType_(eSelectOtherOptions),
+            : formatter_(nullptr), filterType_(eSelectOtherOptions),
               bShowHidden_(false)
         {
         }
@@ -170,7 +170,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         return;
     }
     const FileNameOptionInfo *const fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL && fileOption->isInputFile())
+    if (fileOption != nullptr && fileOption->isInputFile())
     {
         if (filterType_ == eSelectInputFileOptions)
         {
@@ -178,7 +178,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         }
         return;
     }
-    if (fileOption != NULL && fileOption->isInputOutputFile())
+    if (fileOption != nullptr && fileOption->isInputOutputFile())
     {
         if (filterType_ == eSelectInputOutputFileOptions)
         {
@@ -186,7 +186,7 @@ void OptionsFilter::visitOption(const OptionInfo &option)
         }
         return;
     }
-    if (fileOption != NULL && fileOption->isOutputFile())
+    if (fileOption != nullptr && fileOption->isOutputFile())
     {
         if (filterType_ == eSelectOutputFileOptions)
         {
@@ -282,8 +282,8 @@ descriptionWithOptionDetails(const CommonFormatterData &common,
 
     const FloatOptionInfo  *floatOption  = option.toType<FloatOptionInfo>();
     const DoubleOptionInfo *doubleOption = option.toType<DoubleOptionInfo>();
-    if ((floatOption != NULL && floatOption->isTime())
-        || (doubleOption != NULL && doubleOption->isTime()))
+    if ((floatOption != nullptr && floatOption->isTime())
+        || (doubleOption != nullptr && doubleOption->isTime()))
     {
         // TODO: It could be nicer to have this in basicoptions.cpp.
         description = replaceAll(description, "%t", common.timeUnit);
@@ -416,14 +416,14 @@ class OptionsListFormatter : public IOptionsFormatter
     private:
         void writeSectionStartIfNecessary()
         {
-            if (title_ != NULL)
+            if (title_ != nullptr)
             {
                 context_.writeTitle(title_);
-                title_ = NULL;
+                title_ = nullptr;
             }
             if (!bDidOutput_)
             {
-                if (header_ != NULL)
+                if (header_ != nullptr)
                 {
                     context_.paragraphBreak();
                     context_.writeTextBlock(header_);
@@ -448,7 +448,7 @@ OptionsListFormatter::OptionsListFormatter(
         const CommonFormatterData &common,
         const char                *title)
     : context_(context), common_(common),
-      title_(title), header_(NULL), bDidOutput_(false)
+      title_(title), header_(nullptr), bDidOutput_(false)
 {
 }
 
@@ -460,7 +460,7 @@ void OptionsListFormatter::formatOption(const OptionInfo &option)
     std::string               defaultValue(defaultOptionValue(option));
     std::string               info;
     const FileNameOptionInfo *fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL)
+    if (fileOption != nullptr)
     {
         const bool bAbbrev = (context_.outputFormat() == eHelpOutputFormat_Console);
         info = fileOptionFlagsAsString(*fileOption, bAbbrev);
index 2915f0aacbf5aae8fab6d1b6defd301e920ae82c..e59cb866248ee664ddbf57260a662daf8834c0d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -141,9 +141,9 @@ CommandLineProgramContext &initForCommandLine(int *argc, char ***argv)
 void finalizeForCommandLine()
 {
     gmx::finalize();
-    setLibraryFileFinder(NULL);
+    setLibraryFileFinder(nullptr);
     g_libFileFinder.reset();
-    setProgramContext(NULL);
+    setProgramContext(nullptr);
     g_commandLineContext.reset();
 }
 
index 0019a324da66df3b0408b503471c01e5d86a34ca..9050a5a6901c0ed8eaaa1f57df1ef0b91a9af230 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,7 +84,7 @@ void writeCommandLineHelpCMain(
     int   argc = 1;
     // TODO: The constness should not be cast away.
     argv[0] = const_cast<char *>(name);
-    argv[1] = NULL;
+    argv[1] = nullptr;
     GlobalCommandLineHelpContext global(context);
     mainFunction(argc, argv);
 }
index 82b14fe19c628b57107877f6f599a7f1b0555d0b..45a06cef72e12ea7262b91396d1791fce2a71711 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -316,8 +316,8 @@ class CommandLineModuleManager::Impl
 CommandLineModuleManager::Impl::Impl(const char                *binaryName,
                                      CommandLineProgramContext *programContext)
     : programContext_(*programContext),
-      binaryName_(binaryName != NULL ? binaryName : ""),
-      helpModule_(NULL), singleModule_(NULL),
+      binaryName_(binaryName != nullptr ? binaryName : ""),
+      helpModule_(nullptr), singleModule_(nullptr),
       bQuiet_(false)
 {
     GMX_RELEASE_ASSERT(binaryName_.find('-') == std::string::npos,
@@ -337,7 +337,7 @@ void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)
 
 void CommandLineModuleManager::Impl::ensureHelpModuleExists()
 {
-    if (helpModule_ == NULL)
+    if (helpModule_ == nullptr)
     {
         helpModule_ = new CommandLineHelpModule(programContext_, binaryName_,
                                                 modules_, moduleGroups_);
@@ -362,7 +362,7 @@ CommandLineModuleManager::Impl::processCommonOptions(
     // TODO: It would be nice to propagate at least the -quiet option to
     // the modules so that they can also be quiet in response to this.
 
-    if (module == NULL)
+    if (module == nullptr)
     {
         // If not in single-module mode, process options to the wrapper binary.
         // TODO: Ideally, this could be done by CommandLineParser.
@@ -395,9 +395,9 @@ CommandLineModuleManager::Impl::processCommonOptions(
             // which path is taken: (*argv)[0] is the module name.
         }
     }
-    if (module != NULL)
+    if (module != nullptr)
     {
-        if (singleModule_ == NULL)
+        if (singleModule_ == nullptr)
         {
             programContext_.setDisplayName(binaryName_ + " " + module->name());
         }
@@ -409,14 +409,14 @@ CommandLineModuleManager::Impl::processCommonOptions(
     }
     if (!optionsHolder->finishOptions())
     {
-        return NULL;
+        return nullptr;
     }
     // If no module specified and no other action, show the help.
     // Also explicitly specifying -h for the wrapper binary goes here.
-    if (module == NULL || optionsHolder->shouldShowHelp())
+    if (module == nullptr || optionsHolder->shouldShowHelp())
     {
         ensureHelpModuleExists();
-        if (module != NULL)
+        if (module != nullptr)
         {
             helpModule_->setModuleOverride(*module);
         }
@@ -536,7 +536,7 @@ int CommandLineModuleManager::run(int argc, char *argv[])
                                optionsHolder.binaryInfoSettings());
         fprintf(out, "\n");
     }
-    if (module == NULL)
+    if (module == nullptr)
     {
         return 0;
     }
@@ -596,7 +596,7 @@ int CommandLineModuleManager::runAsMainSingleModule(
     CommandLineProgramContext &programContext = gmx::initForCommandLine(&argc, &argv);
     try
     {
-        CommandLineModuleManager manager(NULL, &programContext);
+        CommandLineModuleManager manager(nullptr, &programContext);
         manager.setSingleModule(module);
         int rc = manager.run(argc, argv);
         gmx::finalizeForCommandLine();
@@ -636,10 +636,10 @@ void CommandLineModuleGroupData::addModule(const char *name,
     CommandLineModuleMap::const_iterator moduleIter = allModules_.find(name);
     GMX_RELEASE_ASSERT(moduleIter != allModules_.end(),
                        "Non-existent module added to a group");
-    if (description == NULL)
+    if (description == nullptr)
     {
         description = moduleIter->second->shortDescription();
-        GMX_RELEASE_ASSERT(description != NULL,
+        GMX_RELEASE_ASSERT(description != nullptr,
                            "Module without a description added to a group");
     }
     std::string       tag(formatString("%s-%s", binaryName_, name));
@@ -652,7 +652,7 @@ void CommandLineModuleGroupData::addModule(const char *name,
 
 void CommandLineModuleGroup::addModule(const char *name)
 {
-    impl_->addModule(name, NULL);
+    impl_->addModule(name, nullptr);
 }
 
 void CommandLineModuleGroup::addModuleWithDescription(const char *name,
index b4d45d37556010611c2e8accdb319a7a28f08127..f0e6db73a3618fe08bbd12d12e22475f13e4875c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,7 +131,7 @@ void CommandLineOptionsModule::init(CommandLineModuleSettings *settings)
 {
     if (!module_)
     {
-        GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided");
+        GMX_RELEASE_ASSERT(factory_ != nullptr, "Neither factory nor module provided");
         module_ = factory_();
     }
     module_->init(settings);
@@ -150,7 +150,7 @@ void CommandLineOptionsModule::writeHelp(const CommandLineHelpContext &context)
     ICommandLineOptionsModule        *module = module_.get();
     if (!module)
     {
-        GMX_RELEASE_ASSERT(factory_ != NULL, "Neither factory nor module provided");
+        GMX_RELEASE_ASSERT(factory_ != nullptr, "Neither factory nor module provided");
         moduleGuard = factory_();
         module      = moduleGuard.get();
     }
index 2db9afd01666db2d72928446d0a6bef83241cfb7..9ba3cac18000a73a410982680b55f14aaac80add 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -97,7 +97,7 @@ const char *CommandLineParser::Impl::toOptionName(const char *arg) const
     // Lone '-' or '--' is not an option.
     if (arg[0] != '-' || arg[1] == '\0' || (arg[1] == '-' && arg[2] == '\0'))
     {
-        return NULL;
+        return nullptr;
     }
     // Something starting with '--' is always an option.
     if (arg[1] == '-')
@@ -110,7 +110,7 @@ const char *CommandLineParser::Impl::toOptionName(const char *arg) const
     GMX_IGNORE_RETURN_VALUE(std::strtod(arg, &endptr));
     if (*endptr == '\0')
     {
-        return NULL;
+        return nullptr;
     }
     return arg + 1;
 }
@@ -146,7 +146,7 @@ void CommandLineParser::parse(int *argc, char *argv[])
     {
         const char *const arg        = argv[i];
         const char *const optionName = impl_->toOptionName(arg);
-        if (optionName != NULL)
+        if (optionName != nullptr)
         {
             if (bInOption)
             {
@@ -213,7 +213,7 @@ void CommandLineParser::parse(int *argc, char *argv[])
     if (impl_->bSkipUnknown_)
     {
         *argc      = newi;
-        argv[newi] = NULL;
+        argv[newi] = nullptr;
     }
     // Finish the last option.
     if (bInOption)
index 7d61b0c0715bfb4a769ecbfc5037e47046d65985..dc15cd2df794c62a54e233beb15f78305302e9c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,7 @@ namespace
  */
 std::string quoteIfNecessary(const char *str)
 {
-    const bool bSpaces = (std::strchr(str, ' ') != NULL);
+    const bool bSpaces = (std::strchr(str, ' ') != nullptr);
     if (bSpaces)
     {
         return formatString("'%s'", str);
index f8b5e55282807846ec925b42e2ab0150194ee19b..cbda55311ff5e91b4d9435ee27bb6666288015ff 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -62,7 +62,7 @@ const t_filenm *getFilenm(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
@@ -79,7 +79,7 @@ const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
 
     fprintf(stderr, "No option %s\n", opt);
 
-    return NULL;
+    return nullptr;
 }
 
 int opt2fns(char **fns[], const char *opt, int nfile, const t_filenm fnm[])
@@ -112,7 +112,7 @@ const char *ftp2fn(int ftp, int nfile, const t_filenm fnm[])
     }
 
     fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
-    return NULL;
+    return nullptr;
 }
 
 int ftp2fns(char **fns[], int ftp, int nfile, const t_filenm fnm[])
@@ -176,7 +176,7 @@ const char *opt2fn_null(const char *opt, int nfile, const t_filenm fnm[])
         {
             if (IS_OPT(fnm[i]) && !IS_SET(fnm[i]))
             {
-                return NULL;
+                return nullptr;
             }
             else
             {
@@ -185,7 +185,7 @@ const char *opt2fn_null(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
     fprintf(stderr, "No option %s\n", opt);
-    return NULL;
+    return nullptr;
 }
 
 const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
@@ -198,7 +198,7 @@ const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
         {
             if (IS_OPT(fnm[i]) && !IS_SET(fnm[i]))
             {
-                return NULL;
+                return nullptr;
             }
             else
             {
@@ -207,7 +207,7 @@ const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
         }
     }
     fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
-    return NULL;
+    return nullptr;
 }
 
 gmx_bool is_optional(const t_filenm *fnm)
@@ -266,7 +266,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
         }
         else
         {
-            ret[i].opt = NULL;
+            ret[i].opt = nullptr;
         }
 
         if (tfn[i].fn)
@@ -275,7 +275,7 @@ t_filenm *dup_tfn(int nf, const t_filenm tfn[])
         }
         else
         {
-            ret[i].fn = NULL;
+            ret[i].fn = nullptr;
         }
 
         if (tfn[i].nfiles > 0)
@@ -301,6 +301,6 @@ void done_filenms(int nf, t_filenm fnm[])
             sfree(fnm[i].fns[j]);
         }
         sfree(fnm[i].fns);
-        fnm[i].fns = NULL;
+        fnm[i].fns = nullptr;
     }
 }
index dcbb501dc26947e58930554c225334a0414e01a2..0ceb6a777fc23af35234e002baca4843b0fc5793 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -149,7 +149,7 @@ const char *opt2parg_str(const char *option, int nparg, t_pargs pa[])
 
     gmx_fatal(FARGS, "No string option %s in pargs", option);
 
-    return NULL;
+    return nullptr;
 }
 
 gmx_bool opt2parg_bSet(const char *option, int nparg, t_pargs pa[])
@@ -183,7 +183,7 @@ const char *opt2parg_enum(const char *option, int nparg, t_pargs pa[])
 
     gmx_fatal(FARGS, "No such option %s in pargs", option);
 
-    return NULL;
+    return nullptr;
 }
 
 /********************************************************************
@@ -204,7 +204,7 @@ namespace
 int getDefaultXvgFormat(gmx::ConstArrayRef<const char *> xvgFormats)
 {
     const char *const select = getenv("GMX_VIEW_XVG");
-    if (select != NULL)
+    if (select != nullptr)
     {
         ConstArrayRef<const char *>::const_iterator i =
             std::find(xvgFormats.begin(), xvgFormats.end(), std::string(select));
@@ -272,7 +272,7 @@ class OptionsAdapter
         struct FileNameData
         {
             //! Creates a conversion helper for a given `t_filenm` struct.
-            explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(NULL)
+            explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(nullptr)
             {
             }
 
@@ -287,7 +287,7 @@ class OptionsAdapter
         {
             //! Creates a conversion helper for a given `t_pargs` struct.
             explicit ProgramArgData(t_pargs *pa)
-                : pa(pa), optionInfo(NULL), enumIndex(0), boolValue(false)
+                : pa(pa), optionInfo(nullptr), enumIndex(0), boolValue(false)
             {
             }
 
@@ -316,7 +316,7 @@ class OptionsAdapter
 
 void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
 {
-    if (fnm->opt == NULL)
+    if (fnm->opt == nullptr)
     {
         // Existing code may use opt2fn() instead of ftp2fn() for
         // options that use the default option name, so we need to
@@ -334,7 +334,7 @@ void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
     const char *const name      = &fnm->opt[1];
     const char *      defName   = fnm->fn;
     int               defType   = -1;
-    if (defName == NULL)
+    if (defName == nullptr)
     {
         defName = ftp2defnm(fnm->ftp);
     }
@@ -387,7 +387,7 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
             return;
         case etSTR:
         {
-            const char *const defValue = (*pa->u.c != NULL ? *pa->u.c : "");
+            const char *const defValue = (*pa->u.c != nullptr ? *pa->u.c : "");
             data.optionInfo = options->addOption(
                         StringOption(name).store(&data.stringValue)
                             .defaultValue(defValue)
@@ -407,7 +407,7 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
             return;
         case etENUM:
         {
-            const int defaultIndex = (pa->u.c[0] != NULL ? nenum(pa->u.c) - 1 : 0);
+            const int defaultIndex = (pa->u.c[0] != nullptr ? nenum(pa->u.c) - 1 : 0);
             data.optionInfo = options->addOption(
                         EnumIntOption(name).store(&data.enumIndex)
                             .defaultValue(defaultIndex)
@@ -571,7 +571,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
 
         const gmx::CommandLineHelpContext *context =
             gmx::GlobalCommandLineHelpContext::get();
-        if (context != NULL)
+        if (context != nullptr)
         {
             GMX_RELEASE_ASSERT(gmx_node_rank() == 0,
                                "Help output should be handled higher up and "
index 88d64ab8c627d2060d5abbedaabc4e905ff21177..7a8e23da57cf34f292de98b1744e40c555ea4575 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -94,7 +94,7 @@ class OptionsListWriter : public OptionsVisitor
             optionList_.append("-");
             const BooleanOptionInfo *booleanOption
                 = option.toType<BooleanOptionInfo>();
-            if (booleanOption != NULL && booleanOption->defaultValue())
+            if (booleanOption != nullptr && booleanOption->defaultValue())
             {
                 optionList_.append("no");
             }
@@ -132,7 +132,7 @@ void OptionCompletionWriter::visitOption(const OptionInfo &option)
         return;
     }
     const FileNameOptionInfo *fileOption = option.toType<FileNameOptionInfo>();
-    if (fileOption != NULL)
+    if (fileOption != nullptr)
     {
         if (fileOption->isDirectoryOption())
         {
@@ -157,7 +157,7 @@ void OptionCompletionWriter::visitOption(const OptionInfo &option)
         return;
     }
     const StringOptionInfo *stringOption = option.toType<StringOptionInfo>();
-    if (stringOption != NULL && stringOption->isEnumerated())
+    if (stringOption != nullptr && stringOption->isEnumerated())
     {
         std::string completion("compgen -S ' ' -W $'");
         completion.append(joinStrings(stringOption->allowedValues(), "\\n"));
index 84f70e7891cdbb82565e95f341fb5c33ad32fd07..055be24bcb51c000eb38b4b0c85fd89dc8284f26 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -80,7 +80,7 @@ void CommandLineHelpWriterTest::checkHelp(gmx::CommandLineHelpWriter *writer)
     gmx::StringOutputStream     stream;
     gmx::TextWriter             streamWriter(&stream);
     gmx::CommandLineHelpContext context(&streamWriter, gmx::eHelpOutputFormat_Console,
-                                        NULL, "test");
+                                        nullptr, "test");
     context.setShowHidden(bHidden_);
     writer->writeHelp(context);
     stream.close();
index b32791630b2cf1dfd94477be03b2010019c5c4a3..6e619dc68dcc772c38bde66cc91b705070d5bd03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,7 +120,7 @@ TEST_F(CommandLineModuleManagerTest, RunsModuleHelpWithDashHWithSingleModule)
     };
     CommandLine       args(cmdline);
     initManager(args, "g_module");
-    MockModule        mod(NULL, NULL);
+    MockModule        mod(nullptr, nullptr);
     manager().setSingleModule(&mod);
     using ::testing::_;
     EXPECT_CALL(mod, writeHelp(_));
index d9f973d0117eeace823313c28981a5d8f23a0a51..a1ad8871a06b5dd1053f44e23034fe67038634c5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -165,7 +165,7 @@ TEST_F(CommandLineParserTest, HandlesSkipUnknown)
     EXPECT_STREQ("-opt2", args.arg(2));
     EXPECT_STREQ("value", args.arg(3));
     EXPECT_STREQ("-opt3", args.arg(4));
-    EXPECT_TRUE(args.arg(5) == NULL);
+    EXPECT_TRUE(args.arg(5) == nullptr);
 
     EXPECT_TRUE(flag_);
     ASSERT_EQ(1U, ivalues_.size());
index 4308ac80e7ba754176b845939787b4cfd0e38b14..0bb6864c6e82690b0ada468076355892e08c53a8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -114,7 +114,7 @@ class CommandLineProgramContextTest : public ::testing::Test
 
         void testBinaryPathSearch(const char *argv0)
         {
-            ASSERT_TRUE(env_.get() != NULL);
+            ASSERT_TRUE(env_.get() != nullptr);
             gmx::CommandLineProgramContext  info(1, &argv0, move(env_));
             EXPECT_EQ(expectedExecutable_, info.fullBinaryPath());
         }
index 28cb5ad88d0c690c08d250ecf5c8d4ab60632430..876862acf9c674b8ccfa90779bf70e79dea301a9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,7 @@ class ParseCommonArgsTest : public ::testing::Test
         };
 
         ParseCommonArgsTest()
-            : oenv_(NULL), fileCount_(0)
+            : oenv_(nullptr), fileCount_(0)
         {
         }
         virtual ~ParseCommonArgsTest()
@@ -93,7 +93,7 @@ class ParseCommonArgsTest : public ::testing::Test
             bool bOk = parse_common_args(&args_.argc(), args_.argv(), flags,
                                          fnm.size(), fnm.data(),
                                          pa.size(), pa.data(),
-                                         0, NULL, 0, NULL, &oenv_);
+                                         0, nullptr, 0, nullptr, &oenv_);
             EXPECT_TRUE(bOk);
         }
         void parseFromArray(gmx::ConstArrayRef<const char *> cmdline,
@@ -109,7 +109,7 @@ class ParseCommonArgsTest : public ::testing::Test
         {
             std::string filename(tempFiles_.getTemporaryFilePath(extension));
             gmx::TextWriter::writeFileFromString(filename, "Dummy file");
-            if (name != NULL)
+            if (name != nullptr)
             {
                 args_.append(name);
                 switch (type)
@@ -285,9 +285,9 @@ TEST_F(ParseCommonArgsTest, ParsesTimeArgsWithTimeUnit)
 
 TEST_F(ParseCommonArgsTest, ParsesEnumArgs)
 {
-    const char       *value1[] = {NULL, "none", "on", "off", NULL };
-    const char       *value2[] = {NULL, "def", "value", "value_other", NULL };
-    const char       *value3[] = {NULL, "default", "value", NULL };
+    const char       *value1[] = {nullptr, "none", "on", "off", nullptr };
+    const char       *value2[] = {nullptr, "def", "value", "value_other", nullptr };
+    const char       *value3[] = {nullptr, "default", "value", nullptr };
     t_pargs           pa[]     = {
         { "-s1", FALSE, etENUM, {value1}, "Description" },
         { "-s2", FALSE, etENUM, {value2}, "Description" },
@@ -325,8 +325,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgs)
     EXPECT_STREQ("test.xvg", opt2fn_null("-o2", nfile(), fnm));
     char **files;
     EXPECT_EQ(2, opt2fns(&files, "-om", nfile(), fnm));
-    EXPECT_TRUE(files != NULL);
-    if (files != NULL)
+    EXPECT_TRUE(files != nullptr);
+    if (files != nullptr)
     {
         EXPECT_STREQ("test1.xvg", files[0]);
         EXPECT_STREQ("test2.xvg", files[1]);
@@ -338,8 +338,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgs)
 TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
 {
     t_filenm          fnm[] = {
-        { efTPS, NULL,  NULL,   ffWRITE },
-        { efTRX, "-f2", NULL,   ffOPTWR },
+        { efTPS, nullptr,  nullptr,   ffWRITE },
+        { efTRX, "-f2", nullptr,   ffOPTWR },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
         { efXVG, "-om", "outm", ffWRMULT }
@@ -360,8 +360,8 @@ TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaults)
 TEST_F(ParseCommonArgsTest, ParsesFileArgsWithDefaultFileName)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffWRITE },
-        { efTRX, "-f2", NULL,   ffWRITE },
+        { efTPS, "-s",  nullptr,   ffWRITE },
+        { efTRX, "-f2", nullptr,   ffWRITE },
         { efTRX, "-f3", "trj3", ffWRITE },
         { efXVG, "-o",  "out",  ffWRITE },
         { efXVG, "-om", "outm", ffWRMULT }
@@ -402,7 +402,7 @@ TEST_F(ParseCommonArgsTest, ParseFileArgsWithCustomDefaultExtension)
 TEST_F(ParseCommonArgsTest, HandlesNonExistentInputFiles)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffREAD },
+        { efTPS, "-s",  nullptr,   ffREAD },
         { efTRX, "-f",  "trj",  ffREAD },
         { efTRX, "-f2", "trj2", ffREAD },
         { efTRX, "-f3", "trj3", ffREAD },
@@ -427,7 +427,7 @@ TEST_F(ParseCommonArgsTest, HandlesNonExistentInputFiles)
 TEST_F(ParseCommonArgsTest, HandlesNonExistentOptionalInputFiles)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,   ffOPTRD },
+        { efTPS, "-s",  nullptr,   ffOPTRD },
         { efTRX, "-f",  "trj",  ffOPTRD }
     };
     const char *const cmdline[] = {
@@ -463,8 +463,8 @@ TEST_F(ParseCommonArgsTest, AcceptsNonExistentInputFilesIfSpecified)
 TEST_F(ParseCommonArgsTest, HandlesCompressedFiles)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efGRO, "-g", NULL, ffREAD }
+        { efTRX, "-f", nullptr, ffREAD },
+        { efGRO, "-g", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expectedF = addFileArg("-f", ".pdb.gz", efFull);
@@ -480,7 +480,7 @@ TEST_F(ParseCommonArgsTest, HandlesCompressedFiles)
 TEST_F(ParseCommonArgsTest, AcceptsUnknownTrajectoryExtension)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD }
+        { efTRX, "-f", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expected = addFileArg("-f", ".foo", efFull);
@@ -492,10 +492,10 @@ TEST_F(ParseCommonArgsTest, AcceptsUnknownTrajectoryExtension)
 TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFile)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f1", NULL, ffREAD },
-        { efTRX, "-f2", NULL, ffREAD },
-        { efTRX, "-f3", NULL, ffREAD },
-        { efTRX, "-f4", NULL, ffREAD }
+        { efTRX, "-f1", nullptr, ffREAD },
+        { efTRX, "-f2", nullptr, ffREAD },
+        { efTRX, "-f3", nullptr, ffREAD },
+        { efTRX, "-f4", nullptr, ffREAD }
     };
     args_.append("test");
     std::string       expected1 = addFileArg("-f1", "1.xtc", efNoExtension);
@@ -515,16 +515,16 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFile)
 TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileName)
 {
     t_filenm          fnm[] = {
-        { efTRX, "-f1", NULL,  ffREAD },
+        { efTRX, "-f1", nullptr,  ffREAD },
         { efSTO, "-f2", "foo", ffREAD },
-        { efTRX, "-f3", NULL,  ffREAD },
-        { efSTX, "-f4", NULL,  ffREAD }
+        { efTRX, "-f3", nullptr,  ffREAD },
+        { efSTX, "-f4", nullptr,  ffREAD }
     };
     args_.append("test");
     std::string       expected1 = addFileArg("-f1", "1.trr", efNoExtension);
     std::string       expected2 = addFileArg("-f2", ".pdb", efEmptyValue);
     std::string       expected3 = addFileArg("-f3", ".trr", efEmptyValue);
-    std::string       expected4 = addFileArg(NULL, ".pdb", efEmptyValue);
+    std::string       expected4 = addFileArg(nullptr, ".pdb", efEmptyValue);
     std::string       deffnm    = gmx::Path::stripExtension(expected3);
     args_.append("-deffnm");
     args_.append(deffnm);
@@ -543,9 +543,9 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileNam
 TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,  ffREAD },
-        { efTRX, "-f",  NULL,  ffREAD },
-        { efTRX, "-f2", NULL,  ffREAD }
+        { efTPS, "-s",  nullptr,  ffREAD },
+        { efTRX, "-f",  nullptr,  ffREAD },
+        { efTRX, "-f2", nullptr,  ffREAD }
     };
     const char *const cmdline[] = {
         "test", "-f", "-f2", "other"
@@ -560,9 +560,9 @@ TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
 TEST_F(ParseCommonArgsTest, HandlesNonReadNodeWithDefaultFileName)
 {
     t_filenm          fnm[] = {
-        { efTPS, "-s",  NULL,  ffREAD },
-        { efTRX, "-f",  NULL,  ffREAD },
-        { efTRX, "-f2", NULL,  ffREAD }
+        { efTPS, "-s",  nullptr,  ffREAD },
+        { efTRX, "-f",  nullptr,  ffREAD },
+        { efTRX, "-f2", nullptr,  ffREAD }
     };
     const char *const cmdline[] = {
         "test", "-deffnm", "def", "-f", "-f2", "other"
index 6ba6c60e85ebe9186eb47259a4a48eb265c45415..87a8ebf76933c768866069f5b5fc1387a9588081 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,8 +54,8 @@ static const int   can_view_ftp[] = {
 };
 #define NVIEW asize(can_view_ftp)
 static const char* view_program[] = {
-    NULL,
-    "ghostview",    "display",      NULL,           "xterm -e rasmol"
+    nullptr,
+    "ghostview",    "display",      nullptr,           "xterm -e rasmol"
 };
 
 static int can_view(int ftp)
@@ -81,7 +81,7 @@ void do_view(const gmx_output_env_t *oenv, const char *fn, const char *opts)
 
     if (output_env_get_view(oenv) && fn)
     {
-        if (getenv("DISPLAY") == NULL)
+        if (getenv("DISPLAY") == nullptr)
         {
             fprintf(stderr, "Can not view %s, no DISPLAY environment variable.\n", fn);
         }
@@ -141,7 +141,7 @@ void view_all(const gmx_output_env_t *oenv, int nf, t_filenm fnm[])
         if (can_view(fnm[i].ftp) && is_output(&(fnm[i])) &&
             ( !is_optional(&(fnm[i])) || is_set(&(fnm[i])) ) )
         {
-            do_view(oenv, fnm[i].fns[0], NULL);
+            do_view(oenv, fnm[i].fns[0], nullptr);
         }
     }
 }
index acc01a24957f5659e48b0da5fbd396102a4f9d01..d851184d3bed0c9b5b6c169a2c00a99ff0929d25 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -536,7 +536,7 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
                      gmx_bool bVerbose, real tbeginfit, real tendfit,
                      int eFitFn)
 {
-    FILE       *fp, *gp = NULL;
+    FILE       *fp, *gp = nullptr;
     int         i;
     real       *csum;
     real       *ctmp, *fit;
@@ -621,8 +621,8 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
     }
     else
     {
-        fit = NULL;
-        fp  = NULL;
+        fit = nullptr;
+        fp  = nullptr;
     }
     if (bAver)
     {
@@ -638,12 +638,12 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
 
         if (eFitFn != effnNONE)
         {
-            fit_acf(nout, eFitFn, oenv, fn != NULL, tbeginfit, tendfit, dt, c1[0], fit);
+            fit_acf(nout, eFitFn, oenv, fn != nullptr, tbeginfit, tendfit, dt, c1[0], fit);
             sum = print_and_integrate(fp, nout, dt, c1[0], fit, 1);
         }
         else
         {
-            sum = print_and_integrate(fp, nout, dt, c1[0], NULL, 1);
+            sum = print_and_integrate(fp, nout, dt, c1[0], nullptr, 1);
         }
         if (bVerbose)
         {
@@ -666,12 +666,12 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
             }
             if (eFitFn != effnNONE)
             {
-                fit_acf(nout, eFitFn, oenv, fn != NULL, tbeginfit, tendfit, dt, c1[i], fit);
+                fit_acf(nout, eFitFn, oenv, fn != nullptr, tbeginfit, tendfit, dt, c1[i], fit);
                 sum = print_and_integrate(fp, nout, dt, c1[i], fit, 1);
             }
             else
             {
-                sum = print_and_integrate(fp, nout, dt, c1[i], NULL, 1);
+                sum = print_and_integrate(fp, nout, dt, c1[i], nullptr, 1);
                 if (debug)
                 {
                     fprintf(debug,
@@ -707,7 +707,7 @@ void low_do_autocorr(const char *fn, const gmx_output_env_t *oenv, const char *t
 }
 
 /*! \brief Legend for selecting Legendre polynomials. */
-static const char *Leg[]   = { NULL, "0", "1", "2", "3", NULL };
+static const char *Leg[]   = { nullptr, "0", "1", "2", "3", nullptr };
 
 t_pargs *add_acf_pargs(int *npargs, t_pargs *pa)
 {
index 9eac51beae7037edd469542561bb48b78f2491e0..4fc9fd425effcc48538eb8275577919df81a699d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,9 +75,9 @@ static const int nfp_ffn[effnNR] = { 0, 1, 2, 3, 5, 7, 9, 2, 4, 3, 6 };
  * the array).
  */
 const char      *s_ffn[effnNR+2] = {
-    NULL, "none", "exp", "aexp", "exp_exp",
+    nullptr, "none", "exp", "aexp", "exp_exp",
     "exp5", "exp7", "exp9",
-    NULL, NULL, NULL, NULL, NULL
+    nullptr, nullptr, nullptr, nullptr, nullptr
 };
 
 /*! \brief Long description for each fitting function type */
@@ -115,7 +115,7 @@ const char *effnDescription(int effn)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -725,7 +725,7 @@ real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
         {
             x[j]  = ttt;
             y[j]  = c1[i];
-            if (NULL == sig)
+            if (nullptr == sig)
             {
                 // No weighting if all values are divided by 1.
                 dy[j] = 1;
@@ -814,7 +814,7 @@ real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
                 }
             }
             /* Generate debug output */
-            if (NULL != fn_fitted)
+            if (nullptr != fn_fitted)
             {
                 fp = xvgropen(fn_fitted, "Data + Fit", "Time (ps)",
                               "Data (t)", oenv);
@@ -861,7 +861,7 @@ real fit_acf(int ncorr, int fitfn, const gmx_output_env_t *oenv, gmx_bool bVerbo
         tendfit = ncorr*dt;
     }
     nf_int = std::min(ncorr, (int)(tendfit/dt));
-    sum    = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
+    sum    = print_and_integrate(debug, nf_int, dt, c1, nullptr, 1);
 
     if (bPrint)
     {
@@ -946,9 +946,9 @@ real fit_acf(int ncorr, int fitfn, const gmx_output_env_t *oenv, gmx_bool bVerbo
         }
 
         nf_int    = std::min(ncorr, (int)((tStart+1e-4)/dt));
-        sum       = print_and_integrate(debug, nf_int, dt, c1, NULL, 1);
-        tail_corr = do_lmfit(ncorr, c1, sig, dt, NULL, tStart, tendfit, oenv,
-                             bDebugMode(), fitfn, fitparm, 0, NULL);
+        sum       = print_and_integrate(debug, nf_int, dt, c1, nullptr, 1);
+        tail_corr = do_lmfit(ncorr, c1, sig, dt, nullptr, tStart, tendfit, oenv,
+                             bDebugMode(), fitfn, fitparm, 0, nullptr);
         sumtot = sum+tail_corr;
         if (fit && ((jmax == 1) || (j == 1)))
         {
index 561ecb99e68ddaf86cf5aca407ba176884bbb05a..2d7053b4d9df635b8a300f9697562b73374aa10f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -99,13 +99,13 @@ class AutocorrTest : public ::testing::Test
             std::string fileName = "testCOS3.xvg";
             data_                = CorrelationDataSetPointer(new CorrelationDataSet(fileName));
             nrFrames_            = data_->getNrLines();
-            tempArgs_            = add_acf_pargs(&n, NULL);
+            tempArgs_            = add_acf_pargs(&n, nullptr);
         }
 
         static void TearDownTestCase()
         {
             sfree(tempArgs_);
-            tempArgs_ = NULL;
+            tempArgs_ = nullptr;
             gmx_fft_cleanup();
         }
 
@@ -125,7 +125,7 @@ class AutocorrTest : public ::testing::Test
                 }
             }
             real *ptr = result.data();
-            low_do_autocorr(0, 0, 0,   nrFrames_, 1,
+            low_do_autocorr(nullptr, nullptr, nullptr,   nrFrames_, 1,
                             get_acfnout(), &ptr, data_->getDt(), mode,
                             nrRestart, bAverage, bNormalize,
                             bVerbose, data_->getStartTime(), data_->getEndTime(),
index 8eb263601503d5f8c4838b9fe50a03b8523eb7d7..593b6064432c51f2b3bd7c50043fc4920611e09d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,10 +68,10 @@ CorrelationDataSet::~CorrelationDataSet()
     for (int i = 0; i < nrColumns_; i++)
     {
         sfree(tempValues_[i]);
-        tempValues_[i] = NULL;
+        tempValues_[i] = nullptr;
     }
     sfree(tempValues_);
-    tempValues_ = NULL;
+    tempValues_ = nullptr;
 }
 
 real CorrelationDataSet::getValue(int set, int time) const
index a4e66a578df4538f98c813dd8407260296454086..eb93463fd9ced3b794b38bb0000d1f6969cc49c0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,7 +85,7 @@ class ExpfitTest : public ::testing::Test
         // Static initiation, only run once every test.
         static void SetUpTestCase()
         {
-            double                ** tempValues = NULL;
+            double                ** tempValues = nullptr;
             std::vector<std::string> fileName;
             fileName.push_back(test::TestFileManager::getInputFilePath("testINVEXP.xvg"));
             fileName.push_back(test::TestFileManager::getInputFilePath("testPRES.xvg"));
@@ -112,10 +112,10 @@ class ExpfitTest : public ::testing::Test
                 for (int j = 0; j < nrColumns; j++)
                 {
                     sfree(tempValues[j]);
-                    tempValues[j] = NULL;
+                    tempValues[j] = nullptr;
                 }
                 sfree(tempValues);
-                tempValues = NULL;
+                tempValues = nullptr;
             }
         }
 
@@ -136,12 +136,12 @@ class ExpfitTest : public ::testing::Test
             output_env_init_default(&oenv);
             do_lmfit(data_[testType].nrLines_,
                      &(data_[testType].y_[0]),
-                     NULL,
+                     nullptr,
                      data_[testType].dt_,
                      &(data_[testType].x_[0]),
                      data_[testType].startTime_,
                      data_[testType].endTime_,
-                     oenv, false, type, result, 0, NULL);
+                     oenv, false, type, result, 0, nullptr);
             output_env_done(oenv);
             checker_.setDefaultTolerance(test::relativeToleranceAsFloatingPoint(1, tolerance));
             checker_.checkSequenceArray(nfitparm, result, "result");
index 93a685edce4cbf4c90620d432dc88786363d23d7..e7a9b2160dfd504ed6f4557b8874607c1b3d0600 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -252,7 +252,7 @@ int ddglatnr(const gmx_domdec_t *dd, int i)
 {
     int atnr;
 
-    if (dd == NULL)
+    if (dd == nullptr)
     {
         atnr = i + 1;
     }
@@ -282,7 +282,7 @@ static bool dlbIsOn(const gmx_domdec_comm_t *comm)
 static void vec_rvec_init(vec_rvec_t *v)
 {
     v->nalloc = 0;
-    v->v      = NULL;
+    v->v      = nullptr;
 }
 
 static void vec_rvec_check_alloc(vec_rvec_t *v, int n)
@@ -517,7 +517,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
            consider PBC in the treatment of fshift */
         bShiftForcesNeedPbc   = (dd->ci[dd->dim[d]] == 0);
         bScrew                = (bShiftForcesNeedPbc && dd->bScrewPBC && dd->dim[d] == XX);
-        if (fshift == NULL && !bScrew)
+        if (fshift == nullptr && !bScrew)
         {
             bShiftForcesNeedPbc = FALSE;
         }
@@ -1056,8 +1056,8 @@ static void dd_move_cellx(gmx_domdec_t *dd, gmx_ddbox_t *ddbox,
 static void dd_collect_cg(gmx_domdec_t *dd,
                           t_state      *state_local)
 {
-    gmx_domdec_master_t *ma = NULL;
-    int                  buf2[2], *ibuf, i, ncg_home = 0, *cg = NULL, nat_home = 0;
+    gmx_domdec_master_t *ma = nullptr;
+    int                  buf2[2], *ibuf, i, ncg_home = 0, *cg = nullptr, nat_home = 0;
 
     if (state_local->ddp_count == dd->comm->master_cg_ddp_count)
     {
@@ -1103,7 +1103,7 @@ static void dd_collect_cg(gmx_domdec_t *dd,
     }
     else
     {
-        ibuf = NULL;
+        ibuf = nullptr;
     }
     /* Collect the charge group and atom counts on the master */
     dd_gather(dd, 2*sizeof(int), buf2, ibuf);
@@ -1138,9 +1138,9 @@ static void dd_collect_cg(gmx_domdec_t *dd,
     /* Collect the charge group indices on the master */
     dd_gatherv(dd,
                ncg_home*sizeof(int), cg,
-               DDMASTER(dd) ? ma->ibuf : NULL,
-               DDMASTER(dd) ? ma->ibuf+dd->nnodes : NULL,
-               DDMASTER(dd) ? ma->cg : NULL);
+               DDMASTER(dd) ? ma->ibuf : nullptr,
+               DDMASTER(dd) ? ma->ibuf+dd->nnodes : nullptr,
+               DDMASTER(dd) ? ma->cg : nullptr);
 
     dd->comm->master_cg_ddp_count = state_local->ddp_count;
 }
@@ -1150,7 +1150,7 @@ static void dd_collect_vec_sendrecv(gmx_domdec_t *dd,
 {
     gmx_domdec_master_t *ma;
     int                  n, i, c, a, nalloc = 0;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
     t_block             *cgs_gl;
 
     ma = dd->ma;
@@ -1226,9 +1226,9 @@ static void dd_collect_vec_gatherv(gmx_domdec_t *dd,
                                    const rvec *lv, rvec *v)
 {
     gmx_domdec_master_t *ma;
-    int                 *rcounts = NULL, *disps = NULL;
+    int                 *rcounts = nullptr, *disps = nullptr;
     int                  n, i, c, a;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
     t_block             *cgs_gl;
 
     ma = dd->ma;
@@ -1398,7 +1398,7 @@ static void dd_resize_state(t_state *state, PaddedRVecVector *f, int natoms)
         }
     }
 
-    if (f != NULL)
+    if (f != nullptr)
     {
         (*f).resize(natoms + 1);
     }
@@ -1436,7 +1436,7 @@ static void dd_distribute_vec_sendrecv(gmx_domdec_t *dd, t_block *cgs,
 {
     gmx_domdec_master_t *ma;
     int                  n, i, c, a, nalloc = 0;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
 
     if (DDMASTER(dd))
     {
@@ -1496,9 +1496,9 @@ static void dd_distribute_vec_scatterv(gmx_domdec_t *dd, t_block *cgs,
                                        rvec *v, rvec *lv)
 {
     gmx_domdec_master_t *ma;
-    int                 *scounts = NULL, *disps = NULL;
+    int                 *scounts = nullptr, *disps = nullptr;
     int                  n, i, c, a;
-    rvec                *buf = NULL;
+    rvec                *buf = nullptr;
 
     if (DDMASTER(dd))
     {
@@ -1537,7 +1537,7 @@ static void dd_distribute_vec(gmx_domdec_t *dd, t_block *cgs, rvec *v, rvec *lv)
 
 static void dd_distribute_dfhist(gmx_domdec_t *dd, df_history_t *dfhist)
 {
-    if (dfhist == NULL)
+    if (dfhist == nullptr)
     {
         return;
     }
@@ -1590,7 +1590,7 @@ static void dd_distribute_state(gmx_domdec_t *dd, t_block *cgs,
         copy_mat(state->boxv, state_local->boxv);
         copy_mat(state->svir_prev, state_local->svir_prev);
         copy_mat(state->fvir_prev, state_local->fvir_prev);
-        if (state->dfhist != NULL)
+        if (state->dfhist != nullptr)
         {
             copy_df_history(state_local->dfhist, state->dfhist);
         }
@@ -1680,7 +1680,7 @@ static char dim2char(int dim)
 static void write_dd_grid_pdb(const char *fn, gmx_int64_t step,
                               gmx_domdec_t *dd, matrix box, gmx_ddbox_t *ddbox)
 {
-    rvec   grid_s[2], *grid_r = NULL, cx, r;
+    rvec   grid_s[2], *grid_r = nullptr, cx, r;
     char   fname[STRLEN], buf[22];
     FILE  *out;
     int    a, i, d, z, y, x;
@@ -1695,7 +1695,7 @@ static void write_dd_grid_pdb(const char *fn, gmx_int64_t step,
         snew(grid_r, 2*dd->nnodes);
     }
 
-    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : NULL);
+    dd_gather(dd, 2*sizeof(rvec), grid_s, DDMASTER(dd) ? grid_r : nullptr);
 
     if (DDMASTER(dd))
     {
@@ -2018,7 +2018,7 @@ static int dd_simnode2pmenode(const gmx_domdec_t         *dd,
         /* This assumes DD cells with identical x coordinates
          * are numbered sequentially.
          */
-        if (dd->comm->pmenodes == NULL)
+        if (dd->comm->pmenodes == nullptr)
         {
             if (sim_nodeid < dd->nnodes)
             {
@@ -2046,7 +2046,7 @@ static int dd_simnode2pmenode(const gmx_domdec_t         *dd,
 void get_pme_nnodes(const gmx_domdec_t *dd,
                     int *npmenodes_x, int *npmenodes_y)
 {
-    if (dd != NULL)
+    if (dd != nullptr)
     {
         *npmenodes_x = dd->comm->npmenodes_x;
         *npmenodes_y = dd->comm->npmenodes_y;
@@ -2217,7 +2217,7 @@ static void dd_set_cginfo(int *index_gl, int cg0, int cg1,
     int         *cginfo;
     int          cg;
 
-    if (fr != NULL)
+    if (fr != nullptr)
     {
         cginfo_mb = fr->cginfo_mb;
         cginfo    = fr->cginfo;
@@ -2228,7 +2228,7 @@ static void dd_set_cginfo(int *index_gl, int cg0, int cg1,
         }
     }
 
-    if (bLocalCG != NULL)
+    if (bLocalCG != nullptr)
     {
         for (cg = cg0; cg < cg1; cg++)
         {
@@ -2311,7 +2311,7 @@ static int check_bLocalCG(gmx_domdec_t *dd, int ncg_sys, const char *bLocalCG,
     int i, ngl, nerr;
 
     nerr = 0;
-    if (bLocalCG == NULL)
+    if (bLocalCG == nullptr)
     {
         return nerr;
     }
@@ -2837,7 +2837,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox,
     {
         cellsize_min[d] = ddbox->box_size[d]*ddbox->skew_fac[d];
         npulse[d]       = 1;
-        if (dd->nc[d] == 1 || comm->slb_frac[d] == NULL)
+        if (dd->nc[d] == 1 || comm->slb_frac[d] == nullptr)
         {
             /* Uniform grid */
             cell_dx = ddbox->box_size[d]/dd->nc[d];
@@ -2937,7 +2937,7 @@ static void set_dd_cell_sizes_slb(gmx_domdec_t *dd, const gmx_ddbox_t *ddbox,
     for (d = 0; d < comm->npmedecompdim; d++)
     {
         set_pme_maxshift(dd, &comm->ddpme[d],
-                         comm->slb_frac[dd->dim[d]] == NULL, ddbox,
+                         comm->slb_frac[dd->dim[d]] == nullptr, ddbox,
                          comm->ddpme[d].slb_dim_f);
     }
 }
@@ -3504,7 +3504,7 @@ static void realloc_comm_ind(gmx_domdec_t *dd, ivec npulse)
             srenew(cd->ind, np);
             for (i = cd->np_nalloc; i < np; i++)
             {
-                cd->ind[i].index  = NULL;
+                cd->ind[i].index  = nullptr;
                 cd->ind[i].nalloc = 0;
             }
             cd->np_nalloc = np;
@@ -3637,7 +3637,7 @@ static void distribute_cg(FILE *fplog,
                           gmx_domdec_t *dd)
 {
     gmx_domdec_master_t *ma;
-    int                **tmp_ind = NULL, *tmp_nalloc = NULL;
+    int                **tmp_ind = nullptr, *tmp_nalloc = nullptr;
     int                  i, icg, j, k, k0, k1, d;
     matrix               tcm;
     rvec                 cg_cm;
@@ -3815,7 +3815,7 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
                                 t_block *cgs, matrix box, gmx_ddbox_t *ddbox,
                                 rvec pos[])
 {
-    gmx_domdec_master_t *ma = NULL;
+    gmx_domdec_master_t *ma = nullptr;
     ivec                 npulse;
     int                  i, cg_gl;
     int                 *ibuf, buf2[2] = { 0, 0 };
@@ -3842,7 +3842,7 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
     }
     else
     {
-        ibuf = NULL;
+        ibuf = nullptr;
     }
     dd_scatter(dd, 2*sizeof(int), ibuf, buf2);
 
@@ -3866,9 +3866,9 @@ static void get_cg_distribution(FILE *fplog, gmx_domdec_t *dd,
     }
 
     dd_scatterv(dd,
-                bMaster ? ma->ibuf : NULL,
-                bMaster ? ma->ibuf+dd->nnodes : NULL,
-                bMaster ? ma->cg : NULL,
+                bMaster ? ma->ibuf : nullptr,
+                bMaster ? ma->ibuf+dd->nnodes : nullptr,
+                bMaster ? ma->cg : nullptr,
                 dd->ncg_home*sizeof(int), dd->index_gl);
 
     /* Determine the home charge group sizes */
@@ -4386,7 +4386,7 @@ static void dd_redistribute_cg(FILE *fplog, gmx_int64_t step,
     gmx_bool           bV = FALSE, bCGP = FALSE;
     real               pos_d;
     matrix             tcm;
-    rvec              *cg_cm = NULL, cell_x0, cell_x1, limitd, limit0, limit1;
+    rvec              *cg_cm = nullptr, cell_x0, cell_x1, limitd, limit0, limit1;
     int               *cgindex;
     cginfo_mb_t       *cginfo_mb;
     gmx_domdec_comm_t *comm;
@@ -4928,7 +4928,7 @@ static double force_flop_count(t_nrnb *nrnb)
          * for the normal loops and again half it for water loops.
          */
         name = nrnb_str(i);
-        if (strstr(name, "W3") != NULL || strstr(name, "W4") != NULL)
+        if (strstr(name, "W3") != nullptr || strstr(name, "W4") != nullptr)
         {
             sum += nrnb->n[i]*0.25*cost_nrnb(i);
         }
@@ -4940,7 +4940,7 @@ static double force_flop_count(t_nrnb *nrnb)
     for (i = eNR_NBKERNEL_FREE_ENERGY; i <= eNR_NB14; i++)
     {
         name = nrnb_str(i);
-        if (strstr(name, "W3") != NULL || strstr(name, "W4") != NULL)
+        if (strstr(name, "W3") != nullptr || strstr(name, "W4") != nullptr)
         {
             sum += nrnb->n[i]*cost_nrnb(i);
         }
@@ -4987,7 +4987,7 @@ static void get_load_distribution(gmx_domdec_t *dd, gmx_wallcycle_t wcycle)
 {
     gmx_domdec_comm_t *comm;
     domdec_load_t     *load;
-    domdec_root_t     *root = NULL;
+    domdec_root_t     *root = nullptr;
     int                d, dim, i, pos;
     float              cell_frac = 0, sbuf[DD_NLOAD_MAX];
     gmx_bool           bSepPME;
@@ -5819,7 +5819,7 @@ static gmx_domdec_master_t *init_gmx_domdec_master_t(gmx_domdec_t *dd,
 
     if (dd->nnodes <= GMX_DD_NNODES_SENDRECV)
     {
-        ma->vbuf = NULL;
+        ma->vbuf = nullptr;
     }
     else
     {
@@ -5999,7 +5999,7 @@ static void make_dd_communicators(FILE *fplog, t_commrec *cr,
      * Real reordering is only supported on very few architectures,
      * Blue Gene is one of them.
      */
-    CartReorder = (getenv("GMX_NO_CART_REORDER") == NULL);
+    CartReorder = (getenv("GMX_NO_CART_REORDER") == nullptr);
 
     if (cr->npmenodes > 0)
     {
@@ -6062,8 +6062,8 @@ static real *get_slb_frac(FILE *fplog, const char *dir, int nc, const char *size
     int    i, n;
     double dbl;
 
-    slb_frac = NULL;
-    if (nc > 1 && size_string != NULL)
+    slb_frac = nullptr;
+    if (nc > 1 && size_string != nullptr)
     {
         if (fplog)
         {
@@ -6270,7 +6270,7 @@ static void set_dd_dim(FILE *fplog, gmx_domdec_t *dd)
     int dim;
 
     dd->ndim = 0;
-    if (getenv("GMX_DD_ORDER_ZYX") != NULL)
+    if (getenv("GMX_DD_ORDER_ZYX") != nullptr)
     {
         /* Decomposition order z,y,x */
         if (fplog)
@@ -6313,7 +6313,7 @@ static gmx_domdec_comm_t *init_dd_comm()
     }
 
     comm->nalloc_int = 0;
-    comm->buf_int    = NULL;
+    comm->buf_int    = nullptr;
 
     vec_rvec_init(&comm->vbuf);
 
@@ -6361,7 +6361,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     dd->bScrewPBC = (ir->ePBC == epbcSCREW);
 
     dd->pme_recv_f_alloc = 0;
-    dd->pme_recv_f_buf   = NULL;
+    dd->pme_recv_f_buf   = nullptr;
 
     /* Initialize to GPU share count to 0, might change later */
     comm->nrank_gpu_shared = 0;
@@ -6556,7 +6556,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
     }
     else
     {
-        set_ddbox_cr(cr, NULL, ir, box, &comm->cgs_gl, x, ddbox);
+        set_ddbox_cr(cr, nullptr, ir, box, &comm->cgs_gl, x, ddbox);
 
         /* We need to choose the optimal DD grid and possibly PME nodes */
         real limit =
@@ -6624,7 +6624,7 @@ static void set_dd_limits_and_grid(FILE *fplog, t_commrec *cr, gmx_domdec_t *dd,
          */
         if (dd->ndim >= 2 && dd->dim[0] == XX && dd->dim[1] == YY &&
             comm->npmenodes > dd->nc[XX] && comm->npmenodes % dd->nc[XX] == 0 &&
-            getenv("GMX_PMEONEDD") == NULL)
+            getenv("GMX_PMEONEDD") == nullptr)
         {
             comm->npmedecompdim = 2;
             comm->npmenodes_x   = dd->nc[XX];
@@ -6867,8 +6867,8 @@ void dd_init_bondeds(FILE *fplog,
     else
     {
         /* Only communicate atoms based on cut-off */
-        comm->cglink   = NULL;
-        comm->bLocalCG = NULL;
+        comm->cglink   = nullptr;
+        comm->bLocalCG = nullptr;
     }
 }
 
@@ -6883,7 +6883,7 @@ static void print_dd_settings(FILE *fplog, gmx_domdec_t *dd,
     real               limit, shrink;
     char               buf[64];
 
-    if (fplog == NULL)
+    if (fplog == nullptr)
     {
         return;
     }
@@ -7983,7 +7983,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
     real                   r_comm2, r_bcomm2;
     dd_corners_t           corners;
     ivec                   tric_dist;
-    rvec                  *cg_cm, *normal, *v_d, *v_0 = NULL, *v_1 = NULL, *recv_vr;
+    rvec                  *cg_cm, *normal, *v_d, *v_0 = nullptr, *v_1 = nullptr, *recv_vr;
     real                   skew_fac2_d, skew_fac_01;
     rvec                   sf2_round;
     int                    nsend, nat;
@@ -8019,7 +8019,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
             break;
         default:
             gmx_incons("unimplemented");
-            cg_cm = NULL;
+            cg_cm = nullptr;
     }
 
     for (dim_ind = 0; dim_ind < dd->ndim; dim_ind++)
@@ -8431,7 +8431,7 @@ static void setup_dd_communication(gmx_domdec_t *dd,
          * So we pass NULL for the forcerec.
          */
         dd_set_cginfo(dd->index_gl, dd->ncg_home, dd->ncg_tot,
-                      NULL, comm->bLocalCG);
+                      nullptr, comm->bLocalCG);
     }
 
     if (debug)
@@ -8757,7 +8757,7 @@ static void order_vec_atom(int ncg, const int *cgindex, const gmx_cgsort_t *sort
 {
     int a, atot, cg, cg0, cg1, i;
 
-    if (cgindex == NULL)
+    if (cgindex == nullptr)
     {
         /* Avoid the useless loop of the atoms within a cg */
         order_vec_cg(ncg, sort, v, buf);
@@ -8976,7 +8976,7 @@ static void dd_sort_state(gmx_domdec_t *dd, rvec *cgcm, t_forcerec *fr, t_state
     }
     else
     {
-        cgindex = NULL;
+        cgindex = nullptr;
     }
 
     /* Remove the charge groups which are no longer at home here */
@@ -9122,7 +9122,7 @@ void print_dd_statistics(t_commrec *cr, t_inputrec *ir, FILE *fplog)
 
     gmx_sumd(ddnatNR-ddnatZONE, comm->sum_nat, cr);
 
-    if (fplog == NULL)
+    if (fplog == nullptr)
     {
         return;
     }
@@ -9571,7 +9571,7 @@ void dd_partition_system(FILE                *fplog,
                                   comm->zones.dens_zone0,
                                   fr->cginfo,
                                   as_rvec_array(state_local->x.data()),
-                                  ncg_moved, bRedist ? comm->moved : NULL,
+                                  ncg_moved, bRedist ? comm->moved : nullptr,
                                   fr->nbv->grp[eintLocal].kernel_type,
                                   fr->nbv->grp[eintLocal].nbat);
 
@@ -9730,7 +9730,7 @@ void dd_partition_system(FILE                *fplog,
 
     /* Update atom data for mdatoms and several algorithms */
     mdAlgorithmsSetupAtomData(cr, ir, top_global, top_local, fr,
-                              NULL, mdatoms, vsite, NULL);
+                              nullptr, mdatoms, vsite, nullptr);
 
     if (ir->implicit_solvent)
     {
index 684509aabd51063c3cacfea2306b23aa84e31dcd..43baf199539e7789273009b15f02049f95f13b79 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -102,7 +102,7 @@ static void calc_cgcm_av_stddev(const t_block *cgs, int n, const rvec *x,
         }
     }
 
-    if (cr_sum != NULL)
+    if (cr_sum != nullptr)
     {
         for (d = 0; d < DIM; d++)
         {
@@ -146,7 +146,7 @@ static void set_tric_dir(const ivec *dd_nc, gmx_ddbox_t *ddbox, const matrix box
             if (box[j][d] != 0)
             {
                 ddbox->tric_dir[d] = 1;
-                if (dd_nc != NULL && (*dd_nc)[j] > 1 && (*dd_nc)[d] == 1)
+                if (dd_nc != nullptr && (*dd_nc)[j] > 1 && (*dd_nc)[d] == 1)
                 {
                     gmx_fatal(FARGS, "Domain decomposition has not been implemented for box vectors that have non-zero components in directions that do not use domain decomposition: ncells = %d %d %d, box vector[%d] = %f %f %f",
                               (*dd_nc)[XX], (*dd_nc)[YY], (*dd_nc)[ZZ],
@@ -292,7 +292,7 @@ void set_ddbox(gmx_domdec_t *dd, gmx_bool bMasterState, t_commrec *cr_sum,
     {
         low_set_ddbox(ir, &dd->nc, box, bCalcUnboundedSize,
                       bMasterState ? cgs->nr : dd->ncg_home, cgs, x,
-                      bMasterState ? NULL : cr_sum,
+                      bMasterState ? nullptr : cr_sum,
                       ddbox);
     }
 
@@ -309,7 +309,7 @@ void set_ddbox_cr(t_commrec *cr, const ivec *dd_nc,
 {
     if (MASTER(cr))
     {
-        low_set_ddbox(ir, dd_nc, box, TRUE, cgs->nr, cgs, x, NULL, ddbox);
+        low_set_ddbox(ir, dd_nc, box, TRUE, cgs->nr, cgs, x, nullptr, ddbox);
     }
 
     gmx_bcast(sizeof(gmx_ddbox_t), ddbox, cr);
index 91565d67117875cf2991b7fc20432ed0c4826863..f22e8e8e7b0846591964386ddcddbfa800a10fa0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -105,7 +105,7 @@ int *dd_constraints_nlocalatoms(gmx_domdec_t *dd)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -254,7 +254,7 @@ static void atoms_to_settles(gmx_domdec_t *dd,
             {
                 int a_gl = dd->gatindex[a];
                 int a_mol;
-                mtopGetMolblockIndex(mtop, a_gl, &mb, NULL, &a_mol);
+                mtopGetMolblockIndex(mtop, a_gl, &mb, nullptr, &a_mol);
 
                 const gmx_molblock_t *molb   = &mtop->molblock[mb];
                 int                   settle = at2settle_mt[molb->type][a_mol];
@@ -474,8 +474,8 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
     else
     {
         // Currently unreachable
-        at2con_mt = NULL;
-        ireq      = NULL;
+        at2con_mt = nullptr;
+        ireq      = nullptr;
     }
 
     if (dd->bInterCGsettles)
@@ -486,10 +486,10 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
     else
     {
         /* Settle works inside charge groups, we assigned them already */
-        at2settle_mt = NULL;
+        at2settle_mt = nullptr;
     }
 
-    if (at2settle_mt == NULL)
+    if (at2settle_mt == nullptr)
     {
         atoms_to_constraints(dd, mtop, cginfo, at2con_mt, nrec,
                              ilc_local, ireq);
@@ -502,7 +502,7 @@ int dd_make_local_constraints(gmx_domdec_t *dd, int at_start,
         /* Do the constraints, if present, on the first thread.
          * Do the settles on all other threads.
          */
-        t0_set = ((at2con_mt != NULL && dc->nthread > 1) ? 1 : 0);
+        t0_set = ((at2con_mt != nullptr && dc->nthread > 1) ? 1 : 0);
 
 #pragma omp parallel for num_threads(dc->nthread) schedule(static)
         for (thread = 0; thread < dc->nthread; thread++)
index 7f3ccc5cc5983f22a6aa53cb13387895d8902beb..2b810056ac4e9a5b1ac59dccfda4de1b0a150940 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -631,7 +631,7 @@ static real optimize_ncells(FILE *fplog,
          * we can save some time (e.g. 3D DD with pbc=xyz).
          * Here we ignore SIMD bondeds as they always do (fast) PBC.
          */
-        count_bonded_distances(mtop, ir, &pbcdxr, NULL);
+        count_bonded_distances(mtop, ir, &pbcdxr, nullptr);
         pbcdxr /= (double)mtop->natoms;
     }
     else
index 8d86f5f15644d42cc4b0571f95ce2b989da6881d..f7c143a9cb5a4c6e20b5f4264991449d07b05259 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -97,7 +97,7 @@ void dd_move_f_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
 
                 spas = &spac->spas[d][dir];
                 /* Sum the buffer into the required forces */
-                if (!bPBC || (!bScrew && fshift == NULL))
+                if (!bPBC || (!bScrew && fshift == nullptr))
                 {
                     for (i = 0; i < spas->nsend; i++)
                     {
@@ -182,7 +182,7 @@ void dd_move_x_specat(gmx_domdec_t *dd, gmx_domdec_specat_comm_t *spac,
     rvec              shift = {0, 0, 0};
 
     nvec = 1;
-    if (x1 != NULL)
+    if (x1 != nullptr)
     {
         nvec++;
     }
index 79062a81225e793f21e924e7bf0f566078cbb716..d9950c7eb5b948ade529e13e5ec4aeda047e4c6e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -626,7 +626,7 @@ static int make_reverse_ilist(const t_ilist *ilist,
     snew(count, nat_mt);
     low_make_reverse_ilist(ilist, atoms->atom, vsite_pbc,
                            count,
-                           bConstr, bSettle, bBCheck, NULL, NULL,
+                           bConstr, bSettle, bBCheck, nullptr, nullptr,
                            bLinkToAllAtoms, FALSE);
 
     snew(ril_mt->index, nat_mt+1);
@@ -692,7 +692,7 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
         /* Make the atom to interaction list for this molecule type */
         nint_mt[mt] =
             make_reverse_ilist(molt->ilist, &molt->atoms,
-                               vsite_pbc_molt ? vsite_pbc_molt[mt] : NULL,
+                               vsite_pbc_molt ? vsite_pbc_molt[mt] : nullptr,
                                rt->bConstr, rt->bSettle, rt->bBCheck, FALSE,
                                &rt->ril_mt[mt]);
 
@@ -716,15 +716,15 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
     {
         t_atoms atoms_global;
 
-        rt->ril_intermol.index = NULL;
-        rt->ril_intermol.il    = NULL;
+        rt->ril_intermol.index = nullptr;
+        rt->ril_intermol.il    = nullptr;
 
         atoms_global.nr   = mtop->natoms;
-        atoms_global.atom = NULL; /* Only used with virtual sites */
+        atoms_global.atom = nullptr; /* Only used with virtual sites */
 
         *nint +=
             make_reverse_ilist(mtop->intermolecular_ilist, &atoms_global,
-                               NULL,
+                               nullptr,
                                rt->bConstr, rt->bSettle, rt->bBCheck, FALSE,
                                &rt->ril_intermol);
     }
@@ -753,7 +753,7 @@ static gmx_reverse_top_t *make_reverse_top(const gmx_mtop_t *mtop, gmx_bool bFE,
 
     rt->nthread = gmx_omp_nthreads_get(emntDomdec);
     snew(rt->th_work, rt->nthread);
-    if (vsite_pbc_molt != NULL)
+    if (vsite_pbc_molt != nullptr)
     {
         for (thread = 0; thread < rt->nthread; thread++)
         {
@@ -782,7 +782,7 @@ void dd_make_reverse_top(FILE *fplog,
      */
 
     dd->reverse_top = make_reverse_top(mtop, ir->efep != efepNO,
-                                       vsite ? vsite->vsite_pbc_molt : NULL,
+                                       vsite ? vsite->vsite_pbc_molt : nullptr,
                                        !dd->bInterCGcons, !dd->bInterCGsettles,
                                        bBCheck, &dd->nbonded_global);
 
@@ -1227,7 +1227,7 @@ static void combine_idef(t_idef *dest, const thread_work_t *src, int nsrc,
             int      nral1 = 0, ftv = 0;
 
             vpbc = ((interaction_function[ftype].flags & IF_VSITE) &&
-                    vsite->vsite_pbc_loc != NULL);
+                    vsite->vsite_pbc_loc != nullptr);
             if (vpbc)
             {
                 nral1 = 1 + NRAL(ftype);
@@ -2032,8 +2032,8 @@ static int make_local_bondeds_excls(gmx_domdec_t *dd,
                 }
                 else
                 {
-                    vsite_pbc        = NULL;
-                    vsite_pbc_nalloc = NULL;
+                    vsite_pbc        = nullptr;
+                    vsite_pbc_nalloc = nullptr;
                 }
 
                 rt->th_work[thread].nbonded =
@@ -2144,7 +2144,7 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
     real     rc = -1;
     ivec     rcheck;
     int      d, nexcl;
-    t_pbc    pbc, *pbc_null = NULL;
+    t_pbc    pbc, *pbc_null = nullptr;
 
     if (debug)
     {
@@ -2202,7 +2202,7 @@ void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
             }
             else
             {
-                pbc_null = NULL;
+                pbc_null = nullptr;
             }
         }
     }
@@ -2257,7 +2257,7 @@ gmx_localtop_t *dd_init_local_top(const gmx_mtop_t *top_global)
 
     for (i = 0; i < F_NRE; i++)
     {
-        top->idef.il[i].iatoms = NULL;
+        top->idef.il[i].iatoms = nullptr;
         top->idef.il[i].nalloc = 0;
     }
     top->idef.ilsort   = ilsortUNKNOWN;
@@ -2362,16 +2362,16 @@ t_blocka *make_charge_group_links(const gmx_mtop_t *mtop, gmx_domdec_t *dd,
         t_atoms atoms;
 
         atoms.nr   = mtop->natoms;
-        atoms.atom = NULL;
+        atoms.atom = nullptr;
 
         make_reverse_ilist(mtop->intermolecular_ilist, &atoms,
-                           NULL, FALSE, FALSE, FALSE, TRUE, &ril_intermol);
+                           nullptr, FALSE, FALSE, FALSE, TRUE, &ril_intermol);
     }
 
     snew(link, 1);
     snew(link->index, ncg_mtop(mtop)+1);
     link->nalloc_a = 0;
-    link->a        = NULL;
+    link->a        = nullptr;
 
     link->index[0] = 0;
     cg_offset      = 0;
@@ -2392,7 +2392,7 @@ t_blocka *make_charge_group_links(const gmx_mtop_t *mtop, gmx_domdec_t *dd,
          * The constraints are discarded here.
          */
         make_reverse_ilist(molt->ilist, &molt->atoms,
-                           NULL, FALSE, FALSE, FALSE, TRUE, &ril);
+                           nullptr, FALSE, FALSE, FALSE, TRUE, &ril);
 
         cgi_mb = &cginfo_mb[mb];
 
@@ -2652,7 +2652,7 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
 
     if (ePBC != epbcNONE)
     {
-        mk_mshift(NULL, graph, ePBC, box, x);
+        mk_mshift(nullptr, graph, ePBC, box, x);
 
         shift_x(graph, box, x, xs);
         /* By doing an extra mk_mshift the molecules that are broken
@@ -2660,7 +2660,7 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
          * will be made whole again. Such are the healing powers
          * of GROMACS.
          */
-        mk_mshift(NULL, graph, ePBC, box, xs);
+        mk_mshift(nullptr, graph, ePBC, box, xs);
     }
     else
     {
@@ -2677,12 +2677,12 @@ static void get_cgcm_mol(const gmx_moltype_t *molt,
 
     if (vsite)
     {
-        construct_vsites(vsite, xs, 0.0, NULL,
+        construct_vsites(vsite, xs, 0.0, nullptr,
                          ffparams->iparams, molt->ilist,
-                         epbcNONE, TRUE, NULL, NULL);
+                         epbcNONE, TRUE, nullptr, nullptr);
     }
 
-    calc_cgcm(NULL, 0, molt->cgs.nr, &molt->cgs, xs, cg_cm);
+    calc_cgcm(nullptr, 0, molt->cgs.nr, &molt->cgs, xs, cg_cm);
 }
 
 //! Returns whether \p molt has a virtual site
@@ -2723,7 +2723,7 @@ void dd_bonded_cg_distance(FILE *fplog,
 
     bExclRequired = inputrecExclForces(ir);
 
-    vsite = init_vsite(mtop, NULL, TRUE);
+    vsite = init_vsite(mtop, nullptr, TRUE);
 
     *r_2b     = 0;
     *r_mb     = 0;
@@ -2740,7 +2740,7 @@ void dd_bonded_cg_distance(FILE *fplog,
         {
             if (ir->ePBC != epbcNONE)
             {
-                mk_graph_ilist(NULL, molt->ilist, 0, molt->atoms.nr, FALSE, FALSE,
+                mk_graph_ilist(nullptr, molt->ilist, 0, molt->atoms.nr, FALSE, FALSE,
                                &graph);
             }
 
@@ -2750,7 +2750,7 @@ void dd_bonded_cg_distance(FILE *fplog,
             for (mol = 0; mol < molb->nmol; mol++)
             {
                 get_cgcm_mol(molt, &mtop->ffparams, ir->ePBC, &graph, box,
-                             have_vsite_molt(molt) ? vsite : NULL,
+                             have_vsite_molt(molt) ? vsite : nullptr,
                              x+at_offset, xs, cg_cm);
 
                 bonded_distance_t bd_mol_2b = { 0, -1, -1, -1 };
index d9848505351dec80dd19960b097f3ecfa0c667ca..7d9fc36ef0f08108df2f91064b953068483c87ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -89,7 +89,7 @@ void dd_move_x_vsites(gmx_domdec_t *dd, matrix box, rvec *x)
 {
     if (dd->vsite_comm)
     {
-        dd_move_x_specat(dd, dd->vsite_comm, box, x, NULL, FALSE);
+        dd_move_x_specat(dd, dd->vsite_comm, box, x, nullptr, FALSE);
     }
 }
 
index 9aa0b2c54c9b5c210df1ab2bcf44f10fb6974725..0f6b54c64ffc898ad7ac667eadaba0d1abd2f276 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,7 +124,7 @@ static void gmx_hash_realloc(gmx_hash_t *hash, int nkey_used_estimate)
     hash->nalloc = over_alloc_dd(hash->mod);
     srenew(hash->hash, hash->nalloc);
 
-    if (debug != NULL)
+    if (debug != nullptr)
     {
         fprintf(debug, "Hash table mod %d nalloc %d\n", hash->mod, hash->nalloc);
     }
@@ -141,7 +141,7 @@ static void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
     if (hash->nkey > 0 &&
         (4*hash->nkey < hash->mod || 3*hash->nkey > 2*hash->mod))
     {
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "Hash table size %d #key %d: resizing\n",
                     hash->mod, hash->nkey);
@@ -158,7 +158,7 @@ static gmx_hash_t *gmx_hash_init(int nkey_used_estimate)
     gmx_hash_t *hash;
 
     snew(hash, 1);
-    hash->hash = NULL;
+    hash->hash = nullptr;
 
     gmx_hash_realloc(hash, nkey_used_estimate);
 
index df8e76e4452ee820192d4545ea039e559fcdc5d1..2f14c359ab0fad850fe9a563b78474d75d2621d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -573,7 +573,7 @@ static void do_edfit(int natoms, rvec *xp, rvec *x, matrix R, t_edpar *edi)
     struct t_do_edfit *loc;
     gmx_bool           bFirst;
 
-    if (edi->buf->do_edfit != NULL)
+    if (edi->buf->do_edfit != nullptr)
     {
         bFirst = FALSE;
     }
@@ -1189,7 +1189,7 @@ gmx_edsam_t ed_open(int natoms, edsamstate_t **EDstatePtr, int nfile, const t_fi
     /* Allocate space for the ED data structure */
     snew(ed, 1);
 
-    if (*EDstatePtr == NULL)
+    if (*EDstatePtr == nullptr)
     {
         snew(*EDstatePtr, 1);
     }
@@ -1465,13 +1465,13 @@ static int read_edint(FILE *file, gmx_bool *bEOF)
 
 
     eof = fgets2 (line, STRLEN, file);
-    if (eof == NULL)
+    if (eof == nullptr)
     {
         *bEOF = TRUE;
         return -1;
     }
     eof = fgets2 (line, STRLEN, file);
-    if (eof == NULL)
+    if (eof == nullptr)
     {
         *bEOF = TRUE;
         return -1;
@@ -1720,7 +1720,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
     snew(edi->sref.anrs, edi->sref.nr);
     snew(edi->sref.x, edi->sref.nr);
     snew(edi->sref.x_old, edi->sref.nr);
-    edi->sref.sqrtm    = NULL;
+    edi->sref.sqrtm    = nullptr;
     read_edx(in, edi->sref.nr, edi->sref.anrs, edi->sref.x);
 
     /* average positions. they define which atoms will be used for ED sampling */
@@ -1743,7 +1743,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
     {
         snew(edi->star.anrs, edi->star.nr);
         snew(edi->star.x, edi->star.nr);
-        edi->star.sqrtm    = NULL;
+        edi->star.sqrtm    = nullptr;
         read_edx(in, edi->star.nr, edi->star.anrs, edi->star.x);
     }
 
@@ -1760,7 +1760,7 @@ static int read_edi(FILE* in, t_edpar *edi, int nr_mdatoms, const char *fn)
         }
         snew(edi->sori.anrs, edi->sori.nr);
         snew(edi->sori.x, edi->sori.nr);
-        edi->sori.sqrtm    = NULL;
+        edi->sori.sqrtm    = nullptr;
         read_edx(in, edi->sori.nr, edi->sori.anrs, edi->sori.x);
     }
 
@@ -1810,7 +1810,7 @@ static int read_edi_file(const char *fn, t_edpar *edi, int nr_mdatoms)
     }
 
     /* Terminate the edi group list with a NULL pointer: */
-    last_edi->next_edi = NULL;
+    last_edi->next_edi = nullptr;
 
     fprintf(stderr, "ED: Found %d ED group%s.\n", edi_nr, edi_nr > 1 ? "s" : "");
 
@@ -1840,7 +1840,7 @@ static void fit_to_reference(rvec      *xcoll,    /* The positions to be fitted
 
 
     /* Allocate memory the first time this routine is called for each edi group */
-    if (NULL == edi->buf->fit_to_ref)
+    if (nullptr == edi->buf->fit_to_ref)
     {
         snew(edi->buf->fit_to_ref, 1);
         snew(edi->buf->fit_to_ref->xcopy, edi->sref.nr);
@@ -2140,7 +2140,7 @@ static void do_radcon(rvec *xcoll, t_edpar *edi)
     rvec                vec_dum;
 
 
-    if (edi->buf->do_radcon != NULL)
+    if (edi->buf->do_radcon != nullptr)
     {
         bFirst = FALSE;
     }
@@ -2303,7 +2303,7 @@ static void copyEvecReference(t_eigvec* floodvecs)
     int i;
 
 
-    if (NULL == floodvecs->refproj0)
+    if (nullptr == floodvecs->refproj0)
     {
         snew(floodvecs->refproj0, floodvecs->neig);
     }
@@ -2319,11 +2319,11 @@ static void copyEvecReference(t_eigvec* floodvecs)
  * groups of the checkpoint file are consistent with the provided .edi file. */
 static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDstate)
 {
-    t_edpar *edi = NULL;    /* points to a single edi data set */
+    t_edpar *edi = nullptr;    /* points to a single edi data set */
     int      edinum;
 
 
-    if (NULL == EDstate->nref || NULL == EDstate->nav)
+    if (nullptr == EDstate->nref || nullptr == EDstate->nav)
     {
         gmx_fatal(FARGS, "Essential dynamics and flooding can only be switched on (or off) at the\n"
                   "start of a new simulation. If a simulation runs with/without ED constraints,\n"
@@ -2334,7 +2334,7 @@ static void crosscheck_edi_file_vs_checkpoint(gmx_edsam_t ed, edsamstate_t *EDst
 
     edi    = ed->edpar;
     edinum = 0;
-    while (edi != NULL)
+    while (edi != nullptr)
     {
         /* Check number of atoms in the reference and average structures */
         if (EDstate->nref[edinum] != edi->sref.nr)
@@ -2470,12 +2470,12 @@ static void nice_legend_evec(const char ***setname, int *nsets, char **LegendStr
 /* Makes a legend for the xvg output file. Call on MASTER only! */
 static void write_edo_legend(gmx_edsam_t ed, int nED, const gmx_output_env_t *oenv)
 {
-    t_edpar     *edi = NULL;
+    t_edpar     *edi = nullptr;
     int          i;
     int          nr_edi, nsets, n_flood, n_edsam;
     const char **setname;
     char         buf[STRLEN];
-    char        *LegendStr = NULL;
+    char        *LegendStr = nullptr;
 
 
     edi         = ed->edpar;
@@ -2653,19 +2653,19 @@ void init_edsam(const gmx_mtop_t *mtop,
                 matrix            box,
                 edsamstate_t     *EDstate)
 {
-    t_edpar *edi = NULL;                    /* points to a single edi data set */
+    t_edpar *edi = nullptr;                       /* points to a single edi data set */
     int      i, nr_edi, avindex;
-    rvec    *x_pbc  = NULL;                 /* positions of the whole MD system with pbc removed  */
-    rvec    *xfit   = NULL, *xstart = NULL; /* dummy arrays to determine initial RMSDs  */
-    rvec     fit_transvec;                  /* translation ... */
-    matrix   fit_rotmat;                    /* ... and rotation from fit to reference structure */
-    rvec    *ref_x_old = NULL;              /* helper pointer */
+    rvec    *x_pbc  = nullptr;                    /* positions of the whole MD system with pbc removed  */
+    rvec    *xfit   = nullptr, *xstart = nullptr; /* dummy arrays to determine initial RMSDs  */
+    rvec     fit_transvec;                        /* translation ... */
+    matrix   fit_rotmat;                          /* ... and rotation from fit to reference structure */
+    rvec    *ref_x_old = nullptr;                 /* helper pointer */
 
     if (MASTER(cr))
     {
         fprintf(stderr, "ED: Initializing essential dynamics constraints.\n");
 
-        if (NULL == ed)
+        if (nullptr == ed)
         {
             gmx_fatal(FARGS, "The checkpoint file you provided is from an essential dynamics or\n"
                       "flooding simulation. Please also provide the correct .edi file with -ei.\n");
@@ -2685,7 +2685,7 @@ void init_edsam(const gmx_mtop_t *mtop,
          * as well, but will be done in the order given in the edi file, so
          * expect different results for different order of edi file concatenation! */
         edi = ed->edpar;
-        while (edi != NULL)
+        while (edi != nullptr)
         {
             init_edi(mtop, edi);
             init_flood(edi, ed, ir->delta_t);
@@ -2702,7 +2702,7 @@ void init_edsam(const gmx_mtop_t *mtop,
             /* Remove PBC, make molecule(s) subject to ED whole. */
             snew(x_pbc, mtop->natoms);
             copy_rvecn(x, x_pbc, 0, mtop->natoms);
-            do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+            do_pbc_first_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
         }
         /* Reset pointer to first ED data set which contains the actual ED data */
         edi = ed->edpar;
@@ -3025,7 +3025,7 @@ void do_edsam(const t_inputrec *ir,
     /* Loop over all ED groups (usually one) */
     edi   = ed->edpar;
     edinr = 0;
-    while (edi != NULL)
+    while (edi != nullptr)
     {
         edinr++;
         if (bNeedDoEdsam(edi))
@@ -3156,7 +3156,7 @@ void do_edsam(const t_inputrec *ir,
                     /* dx is the ED correction to the positions: */
                     rvec_sub(x_unsh, xs[edi->sav.anrs_loc[i]], dx);
 
-                    if (v != NULL)
+                    if (v != nullptr)
                     {
                         /* dv is the ED correction to the velocity: */
                         svmul(dt_1, dx, dv);
index 1f508cddc9fd98c144cc2edcfe60a2721064a43a..ce3521a16fd3f710d4a2d2b364f9264a28ddf4b0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -87,9 +87,9 @@ void init_ewald_tab(struct gmx_ewald_tab_t **et, const t_inputrec *ir, FILE *fp)
     (*et)->ny       = ir->nky+1;
     (*et)->nz       = ir->nkz+1;
     (*et)->kmax     = std::max((*et)->nx, std::max((*et)->ny, (*et)->nz));
-    (*et)->eir      = NULL;
-    (*et)->tab_xy   = NULL;
-    (*et)->tab_qxyz = NULL;
+    (*et)->eir      = nullptr;
+    (*et)->tab_xy   = nullptr;
+    (*et)->tab_qxyz = nullptr;
 }
 
 //! Calculates wave vectors.
@@ -151,7 +151,7 @@ real do_ewald(t_inputrec *ir,
     real     tmp, cs, ss, ak, akv, mx, my, mz, m2, scale;
     gmx_bool bFreeEnergy;
 
-    if (cr != NULL)
+    if (cr != nullptr)
     {
         if (PAR(cr))
         {
index 2e0b5b6cf9b5516c47a852f5e477ffddf74f6730..4958b8f561a9285b8c365e3e6f2e33dd694c460d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -568,7 +568,7 @@ void pmegrid_init(pmegrid_t *grid,
     }
 
     grid->order = pme_order;
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         gridsize = grid->s[XX]*grid->s[YY]*grid->s[ZZ];
         set_gridsize_alignment(&gridsize, pme_order);
@@ -628,7 +628,7 @@ static void make_subgrid_division(const ivec n, int ovl, int nthread,
     }
 
     env = getenv("GMX_PME_THREAD_DIVISION");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%20d %20d %20d", &nsub[XX], &nsub[YY], &nsub[ZZ]);
     }
@@ -659,7 +659,7 @@ void pmegrids_init(pmegrids_t *grids,
     n_base[ZZ] = nz_base;
 
     pmegrid_init(&grids->grid, 0, 0, 0, 0, 0, 0, n[XX], n[YY], n[ZZ], FALSE, pme_order,
-                 NULL);
+                 nullptr);
 
     grids->nthread = nthread;
 
@@ -717,7 +717,7 @@ void pmegrids_init(pmegrids_t *grids,
     }
     else
     {
-        grids->grid_th = NULL;
+        grids->grid_th = nullptr;
     }
 
     snew(grids->g2t, DIM);
@@ -752,7 +752,7 @@ void pmegrids_init(pmegrids_t *grids,
         {
             grids->nthread_comm[d]++;
         }
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "pmegrid thread grid communication range in %c: %d\n",
                     'x'+d, grids->nthread_comm[d]);
@@ -769,7 +769,7 @@ void pmegrids_init(pmegrids_t *grids,
 
 void pmegrids_destroy(pmegrids_t *grids)
 {
-    if (grids->grid.grid != NULL)
+    if (grids->grid.grid != nullptr)
     {
         sfree_aligned(grids->grid.grid);
 
@@ -857,7 +857,7 @@ void reuse_pmegrids(const pmegrids_t *oldgrid, pmegrids_t *newgrid)
     sfree_aligned(newgrid->grid.grid);
     newgrid->grid.grid = oldgrid->grid.grid;
 
-    if (newgrid->grid_th != NULL && newgrid->nthread == oldgrid->nthread)
+    if (newgrid->grid_th != nullptr && newgrid->nthread == oldgrid->nthread)
     {
         sfree_aligned(newgrid->grid_all);
         newgrid->grid_all = oldgrid->grid_all;
index ed4e6e038dc6430ce10f6d3a0fece02f219a8adf..a559a454fe0cc25bad557eeacab7d781ae7cac2e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -150,7 +150,7 @@ struct pme_load_balancing_t {
  * read bActive anywhere */
 bool pme_loadbal_is_active(const pme_load_balancing_t *pme_lb)
 {
-    return pme_lb != NULL && pme_lb->bActive;
+    return pme_lb != nullptr && pme_lb->bActive;
 }
 
 void pme_loadbal_init(pme_load_balancing_t     **pme_lb_p,
@@ -299,7 +299,7 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t *pme_lb,
     pme_lb->n++;
     srenew(pme_lb->setup, pme_lb->n);
     set          = &pme_lb->setup[pme_lb->n-1];
-    set->pmedata = NULL;
+    set->pmedata = nullptr;
 
     get_pme_nnodes(dd, &npmeranks_x, &npmeranks_y);
 
@@ -320,7 +320,7 @@ static gmx_bool pme_loadbal_increase_cutoff(pme_load_balancing_t *pme_lb,
 
         fac *= 1.01;
         clear_ivec(set->grid);
-        sp = calc_grid(NULL, pme_lb->box_start,
+        sp = calc_grid(nullptr, pme_lb->box_start,
                        fac*pme_lb->setup[pme_lb->cur].spacing,
                        &set->grid[XX],
                        &set->grid[YY],
@@ -410,12 +410,12 @@ static void print_grid(FILE *fp_err, FILE *fp_log,
             pre,
             desc, set->grid[XX], set->grid[YY], set->grid[ZZ], set->rcut_coulomb,
             buft);
-    if (fp_err != NULL)
+    if (fp_err != nullptr)
     {
         fprintf(fp_err, "\r%s\n", buf);
         fflush(fp_err);
     }
-    if (fp_log != NULL)
+    if (fp_log != nullptr)
     {
         fprintf(fp_log, "%s\n", buf);
     }
@@ -446,12 +446,12 @@ static void print_loadbal_limited(FILE *fp_err, FILE *fp_log,
             gmx_step_str(step, sbuf),
             pmelblim_str[pme_lb->elimited],
             pme_lb->setup[pme_loadbal_end(pme_lb)-1].rcut_coulomb);
-    if (fp_err != NULL)
+    if (fp_err != nullptr)
     {
         fprintf(fp_err, "\r%s\n", buf);
         fflush(fp_err);
     }
-    if (fp_log != NULL)
+    if (fp_log != nullptr)
     {
         fprintf(fp_log, "%s\n", buf);
     }
@@ -790,7 +790,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
     }
 
     /* We always re-initialize the tables whether they are used or not */
-    init_interaction_const_tables(NULL, ic, rtab);
+    init_interaction_const_tables(nullptr, ic, rtab);
 
     nbnxn_gpu_pme_loadbal_update_param(nbv, ic);
 
@@ -815,7 +815,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     if (!pme_lb->bSepPMERanks)
     {
-        if (pme_lb->setup[pme_lb->cur].pmedata == NULL)
+        if (pme_lb->setup[pme_lb->cur].pmedata == nullptr)
         {
             /* Generate a new PME data structure,
              * copying part of the old pointers.
@@ -834,7 +834,7 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     if (debug)
     {
-        print_grid(NULL, debug, "", "switched to", set, -1);
+        print_grid(nullptr, debug, "", "switched to", set, -1);
     }
 
     if (pme_lb->stage == pme_lb->nstage)
@@ -1001,7 +1001,7 @@ void pme_loadbal_do(pme_load_balancing_t *pme_lb,
 
         if (ir->eDispCorr != edispcNO)
         {
-            calc_enervirdiff(NULL, ir->eDispCorr, fr);
+            calc_enervirdiff(nullptr, ir->eDispCorr, fr);
         }
     }
 
@@ -1100,7 +1100,7 @@ void pme_loadbal_done(pme_load_balancing_t *pme_lb,
                       const gmx::MDLogger  &mdlog,
                       gmx_bool              bNonBondedOnGPU)
 {
-    if (fplog != NULL && (pme_lb->cur > 0 || pme_lb->elimited != epmelblimNO))
+    if (fplog != nullptr && (pme_lb->cur > 0 || pme_lb->elimited != epmelblimNO))
     {
         print_pme_loadbal_settings(pme_lb, fplog, mdlog, bNonBondedOnGPU);
     }
index 6d8c0984357626a346079437b562ad4a3adcfcf2..66a7728b24b6d5f73b342cb249b7f0d88057347e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,7 +112,7 @@ static void gmx_pmeonly_switch(int *npmedata, struct gmx_pme_t ***pmedata,
                                struct gmx_pme_t **pme_ret)
 {
     int               ind;
-    struct gmx_pme_t *pme = NULL;
+    struct gmx_pme_t *pme = nullptr;
 
     ind = 0;
     while (ind < *npmedata)
@@ -152,10 +152,10 @@ int gmx_pmeonly(struct gmx_pme_t *pme,
     int                ret;
     int                natoms;
     matrix             box;
-    rvec              *x_pp       = NULL, *f_pp = NULL;
-    real              *chargeA    = NULL, *chargeB = NULL;
-    real              *c6A        = NULL, *c6B = NULL;
-    real              *sigmaA     = NULL, *sigmaB = NULL;
+    rvec              *x_pp       = nullptr, *f_pp = nullptr;
+    real              *chargeA    = nullptr, *chargeB = nullptr;
+    real              *c6A        = nullptr, *c6B = nullptr;
+    real              *sigmaA     = nullptr, *sigmaB = nullptr;
     real               lambda_q   = 0;
     real               lambda_lj  = 0;
     int                maxshift_x = 0, maxshift_y = 0;
index daa937b57164ab60f445b40589704d7e827ec362..24819755e2937c1abb45d3bec84a8874c7a7c3ef 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -234,7 +234,7 @@ static void gmx_pme_send_coeffs_coords(t_commrec *cr, unsigned int flags,
     if (dd->pme_receive_vir_ener)
     {
         /* Peer PP node: communicate all data */
-        if (dd->cnb == NULL)
+        if (dd->cnb == nullptr)
         {
             snew(dd->cnb, 1);
         }
@@ -352,7 +352,7 @@ void gmx_pme_send_parameters(t_commrec *cr,
     gmx_pme_send_coeffs_coords(cr, flags,
                                chargeA, chargeB,
                                sqrt_c6A, sqrt_c6B, sigmaA, sigmaB,
-                               NULL, NULL, 0, 0, maxshift_x, maxshift_y, -1);
+                               nullptr, nullptr, 0, 0, maxshift_x, maxshift_y, -1);
 }
 
 void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
@@ -365,7 +365,7 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
     {
         flags |= PP_PME_ENER_VIR;
     }
-    gmx_pme_send_coeffs_coords(cr, flags, NULL, NULL, NULL, NULL, NULL, NULL,
+    gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
                                box, x, lambda_q, lambda_lj, 0, 0, step);
 }
 
@@ -373,7 +373,7 @@ void gmx_pme_send_finish(t_commrec *cr)
 {
     unsigned int flags = PP_PME_FINISH;
 
-    gmx_pme_send_coeffs_coords(cr, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, -1);
+    gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0, 0, -1);
 }
 
 void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr,
index 71553ad7a2d51ee41a2b502a3d898649df4c0afb..1df26a8aab5d9db1dc85c2179ff6b7b012ea45a8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -160,7 +160,7 @@ void pme_free_all_work(struct pme_solve_work_t **work, int nthread)
         free_work(&(*work)[thread]);
     }
     sfree(*work);
-    *work = NULL;
+    *work = nullptr;
 }
 
 void get_pme_ener_vir_q(struct pme_solve_work_t *work, int nthread,
index 5bb4be177ba0a9269c40cd0b98cac1ffd9f7e598..477a24937869d47172199d321c7be6acbe2d6e70 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,9 +69,9 @@ static void calc_interpolation_idx(struct gmx_pme_t *pme, pme_atomcomm_t *atc,
     int             nx, ny, nz;
     int            *g2tx, *g2ty, *g2tz;
     gmx_bool        bThreads;
-    int            *thread_idx = NULL;
-    thread_plist_t *tpl        = NULL;
-    int            *tpl_n      = NULL;
+    int            *thread_idx = nullptr;
+    thread_plist_t *tpl        = nullptr;
+    int            *tpl_n      = nullptr;
     int             thread_i;
 
     nx  = pme->nkx;
@@ -466,7 +466,7 @@ reduce_threadgrid_overlap(struct gmx_pme_t *pme,
     int  thread_f;
     const pmegrid_t *pmegrid, *pmegrid_g, *pmegrid_f;
     const real *grid_th;
-    real *commbuf = NULL;
+    real *commbuf = nullptr;
 
     gmx_parallel_3dfft_real_limits(pme->pfft_setup[grid_index],
                                    local_fft_ndata,
@@ -755,7 +755,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
             sendptr = overlap->sendbuf + send_index0*local_fft_ndata[ZZ];
             recvptr = overlap->recvbuf;
 
-            if (debug != NULL)
+            if (debug != nullptr)
             {
                 fprintf(debug, "PME fftgrid comm y %2d x %2d x %2d\n",
                         local_fft_ndata[XX], send_nindex, local_fft_ndata[ZZ]);
@@ -821,7 +821,7 @@ static void sum_fftgrid_dd(struct gmx_pme_t *pme, real *fftgrid, int grid_index)
 
         recvptr = overlap->recvbuf;
 
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             fprintf(debug, "PME fftgrid comm x %2d x %2d x %2d\n",
                     send_nindex, local_fft_ndata[YY], local_fft_ndata[ZZ]);
@@ -907,10 +907,10 @@ void spread_on_grid(struct gmx_pme_t *pme,
         try
         {
             splinedata_t *spline;
-            pmegrid_t *grid = NULL;
+            pmegrid_t *grid = nullptr;
 
             /* make local bsplines  */
-            if (grids == NULL || !pme->bUseThreads)
+            if (grids == nullptr || !pme->bUseThreads)
             {
                 spline = &atc->spline[0];
 
index e5dea7d8c43390258c055bd13114ed03b5261b6a..b66892b8f55c0b855f491f74d26eccf83397b390 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -466,7 +466,7 @@ void gmx_pme_check_restrictions(int pme_order,
                   nkx/(double)nnodes_major, pme_order);
     }
 
-    if (bValidSettings != NULL)
+    if (bValidSettings != nullptr)
     {
         *bValidSettings = TRUE;
     }
@@ -493,7 +493,7 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
                  real               ewaldcoeff_lj,
                  int                nthread)
 {
-    struct gmx_pme_t *pme = NULL;
+    struct gmx_pme_t *pme = nullptr;
 
     int               use_threads, sum_use_threads, i;
     ivec              ndata;
@@ -504,8 +504,8 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     }
     snew(pme, 1);
 
-    pme->sum_qgrid_tmp       = NULL;
-    pme->sum_qgrid_dd_tmp    = NULL;
+    pme->sum_qgrid_tmp       = nullptr;
+    pme->sum_qgrid_dd_tmp    = nullptr;
     pme->buf_nalloc          = 0;
 
     pme->nnodes              = 1;
@@ -629,7 +629,7 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
     pme->nkx           = ir->nkx;
     pme->nky           = ir->nky;
     pme->nkz           = ir->nkz;
-    pme->bP3M          = (ir->coulombtype == eelP3M_AD || getenv("GMX_PME_P3M") != NULL);
+    pme->bP3M          = (ir->coulombtype == eelP3M_AD || getenv("GMX_PME_P3M") != nullptr);
     pme->pme_order     = ir->pme_order;
     pme->ewaldcoeff_q  = ewaldcoeff_q;
     pme->ewaldcoeff_lj = ewaldcoeff_lj;
@@ -647,7 +647,7 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
                                pme->nnodes_minor,
                                pme->bUseThreads,
                                TRUE,
-                               NULL);
+                               nullptr);
 
     if (pme->nnodes > 1)
     {
@@ -814,8 +814,8 @@ int gmx_pme_init(struct gmx_pme_t **pmedata,
         pme_realloc_atomcomm_things(&pme->atc[0]);
     }
 
-    pme->lb_buf1       = NULL;
-    pme->lb_buf2       = NULL;
+    pme->lb_buf1       = nullptr;
+    pme->lb_buf2       = nullptr;
     pme->lb_buf_nalloc = 0;
 
     pme_init_all_work(&pme->solve_work, pme->nthread, pme->nkx);
@@ -880,7 +880,7 @@ void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V
 
     atc            = &pme->atc_energy;
     atc->nthread   = 1;
-    if (atc->spline == NULL)
+    if (atc->spline == nullptr)
     {
         snew(atc->spline, atc->nthread);
     }
@@ -896,7 +896,7 @@ void gmx_pme_calc_energy(struct gmx_pme_t *pme, int n, rvec *x, real *q, real *V
     grid = &pme->pmegrid[PME_GRID_QA];
 
     /* Only calculate the spline coefficients, don't actually spread */
-    spread_on_grid(pme, atc, NULL, TRUE, FALSE, pme->fftgrid[PME_GRID_QA], FALSE, PME_GRID_QA);
+    spread_on_grid(pme, atc, nullptr, TRUE, FALSE, pme->fftgrid[PME_GRID_QA], FALSE, PME_GRID_QA);
 
     *V = gather_energy_bsplines(pme, grid->grid.grid, atc);
 }
@@ -945,11 +945,11 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 {
     int                  d, i, j, npme, grid_index, max_grid_index;
     int                  n_d;
-    pme_atomcomm_t      *atc        = NULL;
-    pmegrids_t          *pmegrid    = NULL;
-    real                *grid       = NULL;
+    pme_atomcomm_t      *atc        = nullptr;
+    pmegrids_t          *pmegrid    = nullptr;
+    real                *grid       = nullptr;
     rvec                *f_d;
-    real                *coefficient = NULL;
+    real                *coefficient = nullptr;
     real                 energy_AB[4];
     matrix               vir_AB[4];
     real                 scale, lambda;
@@ -1054,7 +1054,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
             fprintf(debug, "PME: number of ranks = %d, rank = %d\n",
                     cr->nnodes, cr->nodeid);
             fprintf(debug, "Grid = %p\n", (void*)grid);
-            if (grid == NULL)
+            if (grid == nullptr)
             {
                 gmx_fatal(FARGS, "No grid!");
             }
@@ -1285,10 +1285,10 @@ int gmx_pme_do(struct gmx_pme_t *pme,
         /* Loop over A- and B-state if we are doing FEP */
         for (fep_state = 0; fep_state < fep_states_lj; ++fep_state)
         {
-            real *local_c6 = NULL, *local_sigma = NULL, *RedistC6 = NULL, *RedistSigma = NULL;
+            real *local_c6 = nullptr, *local_sigma = nullptr, *RedistC6 = nullptr, *RedistSigma = nullptr;
             if (pme->nnodes == 1)
             {
-                if (pme->lb_buf1 == NULL)
+                if (pme->lb_buf1 == nullptr)
                 {
                     pme->lb_buf_nalloc = pme->atc[0].n;
                     snew(pme->lb_buf1, pme->lb_buf_nalloc);
@@ -1675,7 +1675,7 @@ int gmx_pme_destroy(struct gmx_pme_t **pmedata)
     sfree(pme->sum_qgrid_dd_tmp);
 
     sfree(*pmedata);
-    *pmedata = NULL;
+    *pmedata = nullptr;
 
     return 0;
 }
index 8a32f6ef52c625f1fa2da96222fadbdd6ecfd9d2..5e826ada8957323999c84c090abdfaecce254ea4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -107,7 +107,7 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
 
     if ((*nx <= 0) || (*ny <= 0) || (*nz <= 0))
     {
-        if (NULL != fp)
+        if (nullptr != fp)
         {
             fprintf(fp, "Calculating fourier grid dimensions for%s%s%s\n",
                     *nx > 0 ? "" : " X", *ny > 0 ? "" : " Y", *nz > 0 ? "" : " Z");
@@ -162,7 +162,7 @@ real calc_grid(FILE *fp, const matrix box, real gr_sp,
     *nx = n[XX];
     *ny = n[YY];
     *nz = n[ZZ];
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         fprintf(fp, "Using a fourier grid of %dx%dx%d, spacing %.3f %.3f %.3f\n",
                 *nx, *ny, *nz, spacing[XX], spacing[YY], spacing[ZZ]);
index 9ead1601ff498473d61d36b4d0f1c8f097db2b95..53434e64534de854c7305b6fd2f2364af3cea7b2 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 Erik Lindahl, David van der Spoel, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,14 +70,14 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
                      gmx_fft_flag       flags)
 {
     gmx_many_fft_t fft;
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == NULL)
+    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -97,14 +97,14 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
                           gmx_fft_flag       flags)
 {
     gmx_many_fft_t fft;
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == NULL)
+    if ( (fft = (gmx_many_fft_t)malloc(sizeof(struct gmx_many_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -164,9 +164,9 @@ void
 gmx_many_fft_destroy(gmx_fft_t    fft)
 {
     gmx_many_fft_t mfft = (gmx_many_fft_t)fft;
-    if (mfft != NULL)
+    if (mfft != nullptr)
     {
-        if (mfft->fft != NULL)
+        if (mfft->fft != nullptr)
         {
             gmx_fft_destroy(mfft->fft);
         }
index 471f57c25b43e66eff7b77cd6f0c7e94a8d4bfc0..d57cc2cc8e648e475d6711564e2367143beff870 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -174,11 +174,11 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
 
     int        P[2], bMaster, prank[2], i, t;
     int        rNG, rMG, rKG;
-    int       *N0 = 0, *N1 = 0, *M0 = 0, *M1 = 0, *K0 = 0, *K1 = 0, *oN0 = 0, *oN1 = 0, *oM0 = 0, *oM1 = 0, *oK0 = 0, *oK1 = 0;
-    int        N[3], M[3], K[3], pN[3], pM[3], pK[3], oM[3], oK[3], *iNin[3] = {0}, *oNin[3] = {0}, *iNout[3] = {0}, *oNout[3] = {0};
+    int       *N0 = nullptr, *N1 = nullptr, *M0 = nullptr, *M1 = nullptr, *K0 = nullptr, *K1 = nullptr, *oN0 = nullptr, *oN1 = nullptr, *oM0 = nullptr, *oM1 = nullptr, *oK0 = nullptr, *oK1 = nullptr;
+    int        N[3], M[3], K[3], pN[3], pM[3], pK[3], oM[3], oK[3], *iNin[3] = {nullptr}, *oNin[3] = {nullptr}, *iNout[3] = {nullptr}, *oNout[3] = {nullptr};
     int        C[3], rC[3], nP[2];
     int        lsize;
-    t_complex *lin = 0, *lout = 0, *lout2 = 0, *lout3 = 0;
+    t_complex *lin = nullptr, *lout = nullptr, *lout2 = nullptr, *lout3 = nullptr;
     fft5d_plan plan;
     int        s;
 
@@ -239,7 +239,7 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
         {
             printf("FFT5D: FATAL: Datasize cannot be zero in any dimension\n");
         }
-        return 0;
+        return nullptr;
     }
 
     rNG = NG; rMG = MG; rKG = KG;
@@ -556,21 +556,21 @@ fft5d_plan fft5d_plan_3d(int NG, int MG, int KG, MPI_Comm comm[2], int flags, t_
         if ((flags&FFT5D_REALCOMPLEX) && !(flags&FFT5D_BACKWARD))
         {
             plan->p3d = FFTW(plan_guru_dft_r2c)(/*rank*/ 3, dims,
-                                                         /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                         /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                          (real*)lin, (FFTW(complex) *) lout,
                                                          /*flags*/ fftwflags);
         }
         else if ((flags&FFT5D_REALCOMPLEX) && (flags&FFT5D_BACKWARD))
         {
             plan->p3d = FFTW(plan_guru_dft_c2r)(/*rank*/ 3, dims,
-                                                         /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                         /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                          (FFTW(complex) *) lin, (real*)lout,
                                                          /*flags*/ fftwflags);
         }
         else
         {
             plan->p3d = FFTW(plan_guru_dft)(/*rank*/ 3, dims,
-                                                     /*howmany*/ 0, /*howmany_dims*/ 0,
+                                                     /*howmany*/ 0, /*howmany_dims*/ nullptr,
                                                      (FFTW(complex) *) lin, (FFTW(complex) *) lout,
                                                      /*sign*/ (flags&FFT5D_BACKWARD) ? 1 : -1, /*flags*/ fftwflags);
         }
@@ -1264,22 +1264,22 @@ void fft5d_destroy(fft5d_plan plan)
         if (plan->iNin[s])
         {
             free(plan->iNin[s]);
-            plan->iNin[s] = 0;
+            plan->iNin[s] = nullptr;
         }
         if (plan->oNin[s])
         {
             free(plan->oNin[s]);
-            plan->oNin[s] = 0;
+            plan->oNin[s] = nullptr;
         }
         if (plan->iNout[s])
         {
             free(plan->iNout[s]);
-            plan->iNout[s] = 0;
+            plan->iNout[s] = nullptr;
         }
         if (plan->oNout[s])
         {
             free(plan->oNout[s]);
-            plan->oNout[s] = 0;
+            plan->oNout[s] = nullptr;
         }
     }
 #if GMX_FFT_FFTW3
@@ -1334,7 +1334,7 @@ void fft5d_local_size(fft5d_plan plan, int* N1, int* M0, int* K0, int* K1, int**
    of processor dimensions*/
 fft5d_plan fft5d_plan_3d_cart(int NG, int MG, int KG, MPI_Comm comm, int P0, int flags, t_complex** rlin, t_complex** rlout, t_complex** rlout2, t_complex** rlout3, int nthreads)
 {
-    MPI_Comm cart[2] = {0};
+    MPI_Comm cart[2] = {MPI_COMM_NULL, MPI_COMM_NULL};
 #if GMX_MPI
     int      size = 1, prank = 0;
     int      P[2];
index 9a55150b6f003470861fa8b789d82aaa93785957..9f4ab9ec53440fcc7bbf091f591b1eca4ce72b5a 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,23 +81,23 @@ gmx_fft_init_1d(gmx_fft_t *        pfft,
 {
     gmx_fft_t    fft;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
 
-    fft->next = NULL;
+    fft->next = nullptr;
     fft->n    = nx;
 
     /* Need 4*n storage for 1D complex FFT */
-    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx))) == NULL)
+    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -121,23 +121,23 @@ gmx_fft_init_1d_real(gmx_fft_t *        pfft,
 {
     gmx_fft_t    fft;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
 
-    fft->next = NULL;
+    fft->next = nullptr;
     fft->n    = nx;
 
     /* Need 2*n storage for 1D real FFT */
-    if ((fft->work = (real *)malloc(sizeof(real)*(2*nx))) == NULL)
+    if ((fft->work = (real *)malloc(sizeof(real)*(2*nx))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -162,15 +162,15 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     int           nyc = (ny/2 + 1);
     int           rc;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid FFT opaque type pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     /* Create the X transform */
-    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (struct gmx_fft *)malloc(sizeof(struct gmx_fft))) == nullptr)
     {
         return ENOMEM;
     }
@@ -180,7 +180,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     /* Need 4*nx storage for 1D complex FFT, and another
      * 2*nx*nyc elements for complex-to-real storage in our high-level routine.
      */
-    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx+2*nx*nyc))) == NULL)
+    if ( (fft->work = (real *)malloc(sizeof(real)*(4*nx+2*nx*nyc))) == nullptr)
     {
         free(fft);
         return ENOMEM;
@@ -480,10 +480,10 @@ gmx_fft_2d_real          (gmx_fft_t                  fft,
 void
 gmx_fft_destroy(gmx_fft_t      fft)
 {
-    if (fft != NULL)
+    if (fft != nullptr)
     {
         free(fft->work);
-        if (fft->next != NULL)
+        if (fft->next != nullptr)
         {
             gmx_fft_destroy(fft->next);
         }
index e1087d03605891b388024ac525951cff1ef4e3f6..b8eceda133a12dc447ac5dc5c9dc98c910bfce30 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2003 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,15 +120,15 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t)FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -136,7 +136,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -144,7 +144,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
     }
 
     p2  = (FFTWPREFIX(complex) *) FFTWPREFIX(malloc)(sizeof(FFTWPREFIX(complex))*(nx+2)*howmany);
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -185,7 +185,7 @@ gmx_fft_init_many_1d(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -237,15 +237,15 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -253,7 +253,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -261,7 +261,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
     }
 
     p2  = (real *) FFTWPREFIX(malloc)(sizeof(real)*(nx/2+1)*2*howmany + 8);
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -287,15 +287,15 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
                                       fftw_complex *out, const int *onembed,
                                       int ostride, int odist,
                                       unsigned flag    */
-    fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, 0, 1, (nx/2+1), fftw_flags);
-    fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, 0, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), fftw_flags);
+    fft->plan[0][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up2, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[0][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, up1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[1][0][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p2, nullptr, 1, (nx/2+1), fftw_flags);
+    fft->plan[1][1][1] = FFTWPREFIX(plan_many_dft_r2c)(1, &nx, howmany, p1, nullptr, 1, (nx/2+1) *2, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), fftw_flags);
 
-    fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up2, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, 0, 1, (nx/2+1), up1, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p2, 0, 1, (nx/2+1) *2, fftw_flags);
-    fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, 0, 1, (nx/2+1), p1, 0, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[0][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[0][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) up1, nullptr, 1, (nx/2+1), up1, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[1][0][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p2, nullptr, 1, (nx/2+1) *2, fftw_flags);
+    fft->plan[1][1][0] = FFTWPREFIX(plan_many_dft_c2r)(1, &nx, howmany, (FFTWPREFIX(complex) *) p1, nullptr, 1, (nx/2+1), p1, nullptr, 1, (nx/2+1) *2, fftw_flags);
 
     for (i = 0; i < 2; i++)
     {
@@ -303,7 +303,7 @@ gmx_fft_init_many_1d_real(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -348,15 +348,15 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
 
     fftw_flags = (flags & GMX_FFT_FLAG_CONSERVATIVE) ? FFTW_ESTIMATE : FFTW_MEASURE;
 
-    if (pfft == NULL)
+    if (pfft == nullptr)
     {
         gmx_fatal(FARGS, "Invalid opaque FFT datatype pointer.");
         return EINVAL;
     }
-    *pfft = NULL;
+    *pfft = nullptr;
 
     FFTW_LOCK;
-    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == NULL)
+    if ( (fft = (gmx_fft_t) FFTWPREFIX(malloc)(sizeof(struct gmx_fft))) == nullptr)
     {
         FFTW_UNLOCK;
         return ENOMEM;
@@ -364,7 +364,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
 
     /* allocate aligned, and extra memory to make it unaligned */
     p1  = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
-    if (p1 == NULL)
+    if (p1 == nullptr)
     {
         FFTWPREFIX(free)(fft);
         FFTW_UNLOCK;
@@ -372,7 +372,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
     }
 
     p2  = (real *) FFTWPREFIX(malloc)(sizeof(real) *( nx*(ny/2+1)*2 + 2) );
-    if (p2 == NULL)
+    if (p2 == nullptr)
     {
         FFTWPREFIX(free)(p1);
         FFTWPREFIX(free)(fft);
@@ -410,7 +410,7 @@ gmx_fft_init_2d_real(gmx_fft_t *        pfft,
         {
             for (k = 0; k < 2; k++)
             {
-                if (fft->plan[i][j][k] == NULL)
+                if (fft->plan[i][j][k] == nullptr)
                 {
                     gmx_fatal(FARGS, "Error initializing FFTW3 plan.");
                     FFTW_UNLOCK;
@@ -551,7 +551,7 @@ gmx_fft_destroy(gmx_fft_t      fft)
 {
     int                   i, j, k;
 
-    if (fft != NULL)
+    if (fft != nullptr)
     {
         for (i = 0; i < 2; i++)
         {
@@ -559,12 +559,12 @@ gmx_fft_destroy(gmx_fft_t      fft)
             {
                 for (k = 0; k < 2; k++)
                 {
-                    if (fft->plan[i][j][k] != NULL)
+                    if (fft->plan[i][j][k] != nullptr)
                     {
                         FFTW_LOCK;
                         FFTWPREFIX(destroy_plan)(fft->plan[i][j][k]);
                         FFTW_UNLOCK;
-                        fft->plan[i][j][k] = NULL;
+                        fft->plan[i][j][k] = nullptr;
                     }
                 }
             }
index 3c04fb24fc57d7ad177f927519555b9c124ed735..618be1c3aa86b0a67879ab707ab4a4525b50fcc3 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -87,7 +87,7 @@ gmx_parallel_3dfft_init   (gmx_parallel_3dfft_t     *    pfft_setup,
     (*pfft_setup)->p2 = fft5d_plan_3d(Nb, Mb, Kb, rcomm,
                                       (flags|FFT5D_BACKWARD|FFT5D_NOMALLOC)^FFT5D_ORDER_YZ, complex_data, (t_complex**)real_data, &buf1, &buf2, nthreads);
 
-    return (*pfft_setup)->p1 != 0 && (*pfft_setup)->p2 != 0;
+    return (*pfft_setup)->p1 != nullptr && (*pfft_setup)->p2 != nullptr;
 }
 
 
index ca0b6d273bf43348d6115deb0d134a2174a2a7ea..3b9dd87ee25bf6ccd956650129c6796d456c74a5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -118,7 +118,7 @@ class BaseFFTTest : public ::testing::Test
 class FFTTest : public BaseFFTTest
 {
     public:
-        FFTTest() : fft_(NULL)
+        FFTTest() : fft_(nullptr)
         {
         }
         ~FFTTest()
@@ -134,7 +134,7 @@ class FFTTest : public BaseFFTTest
 class ManyFFTTest : public BaseFFTTest
 {
     public:
-        ManyFFTTest() : fft_(NULL)
+        ManyFFTTest() : fft_(nullptr)
         {
         }
         ~ManyFFTTest()
@@ -158,7 +158,7 @@ class FFTTest1D : public FFTTest, public ::testing::WithParamInterface<int>
 class FFFTest3D : public BaseFFTTest
 {
     public:
-        FFFTest3D() : fft_(NULL)
+        FFFTest3D() : fft_(nullptr)
         {
         }
         ~FFFTest3D()
@@ -301,7 +301,7 @@ TEST_F(FFFTest3D, Real5_6_9)
     std::copy(inputdata, inputdata+sizeInReals, in_.begin());
     // Use memcpy to convert to t_complex easily
     memcpy(rdata, in_.data(), sizeInBytes);
-    gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, NULL);
+    gmx_parallel_3dfft_execute(fft_, GMX_FFT_REAL_TO_COMPLEX, 0, nullptr);
     //TODO use std::complex and add checkComplex for it
     checker_.checkSequenceArray(size*2,
                                 reinterpret_cast<real*>(cdata), "forward");
@@ -310,7 +310,7 @@ TEST_F(FFFTest3D, Real5_6_9)
     std::copy(inputdata, inputdata+sizeInReals, in_.begin());
     // Use memcpy to convert to t_complex easily
     memcpy(cdata, in_.data(), sizeInBytes);
-    gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, NULL);
+    gmx_parallel_3dfft_execute(fft_, GMX_FFT_COMPLEX_TO_REAL, 0, nullptr);
     for (int i = 0; i < ndata[0]*ndata[1]; i++) //check sequence but skip unused data
     {
         checker_.checkSequenceArray(ndata[2], rdata+i*rsize[2],
index 4530329127de6fda1f46db101f194abaecf64387..23f037fcad995ad3af534818b6c38d73a959ceba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -180,7 +180,7 @@ static const char *entryName(StatePart part, int ecpt)
         case StatePart::freeEnergyHistory: return edfh_names[ecpt];
     }
 
-    return NULL;
+    return nullptr;
 }
 
 static void cp_warning(FILE *fp)
@@ -376,7 +376,7 @@ static inline xdrproc_t xdrProc(int xdrType)
         default: GMX_RELEASE_ASSERT(false, "XDR data type not implemented");
     }
 
-    return NULL;
+    return nullptr;
 }
 
 /*! \brief Lists or only reads an xdr vector from checkpoint file
@@ -395,7 +395,7 @@ static bool_t listXdrVector(XDR *xd, StatePart part, int ecpt, int nf, int xdrTy
     std::vector<char>  data(nf*elemSize);
     res = xdr_vector(xd, data.data(), nf, elemSize, xdrProc(xdrType));
 
-    if (list != NULL)
+    if (list != nullptr)
     {
         switch (xdrType)
         {
@@ -485,23 +485,23 @@ static int doVectorLow(XDR *xd, StatePart part, int ecpt, int sflags,
                        T **v, std::vector<T> *vector,
                        FILE *list, CptElementType cptElementType)
 {
-    GMX_RELEASE_ASSERT(list != NULL || (v != NULL && vector == NULL) || (v == NULL && vector != NULL), "Without list, we should have exactly one of v and vector != NULL");
+    GMX_RELEASE_ASSERT(list != nullptr || (v != nullptr && vector == nullptr) || (v == nullptr && vector != nullptr), "Without list, we should have exactly one of v and vector != NULL");
 
     bool_t res = 0;
 
     int    numElemInTheFile;
-    if (list == NULL)
+    if (list == nullptr)
     {
         if (nval >= 0)
         {
-            GMX_RELEASE_ASSERT(nptr == NULL, "With nval>=0 we should have nptr==NULL");
+            GMX_RELEASE_ASSERT(nptr == nullptr, "With nval>=0 we should have nptr==NULL");
             numElemInTheFile = nval;
         }
         else
         {
-            if (v != NULL)
+            if (v != nullptr)
             {
-                GMX_RELEASE_ASSERT(nptr != NULL, "With nval<0 we should have nptr!=NULL");
+                GMX_RELEASE_ASSERT(nptr != nullptr, "With nval<0 we should have nptr!=NULL");
                 // cppcheck-suppress nullPointer
                 numElemInTheFile = *nptr;
             }
@@ -526,7 +526,7 @@ static int doVectorLow(XDR *xd, StatePart part, int ecpt, int sflags,
         return -1;
     }
 
-    if (list == NULL && (sflags & (1 << ecpt)))
+    if (list == nullptr && (sflags & (1 << ecpt)))
     {
         if (nval >= 0)
         {
@@ -535,7 +535,7 @@ static int doVectorLow(XDR *xd, StatePart part, int ecpt, int sflags,
                 gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", entryName(part, ecpt), nval, numElemInTheFile);
             }
         }
-        else if (nptr != NULL)
+        else if (nptr != nullptr)
         {
             *nptr = numElemInTheFile;
         }
@@ -559,9 +559,9 @@ static int doVectorLow(XDR *xd, StatePart part, int ecpt, int sflags,
         }
 
         T *vp;
-        if (v != NULL)
+        if (v != nullptr)
         {
-            if (*v == NULL)
+            if (*v == nullptr)
             {
                 snew(*v, numElemInTheFile);
             }
@@ -623,7 +623,7 @@ template <typename T>
 static int doVector(XDR *xd, StatePart part, int ecpt, int sflags,
                     std::vector<T> *vector, FILE *list)
 {
-    return doVectorLow<T>(xd, part, ecpt, sflags, -1, NULL, NULL, vector, list, CptElementType::real);
+    return doVectorLow<T>(xd, part, ecpt, sflags, -1, nullptr, nullptr, vector, list, CptElementType::real);
 }
 
 //! \brief Read/Write an std::vector, on read checks the number of elements matches \p numElements
@@ -631,7 +631,7 @@ template <typename T>
 static int doVector(XDR *xd, StatePart part, int ecpt, int sflags,
                     int numElements, std::vector<T> *vector, FILE *list)
 {
-    return doVectorLow<T>(xd, part, ecpt, sflags, numElements, NULL, NULL, vector, list, CptElementType::real);
+    return doVectorLow<T>(xd, part, ecpt, sflags, numElements, nullptr, nullptr, vector, list, CptElementType::real);
 }
 
 //! \brief Read/Write a PaddedRVecVector, on read checks the number of elements matches \p numElements
@@ -640,7 +640,7 @@ static int doPaddedVector(XDR *xd, StatePart part, int ecpt, int sflags,
 {
     rvec *v_rvec;
 
-    if (list == NULL && (sflags & (1 << ecpt)))
+    if (list == nullptr && (sflags & (1 << ecpt)))
     {
         /* We resize the vector here to avoid pointer reallocation in
          * do_cpte_reals_low. Note the we allocate 1 element extra for SIMD.
@@ -650,11 +650,11 @@ static int doPaddedVector(XDR *xd, StatePart part, int ecpt, int sflags,
     }
     else
     {
-        v_rvec = NULL;
+        v_rvec = nullptr;
     }
 
     return doVectorLow<real>(xd, part, ecpt, sflags,
-                             numElements*DIM, NULL, (real **)(&v_rvec), NULL,
+                             numElements*DIM, nullptr, (real **)(&v_rvec), nullptr,
                              list, CptElementType::real3);
 }
 
@@ -665,7 +665,7 @@ static int doPaddedVector(XDR *xd, StatePart part, int ecpt, int sflags,
 static int do_cpte_reals(XDR *xd, StatePart part, int ecpt, int sflags,
                          int n, real **v, FILE *list)
 {
-    return doVectorLow<real>(xd, part, ecpt, sflags, n, NULL, v, NULL, list, CptElementType::real);
+    return doVectorLow<real>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::real);
 }
 
 /* This function does the same as do_cpte_reals,
@@ -675,19 +675,19 @@ static int do_cpte_reals(XDR *xd, StatePart part, int ecpt, int sflags,
 static int do_cpte_n_reals(XDR *xd, StatePart part, int ecpt, int sflags,
                            int *n, real **v, FILE *list)
 {
-    return doVectorLow<real>(xd, part, ecpt, sflags, -1, n, v, NULL, list, CptElementType::real);
+    return doVectorLow<real>(xd, part, ecpt, sflags, -1, n, v, nullptr, list, CptElementType::real);
 }
 
 static int do_cpte_real(XDR *xd, StatePart part, int ecpt, int sflags,
                         real *r, FILE *list)
 {
-    return doVectorLow<real>(xd, part, ecpt, sflags, 1, NULL, &r, NULL, list, CptElementType::real);
+    return doVectorLow<real>(xd, part, ecpt, sflags, 1, nullptr, &r, nullptr, list, CptElementType::real);
 }
 
 static int do_cpte_ints(XDR *xd, StatePart part, int ecpt, int sflags,
                         int n, int **v, FILE *list)
 {
-    return doVectorLow<int>(xd, part, ecpt, sflags, n, NULL, v, NULL, list, CptElementType::integer);
+    return doVectorLow<int>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::integer);
 }
 
 static int do_cpte_int(XDR *xd, StatePart part, int ecpt, int sflags,
@@ -699,7 +699,7 @@ static int do_cpte_int(XDR *xd, StatePart part, int ecpt, int sflags,
 static int do_cpte_doubles(XDR *xd, StatePart part, int ecpt, int sflags,
                            int n, double **v, FILE *list)
 {
-    return doVectorLow<double>(xd, part, ecpt, sflags, n, NULL, v, NULL, list, CptElementType::real);
+    return doVectorLow<double>(xd, part, ecpt, sflags, n, nullptr, v, nullptr, list, CptElementType::real);
 }
 
 static int do_cpte_double(XDR *xd, StatePart part, int ecpt, int sflags,
@@ -716,7 +716,7 @@ static int do_cpte_matrix(XDR *xd, StatePart part, int ecpt, int sflags,
 
     vr  = &(v[0][0]);
     ret = doVectorLow<real>(xd, part, ecpt, sflags,
-                            DIM*DIM, NULL, &vr, NULL, NULL, CptElementType::matrix3x3);
+                            DIM*DIM, nullptr, &vr, nullptr, nullptr, CptElementType::matrix3x3);
 
     if (list && ret == 0)
     {
@@ -735,13 +735,13 @@ static int do_cpte_nmatrix(XDR *xd, StatePart part, int ecpt, int sflags,
     char  name[CPTSTRLEN];
 
     ret = 0;
-    if (v == NULL)
+    if (v == nullptr)
     {
         snew(v, n);
     }
     for (i = 0; i < n; i++)
     {
-        reti = doVectorLow<real>(xd, part, ecpt, sflags, n, NULL, &(v[i]), NULL, NULL, CptElementType::matrix3x3);
+        reti = doVectorLow<real>(xd, part, ecpt, sflags, n, nullptr, &(v[i]), nullptr, nullptr, CptElementType::matrix3x3);
         if (list && reti == 0)
         {
             sprintf(name, "%s[%d]", entryName(part, ecpt), i);
@@ -759,7 +759,7 @@ static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
                             int n, matrix **v, FILE *list)
 {
     bool_t  res = 0;
-    matrix *vp, *va = NULL;
+    matrix *vp, *va = nullptr;
     real   *vr;
     int     nf, i, j, k;
     int     ret;
@@ -770,7 +770,7 @@ static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
     {
         return -1;
     }
-    if (list == NULL && nf != n)
+    if (list == nullptr && nf != n)
     {
         gmx_fatal(FARGS, "Count mismatch for state entry %s, code count is %d, file count is %d\n", entryName(part, ecpt), n, nf);
     }
@@ -781,7 +781,7 @@ static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
     }
     else
     {
-        if (*v == NULL)
+        if (*v == nullptr)
         {
             snew(*v, nf);
         }
@@ -799,7 +799,7 @@ static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
         }
     }
     ret = doVectorLow<real>(xd, part, ecpt, sflags,
-                            nf*DIM*DIM, NULL, &vr, NULL, NULL,
+                            nf*DIM*DIM, nullptr, &vr, nullptr, nullptr,
                             CptElementType::matrix3x3);
     for (i = 0; i < nf; i++)
     {
@@ -893,7 +893,7 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
     if (*file_version >= 12)
     {
         do_cpt_string_err(xd, bRead, "generating host", &fhost, list);
-        if (list == NULL)
+        if (list == nullptr)
         {
             sfree(fhost);
         }
@@ -1049,10 +1049,10 @@ static int do_cpt_state(XDR *xd,
                 /* The RNG entries are no longer written,
                  * the next 4 lines are only for reading old files.
                  */
-                case estLD_RNG:  ret      = do_cpte_ints(xd, part, i, sflags, 0, NULL, list); break;
-                case estLD_RNGI: ret      = do_cpte_ints(xd, part, i, sflags, 0, NULL, list); break;
-                case estMC_RNG:  ret      = do_cpte_ints(xd, part, i, sflags, 0, NULL, list); break;
-                case estMC_RNGI: ret      = do_cpte_ints(xd, part, i, sflags, 0, NULL, list); break;
+                case estLD_RNG:  ret      = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estLD_RNGI: ret      = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estMC_RNG:  ret      = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
+                case estMC_RNGI: ret      = do_cpte_ints(xd, part, i, sflags, 0, nullptr, list); break;
                 case estDISRE_INITF:  ret = do_cpte_real (xd, part, i, sflags, &state->hist.disre_initf, list); break;
                 case estDISRE_RM3TAV: ret = do_cpte_n_reals(xd, part, i, sflags, &state->hist.ndisrepairs, &state->hist.disre_rm3tav, list); break;
                 case estORIRE_INITF:  ret = do_cpte_real (xd, part, i, sflags, &state->hist.orire_initf, list); break;
@@ -1111,7 +1111,7 @@ static int do_cpt_swapstate(XDR *xd, gmx_bool bRead,
         return 0;
     }
 
-    if (*swapstatePtr == NULL)
+    if (*swapstatePtr == nullptr)
     {
         snew(*swapstatePtr, 1);
     }
@@ -1160,7 +1160,7 @@ static int do_cpt_swapstate(XDR *xd, gmx_bool bRead,
                 do_cpt_int_err(xd, "swap influx net p", gs->inflow_net_p[ic], list);
             }
 
-            if (bRead && (NULL == gs->nMolPast[ic]) )
+            if (bRead && (nullptr == gs->nMolPast[ic]) )
             {
                 snew(gs->nMolPast[ic], swapstate->nAverage);
             }
@@ -1349,7 +1349,7 @@ static int do_cpt_df_hist(XDR *xd, int fflags, int nlambda, df_history_t **dfhis
         return 0;
     }
 
-    if (*dfhistPtr == NULL)
+    if (*dfhistPtr == nullptr)
     {
         snew(*dfhistPtr, 1);
         (*dfhistPtr)->nlambda = nlambda;
@@ -1401,7 +1401,7 @@ static int do_cpt_EDstate(XDR *xd, gmx_bool bRead,
         return 0;
     }
 
-    if (*EDstatePtr == NULL)
+    if (*EDstatePtr == nullptr)
     {
         snew(*EDstatePtr, 1);
     }
@@ -1488,7 +1488,7 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
         {
             do_cpt_string_err(xd, bRead, "output filename", &buf, list);
             std::strncpy(outputfiles[i].filename, buf, CPTSTRLEN-1);
-            if (list == NULL)
+            if (list == nullptr)
             {
                 sfree(buf);
             }
@@ -1687,11 +1687,11 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     do_cpt_header(gmx_fio_getxdr(fp), FALSE, &file_version,
                   &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
                   &eIntegrator, &simulation_part, &step, &t, &nppnodes,
-                  DOMAINDECOMP(cr) ? domdecCells : NULL, &npmenodes,
+                  DOMAINDECOMP(cr) ? domdecCells : nullptr, &npmenodes,
                   &state->natoms, &state->ngtc, &state->nnhpres,
                   &state->nhchainlength, &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh,
                   &nED, &eSwapCoords,
-                  NULL);
+                  nullptr);
 
     sfree(version);
     sfree(btime);
@@ -1699,13 +1699,13 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     sfree(bhost);
     sfree(fprog);
 
-    if ((do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, NULL) < 0)        ||
-        (do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, NULL) < 0) ||
-        (do_cpt_enerhist(gmx_fio_getxdr(fp), FALSE, flags_enh, enerhist, NULL) < 0)  ||
-        (do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, NULL) < 0)  ||
-        (do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, nED, &state->edsamstate, NULL) < 0)      ||
-        (do_cpt_swapstate(gmx_fio_getxdr(fp), FALSE, eSwapCoords, &state->swapstate, NULL) < 0) ||
-        (do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, &noutputfiles, NULL,
+    if ((do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, nullptr) < 0)        ||
+        (do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr) < 0) ||
+        (do_cpt_enerhist(gmx_fio_getxdr(fp), FALSE, flags_enh, enerhist, nullptr) < 0)  ||
+        (do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr) < 0)  ||
+        (do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, nED, &state->edsamstate, nullptr) < 0)      ||
+        (do_cpt_swapstate(gmx_fio_getxdr(fp), FALSE, eSwapCoords, &state->swapstate, nullptr) < 0) ||
+        (do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, &noutputfiles, nullptr,
                       file_version) < 0))
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
@@ -1726,7 +1726,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
                 "Cannot fsync '%s'; maybe you are out of disk space?",
                 gmx_fio_getname(ret));
 
-        if (getenv(GMX_IGNORE_FSYNC_FAILURE_ENV) == NULL)
+        if (getenv(GMX_IGNORE_FSYNC_FAILURE_ENV) == nullptr)
         {
             gmx_file(buf);
         }
@@ -1994,7 +1994,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                   &nppnodes_f, dd_nc_f, &npmenodes_f,
                   &natoms, &ngtc, &nnhpres, &nhchainlength, &nlambda,
                   &fflags, &flags_eks, &flags_enh, &flags_dfh,
-                  &nED, &eSwapCoords, NULL);
+                  &nED, &eSwapCoords, nullptr);
 
     if (bAppendOutputFiles &&
         file_version >= 13 && double_prec != GMX_DOUBLE)
@@ -2002,7 +2002,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         gmx_fatal(FARGS, "Output file appending requested, but the code and checkpoint file precision (single/double) don't match");
     }
 
-    if (cr == NULL || MASTER(cr))
+    if (cr == nullptr || MASTER(cr))
     {
         fprintf(stderr, "\nReading checkpoint file %s generated: %s\n\n",
                 fn, ftime);
@@ -2102,7 +2102,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                           "You can try with the -noappend option, and get more info in the log file.\n");
             }
 
-            if (getenv("GMX_ALLOW_CPT_MISMATCH") == NULL)
+            if (getenv("GMX_ALLOW_CPT_MISMATCH") == nullptr)
             {
                 gmx_fatal(FARGS, "You seem to have switched ensemble, integrator, T and/or P-coupling algorithm between the cpt and tpr file. The recommended way of doing this is passing the cpt file to grompp (with option -t) instead of to mdrun. If you know what you are doing, you can override this error by setting the env.var. GMX_ALLOW_CPT_MISMATCH");
             }
@@ -2128,14 +2128,14 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                         reproducibilityRequested);
         }
     }
-    ret             = do_cpt_state(gmx_fio_getxdr(fp), fflags, state, NULL);
+    ret             = do_cpt_state(gmx_fio_getxdr(fp), fflags, state, nullptr);
     *init_fep_state = state->fep_state;  /* there should be a better way to do this than setting it here.
                                             Investigate for 5.0. */
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, NULL);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
@@ -2144,7 +2144,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                   ((flags_eks & (1<<eeksEKINSCALEF)) | (flags_eks & (1<<eeksEKINSCALEH)) | (flags_eks & (1<<eeksVSCALE))));
 
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, enerhist, NULL);
+                          flags_enh, enerhist, nullptr);
     if (ret)
     {
         cp_error();
@@ -2163,25 +2163,25 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         enerhist->nsum_sim = *step;
     }
 
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, NULL);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &state->edsamstate, NULL);
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &state->edsamstate, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &state->swapstate, NULL);
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &state->swapstate, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, NULL, file_version);
+    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, nullptr, file_version);
     if (ret)
     {
         cp_error();
@@ -2401,7 +2401,7 @@ void read_checkpoint_part_and_step(const char  *filename,
     int       nED, eSwapCoords;
     t_fileio *fp;
 
-    if (filename == NULL ||
+    if (filename == nullptr ||
         !gmx_fexist(filename) ||
         (!(fp = gmx_fio_open(filename, "r"))))
     {
@@ -2419,7 +2419,7 @@ void read_checkpoint_part_and_step(const char  *filename,
                   &eIntegrator, simulation_part, step, &t, &nppnodes, dd_nc, &npme,
                   &state.natoms, &state.ngtc, &state.nnhpres, &state.nhchainlength,
                   &nlambda, &state.flags, &flags_eks, &flags_enh, &flags_dfh,
-                  &nED, &eSwapCoords, NULL);
+                  &nED, &eSwapCoords, nullptr);
 
     gmx_fio_close(fp);
 }
@@ -2438,7 +2438,7 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
     int                  flags_eks, flags_enh, flags_dfh;
     int                  nED, eSwapCoords;
     int                  nfiles_loc;
-    gmx_file_position_t *files_loc = NULL;
+    gmx_file_position_t *files_loc = nullptr;
     int                  ret;
 
     do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
@@ -2446,14 +2446,14 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
                   &eIntegrator, simulation_part, step, t, &nppnodes, dd_nc, &npme,
                   &state->natoms, &state->ngtc, &state->nnhpres, &state->nhchainlength,
                   &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh,
-                  &nED, &eSwapCoords, NULL);
+                  &nED, &eSwapCoords, nullptr);
     ret =
-        do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, NULL);
+        do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, nullptr);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, NULL);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
@@ -2461,24 +2461,24 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
 
     energyhistory_t enerhist;
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, &enerhist, NULL);
+                          flags_enh, &enerhist, nullptr);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, NULL);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &state->edsamstate, NULL);
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &state->edsamstate, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &state->swapstate, NULL);
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &state->swapstate, nullptr);
     if (ret)
     {
         cp_error();
@@ -2487,7 +2487,7 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
     ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE,
                        &files_loc,
                        &nfiles_loc,
-                       NULL, file_version);
+                       nullptr, file_version);
     if (outputfiles != nullptr)
     {
         *outputfiles = files_loc;
@@ -2526,7 +2526,7 @@ read_checkpoint_state(const char *fn, int *simulation_part,
     t_fileio *fp;
 
     fp = gmx_fio_open(fn, "r");
-    read_checkpoint_data(fp, simulation_part, step, t, state, NULL, NULL);
+    read_checkpoint_data(fp, simulation_part, step, t, state, nullptr, nullptr);
     if (gmx_fio_close(fp) != 0)
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
@@ -2546,7 +2546,7 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
 
     init_state(&state, 0, 0, 0, 0, 0);
 
-    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, NULL, NULL);
+    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, nullptr, nullptr);
 
     fr->natoms  = state.natoms;
     fr->bTitle  = FALSE;
index 7735957498427c434613cdfc4ffe885eeab2c416..9888e6407a0929c6dc881b9a51c83c94a760abe6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -103,7 +103,7 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
         case efENT:
         case efPQR:
             out = gmx_fio_fopen(outfile, "w");
-            write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, NULL, TRUE);
+            write_pdbfile_indexed(out, title, atoms, x, ePBC, box, ' ', -1, nindex, index, nullptr, TRUE);
             gmx_fio_fclose(out);
             break;
         case efESP:
@@ -149,19 +149,19 @@ void write_sto_conf(const char *outfile, const char *title, const t_atoms *atoms
             fr.bBox = TRUE;
             copy_mat(box, fr.box);
             out = gmx_fio_fopen(outfile, "w");
-            write_g96_conf(out, &fr, -1, NULL);
+            write_g96_conf(out, &fr, -1, nullptr);
             gmx_fio_fclose(out);
             break;
         case efPDB:
         case efBRK:
         case efENT:
             out = gmx_fio_fopen(outfile, "w");
-            write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, NULL, TRUE);
+            write_pdbfile(out, title, atoms, x, ePBC, box, ' ', -1, nullptr, TRUE);
             gmx_fio_fclose(out);
             break;
         case efESP:
             out = gmx_fio_fopen(outfile, "w");
-            write_espresso_conf_indexed(out, title, atoms, atoms->nr, NULL, x, v, box);
+            write_espresso_conf_indexed(out, title, atoms, atoms->nr, nullptr, x, v, box);
             gmx_fio_fclose(out);
             break;
         case efTPR:
@@ -218,13 +218,13 @@ static void get_stx_coordnum(const char *infile, int *natoms)
         case efG96:
         {
             in        = gmx_fio_fopen(infile, "r");
-            fr.title  = NULL;
+            fr.title  = nullptr;
             fr.natoms = -1;
-            fr.atoms  = NULL;
-            fr.x      = NULL;
-            fr.v      = NULL;
-            fr.f      = NULL;
-            *natoms   = read_g96_conf(in, infile, &fr, NULL, g96_line);
+            fr.atoms  = nullptr;
+            fr.x      = nullptr;
+            fr.v      = nullptr;
+            fr.f      = nullptr;
+            *natoms   = read_g96_conf(in, infile, &fr, nullptr, g96_line);
             sfree(const_cast<char *>(fr.title));
             gmx_fio_fclose(in);
             break;
@@ -317,7 +317,7 @@ static void read_stx_conf(const char *infile,
     {
         fprintf(stderr, "Warning: Number of atoms in %s is 0\n", infile);
     }
-    else if (atoms->atom == NULL)
+    else if (atoms->atom == nullptr)
     {
         gmx_mem("Uninitialized array atom");
     }
@@ -334,12 +334,12 @@ static void read_stx_conf(const char *infile,
             gmx_gro_read_conf(infile, symtab, name, atoms, x, v, box);
             break;
         case efG96:
-            fr.title  = NULL;
+            fr.title  = nullptr;
             fr.natoms = atoms->nr;
             fr.atoms  = atoms;
             fr.x      = x;
             fr.v      = v;
-            fr.f      = NULL;
+            fr.f      = nullptr;
             in        = gmx_fio_fopen(infile, "r");
             read_g96_conf(in, infile, &fr, symtab, g96_line);
             gmx_fio_fclose(in);
@@ -371,7 +371,7 @@ static void readConfAndAtoms(const char *infile,
     init_t_atoms(atoms, natoms, (fn2ftp(infile) == efPDB));
 
     bool xIsNull = false;
-    if (x == NULL)
+    if (x == nullptr)
     {
         snew(x, 1);
         xIsNull = true;
@@ -383,7 +383,7 @@ static void readConfAndAtoms(const char *infile,
     }
     read_stx_conf(infile,
                   symtab, name, atoms,
-                  *x, (v == NULL) ? NULL : *v, ePBC, box);
+                  *x, (v == nullptr) ? nullptr : *v, ePBC, box);
     if (xIsNull)
     {
         sfree(*x);
@@ -396,9 +396,9 @@ void readConfAndTopology(const char *infile,
                          int *ePBC,
                          rvec **x, rvec **v, matrix box)
 {
-    GMX_RELEASE_ASSERT(mtop != NULL, "readConfAndTopology requires mtop!=NULL");
+    GMX_RELEASE_ASSERT(mtop != nullptr, "readConfAndTopology requires mtop!=NULL");
 
-    if (ePBC != NULL)
+    if (ePBC != nullptr)
     {
         *ePBC = -1;
     }
@@ -418,9 +418,9 @@ void readConfAndTopology(const char *infile,
         }
         int natoms;
         int ePBC_tmp
-            = read_tpx(infile, NULL, box, &natoms,
-                       (x == NULL) ? NULL : *x, (v == NULL) ? NULL : *v, mtop);
-        if (ePBC != NULL)
+            = read_tpx(infile, nullptr, box, &natoms,
+                       (x == nullptr) ? nullptr : *x, (v == nullptr) ? nullptr : *v, mtop);
+        if (ePBC != nullptr)
         {
             *ePBC = ePBC_tmp;
         }
index 6dc3619ffc4ba516a5d942e2f0bde3d98b75189c..964b35e805ae08d97abc8099dc9904093e5a0222 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -101,12 +101,12 @@ static void enxsubblock_init(t_enxsubblock *sb)
 #else
     sb->type = xdr_datatype_float;
 #endif
-    sb->fval       = NULL;
-    sb->dval       = NULL;
-    sb->ival       = NULL;
-    sb->lval       = NULL;
-    sb->cval       = NULL;
-    sb->sval       = NULL;
+    sb->fval       = nullptr;
+    sb->dval       = nullptr;
+    sb->ival       = nullptr;
+    sb->lval       = nullptr;
+    sb->cval       = nullptr;
+    sb->sval       = nullptr;
     sb->fval_alloc = 0;
     sb->dval_alloc = 0;
     sb->ival_alloc = 0;
@@ -121,31 +121,31 @@ static void enxsubblock_free(t_enxsubblock *sb)
     {
         sfree(sb->fval);
         sb->fval_alloc = 0;
-        sb->fval       = NULL;
+        sb->fval       = nullptr;
     }
     if (sb->dval_alloc)
     {
         sfree(sb->dval);
         sb->dval_alloc = 0;
-        sb->dval       = NULL;
+        sb->dval       = nullptr;
     }
     if (sb->ival_alloc)
     {
         sfree(sb->ival);
         sb->ival_alloc = 0;
-        sb->ival       = NULL;
+        sb->ival       = nullptr;
     }
     if (sb->lval_alloc)
     {
         sfree(sb->lval);
         sb->lval_alloc = 0;
-        sb->lval       = NULL;
+        sb->lval       = nullptr;
     }
     if (sb->cval_alloc)
     {
         sfree(sb->cval);
         sb->cval_alloc = 0;
-        sb->cval       = NULL;
+        sb->cval       = nullptr;
     }
     if (sb->sval_alloc)
     {
@@ -160,7 +160,7 @@ static void enxsubblock_free(t_enxsubblock *sb)
         }
         sfree(sb->sval);
         sb->sval_alloc = 0;
-        sb->sval       = NULL;
+        sb->sval       = nullptr;
     }
 }
 
@@ -213,7 +213,7 @@ static void enxsubblock_alloc(t_enxsubblock *sb)
                 srenew(sb->sval, sb->nr);
                 for (i = sb->sval_alloc; i < sb->nr; i++)
                 {
-                    sb->sval[i] = NULL;
+                    sb->sval[i] = nullptr;
                 }
                 sb->sval_alloc = sb->nr;
             }
@@ -227,7 +227,7 @@ static void enxblock_init(t_enxblock *eb)
 {
     eb->id         = enxOR;
     eb->nsub       = 0;
-    eb->sub        = NULL;
+    eb->sub        = nullptr;
     eb->nsub_alloc = 0;
 }
 
@@ -242,21 +242,21 @@ static void enxblock_free(t_enxblock *eb)
         }
         sfree(eb->sub);
         eb->nsub_alloc = 0;
-        eb->sub        = NULL;
+        eb->sub        = nullptr;
     }
 }
 
 void init_enxframe(t_enxframe *fr)
 {
     fr->e_alloc = 0;
-    fr->ener    = NULL;
+    fr->ener    = nullptr;
 
     /*fr->d_alloc=0;*/
     /*fr->ndisre=0;*/
 
     fr->nblock       = 0;
     fr->nblock_alloc = 0;
-    fr->block        = NULL;
+    fr->block        = nullptr;
 }
 
 
@@ -307,7 +307,7 @@ t_enxblock *find_block_id_enxframe(t_enxframe *ef, int id, t_enxblock *prev)
             return &(ef->block[i]);
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 void add_subblocks_enxblock(t_enxblock *eb, int n)
@@ -328,7 +328,7 @@ void add_subblocks_enxblock(t_enxblock *eb, int n)
 
 static void enx_warning(const char *msg)
 {
-    if (getenv("GMX_ENX_NO_FATAL") != NULL)
+    if (getenv("GMX_ENX_NO_FATAL") != nullptr)
     {
         gmx_warning(msg);
     }
@@ -346,7 +346,7 @@ static void edr_strings(XDR *xdr, gmx_bool bRead, int file_version,
     int          i;
     gmx_enxnm_t *nm;
 
-    if (*nms == NULL)
+    if (*nms == nullptr)
     {
         snew(*nms, n);
     }
@@ -358,12 +358,12 @@ static void edr_strings(XDR *xdr, gmx_bool bRead, int file_version,
             if (nm->name)
             {
                 sfree(nm->name);
-                nm->name = NULL;
+                nm->name = nullptr;
             }
             if (nm->unit)
             {
                 sfree(nm->unit);
-                nm->unit = NULL;
+                nm->unit = nullptr;
             }
         }
         if (!xdr_string(xdr, &(nm->name), STRLEN))
@@ -746,7 +746,7 @@ void free_enxnms(int n, gmx_enxnm_t *nms)
 
 void close_enx(ener_file_t ef)
 {
-    if (ef == NULL)
+    if (ef == nullptr)
     {
         // Nothing to do
         return;
@@ -795,7 +795,7 @@ empty_file(const char *fn)
 ener_file_t open_enx(const char *fn, const char *mode)
 {
     int               nre;
-    gmx_enxnm_t      *nms          = NULL;
+    gmx_enxnm_t      *nms          = nullptr;
     int               file_version = -1;
     t_enxframe       *fr;
     gmx_bool          bWrongPrecision, bOK = TRUE;
@@ -959,7 +959,7 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr)
         /*d_size = fr->ndisre*(sizeof(real)*2);*/
     }
 
-    if (!do_eheader(ef, &file_version, fr, -1, NULL, &bOK))
+    if (!do_eheader(ef, &file_version, fr, -1, nullptr, &bOK))
     {
         if (bRead)
         {
@@ -1168,7 +1168,7 @@ void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputre
     int          nre, nfr, i, j, ni, npcoupl;
     char         buf[STRLEN];
     const char  *bufi;
-    gmx_enxnm_t *enm = NULL;
+    gmx_enxnm_t *enm = nullptr;
     t_enxframe  *fr;
     ener_file_t  in;
 
@@ -1496,7 +1496,7 @@ void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const ch
     int            nre, nre1, nre2;
     ener_file_t    in1, in2;
     int            i, j, maxener, *ind1, *ind2, *have;
-    gmx_enxnm_t   *enm1 = NULL, *enm2 = NULL;
+    gmx_enxnm_t   *enm1 = nullptr, *enm2 = nullptr;
     t_enxframe    *fr1, *fr2;
     gmx_bool       b1, b2;
 
@@ -1549,7 +1549,7 @@ void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const ch
     maxener = nre;
     for (i = 0; i < nre; i++)
     {
-        if ((lastener != NULL) && (std::strstr(enm1[i].name, lastener) != NULL))
+        if ((lastener != nullptr) && (std::strstr(enm1[i].name, lastener) != nullptr))
         {
             maxener = i+1;
             break;
index 8ea7da89053e527b8c8b41874666f7a55a2cea1c..f7ee9fea2c4bbec7d11dc3c2c389581e73f1d8dc 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -263,7 +263,7 @@ void gmx_espresso_read_conf(const char *infile,
                                 break;
                             case espTYPE:
                                 r                   = get_espresso_word(fp, word);
-                                atoms->atom[i].type = std::strtol(word, NULL, 10);
+                                atoms->atom[i].type = std::strtol(word, nullptr, 10);
                                 break;
                             case espQ:
                                 r = get_espresso_word(fp, word);
@@ -287,7 +287,7 @@ void gmx_espresso_read_conf(const char *infile,
                                 break;
                             case espMOLECULE:
                                 r     = get_espresso_word(fp, word);
-                                molnr = std::strtol(word, NULL, 10);
+                                molnr = std::strtol(word, nullptr, 10);
                                 if (i == 0 ||
                                     atoms->resinfo[atoms->atom[i-1].resind].nr != molnr)
                                 {
index 2002498f344eb3a0493f2ec24207499497c09ed6..f558370d0d82693705ac0f98757cab34798d3b5e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -114,16 +114,16 @@ static const t_deffile deffile[efNR] =
     { eftASC, ".mdp", "grompp", "-f", "grompp input file with MD parameters" },
     { eftGEN, ".???", "traj", "-f", "Trajectory", NTRXS, trxs },
     { eftGEN, ".???", "trajout", "-f", "Trajectory", NTROS, tros },
-    { eftGEN, ".???", "traj", NULL,
+    { eftGEN, ".???", "traj", nullptr,
       "Full precision trajectory", NTRNS, trns },
-    { eftXDR, ".trr", "traj", NULL, "Trajectory in portable xdr format" },
-    { eftGEN, ".???", "traj_comp", NULL,
+    { eftXDR, ".trr", "traj", nullptr, "Trajectory in portable xdr format" },
+    { eftGEN, ".???", "traj_comp", nullptr,
       "Compressed trajectory (tng format or portable xdr format)", NTRCOMPRESSED, trcompressed},
-    { eftXDR, ".xtc", "traj", NULL,
+    { eftXDR, ".xtc", "traj", nullptr,
       "Compressed trajectory (portable xdr format): xtc" },
-    { eftTNG, ".tng", "traj", NULL,
+    { eftTNG, ".tng", "traj", nullptr,
       "Trajectory file (tng format)" },
-    { eftXDR, ".edr", "ener",   NULL, "Energy file"},
+    { eftXDR, ".edr", "ener",   nullptr, "Energy file"},
     { eftGEN, ".???", "conf", "-c", "Structure file", NSTXS, stxs },
     { eftGEN, ".???", "out", "-o", "Structure file", NSTOS, stos },
     { eftASC, ".gro", "conf", "-c", "Coordinate file in Gromos-87 format" },
@@ -139,24 +139,24 @@ static const t_deffile deffile[efNR] =
     { eftASC, ".out", "hello",  "-o", "Generic output file"},
     { eftASC, ".ndx", "index",  "-n", "Index file", },
     { eftASC, ".top", "topol",  "-p", "Topology file"},
-    { eftASC, ".itp", "topinc", NULL, "Include file for topology"},
+    { eftASC, ".itp", "topinc", nullptr, "Include file for topology"},
     { eftGEN, ".???", "topol", "-s", "Structure+mass(db)", NTPSS, tpss },
     { eftXDR, ".tpr", "topol",  "-s", "Portable xdr run input file"},
     { eftASC, ".tex", "doc",    "-o", "LaTeX file"},
-    { eftASC, ".rtp", "residue", NULL, "Residue Type file used by pdb2gmx" },
-    { eftASC, ".atp", "atomtp", NULL, "Atomtype file used by pdb2gmx" },
-    { eftASC, ".hdb", "polar",  NULL, "Hydrogen data base"},
-    { eftASC, ".dat", "nnnice", NULL, "Generic data file"},
-    { eftASC, ".dlg", "user",   NULL, "Dialog Box data for ngmx"},
-    { eftASC, ".map", "ss", NULL, "File that maps matrix data to colors" },
-    { eftASC, ".eps", "plot", NULL, "Encapsulated PostScript (tm) file" },
-    { eftASC, ".mat", "ss",     NULL, "Matrix Data file"},
-    { eftASC, ".m2p", "ps",     NULL, "Input file for mat2ps"},
+    { eftASC, ".rtp", "residue", nullptr, "Residue Type file used by pdb2gmx" },
+    { eftASC, ".atp", "atomtp", nullptr, "Atomtype file used by pdb2gmx" },
+    { eftASC, ".hdb", "polar",  nullptr, "Hydrogen data base"},
+    { eftASC, ".dat", "nnnice", nullptr, "Generic data file"},
+    { eftASC, ".dlg", "user",   nullptr, "Dialog Box data for ngmx"},
+    { eftASC, ".map", "ss", nullptr, "File that maps matrix data to colors" },
+    { eftASC, ".eps", "plot", nullptr, "Encapsulated PostScript (tm) file" },
+    { eftASC, ".mat", "ss",     nullptr, "Matrix Data file"},
+    { eftASC, ".m2p", "ps",     nullptr, "Input file for mat2ps"},
     { eftXDR, ".mtx", "hessian", "-m", "Hessian matrix"},
-    { eftASC, ".edi", "sam",    NULL, "ED sampling input"},
-    { eftASC, ".cub", "pot",  NULL, "Gaussian cube file" },
-    { eftASC, ".xpm", "root", NULL, "X PixMap compatible matrix file" },
-    { eftASC, "", "rundir", NULL, "Run directory" }
+    { eftASC, ".edi", "sam",    nullptr, "ED sampling input"},
+    { eftASC, ".cub", "pot",  nullptr, "Gaussian cube file" },
+    { eftASC, ".xpm", "root", nullptr, "X PixMap compatible matrix file" },
+    { eftASC, "", "rundir", nullptr, "Run directory" }
 };
 
 const char *ftp2ext(int ftp)
@@ -229,7 +229,7 @@ const int *ftp2generic_list(int ftp)
     }
     else
     {
-        return 0;
+        return nullptr;
     }
 }
 
@@ -271,7 +271,7 @@ const char *ftp2defnm(int ftp)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -283,7 +283,7 @@ const char *ftp2defopt(int ftp)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -310,7 +310,7 @@ int fn2ftp(const char *fn)
 
     for (i = 0; (i < efNR); i++)
     {
-        if ((eptr = deffile[i].ext) != NULL)
+        if ((eptr = deffile[i].ext) != nullptr)
         {
             if (gmx_strcasecmp(feptr, eptr) == 0)
             {
index bfaf13309ee934881070c36620d22e6855cd4778..b1dd3f632616da75a289ed1d76a5a4731d109ac0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,7 +66,7 @@ static int read_g96_pos(char line[], t_symtab *symtab,
     nwanted = fr->natoms;
 
     atoms = fr->atoms;
-    if (atoms != NULL)
+    if (atoms != nullptr)
     {
         atoms->haveMass    = FALSE;
         atoms->haveCharge  = FALSE;
@@ -242,7 +242,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
         {
             fr->bTitle = (std::strcmp(line, "TITLE") == 0);
         }
-        if (fr->title == NULL)
+        if (fr->title == nullptr)
         {
             fgets2(line, STRLEN, fp);
             fr->title = gmx_strdup(line);
@@ -275,7 +275,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
                 fr->bTime = bTime;
                 do
                 {
-                    bFinished = (fgets2(line, STRLEN, fp) == NULL);
+                    bFinished = (fgets2(line, STRLEN, fp) == nullptr);
                 }
                 while (!bFinished && (line[0] == '#'));
                 sscanf(line, "%15" GMX_SCNd64 "%15lf", &(fr->step), &db1);
index 1da46d4f52d0494bc93ff3793559b21944e4ca69..16eb311b5806310fae96bfe466fa80b620c443fe 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,9 +71,9 @@ void gmx_fio_setprecision(t_fileio *fio, gmx_bool bDouble)
 
 XDR *gmx_fio_getxdr(t_fileio *fio)
 {
-    XDR *ret = NULL;
+    XDR *ret = nullptr;
     gmx_fio_lock(fio);
-    GMX_RELEASE_ASSERT( fio->xdr != NULL, "Implementation error: NULL XDR pointers");
+    GMX_RELEASE_ASSERT( fio->xdr != nullptr, "Implementation error: NULL XDR pointers");
     ret = fio->xdr;
     gmx_fio_unlock(fio);
     return ret;
@@ -117,7 +117,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio,
     double          d = 0;
     float           f = 0;
 
-    GMX_RELEASE_ASSERT( fio->xdr != NULL, "Implementation error: NULL XDR pointers");
+    GMX_RELEASE_ASSERT( fio->xdr != nullptr, "Implementation error: NULL XDR pointers");
     gmx_fio_check_nitem(eio, nitem, srcfile, line);
     switch (eio)
     {
@@ -264,7 +264,7 @@ static gmx_bool do_xdr(t_fileio *fio, void *item, int nitem, int eio,
             }
             break;
         case eioNRVEC:
-            ptr = NULL;
+            ptr = nullptr;
             res = 1;
             for (j = 0; (j < nitem) && res; j++)
             {
index e632956a8dcdb9adc0cdd7305a7c86368715683a..ae439a5c50dedeaa96d249a8ae9c1a8e6577ea46 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,7 +67,7 @@
 
 /* the list of open files is a linked list, with a dummy element at its head;
        it is initialized when the first file is opened. */
-static t_fileio *open_files = NULL;
+static t_fileio *open_files = nullptr;
 
 
 /* this mutex locks the open_files structure so that no two threads can
@@ -117,8 +117,8 @@ static void gmx_fio_make_dummy(void)
     if (!open_files)
     {
         snew(open_files, 1);
-        open_files->fp   = NULL;
-        open_files->fn   = NULL;
+        open_files->fp   = nullptr;
+        open_files->fn   = nullptr;
         open_files->next = open_files;
         open_files->prev = open_files;
         tMPI_Lock_init(&(open_files->mtx));
@@ -217,7 +217,7 @@ static t_fileio *gmx_fio_get_first(void)
     if (ret == open_files)
     {
         /* after this, the open_file pointer should never change */
-        ret = NULL;
+        ret = nullptr;
     }
     else
     {
@@ -239,7 +239,7 @@ static t_fileio *gmx_fio_get_next(t_fileio *fio)
     /* check if that was the last one */
     if (fio->next == open_files)
     {
-        ret = NULL;
+        ret = nullptr;
         tMPI_Thread_mutex_unlock(&open_file_mutex);
     }
     else
@@ -268,7 +268,7 @@ static void gmx_fio_stop_getting_next(t_fileio *fio)
  *****************************************************************/
 t_fileio *gmx_fio_open(const char *fn, const char *mode)
 {
-    t_fileio *fio = NULL;
+    t_fileio *fio = nullptr;
     char      newmode[5];
     gmx_bool  bRead, bReadWrite;
 
@@ -312,8 +312,8 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
     tMPI_Lock_init(&(fio->mtx));
     bRead      = (newmode[0] == 'r' && newmode[1] != '+');
     bReadWrite = (newmode[1] == '+');
-    fio->fp    = NULL;
-    fio->xdr   = NULL;
+    fio->fp    = nullptr;
+    fio->xdr   = nullptr;
     if (fn)
     {
         if (fn2ftp(fn) == efTNG)
@@ -365,13 +365,13 @@ static int gmx_fio_close_locked(t_fileio *fio)
 {
     int rc = 0;
 
-    if (fio->xdr != NULL)
+    if (fio->xdr != nullptr)
     {
         xdr_destroy(fio->xdr);
         sfree(fio->xdr);
     }
 
-    if (fio->fp != NULL)
+    if (fio->fp != nullptr)
     {
         rc = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
 
@@ -407,10 +407,10 @@ int gmx_fio_fp_close(t_fileio *fio)
 {
     int rc = 0;
     gmx_fio_lock(fio);
-    if (fio->xdr == NULL)
+    if (fio->xdr == nullptr)
     {
         rc      = gmx_ffclose(fio->fp); /* fclose returns 0 if happy */
-        fio->fp = NULL;
+        fio->fp = nullptr;
     }
     gmx_fio_unlock(fio);
 
@@ -712,7 +712,7 @@ int gmx_fio_fsync(t_fileio *fio)
 
 t_fileio *gmx_fio_all_output_fsync(void)
 {
-    t_fileio *ret = NULL;
+    t_fileio *ret = nullptr;
     t_fileio *cur;
 
     cur = gmx_fio_get_first();
@@ -778,7 +778,7 @@ int gmx_fio_seek(t_fileio* fio, gmx_off_t fpos)
 
 FILE *gmx_fio_getfp(t_fileio *fio)
 {
-    FILE *ret = NULL;
+    FILE *ret = nullptr;
 
     gmx_fio_lock(fio);
     if (fio->fp)
index 0aa130216cb5d1c1884c50ebf7b4d84795ca2459..c0f041c28ea68d1a441188f86f6b0312a9559331 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -132,7 +132,7 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
     /* just pray the arrays are big enough */
     for (i = 0; (i < natoms); i++)
     {
-        if ((fgets2(line, STRLEN, in)) == NULL)
+        if ((fgets2(line, STRLEN, in)) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of file in file %s at line %d",
                       infile, i+2);
@@ -148,12 +148,12 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
         {
             bFirst = FALSE;
             p1     = strchr(line, '.');
-            if (p1 == NULL)
+            if (p1 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
             p2 = strchr(&p1[1], '.');
-            if (p2 == NULL)
+            if (p2 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
@@ -161,7 +161,7 @@ static gmx_bool get_w_conf(FILE *in, const char *infile, char *title,
             *ndec = ddist - 5;
 
             p3 = strchr(&p2[1], '.');
-            if (p3 == NULL)
+            if (p3 == nullptr)
             {
                 gmx_fatal(FARGS, "A coordinate in file %s does not contain a '.'", infile);
             }
@@ -369,7 +369,7 @@ gmx_bool gro_next_x_or_v(FILE *status, t_trxframe *fr)
     sfree(atoms.atomname);
     done_symtab(&symtab);
 
-    if ((p = strstr(title, "t=")) != NULL)
+    if ((p = strstr(title, "t=")) != nullptr)
     {
         p += 2;
         if (sscanf(p, "%lf", &tt) == 1)
@@ -455,7 +455,7 @@ void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
     fprintf(out, "%s\n", (title && title[0]) ? title : gmx::bromacs().c_str());
     fprintf(out, "%5d\n", nx);
 
-    const char *format = get_hconf_format(v != NULL);
+    const char *format = get_hconf_format(v != nullptr);
 
     for (i = 0; (i < nx); i++)
     {
@@ -513,7 +513,7 @@ void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop,
     fprintf(out, "%s\n", (title && title[0]) ? title : gmx::bromacs().c_str());
     fprintf(out, "%5d\n", mtop->natoms);
 
-    const char *format = get_hconf_format(v != NULL);
+    const char *format = get_hconf_format(v != nullptr);
 
     aloop = gmx_mtop_atomloop_all_init(mtop);
     while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
index ceabe761ecb64e41b7aee6cb144a68d091dc71d9..b6d17c649ad7c5f604d31367597f70668414c89a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -396,8 +396,8 @@ static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
 
 int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
 {
-    int     *ip  = NULL;
-    int     *buf = NULL;
+    int     *ip  = nullptr;
+    int     *buf = nullptr;
     gmx_bool bRead;
 
     /* preallocate a small buffer and ip on the stack - if we need more
@@ -468,7 +468,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
             bufsize        = static_cast<int>(size3 * 1.2);
             ip             = reinterpret_cast<int *>(malloc(size3 * sizeof(*ip)));
             buf            = reinterpret_cast<int *>(malloc(bufsize * sizeof(*buf)));
-            if (ip == NULL || buf == NULL)
+            if (ip == nullptr || buf == nullptr)
             {
                 fprintf(stderr, "malloc failed\n");
                 exit(1);
@@ -814,7 +814,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
             bufsize        = static_cast<int>(size3 * 1.2);
             ip             = reinterpret_cast<int *>(malloc(size3 * sizeof(*ip)));
             buf            = reinterpret_cast<int *>(malloc(bufsize * sizeof(*buf)));
-            if (ip == NULL || buf == NULL)
+            if (ip == nullptr || buf == nullptr)
             {
                 fprintf(stderr, "malloc failed\n");
                 exit(1);
index 4fb86f27f1f8d26d84e664e6bd19bb3c529b2b5d..0fb307ca73b7dd7883c5abd92df01d82548847c4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -95,7 +95,7 @@ void done_matrix(int nx, real ***m)
         sfree((*m)[i]);
     }
     sfree(*m);
-    *m = NULL;
+    *m = nullptr;
 }
 
 gmx_bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2)
@@ -126,7 +126,7 @@ int getcmap(FILE *in, const char *fn, t_mapping **map)
     double     r, g, b;
     t_mapping *m;
 
-    if (fgets2(line, STRLEN-1, in) == NULL)
+    if (fgets2(line, STRLEN-1, in) == nullptr)
     {
         gmx_fatal(FARGS, "Not enough lines in colormap file %s"
                   "(just wanted to read number of entries)", fn);
@@ -135,7 +135,7 @@ int getcmap(FILE *in, const char *fn, t_mapping **map)
     snew(m, n);
     for (i = 0; (i < n); i++)
     {
-        if (fgets2(line, STRLEN-1, in) == NULL)
+        if (fgets2(line, STRLEN-1, in) == nullptr)
         {
             gmx_fatal(FARGS, "Not enough lines in colormap file %s"
                       "(should be %d, found only %d)", fn, n+1, i);
@@ -226,7 +226,7 @@ static char *line2string(char **line)
 {
     int i;
 
-    if (*line != NULL)
+    if (*line != nullptr)
     {
         while (((*line)[0] != '\"' ) && ( (*line)[0] != '\0' ))
         {
@@ -235,7 +235,7 @@ static char *line2string(char **line)
 
         if ((*line)[0] != '\"')
         {
-            return NULL;
+            return nullptr;
         }
         (*line)++;
 
@@ -247,7 +247,7 @@ static char *line2string(char **line)
 
         if ((*line)[i] != '\"')
         {
-            *line = NULL;
+            *line = nullptr;
         }
         else
         {
@@ -273,7 +273,7 @@ static void parsestring(char *line, const char *label, char *string)
 static void read_xpm_entry(FILE *in, t_matrix *mm)
 {
     t_mapping   *map;
-    char        *line_buf = NULL, *line = NULL, *str, buf[256] = {0};
+    char        *line_buf = nullptr, *line = nullptr, *str, buf[256] = {0};
     int          i, m, col_len, nch = 0, n_axis_x, n_axis_y, llmax;
     int          llalloc = 0;
     unsigned int r, g, b;
@@ -286,14 +286,14 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
     mm->legend[0]  = 0;
     mm->label_x[0] = 0;
     mm->label_y[0] = 0;
-    mm->matrix     = NULL;
-    mm->axis_x     = NULL;
-    mm->axis_y     = NULL;
+    mm->matrix     = nullptr;
+    mm->axis_x     = nullptr;
+    mm->axis_y     = nullptr;
     mm->bDiscrete  = FALSE;
 
     llmax = STRLEN;
 
-    while ((NULL != fgetline(&line_buf, llmax, &llalloc, in)) &&
+    while ((nullptr != fgetline(&line_buf, llmax, &llalloc, in)) &&
            (std::strncmp(line_buf, "static", 6) != 0))
     {
         line = line_buf;
@@ -322,7 +322,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
 
     /* Read sizes */
     bGetOnWithIt = FALSE;
-    while (!bGetOnWithIt && (NULL != fgetline(&line_buf, llmax, &llalloc, in)))
+    while (!bGetOnWithIt && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)))
     {
         line = line_buf;
         while (( line[0] != '\"' ) && ( line[0] != '\0' ))
@@ -359,7 +359,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
     /* Read color map */
     snew(map, mm->nmap);
     m = 0;
-    while ((m < mm->nmap) && (NULL != fgetline(&line_buf, llmax, &llalloc, in)))
+    while ((m < mm->nmap) && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)))
     {
         line = std::strchr(line_buf, '\"');
         if  (line)
@@ -448,7 +448,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
         {
             line = std::strstr(line, "x-axis");
             skipstr(line);
-            if (mm->axis_x == NULL)
+            if (mm->axis_x == nullptr)
             {
                 snew(mm->axis_x, mm->nx + 1);
             }
@@ -471,7 +471,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
         {
             line = std::strstr(line, "y-axis");
             skipstr(line);
-            if (mm->axis_y == NULL)
+            if (mm->axis_y == nullptr)
             {
                 snew(mm->axis_y, mm->ny + 1);
             }
@@ -491,7 +491,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
             }
         }
     }
-    while ((line[0] != '\"') && (NULL != fgetline(&line_buf, llmax, &llalloc, in)));
+    while ((line[0] != '\"') && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)));
 
     /* Read matrix */
     snew(mm->matrix, mm->nx);
@@ -539,7 +539,7 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
             m--;
         }
     }
-    while ((m >= 0) && (NULL != fgetline(&line_buf, llmax, &llalloc, in)));
+    while ((m >= 0) && (nullptr != fgetline(&line_buf, llmax, &llalloc, in)));
     if (m >= 0)
     {
         gmx_incons("Not enough rows in the matrix");
@@ -551,14 +551,14 @@ static void read_xpm_entry(FILE *in, t_matrix *mm)
 int read_xpm_matrix(const char *fnm, t_matrix **mat)
 {
     FILE *in;
-    char *line = NULL;
+    char *line = nullptr;
     int   nmat;
     int   llalloc = 0;
 
     in = gmx_fio_fopen(fnm, "r");
 
     nmat = 0;
-    while (NULL != fgetline(&line, STRLEN, &llalloc, in))
+    while (nullptr != fgetline(&line, STRLEN, &llalloc, in))
     {
         if (std::strstr(line, "/* XPM */"))
         {
@@ -592,18 +592,18 @@ real **matrix2real(t_matrix *in, real **out)
 
     for (i = 0; i < nmap; i++)
     {
-        if ((map[i].desc == NULL) || (sscanf(map[i].desc, "%lf", &tmp) != 1))
+        if ((map[i].desc == nullptr) || (sscanf(map[i].desc, "%lf", &tmp) != 1))
         {
             fprintf(stderr, "Could not convert matrix to reals,\n"
                     "color map entry %d has a non-real description: \"%s\"\n",
                     i, map[i].desc);
             sfree(rmap);
-            return NULL;
+            return nullptr;
         }
         rmap[i] = tmp;
     }
 
-    if (out == NULL)
+    if (out == nullptr)
     {
         snew(out, in->nx);
         for (i = 0; i < in->nx; i++)
index 827452131cd9e14b19ed43d2f40b6e8fb3e89879..7a48bc64ffca1617a322e1c5bd5c03b885ebfa9b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -89,7 +89,7 @@ void gmx_mtxio_write(const char *             filename,
     int         i, j, prec;
     size_t      sz;
 
-    if (full_matrix != NULL && sparse_matrix != NULL)
+    if (full_matrix != nullptr && sparse_matrix != nullptr)
     {
         gmx_fatal(FARGS, "Both full AND sparse matrix specified to gmx_mtxio_write().\n");
     }
@@ -117,7 +117,7 @@ void gmx_mtxio_write(const char *             filename,
     gmx_fio_do_int(fio, nrow);
     gmx_fio_do_int(fio, ncol);
 
-    if (full_matrix != NULL)
+    if (full_matrix != nullptr)
     {
         /* Full matrix storage format */
         i = GMX_MTXIO_FULL_MATRIX;
@@ -200,7 +200,7 @@ gmx_mtxio_read (const char *            filename,
 
     gmx_fio_do_int(fio, i);
 
-    if (i == GMX_MTXIO_FULL_MATRIX && NULL != full_matrix)
+    if (i == GMX_MTXIO_FULL_MATRIX && nullptr != full_matrix)
     {
         printf("Full matrix storage format, nrow=%d, ncols=%d\n", *nrow, *ncol);
 
@@ -208,7 +208,7 @@ gmx_mtxio_read (const char *            filename,
         snew((*full_matrix), sz);
         gmx_fio_ndo_real(fio, (*full_matrix), sz);
     }
-    else if (NULL != sparse_matrix)
+    else if (nullptr != sparse_matrix)
     {
         /* Sparse storage */
         printf("Sparse matrix storage format, nrow=%d, ncols=%d\n", *nrow, *ncol);
index fcc648f576e473fb624dd50881ce0091155b2cca..4c1f5fbf259eaadaf9e6705eb36571a62455a716 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -77,12 +77,12 @@ struct gmx_output_env_t
 static const real  timefactors[] =   { real(0),  real(1e3),  real(1), real(1e-3), real(1e-6), real(1e-9), real(1e-12), real(0) };
 static const real  timeinvfactors[] = { real(0), real(1e-3),  real(1),  real(1e3),  real(1e6),  real(1e9),  real(1e12), real(0) };
 static const char *time_units_str[] = {
-    NULL, "fs", "ps", "ns", "us",
+    nullptr, "fs", "ps", "ns", "us",
     "\\mus", "ms", "s"
 };
 static const char *time_units_xvgr[] = {
-    NULL, "fs", "ps", "ns",
-    "ms", "s", NULL
+    nullptr, "fs", "ps", "ns",
+    "ms", "s", nullptr
 };
 
 
@@ -194,7 +194,7 @@ xvg_format_t output_env_get_xvg_format(const gmx_output_env_t *oenv)
 
 const char *output_env_get_program_display_name(const gmx_output_env_t *oenv)
 {
-    const char *displayName = NULL;
+    const char *displayName = nullptr;
 
     try
     {
index 7824afd521cc57389ecb8c2a5d23b80b389ed313..cab5fa06aa4cd0996d9d0ac7df29285a370cdc29 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -192,7 +192,7 @@ static void read_cryst1(char *line, int *ePBC, matrix box)
         sscanf(sg, "%c %d %d %d", &ident, &syma, &symb, &symc);
         if (ident == 'P' && syma ==  1 && symb <= 1 && symc <= 1)
         {
-            fc        = strtod(sc, NULL)*0.1;
+            fc        = strtod(sc, nullptr)*0.1;
             ePBC_file = (fc > 0 ? epbcXYZ : epbcXY);
         }
         if (ident == 'P' && syma == 21 && symb == 1 && symc == 1)
@@ -207,9 +207,9 @@ static void read_cryst1(char *line, int *ePBC, matrix box)
 
     if (box)
     {
-        fa = strtod(sa, NULL)*0.1;
-        fb = strtod(sb, NULL)*0.1;
-        fc = strtod(sc, NULL)*0.1;
+        fa = strtod(sa, nullptr)*0.1;
+        fb = strtod(sb, nullptr)*0.1;
+        fc = strtod(sc, nullptr)*0.1;
         if (ePBC_file == epbcSCREW)
         {
             fa *= 0.5;
@@ -306,7 +306,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     fprintf(out, "MODEL %8d\n", model_nr > 0 ? model_nr : 1);
 
     lastchainnum      = -1;
-    p_restype         = NULL;
+    p_restype         = nullptr;
 
     for (ii = 0; ii < nindex; ii++)
     {
@@ -399,7 +399,7 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     fprintf(out, "TER\n");
     fprintf(out, "ENDMDL\n");
 
-    if (NULL != gc)
+    if (nullptr != gc)
     {
         /* Write conect records */
         for (i = 0; (i < gc->nconect); i++)
@@ -473,7 +473,7 @@ static void read_anisou(char line[], int natom, t_atoms *atoms)
     trim(anm);
 
     /* Search backwards for number and name only */
-    atomnr = std::strtol(anr, NULL, 10);
+    atomnr = std::strtol(anr, nullptr, 10);
     for (i = natom-1; (i >= 0); i--)
     {
         if ((std::strcmp(anm, *(atoms->atomname[i])) == 0) &&
@@ -568,9 +568,9 @@ void get_pdb_atomnumber(const t_atoms *atoms, gmx_atomprop_t aps)
         }
         else
         {
-            ptr = NULL;
+            ptr = nullptr;
         }
-        std::strncpy(atoms->atom[i].elem, ptr == NULL ? "" : ptr, 4);
+        std::strncpy(atoms->atom[i].elem, ptr == nullptr ? "" : ptr, 4);
     }
 }
 
@@ -629,7 +629,7 @@ static int read_atom(t_symtab *symtab,
     }
     rnr[k] = nc;
     trim(rnr);
-    resnr = std::strtol(rnr, NULL, 10);
+    resnr = std::strtol(rnr, nullptr, 10);
     resic = line[j];
     j    += 4;
 
@@ -708,17 +708,17 @@ static int read_atom(t_symtab *symtab,
         atomn->atomnumber      = atomnumber;
         strncpy(atomn->elem, elem, 4);
     }
-    x[natom][XX] = strtod(xc, NULL)*0.1;
-    x[natom][YY] = strtod(yc, NULL)*0.1;
-    x[natom][ZZ] = strtod(zc, NULL)*0.1;
+    x[natom][XX] = strtod(xc, nullptr)*0.1;
+    x[natom][YY] = strtod(yc, nullptr)*0.1;
+    x[natom][ZZ] = strtod(zc, nullptr)*0.1;
     if (atoms->pdbinfo)
     {
         atoms->pdbinfo[natom].type   = type;
-        atoms->pdbinfo[natom].atomnr = strtol(anr, NULL, 10);
+        atoms->pdbinfo[natom].atomnr = strtol(anr, nullptr, 10);
         atoms->pdbinfo[natom].altloc = altloc;
         strcpy(atoms->pdbinfo[natom].atomnm, anm_copy);
-        atoms->pdbinfo[natom].bfac  = strtod(bfac, NULL);
-        atoms->pdbinfo[natom].occup = strtod(occup, NULL);
+        atoms->pdbinfo[natom].bfac  = strtod(bfac, nullptr);
+        atoms->pdbinfo[natom].occup = strtod(occup, nullptr);
     }
     natom++;
 
@@ -865,7 +865,7 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
         /* Only assume pbc when there is a CRYST1 entry */
         *ePBC = epbcNONE;
     }
-    if (box != NULL)
+    if (box != nullptr)
     {
         clear_mat(box);
     }
@@ -874,13 +874,13 @@ int read_pdbfile(FILE *in, char *title, int *model_nr,
     atoms->haveCharge  = FALSE;
     atoms->haveType    = FALSE;
     atoms->haveBState  = FALSE;
-    atoms->havePdbInfo = (atoms->pdbinfo != NULL);
+    atoms->havePdbInfo = (atoms->pdbinfo != nullptr);
 
     bCOMPND  = FALSE;
     title[0] = '\0';
     natom    = 0;
     chainnum = 0;
-    while (!bStop && (fgets2(line, STRLEN, in) != NULL))
+    while (!bStop && (fgets2(line, STRLEN, in) != nullptr))
     {
         line_type = line2type(line);
 
@@ -1029,7 +1029,7 @@ void gmx_pdb_read_conf(const char *infile,
 {
     FILE *in = gmx_fio_fopen(infile, "r");
     char  title[STRLEN];
-    read_pdbfile(in, title, NULL, atoms, symtab, x, ePBC, box, TRUE, NULL);
+    read_pdbfile(in, title, nullptr, atoms, symtab, x, ePBC, box, TRUE, nullptr);
     *name = put_symtab(symtab, title);
     gmx_fio_fclose(in);
 }
@@ -1083,12 +1083,12 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
     }
 
     /* Format atom name */
-    if (atom_name != NULL)
+    if (atom_name != nullptr)
     {
         /* If the atom name is an element name with two chars, it should start already in column 13.
          * Otherwise it should start in column 14, unless the name length is 4 chars.
          */
-        if ( (element != NULL) && (std::strlen(element) >= 2) && (gmx_strncasecmp(atom_name, element, 2) == 0) )
+        if ( (element != nullptr) && (std::strlen(element) >= 2) && (gmx_strncasecmp(atom_name, element, 2) == 0) )
         {
             start_name_in_col13 = TRUE;
         }
@@ -1106,7 +1106,7 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
     }
 
     /* Format residue name */
-    std::strncpy(tmp_resname, (res_name != NULL) ? res_name : "", 4);
+    std::strncpy(tmp_resname, (res_name != nullptr) ? res_name : "", 4);
     /* Make sure the string is terminated if strlen was > 4 */
     tmp_resname[4] = '\0';
     /* String is properly terminated, so now we can use strcat. By adding a
@@ -1132,7 +1132,7 @@ gmx_fprintf_pdb_atomline(FILE *            fp,
                 x, y, z,
                 occupancy,
                 b_factor,
-                (element != NULL) ? element : "");
+                (element != nullptr) ? element : "");
 
     return n;
 }
index cc996414856b096b2f0fc540f96d6a272ead5c99..e2d139ab0510287d93d96bca558abf5fa9dd435a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -62,7 +62,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
     FILE      *in;
     char       buf[STRLEN], lbuf[STRLEN], rbuf[STRLEN], warn_buf[STRLEN];
     char      *ptr, *cptr;
-    t_inpfile *inp = NULL;
+    t_inpfile *inp = nullptr;
     int        nin, lc, i, j, k;
 
 
@@ -85,7 +85,7 @@ t_inpfile *read_inpfile(const char *fn, int *ninp,
             // strchr, etc. rather than re-inventing wheels.
 
             /* Strip comment */
-            if ((cptr = std::strchr(buf, COMMENTSIGN)) != NULL)
+            if ((cptr = std::strchr(buf, COMMENTSIGN)) != nullptr)
             {
                 *cptr = '\0';
             }
@@ -296,7 +296,7 @@ int search_einp(int ninp, const t_inpfile *inp, const char *name)
 {
     int i;
 
-    if (inp == NULL)
+    if (inp == nullptr)
     {
         return -1;
     }
@@ -460,7 +460,7 @@ const char *get_estr(int *ninp, t_inpfile **inp, const char *name, const char *d
         }
         else
         {
-            (*inp)[(*ninp)-1].value = NULL;
+            (*inp)[(*ninp)-1].value = nullptr;
         }
 
         return def;
@@ -488,7 +488,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
         return 0;
     }
 
-    for (i = 0; (defs[i] != NULL); i++)
+    for (i = 0; (defs[i] != nullptr); i++)
     {
         if (gmx_strcasecmp_min(defs[i], (*inp)[ii].value) == 0)
         {
@@ -496,7 +496,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
         }
     }
 
-    if (defs[i] == NULL)
+    if (defs[i] == nullptr)
     {
         n += sprintf(buf, "Invalid enum '%s' for variable %s, using '%s'\n",
                      (*inp)[ii].value, name, defs[0]);
@@ -507,7 +507,7 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
             n += sprintf(buf+n, " '%s'", defs[j]);
             j++;
         }
-        if (wi != NULL)
+        if (wi != nullptr)
         {
             warning_error(wi, buf);
         }
@@ -526,5 +526,5 @@ int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
 
 int get_eenum(int *ninp, t_inpfile **inp, const char *name, const char **defs)
 {
-    return get_eeenum(ninp, inp, name, defs, NULL);
+    return get_eeenum(ninp, inp, name, defs, nullptr);
 }
index aff4ee969be653ba30b7488b583ea21fd72079de..c544689f71408790853de7f83fb88c69906e09e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,8 +81,8 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         {
             generateReferenceTopology();
             generateReferenceCoordinates();
-            testTop_ = NULL;
-            testX_   = NULL;
+            testTop_ = nullptr;
+            testX_   = nullptr;
             clear_mat(testBox_);
             referenceFilename_ =
                 fileManager_.getTemporaryFilePath(getFileSuffix("ref"));
@@ -91,7 +91,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         }
         ~StructureIORoundtripTest()
         {
-            if (testTop_ != NULL)
+            if (testTop_ != nullptr)
             {
                 done_top(testTop_);
                 sfree(testTop_);
@@ -104,7 +104,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         void writeReferenceFile()
         {
             write_sto_conf(referenceFilename_.c_str(), *refTop_->name,
-                           &refTop_->atoms, as_rvec_array(refX_.data()), NULL, -1,
+                           &refTop_->atoms, as_rvec_array(refX_.data()), nullptr, -1,
                            refBox_);
         }
 
@@ -113,7 +113,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
             snew(testTop_, 1);
             int  ePBC = -2;
             read_tps_conf(referenceFilename_.c_str(), testTop_,
-                          &ePBC, &testX_, NULL, testBox_, FALSE);
+                          &ePBC, &testX_, nullptr, testBox_, FALSE);
         }
 
         void testTopologies()
@@ -124,7 +124,7 @@ class StructureIORoundtripTest : public gmx::test::StringTestBase,
         void writeTestFileAndTest()
         {
             write_sto_conf(testFilename_.c_str(), *testTop_->name,
-                           &testTop_->atoms, testX_, NULL, -1, testBox_);
+                           &testTop_->atoms, testX_, nullptr, -1, testBox_);
             testFilesEqual(referenceFilename_, testFilename_);
         }
 
index f32c0c0fb1a5fb5752c8bd9abde390e0c527e855..61f8d27998d780bafb82788de492498f6dd9f97f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -57,7 +57,7 @@ class ReadTest : public ::testing::Test
 {
     public:
         ReadTest() : numInputs_(1),
-                     inputField_(0),
+                     inputField_(nullptr),
                      inpGuard_(),
                      wi_(),
                      wiGuard_()
index 2b19f25c33bb9dd4457cbc223caa359e09e11a4e..4d2e7b68eed196b92b448e98401b2695fea033f9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,7 +74,7 @@ TEST_F(TngTest, CanOpenTngFile)
 
 TEST_F(TngTest, CloseBeforeOpenIsNotFatal)
 {
-    tng_trajectory_t tng = NULL;
+    tng_trajectory_t tng = nullptr;
     gmx_tng_close(&tng);
 }
 
index 8c4052a210681814235e49cef1ac1cd64ae21581..9b0f4a9ba6b5200355aa3f1b3b5a140b2f767058 100644 (file)
@@ -184,8 +184,8 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
                                        gmx_int64_t          numMolecules,
                                        tng_molecule_t      *tngMol)
 {
-    tng_chain_t      tngChain = NULL;
-    tng_residue_t    tngRes   = NULL;
+    tng_chain_t      tngChain = nullptr;
+    tng_residue_t    tngRes   = nullptr;
 
     if (tng_molecule_add(tng, moleculeName, tngMol) != TNG_SUCCESS)
     {
@@ -203,7 +203,7 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
         {
             const t_resinfo *resInfo        = &atoms->resinfo[at->resind];
             char             chainName[2]   = {resInfo->chainid, 0};
-            tng_atom_t       tngAtom        = NULL;
+            tng_atom_t       tngAtom        = nullptr;
             t_atom          *prevAtom;
 
             if (atomIndex > 0)
@@ -212,7 +212,7 @@ static void addTngMoleculeFromTopology(tng_trajectory_t     tng,
             }
             else
             {
-                prevAtom = 0;
+                prevAtom = nullptr;
             }
 
             /* If this is the first atom or if the residue changed add the
@@ -252,7 +252,7 @@ void gmx_tng_add_mtop(tng_trajectory_t  tng,
 
     for (int molIndex = 0; molIndex < mtop->nmolblock; molIndex++)
     {
-        tng_molecule_t       tngMol  = NULL;
+        tng_molecule_t       tngMol  = nullptr;
         const gmx_moltype_t *molType =
             &mtop->moltype[mtop->molblock[molIndex].type];
 
@@ -1265,9 +1265,9 @@ gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
     gmx_bool                bOK = TRUE;
     tng_function_status     stat;
     gmx_int64_t             numberOfAtoms = -1, frameNumber = -1;
-    gmx_int64_t             nBlocks, blockId, *blockIds = NULL, codecId;
+    gmx_int64_t             nBlocks, blockId, *blockIds = nullptr, codecId;
     char                    datatype      = -1;
-    void                   *values        = NULL;
+    void                   *values        = nullptr;
     double                  frameTime     = -1.0;
     int                     size, blockDependency;
     double                  prec;
@@ -1620,7 +1620,7 @@ gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
     char                datatype = -1;
     gmx_int64_t         codecId;
     int                 blockDependency;
-    void               *data = 0;
+    void               *data = nullptr;
     double              localPrec;
 
     stat = tng_data_block_name_get(input, blockId, name, maxLen);
index c85e1530ddc545f716ae94e92ea1e2c3eeb9a58e..24d71f8e6d68af744d1dfc0cbd075d3aff4bf86a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -292,14 +292,14 @@ static void do_pull_coord(t_fileio *fio, t_pull_coord *pcrd,
             }
             else
             {
-                pcrd->externalPotentialProvider = NULL;
+                pcrd->externalPotentialProvider = nullptr;
             }
         }
         else
         {
             if (bRead)
             {
-                pcrd->externalPotentialProvider = NULL;
+                pcrd->externalPotentialProvider = nullptr;
             }
         }
         /* Note that we try to support adding new geometries without
@@ -538,7 +538,7 @@ static void do_fepvals(t_fileio *fio, t_lambda *fepvals, gmx_bool bRead, int fil
     else
     {
         fepvals->n_lambda     = 0;
-        fepvals->all_lambda   = NULL;
+        fepvals->all_lambda   = nullptr;
         if (fepvals->init_lambda >= 0)
         {
             fepvals->separate_dvdl[efptFEP] = TRUE;
@@ -2118,7 +2118,7 @@ static void do_ilists(t_fileio *fio, t_ilist *ilist, gmx_bool bRead,
         if (bClear)
         {
             ilist[j].nr     = 0;
-            ilist[j].iatoms = NULL;
+            ilist[j].iatoms = nullptr;
         }
         else
         {
@@ -2162,7 +2162,7 @@ static void do_block(t_fileio *fio, t_block *block, gmx_bool bRead, int file_ver
     }
     if (bRead)
     {
-        if ((block->nalloc_index > 0) && (NULL != block->index))
+        if ((block->nalloc_index > 0) && (nullptr != block->index))
         {
             sfree(block->index);
         }
@@ -2419,7 +2419,7 @@ static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *sy
         {
             snew(groups->grpname, groups->ngrpname);
         }
-        atoms->pdbinfo = NULL;
+        atoms->pdbinfo = nullptr;
     }
     else
     {
@@ -2463,7 +2463,7 @@ static void do_groups(t_fileio *fio, gmx_groups_t *groups,
         {
             if (bRead)
             {
-                groups->grpnr[g] = NULL;
+                groups->grpnr[g] = nullptr;
             }
         }
         else
@@ -2530,7 +2530,7 @@ static void do_symtab(t_fileio *fio, t_symtab *symtab, gmx_bool bRead)
     else
     {
         symbuf = symtab->symbuf;
-        while (symbuf != NULL)
+        while (symbuf != nullptr)
         {
             for (i = 0; (i < symbuf->bufsize) && (i < nr); i++)
             {
@@ -2877,7 +2877,7 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
     {
         mtop->ffparams.cmap_grid.ngrid        = 0;
         mtop->ffparams.cmap_grid.grid_spacing = 0;
-        mtop->ffparams.cmap_grid.cmapdata     = NULL;
+        mtop->ffparams.cmap_grid.cmapdata     = nullptr;
     }
 
     if (file_version >= 57)
@@ -3080,14 +3080,14 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
 
     if (!bRead)
     {
-        GMX_RELEASE_ASSERT(x == NULL && v == NULL, "Passing separate x and v pointers to do_tpx() is not supported when writing");
+        GMX_RELEASE_ASSERT(x == nullptr && v == nullptr, "Passing separate x and v pointers to do_tpx() is not supported when writing");
 
         tpx.natoms    = state->natoms;
         tpx.ngtc      = state->ngtc;
         tpx.fep_state = state->fep_state;
         tpx.lambda    = state->lambda[efptFEP];
-        tpx.bIr       = (ir       != NULL);
-        tpx.bTop      = (mtop     != NULL);
+        tpx.bIr       = (ir       != nullptr);
+        tpx.bTop      = (mtop     != nullptr);
         tpx.bX        = (state->flags & (1 << estX));
         tpx.bV        = (state->flags & (1 << estV));
         tpx.bF        = FALSE;
@@ -3095,10 +3095,10 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     }
     else
     {
-        GMX_RELEASE_ASSERT(!(x == NULL && v != NULL), "Passing x==NULL and v!=NULL is not supported");
+        GMX_RELEASE_ASSERT(!(x == nullptr && v != nullptr), "Passing x==NULL and v!=NULL is not supported");
     }
 
-    TopOnlyOK = (ir == NULL);
+    TopOnlyOK = (ir == nullptr);
 
     int fileVersion;    /* Version number of the code that wrote the file */
     int fileGeneration; /* Generation version number of the code that wrote the file */
@@ -3107,7 +3107,7 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
     if (bRead)
     {
         state->flags  = 0;
-        if (x != NULL)
+        if (x != nullptr)
         {
             init_state(state, 0, tpx.ngtc, 0, 0, 0);
         }
@@ -3117,7 +3117,7 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         }
     }
 
-    if (x == NULL)
+    if (x == nullptr)
     {
         x = as_rvec_array(state->x.data());
         v = as_rvec_array(state->v.data());
@@ -3227,7 +3227,7 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         }
         if (fileGeneration <= tpx_generation && ir)
         {
-            do_inputrec(fio, ir, bRead, fileVersion, mtop ? &mtop->ffparams.fudgeQQ : NULL);
+            do_inputrec(fio, ir, bRead, fileVersion, mtop ? &mtop->ffparams.fudgeQQ : nullptr);
             if (fileVersion < 51)
             {
                 set_box_rel(ir, state);
@@ -3302,7 +3302,7 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK)
     t_fileio *fio;
 
     fio = open_tpx(fn, "r");
-    do_tpxheader(fio, TRUE, tpx, TopOnlyOK, NULL, NULL);
+    do_tpxheader(fio, TRUE, tpx, TopOnlyOK, nullptr, nullptr);
     close_tpx(fio);
 }
 
@@ -3314,7 +3314,7 @@ void write_tpx_state(const char *fn,
     fio = open_tpx(fn, "w");
     do_tpx(fio, FALSE,
            const_cast<t_inputrec *>(ir),
-           const_cast<t_state *>(state), NULL, NULL,
+           const_cast<t_state *>(state), nullptr, nullptr,
            const_cast<gmx_mtop_t *>(mtop));
     close_tpx(fio);
 }
@@ -3325,7 +3325,7 @@ void read_tpx_state(const char *fn,
     t_fileio *fio;
 
     fio = open_tpx(fn, "r");
-    do_tpx(fio, TRUE, ir, state, NULL, NULL, mtop);
+    do_tpx(fio, TRUE, ir, state, nullptr, nullptr, mtop);
     close_tpx(fio);
 }
 
index ec6ee9c04e32585b486284f16061c6aa9de6d8b2..f17b50884616baed48ed333c1a531f23ab27ee57 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -168,13 +168,13 @@ static void initcount(t_trxstatus *status)
 static void status_init(t_trxstatus *status)
 {
     status->flags           = 0;
-    status->xframe          = NULL;
-    status->fio             = NULL;
+    status->xframe          = nullptr;
+    status->fio             = nullptr;
     status->__frame         = -1;
     status->t0              = 0;
     status->tf              = 0;
-    status->persistent_line = NULL;
-    status->tng             = NULL;
+    status->persistent_line = nullptr;
+    status->tng             = nullptr;
 }
 
 
@@ -297,16 +297,16 @@ void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
     {
         fr->bDouble   = FALSE;
         fr->natoms    = -1;
-        fr->title     = NULL;
+        fr->title     = nullptr;
         fr->step      = 0;
         fr->time      = 0;
         fr->lambda    = 0;
         fr->fep_state = 0;
-        fr->atoms     = NULL;
+        fr->atoms     = nullptr;
         fr->prec      = 0;
-        fr->x         = NULL;
-        fr->v         = NULL;
-        fr->f         = NULL;
+        fr->x         = nullptr;
+        fr->v         = nullptr;
+        fr->f         = nullptr;
         clear_mat(fr->box);
         fr->bPBC   = FALSE;
         fr->ePBC   = -1;
@@ -323,7 +323,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
                            const int *ind, gmx_conect gc)
 {
     char  title[STRLEN];
-    rvec *xout = NULL, *vout = NULL, *fout = NULL;
+    rvec *xout = nullptr, *vout = nullptr, *fout = nullptr;
     int   i, ftp = -1;
     real  prec;
 
@@ -423,7 +423,7 @@ int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
             if (ftp == efGRO)
             {
                 write_hconf_indexed_p(gmx_fio_getfp(status->fio), title, fr->atoms, nind, ind,
-                                      fr->x, fr->bV ? fr->v : NULL, fr->box);
+                                      fr->x, fr->bV ? fr->v : nullptr, fr->box);
             }
             else
             {
@@ -478,13 +478,13 @@ void trjtools_gmx_prepare_tng_writing(const char       *filename,
         gmx_incons("Sorry, can only prepare for TNG output.");
     }
 
-    if (*out == NULL)
+    if (*out == nullptr)
     {
         snew((*out), 1);
     }
     status_init(*out);
 
-    if (in != NULL)
+    if (in != nullptr)
     {
         gmx_prepare_tng_writing(filename,
                                 filemode,
@@ -559,7 +559,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             break;
         case efTRR:
             gmx_trr_write_frame(status->fio, fr->step, fr->time, fr->lambda, fr->box, fr->natoms,
-                                fr->bX ? fr->x : NULL, fr->bV ? fr->v : NULL, fr->bF ? fr->f : NULL);
+                                fr->bX ? fr->x : nullptr, fr->bV ? fr->v : nullptr, fr->bF ? fr->f : nullptr);
             break;
         case efGRO:
         case efPDB:
@@ -574,7 +574,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             if (gmx_fio_getftp(status->fio) == efGRO)
             {
                 write_hconf_p(gmx_fio_getfp(status->fio), title, fr->atoms,
-                              fr->x, fr->bV ? fr->v : NULL, fr->box);
+                              fr->x, fr->bV ? fr->v : nullptr, fr->box);
             }
             else
             {
@@ -584,7 +584,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
             }
             break;
         case efG96:
-            write_g96_conf(gmx_fio_getfp(status->fio), fr, -1, NULL);
+            write_g96_conf(gmx_fio_getfp(status->fio), fr, -1, nullptr);
             break;
         default:
             gmx_fatal(FARGS, "Sorry, write_trxframe can not write %s",
@@ -606,11 +606,11 @@ int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atom
     fr.step   = step;
     fr.bTime  = TRUE;
     fr.time   = time;
-    fr.bAtoms = atoms != NULL;
+    fr.bAtoms = atoms != nullptr;
     fr.atoms  = const_cast<t_atoms *>(atoms);
     fr.bX     = TRUE;
     fr.x      = x;
-    fr.bV     = v != NULL;
+    fr.bV     = v != nullptr;
     fr.v      = v;
     fr.bBox   = TRUE;
     copy_mat(box, fr.box);
@@ -668,7 +668,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         fr->bBox      = sh.box_size > 0;
         if (status->flags & (TRX_READ_X | TRX_NEED_X))
         {
-            if (fr->x == NULL)
+            if (fr->x == nullptr)
             {
                 snew(fr->x, sh.natoms);
             }
@@ -676,7 +676,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         }
         if (status->flags & (TRX_READ_V | TRX_NEED_V))
         {
-            if (fr->v == NULL)
+            if (fr->v == nullptr)
             {
                 snew(fr->v, sh.natoms);
             }
@@ -684,7 +684,7 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
         }
         if (status->flags & (TRX_READ_F | TRX_NEED_F))
         {
-            if (fr->f == NULL)
+            if (fr->f == nullptr)
             {
                 snew(fr->f, sh.natoms);
             }
@@ -721,12 +721,12 @@ static gmx_bool pdb_next_x(t_trxstatus *status, FILE *fp, t_trxframe *fr)
     double    dbl;
 
     atoms.nr      = fr->natoms;
-    atoms.atom    = NULL;
-    atoms.pdbinfo = NULL;
+    atoms.atom    = nullptr;
+    atoms.pdbinfo = nullptr;
     /* the other pointers in atoms should not be accessed if these are NULL */
     snew(symtab, 1);
     open_symtab(symtab);
-    na       = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &ePBC, boxpdb, TRUE, NULL);
+    na       = read_pdbfile(fp, title, &model_nr, &atoms, symtab, fr->x, &ePBC, boxpdb, TRUE, nullptr);
     free_symtab(symtab);
     sfree(symtab);
     set_trxframe_ePBC(fr, ePBC);
@@ -838,7 +838,7 @@ gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_tr
                 t_symtab *symtab;
                 snew(symtab, 1);
                 open_symtab(symtab);
-                read_g96_conf(gmx_fio_getfp(status->fio), NULL, fr,
+                read_g96_conf(gmx_fio_getfp(status->fio), nullptr, fr,
                               symtab, status->persistent_line);
                 free_symtab(symtab);
                 bRet = (fr->natoms > 0);
@@ -869,7 +869,7 @@ gmx_bool read_next_frame(const gmx_output_env_t *oenv, t_trxstatus *status, t_tr
                 }
                 break;
             case efTNG:
-                bRet = gmx_read_next_tng_frame(status->tng, fr, NULL, 0);
+                bRet = gmx_read_next_tng_frame(status->tng, fr, nullptr, 0);
                 break;
             case efPDB:
                 bRet = pdb_next_x(status, gmx_fio_getfp(status->fio), fr);
@@ -1013,7 +1013,7 @@ int read_first_frame(const gmx_output_env_t *oenv, t_trxstatus **status,
             break;
         case efTNG:
             fr->step = -1;
-            if (!gmx_read_next_tng_frame((*status)->tng, fr, NULL, 0))
+            if (!gmx_read_next_tng_frame((*status)->tng, fr, nullptr, 0))
             {
                 fr->not_ok = DATA_NOT_OK;
                 fr->natoms = 0;
@@ -1152,7 +1152,7 @@ t_topology *read_top(const char *fn, int *ePBC)
     t_topology *top;
 
     snew(top, 1);
-    epbc = read_tpx_top(fn, NULL, NULL, &natoms, NULL, NULL, top);
+    epbc = read_tpx_top(fn, nullptr, nullptr, &natoms, nullptr, nullptr, top);
     if (ePBC)
     {
         *ePBC = epbc;
index 27760147cd5c92302430c743101f357f1f2aec89..cc42a28af7b762057a8f340060c2a2347c62a963 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -170,7 +170,7 @@ static int load_sharedlibrary_plugins(const char *fullpath, gmx_vmdplugin_t *vmd
     }
 
     /* in case this library does not support the filetype, close it */
-    if (vmdplugin->api == NULL)
+    if (vmdplugin->api == nullptr)
     {
         vmddlclose(handle);
     }
@@ -283,7 +283,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
     sprintf(defpathenv, "%s\\University of Illinois\\VMD\\plugins\\WIN32\\molfile", progfolder);
 #endif
 
-    vmdplugin->api      = NULL;
+    vmdplugin->api      = nullptr;
     vmdplugin->filetype = strrchr(fn, '.');
     if (!vmdplugin->filetype)
     {
@@ -296,10 +296,10 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
      * given at configure time. This last might be hard-coded to the
      * default for VMD installs. */
     pathenv = getenv("VMD_PLUGIN_PATH");
-    if (pathenv == NULL)
+    if (pathenv == nullptr)
     {
         pathenv = getenv("VMDDIR");
-        if (NULL == pathenv)
+        if (nullptr == pathenv)
         {
             printf("\nNeither VMD_PLUGIN_PATH or VMDDIR set. ");
             printf("Using default location:\n%s\n", defpathenv);
@@ -320,7 +320,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
     strncpy(pathname, pathenv, sizeof(pathname));
 #if !GMX_NATIVE_WINDOWS
     strcat(pathname, "/*.so");
-    glob(pathname, 0, NULL, &globbuf);
+    glob(pathname, 0, nullptr, &globbuf);
     if (globbuf.gl_pathc == 0)
     {
         printf("\nNo VMD Plugins found\n"
@@ -329,7 +329,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
                "The architecture (e.g. 32bit versus 64bit) of GROMACS and VMD has to match.\n");
         return 0;
     }
-    for (size_t i = 0; i < globbuf.gl_pathc && vmdplugin->api == NULL; i++)
+    for (size_t i = 0; i < globbuf.gl_pathc && vmdplugin->api == nullptr; i++)
     {
         /* FIXME: Undefined which plugin is chosen if more than one plugin
            can read a certain file ending. Requires some additional command
@@ -372,7 +372,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
         return 0;
     }
 
-    if (vmdplugin->api == NULL)
+    if (vmdplugin->api == nullptr)
     {
         printf("\nNo plugin for %s found\n", vmdplugin->filetype);
         return 0;
@@ -392,7 +392,7 @@ static int load_vmd_library(const char *fn, gmx_vmdplugin_t *vmdplugin)
 
 int read_first_vmd_frame(const char *fn, gmx_vmdplugin_t **vmdpluginp, t_trxframe *fr)
 {
-    molfile_timestep_metadata_t *metadata = NULL;
+    molfile_timestep_metadata_t *metadata = nullptr;
     gmx_vmdplugin_t             *vmdplugin;
 
     snew(vmdplugin, 1);
index a91f300a2e009ab9839c31fa9dd54acc3bd98829..27f049114c54b001d00257823f1b0caef67a07ba 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,7 +73,7 @@ warninp_t init_warning(gmx_bool bAllowWarnings, int maxwarning)
 
 void set_warning_line(warninp_t wi, const char *s, int line)
 {
-    if (s != NULL)
+    if (s != nullptr)
     {
         std::strcpy(wi->filenm, s);
     }
@@ -96,7 +96,7 @@ static void low_warning(warninp_t wi, const char *wtype, int n, const char *s)
     char *temp, *temp2;
     int   i;
 
-    if (s == NULL)
+    if (s == nullptr)
     {
         s = "Empty error message.";
     }
index 7f9f6229f51ceab82deb58cc3600f265553ba3cf..761036da75633d652e4344ba75fd22420b7c6166 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -86,7 +86,7 @@ t_psdata ps_open(const char *fn, real x1, real y1, real x2, real y2)
 
     ps->nrgb     = 0;
     ps->maxrgb   = 0;
-    ps->rgb      = NULL;
+    ps->rgb      = nullptr;
     ps->gen_ybox = 0;
     ps->ostack   = 0;
 
index db6e22421dabd15ddd91b2c9cbd6c7252b62dfad..226d9d242b60d727d128c27ccfb40d9baa3a0785 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,7 +69,7 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
                      char *buf, int buflen)
 {
     /* Supported greek letter names and corresponding xmgrace/xmgr symbols */
-    const char *sym[]  = { "beta", "chi", "delta", "eta", "lambda", "mu", "omega", "phi", "psi", "rho", "theta", NULL };
+    const char *sym[]  = { "beta", "chi", "delta", "eta", "lambda", "mu", "omega", "phi", "psi", "rho", "theta", nullptr };
     const char  symc[] = { 'b',    'c',   'd',     'h',   'l',      'm',  'w',     'f',   'y',   'r',   'q',     '\0' };
     int         xvgf;
     gmx_bool    bXVGR;
@@ -176,12 +176,12 @@ static char *xvgrstr(const char *gmx, const gmx_output_env_t *oenv,
             {
                 /* Check for special symbol */
                 i = 0;
-                while (sym[i] != NULL &&
+                while (sym[i] != nullptr &&
                        gmx_strncasecmp(sym[i], gmx+g, std::strlen(sym[i])) != 0)
                 {
                     i++;
                 }
-                if (sym[i] != NULL)
+                if (sym[i] != nullptr)
                 {
                     c = symc[i];
                     if (std::isupper(gmx[g]))
@@ -462,25 +462,25 @@ static char *fgets3(FILE *fp, char **ptr, int *len, int maxlen)
                 curp          = 0;
             }
         }
-        if (fgets(*ptr + curp, len_remaining, fp) == NULL)
+        if (fgets(*ptr + curp, len_remaining, fp) == nullptr)
         {
             /* if last line, skip */
-            return NULL;
+            return nullptr;
         }
         curp         += len_remaining-1; /* overwrite the nul char in next iteration */
         len_remaining = 1;
     }
-    while ((std::strchr(*ptr, '\n') == NULL) && (!feof(fp)));
+    while ((std::strchr(*ptr, '\n') == nullptr) && (!feof(fp)));
 
     if (*len + STRLEN >= maxlen)
     {
-        return NULL; /* this line was too long */
+        return nullptr; /* this line was too long */
     }
 
     if (feof(fp))
     {
         /* We reached EOF before '\n', skip this last line. */
-        return NULL;
+        return nullptr;
     }
     {
         /* now remove newline */
@@ -500,7 +500,7 @@ static int wordcount(char *ptr)
     int cur = 0;
 #define prev (1-cur)
 
-    if (NULL != ptr)
+    if (nullptr != ptr)
     {
         for (i = 0; (ptr[i] != '\0'); i++)
         {
@@ -525,11 +525,11 @@ static char *read_xvgr_string(const char *line)
     char       *str;
 
     ptr0 = std::strchr(line, '"');
-    if (ptr0 != NULL)
+    if (ptr0 != nullptr)
     {
         ptr0++;
         ptr1 = std::strchr(ptr0, '"');
-        if (ptr1 != NULL)
+        if (ptr1 != nullptr)
         {
             str            = gmx_strdup(ptr0);
             str[ptr1-ptr0] = '\0';
@@ -552,11 +552,11 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
 {
     FILE    *fp;
     char    *ptr;
-    char    *base = NULL;
-    char    *fmt  = NULL;
+    char    *base = nullptr;
+    char    *fmt  = nullptr;
     int      k, line = 0, nny, nx, maxx, rval, legend_nalloc, set, nchar;
     double   lf;
-    double **yy = NULL;
+    double **yy = nullptr;
     char    *tmpbuf;
     int      len = STRLEN;
     *ny  = 0;
@@ -566,23 +566,23 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
     fp   = gmx_fio_fopen(fn, "r");
 
     snew(tmpbuf, len);
-    if (subtitle != NULL)
+    if (subtitle != nullptr)
     {
-        *subtitle = NULL;
+        *subtitle = nullptr;
     }
     legend_nalloc = 0;
-    if (legend != NULL)
+    if (legend != nullptr)
     {
-        *legend = NULL;
+        *legend = nullptr;
     }
 
-    while ((ptr = fgets3(fp, &tmpbuf, &len, 10*STRLEN)) != NULL && ptr[0] != '&')
+    while ((ptr = fgets3(fp, &tmpbuf, &len, 10*STRLEN)) != nullptr && ptr[0] != '&')
     {
         line++;
         trim(ptr);
         if (ptr[0] == '@')
         {
-            if (legend != NULL)
+            if (legend != nullptr)
             {
                 ptr++;
                 trim(ptr);
@@ -590,7 +590,7 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
                 if (std::strncmp(ptr, "subtitle", 8) == 0)
                 {
                     ptr += 8;
-                    if (subtitle != NULL)
+                    if (subtitle != nullptr)
                     {
                         *subtitle = read_xvgr_string(ptr);
                     }
@@ -697,7 +697,7 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
             srenew(*legend, *ny-1);
             for (set = legend_nalloc; set < *ny-1; set++)
             {
-                (*legend)[set] = NULL;
+                (*legend)[set] = nullptr;
             }
         }
     }
@@ -707,7 +707,7 @@ int read_xvg_legend(const char *fn, double ***y, int *ny,
 
 int read_xvg(const char *fn, double ***y, int *ny)
 {
-    return read_xvg_legend(fn, y, ny, NULL, NULL);
+    return read_xvg_legend(fn, y, ny, nullptr, nullptr);
 }
 
 void write_xvg(const char *fn, const char *title, int nx, int ny, real **y,
@@ -746,9 +746,9 @@ real **read_xvg_time(const char *fn,
     real     **val;
 
     t_nalloc   = 0;
-    *t         = NULL;
-    val        = NULL;
-    val_nalloc = NULL;
+    *t         = nullptr;
+    val        = nullptr;
+    val_nalloc = nullptr;
     *nset      = 0;
     *dt        = 0;
     fp         = gmx_fio_fopen(fn, "r");
@@ -842,7 +842,7 @@ real **read_xvg_time(const char *fn,
                                 srenew(val, *nset);
                                 srenew(val_nalloc, *nset);
                                 val_nalloc[set] = 0;
-                                val[set]        = NULL;
+                                val[set]        = nullptr;
                             }
                         }
                         if (set == -1)
index 21ce527ed1791384723b4bc42e27b863922cd692..15759e537629156a1e5340300a50a31fd725a710 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -377,16 +377,16 @@ void mk_multiplicity_lookup (int *multiplicity, int maxchi,
                 /* dihedrals to aromatic rings, COO, CONH2 or guanidinium are 2fold*/
                 if (Dih > edOmega && (dlist[i].atm.Cn[Dih-NONCHI+3] != -1))
                 {
-                    if ( ((std::strstr(name, "PHE") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "TYR") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "PTR") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "TRP") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "HIS") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "GLU") != NULL) && (Dih == edChi3))  ||
-                         ((std::strstr(name, "ASP") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "GLN") != NULL) && (Dih == edChi3))  ||
-                         ((std::strstr(name, "ASN") != NULL) && (Dih == edChi2))  ||
-                         ((std::strstr(name, "ARG") != NULL) && (Dih == edChi4))  )
+                    if ( ((std::strstr(name, "PHE") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "TYR") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "PTR") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "TRP") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "HIS") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "GLU") != nullptr) && (Dih == edChi3))  ||
+                         ((std::strstr(name, "ASP") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "GLN") != nullptr) && (Dih == edChi3))  ||
+                         ((std::strstr(name, "ASN") != nullptr) && (Dih == edChi2))  ||
+                         ((std::strstr(name, "ARG") != nullptr) && (Dih == edChi4))  )
                     {
                         multiplicity[j] = 2;
                     }
@@ -564,7 +564,7 @@ void get_chi_product_traj (real **dih, int nframes, int nlist,
 
             /* make a histogram pf culm. rotamer occupancy too */
             snew(chi_prhist, nbin);
-            make_histo(NULL, nframes, chi_prtrj, nbin, chi_prhist, 0, nbin);
+            make_histo(nullptr, nframes, chi_prtrj, nbin, chi_prhist, 0, nbin);
             if (bAll)
             {
                 sprintf(hisfile, "histo-chiprod%s.xvg", dlist[i].name);
@@ -848,9 +848,9 @@ void read_ang_dih(const char *trj_fn,
     total       = 0;
     teller      = 0;
     n_alloc     = 0;
-    *time       = NULL;
-    *trans_frac = NULL;
-    *aver_angle = NULL;
+    *time       = nullptr;
+    *trans_frac = nullptr;
+    *aver_angle = nullptr;
 
     do
     {
index 6fddb2674e30f5a8cfe756c1478b2000e5608abe..d19601cff21322e98c5ca760475383d989e0414c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -144,7 +144,7 @@ void done_mat(t_mat **m)
     sfree((*m)->m_ind);
     sfree((*m)->erow);
     sfree(*m);
-    *m = NULL;
+    *m = nullptr;
 }
 
 real mat_energy(t_mat *m)
index 8b34c82ba529b6ea83a0cd2436e85c7aed937b8b..416b9b4ca23c86ed4b9f11b3b367ae62321500d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -64,7 +64,7 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
     gmx_trr_read_frame_header(status, &head, &bOK);
     *natoms = head.natoms;
     snew(*xav, *natoms);
-    gmx_trr_read_frame_data(status, &head, box, *xav, NULL, NULL);
+    gmx_trr_read_frame_data(status, &head, box, *xav, nullptr, nullptr);
 
     if ((head.t >= -1.1) && (head.t <= -0.9))
     {
@@ -83,15 +83,15 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
         {
             fprintf(stderr, "Eigenvectors in %s were determined without fitting\n", file);
             sfree(*xref);
-            *xref = NULL;
+            *xref = nullptr;
         }
         gmx_trr_read_frame_header(status, &head, &bOK);
-        gmx_trr_read_frame_data(status, &head, box, *xav, NULL, NULL);
+        gmx_trr_read_frame_data(status, &head, box, *xav, nullptr, nullptr);
     }
     else
     {
         *bFit = TRUE;
-        *xref = NULL;
+        *xref = nullptr;
     }
     *bDMA = (head.lambda > 0.5);
     if ((head.t <= -0.01) || (head.t >= 0.01))
@@ -117,7 +117,7 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
     *nvec = 0;
     while (gmx_trr_read_frame_header(status, &head, &bOK))
     {
-        gmx_trr_read_frame_data(status, &head, box, x, NULL, NULL);
+        gmx_trr_read_frame_data(status, &head, box, x, nullptr, nullptr);
         if (*nvec >= snew_size)
         {
             snew_size += 10;
@@ -164,16 +164,16 @@ void write_eigenvectors(const char *trrname, int natoms, const real mat[],
     if (WriteXref == eWXR_YES)
     {
         /* misuse lambda: 0/1 mass weighted fit no/yes */
-        gmx_trr_write_frame(trrout, -1, -1, bDMR ? 1.0 : 0.0, zerobox, natoms, xref, NULL, NULL);
+        gmx_trr_write_frame(trrout, -1, -1, bDMR ? 1.0 : 0.0, zerobox, natoms, xref, nullptr, nullptr);
     }
     else if (WriteXref == eWXR_NOFIT)
     {
         /* misuse lambda: -1 no fit */
-        gmx_trr_write_frame(trrout, -1, -1, -1.0, zerobox, natoms, x, NULL, NULL);
+        gmx_trr_write_frame(trrout, -1, -1, -1.0, zerobox, natoms, x, nullptr, nullptr);
     }
 
     /* misuse lambda: 0/1 mass weighted analysis no/yes */
-    gmx_trr_write_frame(trrout, 0, 0, bDMA ? 1.0 : 0.0, zerobox, natoms, xav, NULL, NULL);
+    gmx_trr_write_frame(trrout, 0, 0, bDMA ? 1.0 : 0.0, zerobox, natoms, xav, nullptr, nullptr);
 
     for (i = 0; i <= (end-begin); i++)
     {
@@ -196,7 +196,7 @@ void write_eigenvectors(const char *trrname, int natoms, const real mat[],
         }
 
         /* Store the eigenvalue in the time field */
-        gmx_trr_write_frame(trrout, begin+i, eigval[vec], 0, zerobox, natoms, x, NULL, NULL);
+        gmx_trr_write_frame(trrout, begin+i, eigval[vec], 0, zerobox, natoms, x, nullptr, nullptr);
     }
     gmx_trr_close(trrout);
 
index 780d82ee1ecec01f7a362af753dfc668dc904ab8..dc6f581d074bbb1ac991b8698e73d3e4374d4de8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,8 +76,8 @@ real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
              rvec x[], int nca,
              int caindex[], gmx_bool bFit)
 {
-    static rvec *xref = NULL;
-    static real *mass = NULL;
+    static rvec *xref = nullptr;
+    static real *mass = nullptr;
     const  real  d    = 0.15;  /* Rise per residue (nm)    */
     const  real  tw   = 1.745; /* Twist per residue (rad)  */
     const  real  rad  = 0.23;  /* Radius of the helix (nm) */
@@ -90,7 +90,7 @@ real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
         gmx_fatal(FARGS, "Need at least 3 Calphas to fit to, (now %d)...\n", nca);
     }
 
-    if (xref == NULL)
+    if (xref == nullptr)
     {
         snew(xref, natoms);
         snew(mass, natoms);
index f1f3e6a6cc950abeba3bc0439332fcd66a03dee8..d9f1fcede9e01d0aa26183898aaef3ba7a110035 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,19 +73,19 @@ static t_pdbfile *read_pdbf(const char *fn)
 
     snew(pdbf, 1);
     t_topology top;
-    read_tps_conf(fn, &top, &pdbf->ePBC, &pdbf->x, NULL, pdbf->box, FALSE);
+    read_tps_conf(fn, &top, &pdbf->ePBC, &pdbf->x, nullptr, pdbf->box, FALSE);
     pdbf->atoms = top.atoms;
     fp          = gmx_ffopen(fn, "r");
     char       buf[256], *ptr;
-    while ((ptr = fgets2(buf, 255, fp)) != NULL)
+    while ((ptr = fgets2(buf, 255, fp)) != nullptr)
     {
-        if (std::strstr(buf, "Intermolecular") != NULL)
+        if (std::strstr(buf, "Intermolecular") != nullptr)
         {
             ptr = std::strchr(buf, '=');
             sscanf(ptr+1, "%lf", &e);
             pdbf->edocked = e;
         }
-        else if (std::strstr(buf, "Estimated Free") != NULL)
+        else if (std::strstr(buf, "Estimated Free") != nullptr)
         {
             ptr = std::strchr(buf, '=');
             sscanf(ptr+1, "%lf", &e);
@@ -99,7 +99,7 @@ static t_pdbfile *read_pdbf(const char *fn)
 
 static t_pdbfile **read_em_all(const char *fn, int *npdbf)
 {
-    t_pdbfile **pdbf = 0;
+    t_pdbfile **pdbf = nullptr;
     int         i, maxpdbf;
     char        buf[256], name[256];
     gmx_bool    bExist;
@@ -208,9 +208,9 @@ static void clust_stat(FILE *fp, int start, int end, t_pdbfile *pdbf[])
         gmx_stats_add_point(ed, i-start, pdbf[i]->edocked, 0, 0);
         gmx_stats_add_point(ef, i-start, pdbf[i]->efree, 0, 0);
     }
-    gmx_stats_get_ase(ed, &aver, &sigma, NULL);
+    gmx_stats_get_ase(ed, &aver, &sigma, nullptr);
     fprintf(fp, "  <%12s> = %8.3f (+/- %6.3f)\n", etitles[FALSE], aver, sigma);
-    gmx_stats_get_ase(ef, &aver, &sigma, NULL);
+    gmx_stats_get_ase(ef, &aver, &sigma, nullptr);
     fprintf(fp, "  <%12s> = %8.3f (+/- %6.3f)\n", etitles[TRUE], aver, sigma);
     gmx_stats_free(ed);
     gmx_stats_free(ef);
@@ -344,7 +344,7 @@ int gmx_anadock(int argc, char *argv[])
         "energy or average energy."
     };
     t_filenm          fnm[] = {
-        { efPDB, "-f", NULL,       ffREAD  },
+        { efPDB, "-f", nullptr,       ffREAD  },
         { efXVG, "-od", "edocked", ffWRITE },
         { efXVG, "-of", "efree",   ffWRITE },
         { efLOG, "-g",  "anadock", ffWRITE }
@@ -364,11 +364,11 @@ int gmx_anadock(int argc, char *argv[])
 #define NPA asize(pa)
 
     FILE       *fp;
-    t_pdbfile **pdbf = NULL;
+    t_pdbfile **pdbf = nullptr;
     int         npdbf;
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, NPA, pa, asize(desc), desc, 0,
-                           NULL, &oenv))
+                           nullptr, &oenv))
     {
         return 0;
     }
index 28971476152d63c09af61a42dd258221de48824f..23251a08c6be14046a10b5515ff3755a96e6b549 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -318,7 +318,7 @@ compare(int natoms, int n1, rvec **eigvec1, int n2, rvec **eigvec2,
     // better to be safe than sorry, so we check it with an assert.
     // If we are in this comparison routine in the first place, neig2 should not be 0,
     // so eigval2 should always be a valid pointer.
-    GMX_RELEASE_ASSERT(eigval2 != NULL, "NULL pointer provided for eigval2");
+    GMX_RELEASE_ASSERT(eigval2 != nullptr, "NULL pointer provided for eigval2");
 
     for (i = n; i < neig2; i++)
     {
@@ -511,19 +511,19 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                     int noutvec, int *outvec, gmx_bool bSplit,
                     const gmx_output_env_t *oenv)
 {
-    FILE        *xvgrout = NULL;
+    FILE        *xvgrout = nullptr;
     int          nat, i, j, d, v, vec, nfr, nframes = 0, snew_size, frame;
-    t_trxstatus *out = NULL;
+    t_trxstatus *out = nullptr;
     t_trxstatus *status;
     int          noutvec_extr, imin, imax;
     real        *pmin, *pmax;
     int         *all_at;
     matrix       box;
     rvec        *xread, *x;
-    real         t, inp, **inprod = NULL;
+    real         t, inp, **inprod = nullptr;
     char         str[STRLEN], str2[STRLEN], **ylabel, *c;
     real         fact;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     snew(x, natoms);
 
@@ -591,7 +591,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                 /* calculate x: a fitted struture of the selected atoms */
                 if (bFit)
                 {
-                    reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+                    reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
                     do_fit(nat, w_rls, xref, xread);
                 }
                 for (i = 0; i < natoms; i++)
@@ -627,7 +627,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                             }
                         }
                     }
-                    write_trx(out, natoms, index, atoms, 0, t, box, xread, NULL, NULL);
+                    write_trx(out, natoms, index, atoms, 0, t, box, xread, nullptr, nullptr);
                 }
                 nframes++;
             }
@@ -654,7 +654,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
 
     if (projfile)
     {
-        GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL if projfile is non-NULL");
+        GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL if projfile is non-NULL");
         snew(ylabel, noutvec);
         for (v = 0; v < noutvec; v++)
         {
@@ -662,9 +662,9 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
             ylabel[v] = gmx_strdup(str);
         }
         sprintf(str, "projection on eigenvectors (%s)", proj_unit);
-        write_xvgr_graphs(projfile, noutvec, 1, str, NULL, output_env_get_xvgr_tlabel(oenv),
+        write_xvgr_graphs(projfile, noutvec, 1, str, nullptr, output_env_get_xvgr_tlabel(oenv),
                           (const char **)ylabel,
-                          nframes, inprod[noutvec], inprod, NULL,
+                          nframes, inprod[noutvec], inprod, nullptr,
                           output_env_get_time_factor(oenv), FALSE, bSplit, oenv);
     }
 
@@ -691,7 +691,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
     {
         t_atoms     atoms;
         rvec       *x;
-        real       *b = NULL;
+        real       *b = nullptr;
         matrix      box;
         char       *resnm, *atnm;
         gmx_bool    bPDB, b4D;
@@ -754,7 +754,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         }
         if ( ( b4D || bSplit ) && bPDB)
         {
-            GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL with 4D or split PDB output options");
+            GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL with 4D or split PDB output options");
 
             out = gmx_ffopen(threedplotfile, "w");
             fprintf(out, "HEADER    %s\n", str);
@@ -783,7 +783,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         }
         else
         {
-            write_sto_conf(threedplotfile, str, &atoms, x, NULL, ePBC, box);
+            write_sto_conf(threedplotfile, str, &atoms, x, nullptr, ePBC, box);
         }
         done_atom(&atoms);
     }
@@ -794,7 +794,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
         snew(pmax, noutvec_extr);
         if (extreme == 0)
         {
-            GMX_RELEASE_ASSERT(inprod != NULL, "inprod must be non-NULL");
+            GMX_RELEASE_ASSERT(inprod != nullptr, "inprod must be non-NULL");
             fprintf(stderr, "%11s %17s %17s\n", "eigenvector", "Minimum", "Maximum");
             fprintf(stderr,
                     "%11s %10s %10s %10s %10s\n", "", "value", "frame", "value", "frame");
@@ -862,7 +862,7 @@ static void project(const char *trajfile, const t_topology *top, int ePBC, matri
                              *eigvec[outvec[v]][i][d]/sqrtm[i]);
                     }
                 }
-                write_trx(out, natoms, index, atoms, 0, frame, topbox, xread, NULL, NULL);
+                write_trx(out, natoms, index, atoms, 0, frame, topbox, xread, nullptr, nullptr);
             }
             close_trx(out);
         }
@@ -912,7 +912,7 @@ static void components(const char *outfile, int natoms,
     write_xvgr_graphs(outfile, noutvec, 4, "Eigenvector components",
                       "black: total, red: x, green: y, blue: z",
                       "Atom number", (const char **)ylabel,
-                      natoms, x, NULL, y, 1, FALSE, FALSE, oenv);
+                      natoms, x, nullptr, y, 1, FALSE, FALSE, oenv);
     fprintf(stderr, "\n");
 }
 
@@ -958,9 +958,9 @@ static void rmsf(const char *outfile, int natoms, real *sqrtm,
             y[g][i] = std::sqrt(eigval[eignr[v]]*norm2(eigvec[v][i]))/sqrtm[i];
         }
     }
-    write_xvgr_graphs(outfile, noutvec, 1, "RMS fluctuation (nm) ", NULL,
+    write_xvgr_graphs(outfile, noutvec, 1, "RMS fluctuation (nm) ", nullptr,
                       "Atom number", (const char **)ylabel,
-                      natoms, x, y, NULL, 1, TRUE, FALSE, oenv);
+                      natoms, x, y, nullptr, 1, TRUE, FALSE, oenv);
     fprintf(stderr, "\n");
 }
 
@@ -1071,11 +1071,11 @@ int gmx_anaeig(int argc, char *argv[])
 
     t_topology        top;
     int               ePBC  = -1;
-    const t_atoms    *atoms = NULL;
-    rvec             *xtop, *xref1, *xref2, *xrefp = NULL;
+    const t_atoms    *atoms = nullptr;
+    rvec             *xtop, *xref1, *xref2, *xrefp = nullptr;
     gmx_bool          bDMR1, bDMA1, bDMR2, bDMA2;
-    int               nvec1, nvec2, *eignr1 = NULL, *eignr2 = NULL;
-    rvec             *xav1, *xav2, **eigvec1 = NULL, **eigvec2 = NULL;
+    int               nvec1, nvec2, *eignr1 = nullptr, *eignr2 = nullptr;
+    rvec             *xav1, *xav2, **eigvec1 = nullptr, **eigvec2 = nullptr;
     matrix            topbox;
     real              totmass, *sqrtm, *w_rls, t;
     int               natoms;
@@ -1083,7 +1083,7 @@ int gmx_anaeig(int argc, char *argv[])
     const char       *indexfile;
     int               i, j, d;
     int               nout, *iout, noutvec, *outvec, nfit;
-    int              *index = NULL, *ifit = NULL;
+    int              *index = nullptr, *ifit = nullptr;
     const char       *VecFile, *Vec2File, *topfile;
     const char       *EigFile, *Eig2File;
     const char       *CompFile, *RmsfFile, *ProjOnVecFile;
@@ -1092,7 +1092,7 @@ int gmx_anaeig(int argc, char *argv[])
     const char       *OverlapFile, *InpMatFile;
     gmx_bool          bFit1, bFit2, bM, bIndex, bTPS, bTop, bVec2, bProj;
     gmx_bool          bFirstToLast, bFirstLastSet, bTraj, bCompare, bPDB3D;
-    real             *eigval1 = NULL, *eigval2 = NULL;
+    real             *eigval1 = nullptr, *eigval2 = nullptr;
     int               neig1, neig2;
     double          **xvgdata;
     gmx_output_env_t *oenv;
@@ -1101,9 +1101,9 @@ int gmx_anaeig(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efTRN, "-v2",   "eigenvec2",   ffOPTRD },
-        { efTRX, "-f",    NULL,          ffOPTRD },
-        { efTPS, NULL,    NULL,          ffOPTRD },
-        { efNDX, NULL,    NULL,          ffOPTRD },
+        { efTRX, "-f",    nullptr,          ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffOPTRD },
+        { efNDX, nullptr,    nullptr,          ffOPTRD },
         { efXVG, "-eig", "eigenval",     ffOPTRD },
         { efXVG, "-eig2", "eigenval2",   ffOPTRD },
         { efXVG, "-comp", "eigcomp",     ffOPTWR },
@@ -1120,7 +1120,7 @@ int gmx_anaeig(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1164,7 +1164,7 @@ int gmx_anaeig(int argc, char *argv[])
     neig1 = DIM*natoms;
 
     /* Overwrite eigenvalues from separate files if the user provides them */
-    if (EigFile != NULL)
+    if (EigFile != nullptr)
     {
         int neig_tmp = read_xvg(EigFile, &xvgdata, &i);
         if (neig_tmp != neig1)
@@ -1222,7 +1222,7 @@ int gmx_anaeig(int argc, char *argv[])
         neig2 = 0;
     }
 
-    if (Eig2File != NULL)
+    if (Eig2File != nullptr)
     {
         neig2 = read_xvg(Eig2File, &xvgdata, &i);
         srenew(eigval2, neig2);
@@ -1243,15 +1243,15 @@ int gmx_anaeig(int argc, char *argv[])
     {
         bM = FALSE;
     }
-    if ((xref1 == NULL) && (bM || bTraj))
+    if ((xref1 == nullptr) && (bM || bTraj))
     {
         bTPS = TRUE;
     }
 
-    xtop  = NULL;
+    xtop  = nullptr;
     nfit  = 0;
-    ifit  = NULL;
-    w_rls = NULL;
+    ifit  = nullptr;
+    w_rls = nullptr;
 
     if (!bTPS)
     {
@@ -1260,14 +1260,14 @@ int gmx_anaeig(int argc, char *argv[])
     else
     {
         bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                             &top, &ePBC, &xtop, NULL, topbox, bM);
+                             &top, &ePBC, &xtop, nullptr, topbox, bM);
         atoms = &top.atoms;
         gpbc  = gmx_rmpbc_init(&top.idef, ePBC, atoms->nr);
         gmx_rmpbc(gpbc, atoms->nr, topbox, xtop);
         /* Fitting is only required for the projection */
         if (bProj && bFit1)
         {
-            if (xref1 == NULL)
+            if (xref1 == nullptr)
             {
                 printf("\nNote: the structure in %s should be the same\n"
                        "      as the one used for the fit in g_covar\n", topfile);
@@ -1289,7 +1289,7 @@ int gmx_anaeig(int argc, char *argv[])
             }
 
             snew(xrefp, atoms->nr);
-            if (xref1 != NULL)
+            if (xref1 != nullptr)
             {
                 /* Safety check between selected fit-group and reference structure read from the eigenvector file */
                 if (natoms != nfit)
@@ -1308,7 +1308,7 @@ int gmx_anaeig(int argc, char *argv[])
                 {
                     copy_rvec(xtop[ifit[i]], xrefp[ifit[i]]);
                 }
-                reset_x(nfit, ifit, atoms->nr, NULL, xrefp, w_rls);
+                reset_x(nfit, ifit, atoms->nr, nullptr, xrefp, w_rls);
             }
         }
         gmx_rmpbc_done(gpbc);
@@ -1402,7 +1402,7 @@ int gmx_anaeig(int argc, char *argv[])
     {
         printf("Select eigenvectors for output, end your selection with 0\n");
         nout = -1;
-        iout = NULL;
+        iout = nullptr;
 
         do
         {
@@ -1458,8 +1458,8 @@ int gmx_anaeig(int argc, char *argv[])
 
     if (bProj)
     {
-        project(bTraj ? opt2fn("-f", NFILE, fnm) : NULL,
-                bTop ? &top : NULL, ePBC, topbox,
+        project(bTraj ? opt2fn("-f", NFILE, fnm) : nullptr,
+                bTop ? &top : nullptr, ePBC, topbox,
                 ProjOnVecFile, TwoDPlotFile, ThreeDPlotFile, FilterFile, skip,
                 ExtremeFile, bFirstLastSet, max, nextr, atoms, natoms, index,
                 bFit1, xrefp, nfit, ifit, w_rls,
index c7b477f4d1eee72a997086febc1ac96946ba8be9..36ad1e0940894272466c4d45a79778d6e9e656b5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -221,7 +221,7 @@ static void regression_analysis(int n, gmx_bool bXYdy,
             }
         }
         snew(a, nset-1);
-        chi2 = multi_regression(NULL, n, y, nset-1, xx, a);
+        chi2 = multi_regression(nullptr, n, y, nset-1, xx, a);
         printf("Fitting %d data points in %d sets\n", n, nset-1);
         printf("chi2 = %g\n", chi2);
         printf("A =");
@@ -321,7 +321,7 @@ static void average(const char *avfile, int avbar_opt,
     FILE   *fp;
     int     i, s, edge = 0;
     double  av, var, err;
-    real   *tmp = NULL;
+    real   *tmp = nullptr;
 
     fp = gmx_ffopen(avfile, "w");
     if ((avbar_opt == avbarERROR) && (nset == 1))
@@ -563,7 +563,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                 fitparm[2] = std::sqrt(tau1_est*(n-1)*dt);
                 do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv,
                          bDebugMode(), effnERREST, fitparm, 0,
-                         NULL);
+                         nullptr);
             }
             if (bSingleExpFit || fitparm[0] < 0 || fitparm[2] < 0 || fitparm[1] < 0
                 || (fitparm[1] > 1 && !bAllowNegLTCorr) || fitparm[2] > (n-1)*dt)
@@ -592,7 +592,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitparm[2] = (n-1)*dt;
                     fprintf(stdout, "Will fix tau2 at the total time: %g\n", fitparm[2]);
                     do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv, bDebugMode(),
-                             effnERREST, fitparm, 4, NULL);
+                             effnERREST, fitparm, 4, nullptr);
                 }
                 if (bSingleExpFit || fitparm[0] < 0 || fitparm[1] < 0
                     || (fitparm[1] > 1 && !bAllowNegLTCorr))
@@ -610,7 +610,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitparm[1] = 1.0;
                     fitparm[2] = 0.0;
                     do_lmfit(nbs, ybs, fitsig, 0, tbs, 0, dt*n, oenv, bDebugMode(),
-                             effnERREST, fitparm, 6, NULL);
+                             effnERREST, fitparm, 6, nullptr);
                 }
             }
             ee   = optimal_error_estimate(sig[s], fitparm, n*dt);
@@ -657,7 +657,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
                     fitsig[i] = 1;
                 }
             }
-            low_do_autocorr(NULL, oenv, NULL, n, 1, -1, &ac,
+            low_do_autocorr(nullptr, oenv, nullptr, n, 1, -1, &ac,
                             dt, eacNormal, 1, FALSE, TRUE,
                             FALSE, 0, 0, effnNONE);
 
@@ -680,8 +680,8 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n,
             ac_fit[0] = 0.5*acint;
             ac_fit[1] = 0.95;
             ac_fit[2] = 10*acint;
-            do_lmfit(n/nb_min, ac, fitsig, dt, 0, 0, fitlen*dt, oenv,
-                     bDebugMode(), effnEXPEXP, ac_fit, 0, NULL);
+            do_lmfit(n/nb_min, ac, fitsig, dt, nullptr, 0, fitlen*dt, oenv,
+                     bDebugMode(), effnEXPEXP, ac_fit, 0, nullptr);
             ac_fit[3] = 1 - ac_fit[1];
 
             fprintf(stdout, "Set %3d:  ac erest %g  a %g  tau1 %g  tau2 %g\n",
@@ -735,7 +735,7 @@ static void luzar_correl(int nn, real *time, int nset, real **val, real temp,
             }
             fprintf(debug, "RMS difference in derivatives is %g\n", std::sqrt(d2/nn));
         }
-        analyse_corr(nn, time, val[0], val[2], kt, NULL, NULL, NULL, fit_start,
+        analyse_corr(nn, time, val[0], val[2], kt, nullptr, nullptr, nullptr, fit_start,
                      temp);
         sfree(kt);
     }
@@ -799,7 +799,7 @@ static void do_fit(FILE *out, int n, gmx_bool bYdy,
                    int npargs, t_pargs *ppa, const gmx_output_env_t *oenv,
                    const char *fn_fitted)
 {
-    real   *c1 = NULL, *sig = NULL;
+    real   *c1 = nullptr, *sig = nullptr;
     double *fitparm;
     real    tendfit, tbeginfit;
     int     i, efitfn, nparm;
@@ -918,9 +918,9 @@ static void print_fitted_function(const char       *fitfile,
     }
     else
     {
-        char *buf2 = NULL;
+        char *buf2 = nullptr;
         int   s, buflen = 0;
-        if (NULL != fn_fitted)
+        if (nullptr != fn_fitted)
         {
             buflen = std::strlen(fn_fitted)+32;
             snew(buf2, buflen);
@@ -929,8 +929,8 @@ static void print_fitted_function(const char       *fitfile,
         }
         for (s = 0; s < nset; s++)
         {
-            char *buf = NULL;
-            if (NULL != fn_fitted)
+            char *buf = nullptr;
+            if (nullptr != fn_fitted)
             {
                 snew(buf, buflen);
                 snprintf(buf, n, "%s_%d.xvg", buf2, s);
@@ -1041,7 +1041,7 @@ int gmx_analyze(int argc, char *argv[])
 
     /* must correspond to enum avbar* declared at beginning of file */
     static const char *avbar_opt[avbarNR+1] = {
-        NULL, "none", "stddev", "error", "90", NULL
+        nullptr, "none", "stddev", "error", "90", nullptr
     };
 
     t_pargs            pa[] = {
@@ -1129,7 +1129,7 @@ int gmx_analyze(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -1141,7 +1141,7 @@ int gmx_analyze(int argc, char *argv[])
     distfile = opt2fn_null("-dist", NFILE, fnm);
     avfile   = opt2fn_null("-av", NFILE, fnm);
     eefile   = opt2fn_null("-ee", NFILE, fnm);
-    if (opt2parg_bSet("-fitfn", npargs, ppa) && acfile == NULL)
+    if (opt2parg_bSet("-fitfn", npargs, ppa) && acfile == nullptr)
     {
         fitfile  = opt2fn("-g", NFILE, fnm);
     }
@@ -1185,13 +1185,13 @@ int gmx_analyze(int argc, char *argv[])
         {
             for (s = 0; s < nset; s++)
             {
-                sum = evaluate_integral(n, t, val[s], NULL, aver_start, &stddev);
+                sum = evaluate_integral(n, t, val[s], nullptr, aver_start, &stddev);
                 printf("Integral %d  %10.5f  +/- %10.5f\n", s+1, sum, stddev);
             }
         }
     }
 
-    if (fitfile != NULL)
+    if (fitfile != nullptr)
     {
         print_fitted_function(fitfile,
                               opt2fn_null("-fitted", NFILE, fnm),
@@ -1304,7 +1304,7 @@ int gmx_analyze(int argc, char *argv[])
         power_fit(n, nset, val, t);
     }
 
-    if (acfile != NULL)
+    if (acfile != nullptr)
     {
         if (bSubAv)
         {
index 5ebdeb124a4ef1cc736159003faf59bf2d3fc99f..295b9be41b9229d40bfcaccea537fea4f270d53e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -101,7 +101,7 @@ static void dump_dih_trr(int nframes, int nangles, real **dih, const char *fn,
                 }
             }
         }
-        gmx_trr_write_frame(fio, i, time[i], 0, box, na, x, NULL, NULL);
+        gmx_trr_write_frame(fio, i, time[i], 0, box, na, x, nullptr, nullptr);
     }
     gmx_trr_close(fio);
     sfree(x);
@@ -130,7 +130,7 @@ int gmx_g_angle(int argc, char *argv[])
         "records a histogram of the times between such transitions,",
         "assuming the input trajectory frames are equally spaced in time."
     };
-    static const char *opt[]    = { NULL, "angle", "dihedral", "improper", "ryckaert-bellemans", NULL };
+    static const char *opt[]    = { nullptr, "angle", "dihedral", "improper", "ryckaert-bellemans", nullptr };
     static gmx_bool    bALL     = FALSE, bChandler = FALSE, bAverCorr = FALSE, bPBC = TRUE;
     static real        binwidth = 1;
     t_pargs            pa[]     = {
@@ -167,18 +167,18 @@ int gmx_g_angle(int argc, char *argv[])
     real              aver, aver2, aversig; /* fraction trans dihedrals */
     double            tfrac = 0;
     char              title[256];
-    real            **dih = NULL; /* mega array with all dih. angles at all times*/
+    real            **dih = nullptr; /* mega array with all dih. angles at all times*/
     real             *time, *trans_frac, *aver_angle;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efNDX, NULL, "angle",  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efNDX, nullptr, "angle",  ffREAD  },
         { efXVG, "-od", "angdist",  ffWRITE },
         { efXVG, "-ov", "angaver",  ffOPTWR },
         { efXVG, "-of", "dihfrac",  ffOPTWR },
         { efXVG, "-ot", "dihtrans", ffOPTWR },
         { efXVG, "-oh", "trhisto",  ffOPTWR },
         { efXVG, "-oc", "dihcorr",  ffOPTWR },
-        { efTRR, "-or", NULL,       ffOPTWR }
+        { efTRR, "-or", nullptr,       ffOPTWR }
     };
 #define NFILE asize(fnm)
     int               npargs;
@@ -199,7 +199,7 @@ int gmx_g_angle(int argc, char *argv[])
     maxang = 360.0;
     bRb    = FALSE;
 
-    GMX_RELEASE_ASSERT(opt[0] != NULL, "Internal option inconsistency; opt[0]==NULL after processing");
+    GMX_RELEASE_ASSERT(opt[0] != nullptr, "Internal option inconsistency; opt[0]==NULL after processing");
 
     switch (opt[0][0])
     {
@@ -434,7 +434,7 @@ int gmx_g_angle(int argc, char *argv[])
     {
         sprintf(title, "Dihedral Distribution: %s", grpname);
 
-        calc_distribution_props(maxangstat, angstat, -180.0, 0, NULL, &S2);
+        calc_distribution_props(maxangstat, angstat, -180.0, 0, nullptr, &S2);
         fprintf(stderr, "Order parameter S^2 = %g\n", S2);
     }
 
index 14a7895856d706471aec70e708369c289412e712..4755864f06260dc88714b1c1fe59ed2cb6492635 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -255,11 +255,11 @@ static gmx_bool lambda_components_check(const lambda_components_t *lc,
     {
         return FALSE;
     }
-    if (name == NULL && lc->names[index] == NULL)
+    if (name == nullptr && lc->names[index] == nullptr)
     {
         return TRUE;
     }
-    if ((name == NULL) != (lc->names[index] == NULL))
+    if ((name == nullptr) != (lc->names[index] == nullptr))
     {
         return FALSE;
     }
@@ -566,11 +566,11 @@ static void hist_init(hist_t *h, int nhist, int *nbin)
 
 static void xvg_init(xvg_t *ba)
 {
-    ba->filename = NULL;
+    ba->filename = nullptr;
     ba->nset     = 0;
     ba->np_alloc = 0;
-    ba->np       = NULL;
-    ba->y        = NULL;
+    ba->np       = nullptr;
+    ba->y        = nullptr;
 }
 
 static void samples_init(samples_t *s, lambda_vec_t *native_lambda,
@@ -583,13 +583,13 @@ static void samples_init(samples_t *s, lambda_vec_t *native_lambda,
     s->derivative     = derivative;
 
     s->ndu        = 0;
-    s->du         = NULL;
-    s->t          = NULL;
+    s->du         = nullptr;
+    s->t          = nullptr;
     s->start_time = s->delta_time = 0;
-    s->hist       = NULL;
-    s->du_alloc   = NULL;
-    s->t_alloc    = NULL;
-    s->hist_alloc = NULL;
+    s->hist       = nullptr;
+    s->du_alloc   = nullptr;
+    s->t_alloc    = nullptr;
+    s->hist_alloc = nullptr;
     s->ndu_alloc  = 0;
     s->nt_alloc   = 0;
 
@@ -602,7 +602,7 @@ static void sample_range_init(sample_range_t *r, samples_t *s)
     r->start = 0;
     r->end   = s->ndu;
     r->use   = TRUE;
-    r->s     = NULL;
+    r->s     = nullptr;
 }
 
 static void sample_coll_init(sample_coll_t *sc, lambda_vec_t *native_lambda,
@@ -613,12 +613,12 @@ static void sample_coll_init(sample_coll_t *sc, lambda_vec_t *native_lambda,
     sc->temp           = temp;
 
     sc->nsamples       = 0;
-    sc->s              = NULL;
-    sc->r              = NULL;
+    sc->s              = nullptr;
+    sc->r              = nullptr;
     sc->nsamples_alloc = 0;
 
     sc->ntot = 0;
-    sc->next = sc->prev = NULL;
+    sc->next = sc->prev = nullptr;
 }
 
 static void sample_coll_destroy(sample_coll_t *sc)
@@ -635,12 +635,12 @@ static void lambda_data_init(lambda_data_t *l, lambda_vec_t *native_lambda,
     l->lambda = native_lambda;
     l->temp   = temp;
 
-    l->next = NULL;
-    l->prev = NULL;
+    l->next = nullptr;
+    l->prev = nullptr;
 
     l->sc = &(l->sc_head);
 
-    sample_coll_init(l->sc, native_lambda, NULL, 0.);
+    sample_coll_init(l->sc, native_lambda, nullptr, 0.);
     l->sc->next = l->sc;
     l->sc->prev = l->sc;
 }
@@ -656,8 +656,8 @@ static void barres_init(barres_t *br)
     br->dg_stddev     = 0;
     br->dg_stddev_err = 0;
 
-    br->a = NULL;
-    br->b = NULL;
+    br->a = nullptr;
+    br->b = nullptr;
 }
 
 
@@ -700,7 +700,7 @@ static sample_coll_t *lambda_data_find_sample_coll(lambda_data_t *l,
         sc = sc->next;
     }
 
-    return NULL;
+    return nullptr;
 }
 
 /* insert li into an ordered list of lambda_colls */
@@ -995,10 +995,10 @@ void sim_data_histogram(sim_data_t *sd, const char *filename,
     FILE          *fp;
     lambda_data_t *bl;
     int            nsets     = 0;
-    char         **setnames  = NULL;
+    char         **setnames  = nullptr;
     gmx_bool       first_set = FALSE;
     /* histogram data: */
-    int           *hist       = NULL;
+    int           *hist       = nullptr;
     int            nbin       = 0;
     int            nbin_alloc = 0;
     double         dx         = 0;
@@ -1059,7 +1059,7 @@ void sim_data_histogram(sim_data_t *sd, const char *filename,
         {
             if (!first_set)
             {
-                xvgr_new_dataset(fp, 0, 0, NULL, oenv);
+                xvgr_new_dataset(fp, 0, 0, nullptr, oenv);
             }
 
             sample_coll_make_hist(sc, &hist, &nbin_alloc, &nbin, &dx, &minval,
@@ -2213,9 +2213,9 @@ static const char *find_value(const char *str)
     gmx_bool name_end_found = FALSE;
 
     /* if the string is a NULL pointer, return a NULL pointer. */
-    if (str == NULL)
+    if (str == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
     while (*str != '\0')
     {
@@ -2236,7 +2236,7 @@ static const char *find_value(const char *str)
         }
         str++;
     }
-    return NULL;
+    return nullptr;
 }
 
 
@@ -2248,14 +2248,14 @@ static gmx_bool read_lambda_compvec(const char                *str,
                                     const char               **end,
                                     const char                *fn)
 {
-    gmx_bool    initialize_lc = FALSE; /* whether to initialize the lambda
-                                          components, or to check them */
-    gmx_bool    start_reached = FALSE; /* whether the start of component names
-                                          has been reached */
-    gmx_bool    vector        = FALSE; /* whether there are multiple components */
-    int         n             = 0;     /* current component number */
-    const char *val_start     = NULL;  /* start of the component name, or NULL
-                                          if not in a value */
+    gmx_bool    initialize_lc = FALSE;   /* whether to initialize the lambda
+                                            components, or to check them */
+    gmx_bool    start_reached = FALSE;   /* whether the start of component names
+                                            has been reached */
+    gmx_bool    vector        = FALSE;   /* whether there are multiple components */
+    int         n             = 0;       /* current component number */
+    const char *val_start     = nullptr; /* start of the component name, or NULL
+                                            if not in a value */
     char       *strtod_end;
     gmx_bool    OK = TRUE;
 
@@ -2270,7 +2270,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
         initialize_lc = TRUE;
     }
 
-    if (lc_in == NULL)
+    if (lc_in == nullptr)
     {
         lc_in = lc_out;
     }
@@ -2302,7 +2302,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
                 if (std::isspace(*str) || *str == ')' || *str == ',' || *str == '\0')
                 {
                     /* end of value */
-                    if (lv == NULL)
+                    if (lv == nullptr)
                     {
                         if (initialize_lc)
                         {
@@ -2329,7 +2329,7 @@ static gmx_bool read_lambda_compvec(const char                *str,
                         }
                     }
                     /* reset for the next identifier */
-                    val_start = NULL;
+                    val_start = nullptr;
                     n++;
                     if (!vector)
                     {
@@ -2354,12 +2354,12 @@ static gmx_bool read_lambda_compvec(const char                *str,
                 }
                 else
                 {
-                    GMX_RELEASE_ASSERT(lc_in != NULL, "Internal inconsistency? lc_in==NULL");
+                    GMX_RELEASE_ASSERT(lc_in != nullptr, "Internal inconsistency? lc_in==NULL");
                     if (n == lc_in->N)
                     {
                         return OK;
                     }
-                    else if (lv == NULL)
+                    else if (lv == nullptr)
                     {
                         return FALSE;
                     }
@@ -2397,7 +2397,7 @@ static gmx_bool read_lambda_components(const char          *str,
                                        const char         **end,
                                        const char          *fn)
 {
-    return read_lambda_compvec(str, NULL, NULL, lc, end, fn);
+    return read_lambda_compvec(str, nullptr, nullptr, lc, end, fn);
 }
 
 /* read an initialized lambda vector from a string */
@@ -2406,7 +2406,7 @@ static gmx_bool read_lambda_vector(const char   *str,
                                    const char  **end,
                                    const char   *fn)
 {
-    return read_lambda_compvec(str, lv, lv->lc, NULL, end, fn);
+    return read_lambda_compvec(str, lv, lv->lc, nullptr, end, fn);
 }
 
 
@@ -2422,12 +2422,12 @@ static gmx_bool legend2lambda(const char   *fn,
                               const char   *legend,
                               lambda_vec_t *lam)
 {
-    const char   *ptr    = NULL, *ptr2 = NULL;
+    const char   *ptr    = nullptr, *ptr2 = nullptr;
     gmx_bool      ok     = FALSE;
     gmx_bool      bdhdl  = FALSE;
     const char   *tostr  = " to ";
 
-    if (legend == NULL)
+    if (legend == nullptr)
     {
         gmx_fatal(FARGS, "There is no legend in file '%s', can not deduce lambda", fn);
     }
@@ -2437,13 +2437,13 @@ static gmx_bool legend2lambda(const char   *fn,
     do
     {
         ptr2 = std::strstr(ptr2, tostr);
-        if (ptr2 != NULL)
+        if (ptr2 != nullptr)
         {
             ptr = ptr2;
             ptr2++;
         }
     }
-    while (ptr2 != NULL && *ptr2 != '\0');
+    while (ptr2 != nullptr && *ptr2 != '\0');
 
     if (ptr)
     {
@@ -2465,7 +2465,7 @@ static gmx_bool legend2lambda(const char   *fn,
         ok    = TRUE;
         bdhdl = TRUE;
     }
-    else if (std::strchr(legend, 'D') != NULL && std::strchr(legend, 'H') != NULL)
+    else if (std::strchr(legend, 'D') != nullptr && std::strchr(legend, 'H') != nullptr)
     {
         ok    = TRUE;
         bdhdl = FALSE;
@@ -2486,7 +2486,7 @@ static gmx_bool legend2lambda(const char   *fn,
     if (!bdhdl)
     {
         ptr = find_value(ptr);
-        if (!ptr || !read_lambda_vector(ptr, lam, NULL, fn))
+        if (!ptr || !read_lambda_vector(ptr, lam, nullptr, fn))
         {
             gmx_fatal(FARGS, "lambda vector '%s' %s faulty", legend, fn);
         }
@@ -2610,7 +2610,7 @@ static gmx_bool subtitle2lambda(const char *subtitle, xvg_t *ba, const char *fn,
             return FALSE;
         }
         lambda_vec_init(&(ba->native_lambda), lc);
-        if (!read_lambda_vector(ptr, &(ba->native_lambda), NULL, fn))
+        if (!read_lambda_vector(ptr, &(ba->native_lambda), nullptr, fn))
         {
             gmx_fatal(FARGS, "lambda vector in %s faulty", fn);
         }
@@ -2622,21 +2622,21 @@ static gmx_bool subtitle2lambda(const char *subtitle, xvg_t *ba, const char *fn,
         /* compatibility mode: check for lambda in other ways. */
         /* plain text lambda string */
         ptr = std::strstr(subtitle, "lambda");
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* xmgrace formatted lambda string */
             ptr = std::strstr(subtitle, "\\xl\\f{}");
         }
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* xmgr formatted lambda string */
             ptr = std::strstr(subtitle, "\\8l\\4");
         }
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             ptr = std::strstr(ptr, "=");
         }
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             bFound = (sscanf(ptr+1, "%lf", &(native_lambda)) == 1);
             /* add the lambda component name as an empty string */
@@ -2677,7 +2677,7 @@ static double filename2lambda(const char *fn)
     }
     /* searching backward to find the second directory separator */
     dirsep   = 0;
-    digitptr = NULL;
+    digitptr = nullptr;
     while (ptr >= fn)
     {
         if (ptr[0] != DIR_SEPARATOR && ptr[1] == DIR_SEPARATOR)
@@ -2746,11 +2746,11 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
     }
 
     ba->temp = -1;
-    if (subtitle != NULL)
+    if (subtitle != nullptr)
     {
         /* try to extract temperature */
         ptr = std::strstr(subtitle, "T =");
-        if (ptr != NULL)
+        if (ptr != nullptr)
         {
             ptr += 3;
             if (sscanf(ptr, "%lf", &ba->temp) == 1)
@@ -2781,7 +2781,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
         }
     }
     snew(ba->lambda, ba->nset);
-    if (legend == NULL)
+    if (legend == nullptr)
     {
         /* Check if we have a single set, no legend, nset=1 means t and dH/dl */
         if (ba->nset == 1)
@@ -2835,7 +2835,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
         gmx_fatal(FARGS, "File %s contains multiple sets but no indication of the native lambda", fn);
     }
 
-    if (legend != NULL)
+    if (legend != nullptr)
     {
         for (i = 0; i < ba->nset-1; i++)
         {
@@ -3027,7 +3027,7 @@ static samples_t *read_edr_hist_block(int *nsamples, t_enxblock *blk,
     nhist = blk->nsub-2;
     if (nhist == 0)
     {
-        return NULL;
+        return nullptr;
     }
     if (nhist > 2)
     {
@@ -3151,13 +3151,13 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
     ener_file_t    fp;
     t_enxframe    *fr;
     int            nre;
-    gmx_enxnm_t   *enm           = NULL;
+    gmx_enxnm_t   *enm           = nullptr;
     double         first_t       = -1;
     double         last_t        = -1;
-    samples_t    **samples_rawdh = NULL; /* contains samples for raw delta_h  */
-    int           *nhists        = NULL; /* array to keep count & print at end */
-    int           *npts          = NULL; /* array to keep count & print at end */
-    lambda_vec_t **lambdas       = NULL; /* array to keep count & print at end */
+    samples_t    **samples_rawdh = nullptr; /* contains samples for raw delta_h  */
+    int           *nhists        = nullptr; /* array to keep count & print at end */
+    int           *npts          = nullptr; /* array to keep count & print at end */
+    lambda_vec_t **lambdas       = nullptr; /* array to keep count & print at end */
     lambda_vec_t  *native_lambda;
     int            nsamples = 0;
     lambda_vec_t   start_lambda;
@@ -3167,7 +3167,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
     snew(fr, 1);
 
     snew(native_lambda, 1);
-    start_lambda.lc = NULL;
+    start_lambda.lc = nullptr;
 
     while (do_enx(fp, fr))
     {
@@ -3306,9 +3306,9 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
             {
                 nhists[i]        = 0;
                 npts[i]          = 0;
-                lambdas[i]       = NULL;
-                samples_rawdh[i] = NULL; /* init to NULL so we know which
-                                            ones contain values */
+                lambdas[i]       = nullptr;
+                samples_rawdh[i] = nullptr; /* init to NULL so we know which
+                                               ones contain values */
             }
         }
         else
@@ -3338,7 +3338,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
                     // nsamples is always >0 here, so samples_rawdh must be a valid pointer. Unfortunately
                     // cppcheck does not understand the logic unless the assert is inside the loop, but
                     // this is not performance-sensitive code.
-                    GMX_RELEASE_ASSERT(samples_rawdh != NULL, "samples_rawdh==NULL with nsamples>0");
+                    GMX_RELEASE_ASSERT(samples_rawdh != nullptr, "samples_rawdh==NULL with nsamples>0");
                     if (samples_rawdh[i])
                     {
                         /* insert it into the existing list */
@@ -3346,7 +3346,7 @@ static void read_barsim_edr(char *fn, real *temp, sim_data_t *sd)
                                                        samples_rawdh[i]);
                         /* and make sure we'll allocate a new one this time
                            around */
-                        samples_rawdh[i] = NULL;
+                        samples_rawdh[i] = nullptr;
                     }
                 }
             }
@@ -3603,7 +3603,7 @@ int gmx_bar(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -3696,7 +3696,7 @@ int gmx_bar(int argc, char *argv[])
 
 
 
-    fpb = NULL;
+    fpb = nullptr;
     if (opt2bSet("-o", NFILE, fnm))
     {
         sprintf(buf, "%s (%s)", "\\DeltaG", "kT");
@@ -3704,7 +3704,7 @@ int gmx_bar(int argc, char *argv[])
                             "\\lambda", buf, exvggtXYDY, oenv);
     }
 
-    fpi = NULL;
+    fpi = nullptr;
     if (opt2bSet("-oi", NFILE, fnm))
     {
         sprintf(buf, "%s (%s)", "\\DeltaG", "kT");
@@ -3846,14 +3846,14 @@ int gmx_bar(int argc, char *argv[])
     for (f = 0; f < nresults; f++)
     {
 
-        if (fpi != NULL)
+        if (fpi != nullptr)
         {
             lambda_vec_print_short(results[f].a->native_lambda, buf);
             fprintf(fpi, xvg2format, buf, dg_tot);
         }
 
 
-        if (fpb != NULL)
+        if (fpb != nullptr)
         {
             lambda_vec_print_intermediate(results[f].a->native_lambda,
                                           results[f].b->native_lambda,
@@ -3922,13 +3922,13 @@ int gmx_bar(int argc, char *argv[])
     printf("\n");
 
 
-    if (fpi != NULL)
+    if (fpi != nullptr)
     {
         lambda_vec_print_short(results[nresults-1].b->native_lambda, buf);
         fprintf(fpi, xvg2format, buf, dg_tot);
         xvgrclose(fpi);
     }
-    if (fpb != NULL)
+    if (fpb != nullptr)
     {
         xvgrclose(fpb);
     }
index 17c8167279ecf26f49f53b2a779b1a5db06ee6d5..286e67a57d007ea3e2ed53d57a08b29a4af43ca3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -157,10 +157,10 @@ static void dump_axes(t_trxstatus *status, t_trxframe *fr, t_atoms *outat,
                       t_bundle *bun)
 {
     t_trxframe   frout;
-    static rvec *xout = NULL;
+    static rvec *xout = nullptr;
     int          i;
 
-    if (xout == NULL)
+    if (xout == nullptr)
     {
         snew(xout, outat->nr);
     }
@@ -186,7 +186,7 @@ static void dump_axes(t_trxstatus *status, t_trxframe *fr, t_atoms *outat,
     frout.natoms = outat->nr;
     frout.atoms  = outat;
     frout.x      = xout;
-    write_trxframe(status, &frout, NULL);
+    write_trxframe(status, &frout, nullptr);
 }
 
 int gmx_bundle(int argc, char *argv[])
@@ -223,7 +223,7 @@ int gmx_bundle(int argc, char *argv[])
           "Use the [IT]z[it]-axis as reference instead of the average axis" }
     };
     FILE             *flen, *fdist, *fz, *ftilt, *ftiltr, *ftiltl;
-    FILE             *fkink = NULL, *fkinkr = NULL, *fkinkl = NULL;
+    FILE             *fkink = nullptr, *fkinkr = nullptr, *fkinkl = nullptr;
     t_trxstatus      *status;
     t_trxstatus      *fpdb;
     t_topology        top;
@@ -242,13 +242,13 @@ int gmx_bundle(int argc, char *argv[])
     gmx_bool          bKink;
     rvec              va, vb, vc, vr, vl;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
 #define NLEG asize(leg)
     t_filenm fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPS, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efXVG, "-ol", "bun_len", ffWRITE },
         { efXVG, "-od", "bun_dist", ffWRITE },
         { efXVG, "-oz", "bun_z", ffWRITE },
@@ -263,12 +263,12 @@ int gmx_bundle(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, TRUE);
 
     bKink = opt2bSet("-ok", NFILE, fnm) || opt2bSet("-okr", NFILE, fnm)
         || opt2bSet("-okl", NFILE, fnm);
@@ -349,7 +349,7 @@ int gmx_bundle(int argc, char *argv[])
     }
     else
     {
-        fpdb = NULL;
+        fpdb = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, TRX_NEED_X);
index f3412fcb5f6bc291f2d9760127b9aba270d6ff8a..1ce9b2645f52f29d5b1893dda8f3111fc11eefe4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -479,16 +479,16 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
 #define NKKKCHI asize(kkkchi1)
 #define NJC (NKKKPHI+NKKKPSI+NKKKCHI)
 
-    FILE       *fp, *ssfp[3] = {NULL, NULL, NULL};
+    FILE       *fp, *ssfp[3] = {nullptr, nullptr, nullptr};
     const char *sss[3] = { "sheet", "helix", "coil" };
     real        S2;
     real       *normhisto;
     real      **Jc, **Jcsig;
-    int     ****his_aa_ss = NULL;
+    int     ****his_aa_ss = nullptr;
     int      ***his_aa, *histmp;
     int         i, j, k, m, n, nn, Dih, nres, hindex, angle;
     gmx_bool    bBfac, bOccup;
-    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = NULL;
+    char        hisfile[256], hhisfile[256], sshisfile[256], title[256], *ss_str = nullptr;
     char      **leg;
     const char *residue_name;
     int         rt_size;
@@ -630,7 +630,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                         }
                         break;
                     default: /* covers edOmega and higher Chis than Chi1 */
-                        calc_distribution_props(nbin, histmp, -M_PI, 0, NULL, &S2);
+                        calc_distribution_props(nbin, histmp, -M_PI, 0, nullptr, &S2);
                         break;
                 }
                 dlist[i].S2[Dih]        = S2;
@@ -892,12 +892,12 @@ static FILE *rama_file(const char *fn, const char *title, const char *xaxis,
 static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih,
                     gmx_bool bViol, gmx_bool bRamOmega, const gmx_output_env_t *oenv)
 {
-    FILE    *fp, *gp = NULL;
+    FILE    *fp, *gp = nullptr;
     gmx_bool bOm;
     char     fn[256];
     int      i, j, k, Xi1, Xi2, Phi, Psi, Om = 0, nlevels;
 #define NMAT 120
-    real   **mat  = NULL, phi, psi, omega, axis[NMAT], lo, hi;
+    real   **mat  = nullptr, phi, psi, omega, axis[NMAT], lo, hi;
     t_rgb    rlo  = { 1.0, 0.0, 0.0 };
     t_rgb    rmid = { 1.0, 1.0, 1.0 };
     t_rgb    rhi  = { 0.0, 0.0, 1.0 };
@@ -1140,13 +1140,13 @@ static void order_params(FILE *log,
     }
     xvgrclose(fp);
 
-    if (NULL != pdbfn)
+    if (nullptr != pdbfn)
     {
         real x0, y0, z0;
 
         atoms->havePdbInfo = TRUE;
 
-        if (NULL == atoms->pdbinfo)
+        if (nullptr == atoms->pdbinfo)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -1174,7 +1174,7 @@ static void order_params(FILE *log,
         fprintf(fp, "REMARK generated by g_chi\n");
         fprintf(fp, "REMARK "
                 "B-factor field contains negative of dihedral order parameters\n");
-        write_pdbfile(fp, NULL, atoms, x, ePBC, box, ' ', 0, NULL, TRUE);
+        write_pdbfile(fp, nullptr, atoms, x, ePBC, box, ' ', 0, nullptr, TRUE);
         x0 = y0 = z0 = 1000.0;
         for (i = 0; (i < atoms->nr); i++)
         {
@@ -1312,7 +1312,7 @@ int gmx_chi(int argc, char *argv[])
     static gmx_bool    bAll        = FALSE;
     static gmx_bool    bPhi        = FALSE, bPsi = FALSE, bOmega = FALSE;
     static real        bfac_init   = -1.0, bfac_max = 0;
-    static const char *maxchistr[] = { NULL, "0", "1", "2", "3",  "4", "5", "6", NULL };
+    static const char *maxchistr[] = { nullptr, "0", "1", "2", "3",  "4", "5", "6", nullptr };
     static gmx_bool    bRama       = FALSE, bShift = FALSE, bViol = FALSE, bRamOmega = FALSE;
     static gmx_bool    bNormHisto  = TRUE, bChiProduct = FALSE, bHChi = FALSE, bRAD = FALSE, bPBC = TRUE;
     static real        core_frac   = 0.5;
@@ -1376,8 +1376,8 @@ int gmx_chi(int argc, char *argv[])
     int                i, **chi_lookup, *multiplicity;
 
     t_filenm           fnm[] = {
-        { efSTX, "-s",  NULL,     ffREAD  },
-        { efTRX, "-f",  NULL,     ffREAD  },
+        { efSTX, "-s",  nullptr,     ffREAD  },
+        { efTRX, "-f",  nullptr,     ffREAD  },
         { efXVG, "-o",  "order",  ffWRITE },
         { efPDB, "-p",  "order",  ffOPTWR },
         { efDAT, "-ss", "ssdump", ffOPTRD },
@@ -1452,9 +1452,9 @@ int gmx_chi(int argc, char *argv[])
     /* Find the chi angles using atoms struct and a list of amino acids */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efSTX, NFILE, fnm), top, &ePBC, &x, nullptr, box, FALSE);
     t_atoms    &atoms = top->atoms;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
index f8a90473237217a3d612ec00d44377a889b5ab10..6dd4946104fce0724d2ef6d0d171f06eb68f78d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -154,7 +154,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
                  int seed, real kT,
                  const char *conv, gmx_output_env_t *oenv)
 {
-    FILE      *fp = NULL;
+    FILE      *fp = nullptr;
     real       ecur, enext, emin, prob, enorm;
     int        i, j, iswap, jswap, nn, nuphill = 0;
     t_mat     *minimum;
@@ -207,7 +207,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
     minimum->nn = nn;
     copy_t_mat(minimum, m);
 
-    if (NULL != conv)
+    if (nullptr != conv)
     {
         fp = xvgropen(conv, "Convergence of the MC optimization",
                       "Energy", "Step", oenv);
@@ -257,7 +257,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
 
             fprintf(log, "Iter: %d Swapped %4d and %4d (energy: %g prob: %g)\n",
                     i, iswap, jswap, enext, prob);
-            if (NULL != fp)
+            if (nullptr != fp)
             {
                 fprintf(fp, "%6d  %10g\n", i, enext);
             }
@@ -285,7 +285,7 @@ void mc_optimize(FILE *log, t_mat *m, real *time,
                 (i < m->nn-1) ? m->mat[m->m_ind[i]][m->m_ind[i+1]] : 0);
     }
 
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         xvgrclose(fp);
     }
@@ -484,7 +484,7 @@ static void jarvis_patrick(int n1, real **mat, int M, int P,
     int       **nnb;
     int         i, j, k, cid, diff, maxval;
     gmx_bool    bChange;
-    real      **mcpy = NULL;
+    real      **mcpy = nullptr;
 
     if (rmsdcut < 0)
     {
@@ -773,8 +773,8 @@ rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
 
 
     max_nf = 0;
-    xx     = NULL;
-    *time  = NULL;
+    xx     = nullptr;
+    *time  = nullptr;
     natom  = read_first_x(oenv, &status, fn, &t, &x, box);
     i      = 0;
     i0     = 0;
@@ -993,20 +993,20 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                              gmx_bool bFit, FILE *log, t_rgb rlo, t_rgb rhi,
                              const gmx_output_env_t *oenv)
 {
-    FILE        *size_fp = NULL;
+    FILE        *size_fp = nullptr;
     char         buf[STRLEN], buf1[40], buf2[40], buf3[40], *trxsfn;
-    t_trxstatus *trxout  = NULL;
-    t_trxstatus *trxsout = NULL;
+    t_trxstatus *trxout  = nullptr;
+    t_trxstatus *trxsout = nullptr;
     int          i, i1, cl, nstr, *structure, first = 0, midstr;
-    gmx_bool    *bWrite = NULL;
+    gmx_bool    *bWrite = nullptr;
     real         r, clrmsd, midrmsd;
-    rvec        *xav = NULL;
+    rvec        *xav = nullptr;
     matrix       zerobox;
 
     clear_mat(zerobox);
 
     ffprintf_d(stderr, log, buf, "\nFound %d clusters\n\n", clust->ncl);
-    trxsfn = NULL;
+    trxsfn = nullptr;
     if (trxfn)
     {
         /* do we write all structures? */
@@ -1053,7 +1053,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
         /* Prepare a reference structure for the orientation of the clusters  */
         if (bFit)
         {
-            reset_x(ifsize, fitidx, natom, NULL, xtps, mass);
+            reset_x(ifsize, fitidx, natom, nullptr, xtps, mass);
         }
         trxout = open_trx(trxfn, "w");
         /* Calculate the average structure in each cluster,               *
@@ -1113,7 +1113,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                 {
                     if (bFit)
                     {
-                        reset_x(ifsize, fitidx, natom, NULL, xx[i1], mass);
+                        reset_x(ifsize, fitidx, natom, nullptr, xx[i1], mass);
                     }
                     if (nstr == 1)
                     {
@@ -1234,7 +1234,7 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                     if (bWrite[i])
                     {
                         write_trx(trxsout, iosize, outidx, atoms, i, time[structure[i]], zerobox,
-                                  xx[structure[i]], NULL, NULL);
+                                  xx[structure[i]], nullptr, nullptr);
                     }
                 }
                 close_trx(trxsout);
@@ -1255,14 +1255,14 @@ static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
                 }
                 if (bFit)
                 {
-                    reset_x(ifsize, fitidx, natom, NULL, xav, mass);
+                    reset_x(ifsize, fitidx, natom, nullptr, xav, mass);
                 }
             }
             if (bFit)
             {
                 do_fit(natom, mass, xtps, xav);
             }
-            write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, NULL, NULL);
+            write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, nullptr, nullptr);
         }
     }
     /* clean up */
@@ -1397,28 +1397,28 @@ int gmx_cluster(int argc, char *argv[])
     gmx_int64_t        nrms = 0;
 
     matrix             box;
-    rvec              *xtps, *usextps, *x1, **xx = NULL;
+    rvec              *xtps, *usextps, *x1, **xx = nullptr;
     const char        *fn, *trx_out_fn;
     t_clusters         clust;
-    t_mat             *rms, *orig = NULL;
+    t_mat             *rms, *orig = nullptr;
     real              *eigenvalues;
     t_topology         top;
     int                ePBC;
     t_atoms            useatoms;
-    t_matrix          *readmat = NULL;
+    t_matrix          *readmat = nullptr;
     real              *eigenvectors;
 
     int                isize = 0, ifsize = 0, iosize = 0;
-    int               *index = NULL, *fitidx = NULL, *outidx = NULL;
+    int               *index = nullptr, *fitidx = nullptr, *outidx = nullptr;
     char              *grpname;
-    real               rmsd, **d1, **d2, *time = NULL, time_invfac, *mass = NULL;
+    real               rmsd, **d1, **d2, *time = nullptr, time_invfac, *mass = nullptr;
     char               buf[STRLEN], buf1[80], title[STRLEN];
     gmx_bool           bAnalyze, bUseRmsdCut, bJP_RMSD = FALSE, bReadMat, bReadTraj, bPBC = TRUE;
 
     int                method, ncluster = 0;
     static const char *methodname[] = {
-        NULL, "linkage", "jarvis-patrick", "monte-carlo",
-        "diagonalization", "gromos", NULL
+        nullptr, "linkage", "jarvis-patrick", "monte-carlo",
+        "diagonalization", "gromos", nullptr
     };
     enum {
         m_null, m_linkage, m_jarvis_patrick,
@@ -1436,7 +1436,7 @@ int gmx_cluster(int argc, char *argv[])
     static real       kT       = 1e-3;
     static int        M        = 10, P = 3;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_pargs           pa[] = {
         { "-dista", FALSE, etBOOL, {&bRMSdist},
@@ -1484,9 +1484,9 @@ int gmx_cluster(int argc, char *argv[])
           { &bPBC }, "PBC check" }
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",     NULL,        ffOPTRD },
-        { efTPS, "-s",     NULL,        ffOPTRD },
-        { efNDX, NULL,     NULL,        ffOPTRD },
+        { efTRX, "-f",     nullptr,        ffOPTRD },
+        { efTPS, "-s",     nullptr,        ffOPTRD },
+        { efNDX, nullptr,     nullptr,        ffOPTRD },
         { efXPM, "-dm",   "rmsd",       ffOPTRD },
         { efXPM, "-om",   "rmsd-raw",   ffWRITE },
         { efXPM, "-o",    "rmsd-clust", ffWRITE },
@@ -1504,7 +1504,7 @@ int gmx_cluster(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -1523,7 +1523,7 @@ int gmx_cluster(int argc, char *argv[])
     }
     else
     {
-        trx_out_fn = NULL;
+        trx_out_fn = nullptr;
     }
     if (bReadMat && output_env_get_time_factor(oenv) != 1)
     {
@@ -1611,7 +1611,7 @@ int gmx_cluster(int argc, char *argv[])
     if (bReadTraj)
     {
         /* don't read mass-database as masses (and top) are not used */
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, nullptr, box,
                       TRUE);
         if (bPBC)
         {
@@ -1686,7 +1686,7 @@ int gmx_cluster(int argc, char *argv[])
             {
                 for (i = 0; i < nf; i++)
                 {
-                    reset_x(ifsize, fitidx, isize, NULL, xx[i], mass);
+                    reset_x(ifsize, fitidx, isize, nullptr, xx[i], mass);
                 }
             }
         }
@@ -1902,7 +1902,7 @@ int gmx_cluster(int argc, char *argv[])
         useatoms.nr = isize;
         analyze_clusters(nf, &clust, rms->mat, isize, &useatoms, usextps, mass, xx, time,
                          ifsize, fitidx, iosize, outidx,
-                         bReadTraj ? trx_out_fn : NULL,
+                         bReadTraj ? trx_out_fn : nullptr,
                          opt2fn_null("-sz", NFILE, fnm),
                          opt2fn_null("-tr", NFILE, fnm),
                          opt2fn_null("-ntr", NFILE, fnm),
@@ -1956,7 +1956,7 @@ int gmx_cluster(int argc, char *argv[])
     }
     fprintf(stderr, "\n");
     gmx_ffclose(fp);
-    if (NULL != orig)
+    if (nullptr != orig)
     {
         fp = opt2FILE("-om", NFILE, fnm, "w");
         sprintf(buf, "Time (%s)", output_env_get_time_unit(oenv));
@@ -1982,7 +1982,7 @@ int gmx_cluster(int argc, char *argv[])
         do_view(oenv, opt2fn_null("-ntr", NFILE, fnm), "-nxy");
         do_view(oenv, opt2fn_null("-clid", NFILE, fnm), "-nxy");
     }
-    do_view(oenv, opt2fn_null("-conv", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn_null("-conv", NFILE, fnm), nullptr);
 
     return 0;
 }
index d432d47cbec96ed42be7702fbd682dfe14ba7d55..8ba0c0ad9488a0c7a4416a157d37e41f12476b94 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,10 +71,10 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                        const gmx_output_env_t *oenv)
 {
     FILE                 *fp, *gp, *hp, *tp;
-    int                  *index = NULL;
+    int                  *index = nullptr;
     int                   nindex, natoms;
     t_trxstatus          *status;
-    rvec                 *x = NULL, *v = NULL, dx;
+    rvec                 *x = nullptr, *v = nullptr, dx;
     t_pbc                 pbc;
     char                 *gname;
     char                  timebuf[32];
@@ -82,14 +82,14 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
     /* Topology stuff */
     t_trxframe            fr;
     t_tpxheader           tpxh;
-    gmx_mtop_t           *mtop = NULL;
+    gmx_mtop_t           *mtop = nullptr;
     int                   ePBC = -1;
-    t_block              *mols = NULL;
+    t_block              *mols = nullptr;
     int                   ii, jj;
     real                  temp, tfac;
     /* Cluster size distribution (matrix) */
-    real                **cs_dist = NULL;
-    real                  tf, dx2, cut2, *t_x = NULL, *t_y, cmid, cmax, cav, ekin;
+    real                **cs_dist = nullptr;
+    real                  tf, dx2, cut2, *t_x = nullptr, *t_y, cmid, cmax, cav, ekin;
     int                   i, j, k, ai, aj, ci, cj, nframe, nclust, n_x, max_size = 0;
     int                  *clust_index, *clust_size, max_clust_size, max_clust_ind, nav, nhisto;
     t_rgb                 rlo = { 1.0, 1.0, 1.0 };
@@ -120,7 +120,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             gmx_fatal(FARGS, "tpr (%d atoms) and trajectory (%d atoms) do not match!",
                       tpxh.natoms, natoms);
         }
-        ePBC = read_tpx(tpr, NULL, NULL, &natoms, NULL, NULL, mtop);
+        ePBC = read_tpx(tpr, nullptr, nullptr, &natoms, nullptr, nullptr, mtop);
     }
     if (ndf <= -1)
     {
@@ -138,7 +138,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             printf("Using molecules rather than atoms. Not reading index file %s\n",
                    ndx);
         }
-        GMX_RELEASE_ASSERT(mtop != NULL, "Trying to access mtop->mols from NULL mtop pointer");
+        GMX_RELEASE_ASSERT(mtop != nullptr, "Trying to access mtop->mols from NULL mtop pointer");
         mols = &(mtop->mols);
 
         /* Make dummy index */
@@ -207,7 +207,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
                         /* Compute distance */
                         if (bMol)
                         {
-                            GMX_RELEASE_ASSERT(mols != NULL, "Cannot access index[] from NULL mols pointer");
+                            GMX_RELEASE_ASSERT(mols != nullptr, "Cannot access index[] from NULL mols pointer");
                             bSame = FALSE;
                             for (ii = mols->index[ai]; !bSame && (ii < mols->index[ai+1]); ii++)
                             {
@@ -349,7 +349,7 @@ static void clust_size(const char *ndx, const char *trx, const char *xpm,
             {
                 if (bMol)
                 {
-                    GMX_RELEASE_ASSERT(mols != NULL, "Cannot access index[] from NULL mols pointer");
+                    GMX_RELEASE_ASSERT(mols != nullptr, "Cannot access index[] from NULL mols pointer");
                     for (j = mols->index[i]; (j < mols->index[i+1]); j++)
                     {
                         fprintf(fp, "%d\n", j+1);
@@ -487,9 +487,9 @@ int gmx_clustsize(int argc, char *argv[])
     t_rgb             rgblo, rgbhi;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,         ffREAD  },
-        { efTPR, NULL,  NULL,         ffOPTRD },
-        { efNDX, NULL,  NULL,         ffOPTRD },
+        { efTRX, "-f",  nullptr,         ffREAD  },
+        { efTPR, nullptr,  nullptr,         ffOPTRD },
+        { efNDX, nullptr,  nullptr,         ffOPTRD },
         { efXPM, "-o", "csize",       ffWRITE },
         { efXPM, "-ow", "csizew",      ffWRITE },
         { efXVG, "-nc", "nclust",      ffWRITE },
@@ -503,7 +503,7 @@ int gmx_clustsize(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index a5ed70c7ea61e0a449ba2945e2bf9d1b2979c959..d03727675699b5414a0ce84cbd832403f927cf67 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -554,7 +554,7 @@ int gmx_confrms(int argc, char *argv[])
 
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -673,13 +673,13 @@ int gmx_confrms(int argc, char *argv[])
 
         sfree(fit_x);
         sfree(w_rls);
-        w_rls = NULL;
+        w_rls = nullptr;
     }
     else
     {
         clear_rvec(xcm1);
         clear_rvec(xcm2);
-        w_rls = NULL;
+        w_rls = nullptr;
     }
 
     /* calculate the rms deviation */
@@ -801,9 +801,9 @@ int gmx_confrms(int argc, char *argv[])
             fp = gmx_ffopen(outfile, "w");
             if (!bOne)
             {
-                write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, NULL, TRUE);
+                write_pdbfile(fp, *top1->name, atoms1, x1, ePBC1, box1, ' ', 1, nullptr, TRUE);
             }
-            write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, NULL, TRUE);
+            write_pdbfile(fp, *top2->name, atoms2, x2, ePBC2, box2, ' ', bOne ? -1 : 2, nullptr, TRUE);
             gmx_ffclose(fp);
             break;
         case efGRO:
index b7ee514a5697bfc952d34f2463949ae537b7e774..1234232ef53b8773e5410858b37ec14537af1aaf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -109,7 +109,7 @@ int gmx_covar(int argc, char *argv[])
         { "-pbc",  FALSE,  etBOOL, {&bPBC},
           "Apply corrections for periodic boundary conditions" }
     };
-    FILE             *out = NULL; /* initialization makes all compilers happy */
+    FILE             *out = nullptr; /* initialization makes all compilers happy */
     t_trxstatus      *status;
     t_topology        top;
     int               ePBC;
@@ -118,7 +118,7 @@ int gmx_covar(int argc, char *argv[])
     matrix            box, zerobox;
     real             *sqrtm, *mat, *eigenvalues, sum, trace, inv_nframes;
     real              t, tstart, tend, **mat2;
-    real              xj, *w_rls = NULL;
+    real              xj, *w_rls = nullptr;
     real              min, max, *axis;
     int               natoms, nat, nframes0, nframes, nlevels;
     gmx_int64_t       ndim, i, j, k, l;
@@ -134,16 +134,16 @@ int gmx_covar(int argc, char *argv[])
     t_rgb             rlo, rmi, rhi;
     real             *eigenvectors;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPS, NULL,  NULL, ffREAD },
-        { efNDX, NULL,  NULL, ffOPTRD },
-        { efXVG, NULL,  "eigenval", ffWRITE },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPS, nullptr,  nullptr, ffREAD },
+        { efNDX, nullptr,  nullptr, ffOPTRD },
+        { efXVG, nullptr,  "eigenval", ffWRITE },
         { efTRN, "-v",  "eigenvec", ffWRITE },
         { efSTO, "-av", "average.pdb", ffWRITE },
-        { efLOG, NULL,  "covar", ffWRITE },
+        { efLOG, nullptr,  "covar", ffWRITE },
         { efDAT, "-ascii", "covar", ffOPTWR },
         { efXPM, "-xpm", "covar", ffOPTWR },
         { efXPM, "-xpma", "covara", ffOPTWR }
@@ -151,7 +151,7 @@ int gmx_covar(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -169,7 +169,7 @@ int gmx_covar(int argc, char *argv[])
     xpmfile    = opt2fn_null("-xpm", NFILE, fnm);
     xpmafile   = opt2fn_null("-xpma", NFILE, fnm);
 
-    read_tps_conf(fitfile, &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(fitfile, &top, &ePBC, &xref, nullptr, box, TRUE);
     atoms = &top.atoms;
 
     if (bFit)
@@ -247,7 +247,7 @@ int gmx_covar(int argc, char *argv[])
     }
     if (bFit)
     {
-        reset_x(nfit, ifit, atoms->nr, NULL, xref, w_rls);
+        reset_x(nfit, ifit, atoms->nr, nullptr, xref, w_rls);
     }
 
     snew(x, natoms);
@@ -276,7 +276,7 @@ int gmx_covar(int argc, char *argv[])
         }
         if (bFit)
         {
-            reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+            reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
             do_fit(nat, w_rls, xref, xread);
         }
         for (i = 0; i < natoms; i++)
@@ -297,7 +297,7 @@ int gmx_covar(int argc, char *argv[])
         }
     }
     write_sto_conf_indexed(opt2fn("-av", NFILE, fnm), "Average structure",
-                           atoms, xread, NULL, epbcNONE, zerobox, natoms, index);
+                           atoms, xread, nullptr, epbcNONE, zerobox, natoms, index);
     sfree(xread);
 
     fprintf(stderr, "Constructing covariance matrix (%dx%d) ...\n", static_cast<int>(ndim), static_cast<int>(ndim));
@@ -315,7 +315,7 @@ int gmx_covar(int argc, char *argv[])
         }
         if (bFit)
         {
-            reset_x(nfit, ifit, nat, NULL, xread, w_rls);
+            reset_x(nfit, ifit, nat, nullptr, xread, w_rls);
             do_fit(nat, w_rls, xref, xread);
         }
         if (bRef)
index e767a03239a131010b67867f84d62acaba4ba1c3..44be7f8111472468c8bbdd9d4f9e325273bfa10e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -356,12 +356,12 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     int       i, j;
     int       valloc, nalloc, nfr, nvfr;
     int       vshfr;
-    real     *xshfr       = NULL;
-    int      *vfr         = NULL;
+    real     *xshfr       = nullptr;
+    int      *vfr         = nullptr;
     real      refr        = 0.0;
-    real     *cacf        = NULL;
-    real     *time        = NULL;
-    real     *djc         = NULL;
+    real     *cacf        = nullptr;
+    real     *time        = nullptr;
+    real     *djc         = nullptr;
     real      corint      = 0.0;
     real      prefactorav = 0.0;
     real      prefactor   = 0.0;
@@ -378,16 +378,16 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     rvec      mja_tmp;
     rvec      mjd_tmp;
     rvec      mdvec;
-    rvec     *mu    = NULL;
-    rvec     *xp    = NULL;
-    rvec     *v0    = NULL;
-    rvec     *mjdsp = NULL;
-    real     *dsp2  = NULL;
+    rvec     *mu    = nullptr;
+    rvec     *xp    = nullptr;
+    rvec     *v0    = nullptr;
+    rvec     *mjdsp = nullptr;
+    real     *dsp2  = nullptr;
     real      t0;
     real      rtmp;
 
     rvec      tmp;
-    rvec     *mtrans = NULL;
+    rvec     *mtrans = nullptr;
 
     /*
      * Variables for the least-squares fit for Einstein-Helfand and Green-Kubo
@@ -400,7 +400,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     real         err   = 0.0;
     real        *xfit;
     real        *yfit;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     /*
      * indices for EH
@@ -460,7 +460,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
                 xshfr[i] = 0.0;
             }
         }
-        GMX_RELEASE_ASSERT(time != NULL, "Memory not allocated correctly - time array is NULL");
+        GMX_RELEASE_ASSERT(time != nullptr, "Memory not allocated correctly - time array is NULL");
 
         if (nfr == 0)
         {
@@ -639,7 +639,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     printf("\n\nAverage translational dipole moment M_J [enm] after %d frames (|M|^2): %f %f %f (%f)\n", nfr, mja_tmp[XX], mja_tmp[YY], mja_tmp[ZZ], mj2);
     printf("\n\nAverage molecular dipole moment M_D [enm] after %d frames (|M|^2): %f %f %f (%f)\n", nfr, mdvec[XX], mdvec[YY], mdvec[ZZ], md2);
 
-    if (v0 != NULL)
+    if (v0 != nullptr)
     {
         if (bINT)
         {
@@ -751,7 +751,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     }
 
 
-    if (v0 != NULL)
+    if (v0 != nullptr)
     {
         sfree(v0);
     }
@@ -805,13 +805,13 @@ int gmx_current(int argc, char *argv[])
 
     gmx_output_env_t      *oenv;
     t_topology             top;
-    char                 **grpname = NULL;
+    char                 **grpname = nullptr;
     const char            *indexfn;
     t_trxframe             fr;
-    real                  *mass2 = NULL;
+    real                  *mass2 = nullptr;
     matrix                 box;
     int                   *index0;
-    int                   *indexm = NULL;
+    int                   *indexm = nullptr;
     int                    isize;
     t_trxstatus           *status;
     int                    flags = 0;
@@ -821,16 +821,16 @@ int gmx_current(int argc, char *argv[])
     int                    nmols;
     int                    i;
     real                  *qmol;
-    FILE                  *outf   = NULL;
-    FILE                  *mcor   = NULL;
-    FILE                  *fmj    = NULL;
-    FILE                  *fmd    = NULL;
-    FILE                  *fmjdsp = NULL;
-    FILE                  *fcur   = NULL;
+    FILE                  *outf   = nullptr;
+    FILE                  *mcor   = nullptr;
+    FILE                  *fmj    = nullptr;
+    FILE                  *fmd    = nullptr;
+    FILE                  *fmjdsp = nullptr;
+    FILE                  *fcur   = nullptr;
     t_filenm               fnm[]  = {
-        { efTPS,  NULL,  NULL, ffREAD }, /* this is for the topology */
-        { efNDX, NULL, NULL, ffOPTRD },
-        { efTRX, "-f", NULL, ffREAD },   /* and this for the trajectory */
+        { efTPS,  nullptr,  nullptr, ffREAD }, /* this is for the topology */
+        { efNDX, nullptr, nullptr, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },      /* and this for the trajectory */
         { efXVG, "-o",   "current", ffWRITE },
         { efXVG, "-caf", "caf",     ffOPTWR },
         { efXVG, "-dsp", "dsp",     ffWRITE },
@@ -880,7 +880,7 @@ int gmx_current(int argc, char *argv[])
 
     /* At first the arguments will be parsed and the system information processed */
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -888,7 +888,7 @@ int gmx_current(int argc, char *argv[])
     bACF = opt2bSet("-caf", NFILE, fnm);
     bINT = opt2bSet("-mc", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     indexfn = ftp2fn_null(efNDX, NFILE, fnm);
     snew(grpname, 1);
index ad9b231fea9398db62a7bb9703ac831abdad52d7..e92661be9fe9d631ab38d0adc6d74259b65026a8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -94,7 +94,7 @@ int get_electrons(t_electron **eltab, const char *fn)
         gmx_fatal(FARGS, "Couldn't open %s. Exiting.\n", fn);
     }
 
-    if (NULL == fgets(buffer, 255, in))
+    if (nullptr == fgets(buffer, 255, in))
     {
         gmx_fatal(FARGS, "Error reading from file %s", fn);
     }
@@ -108,7 +108,7 @@ int get_electrons(t_electron **eltab, const char *fn)
 
     for (i = 0; i < nr; i++)
     {
-        if (fgets(buffer, 255, in) == NULL)
+        if (fgets(buffer, 255, in) == nullptr)
         {
             gmx_fatal(FARGS, "reading datafile. Check your datafile.\n");
         }
@@ -186,7 +186,7 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
     t_electron  *found;         /* found by bsearch */
     t_electron   sought;        /* thingie thought by bsearch */
     real         boxSz, aveBox;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     real         t,
                  z;
@@ -281,7 +281,7 @@ void calc_electron_density(const char *fn, int **index, int gnx[],
                             (const void *)eltab, nr, sizeof(t_electron),
                             (int(*)(const void*, const void*))compare);
 
-                if (found == NULL)
+                if (found == nullptr)
                 {
                     fprintf(stderr, "Couldn't find %s. Add it to the .dat file\n",
                             *(top->atoms.atomname[index[n][i]]));
@@ -343,7 +343,7 @@ void calc_density(const char *fn, int **index, int gnx[],
     real         t,
                  z;
     real         boxSz, aveBox;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     if (axis < 0 || axis >= DIM)
     {
@@ -482,9 +482,9 @@ void plot_density(double *slDensity[], const char *afile, int nslices,
                   const gmx_output_env_t *oenv)
 {
     FILE       *den;
-    const char *title  = NULL;
-    const char *xlabel = NULL;
-    const char *ylabel = NULL;
+    const char *title  = nullptr;
+    const char *xlabel = nullptr;
+    const char *ylabel = nullptr;
     int         slice, n;
     real        ddd;
     real        axispos;
@@ -621,7 +621,7 @@ int gmx_density(int argc, char *argv[])
 
     gmx_output_env_t  *oenv;
     static const char *dens_opt[] =
-    { NULL, "mass", "number", "charge", "electron", NULL };
+    { nullptr, "mass", "number", "charge", "electron", nullptr };
     static int         axis        = 2;  /* normal to memb. default z  */
     static const char *axtitle     = "Z";
     static int         nslices     = 50; /* nr of slices defined       */
@@ -666,9 +666,9 @@ int gmx_density(int argc, char *argv[])
     int                i;
 
     t_filenm           fnm[] = { /* files for g_density       */
-        { efTRX, "-f", NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
-        { efTPR, NULL, NULL,  ffREAD },
+        { efTRX, "-f", nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
+        { efTPR, nullptr, nullptr,  ffREAD },
         { efDAT, "-ei", "electrons", ffOPTRD }, /* file with nr. of electrons */
         { efXVG, "-o", "density", ffWRITE },
     };
@@ -682,7 +682,7 @@ int gmx_density(int argc, char *argv[])
         return 0;
     }
 
-    GMX_RELEASE_ASSERT(dens_opt[0] != NULL, "Option setting inconsistency; dens_opt[0] is NULL");
+    GMX_RELEASE_ASSERT(dens_opt[0] != nullptr, "Option setting inconsistency; dens_opt[0] is NULL");
 
     if (bSymmetrize && !bCenter)
     {
@@ -725,7 +725,7 @@ int gmx_density(int argc, char *argv[])
     else
     {
         ncenter      = 0;
-        index_center = NULL;
+        index_center = nullptr;
     }
 
     fprintf(stderr, "\nSelect %d group%s to calculate density for:\n", ngrps, (ngrps > 1) ? "s" : "");
index 45d09ee9c298ad7f8b9cea56490c75f93cafb624..84784621f4601398038f1553c2d07cac11d14bcf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -97,8 +97,8 @@ int gmx_densmap(int argc, char *argv[])
     static int         n1      = 0, n2 = 0;
     static real        xmin    = -1, xmax = -1, bin = 0.02, dmin = 0, dmax = 0, amax = 0, rmax = 0;
     static gmx_bool    bMirror = FALSE, bSums = FALSE;
-    static const char *eaver[] = { NULL, "z", "y", "x", NULL };
-    static const char *eunit[] = { NULL, "nm-3", "nm-2", "count", NULL };
+    static const char *eaver[] = { nullptr, "z", "y", "x", nullptr };
+    static const char *eunit[] = { nullptr, "nm-3", "nm-2", "count", nullptr };
 
     t_pargs            pa[] = {
         { "-bin", FALSE, etREAL, {&bin},
@@ -140,8 +140,8 @@ int gmx_densmap(int argc, char *argv[])
     int                cav = 0, c1 = 0, c2 = 0;
     char             **grpname, buf[STRLEN];
     const char        *unit;
-    int                i, j, k, l, ngrps, anagrp, *gnx = NULL, nindex, nradial = 0, nfr, nmpower;
-    int              **ind = NULL, *index;
+    int                i, j, k, l, ngrps, anagrp, *gnx = nullptr, nindex, nradial = 0, nfr, nmpower;
+    int              **ind = nullptr, *index;
     real             **grid, maxgrid, m1, m2, box1, box2, *tickx, *tickz, invcellvol;
     real               invspa = 0, invspz = 0, axial, r, vol_old, vol, rowsum;
     int                nlev   = 51;
@@ -149,9 +149,9 @@ int gmx_densmap(int argc, char *argv[])
     gmx_output_env_t  *oenv;
     const char        *label[] = { "x (nm)", "y (nm)", "z (nm)" };
     t_filenm           fnm[]   = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffOPTRD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffOPTRD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efDAT, "-od",  "densmap",   ffOPTWR },
         { efXPM, "-o",   "densmap",   ffWRITE }
     };
@@ -161,7 +161,7 @@ int gmx_densmap(int argc, char *argv[])
     npargs = asize(pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -177,7 +177,7 @@ int gmx_densmap(int argc, char *argv[])
         }
     }
 
-    GMX_RELEASE_ASSERT(eunit[0] != NULL, "Option setting inconsistency; eunit[0] is NULL");
+    GMX_RELEASE_ASSERT(eunit[0] != nullptr, "Option setting inconsistency; eunit[0] is NULL");
 
     if (std::strcmp(eunit[0], "nm-3") == 0)
     {
@@ -197,7 +197,7 @@ int gmx_densmap(int argc, char *argv[])
 
     if (ftp2bSet(efTPS, NFILE, fnm) || !ftp2bSet(efNDX, NFILE, fnm))
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box,
                       bRadial);
     }
     if (!bRadial)
@@ -226,7 +226,7 @@ int gmx_densmap(int argc, char *argv[])
         }
     }
 
-    GMX_RELEASE_ASSERT(eaver[0] != NULL, "Option setting inconsistency; eaver[0] is NULL");
+    GMX_RELEASE_ASSERT(eaver[0] != nullptr, "Option setting inconsistency; eaver[0] is NULL");
 
     switch (eaver[0][0])
     {
@@ -527,7 +527,7 @@ int gmx_densmap(int argc, char *argv[])
         gmx_ffclose(fp);
     }
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
 
     return 0;
 }
index 57bc3e95274e956ce79047b3172712db36d7dd9f..6aaf4b291df227ddca3201ff9418a3fa30e0ee8c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -115,14 +115,14 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
  * grpn         - group number in index
  */
     t_trxstatus *status;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
     matrix       box;                    /* Box - 3x3 -each step*/
     rvec        *x0;                     /* List of Coord without PBC*/
     int          i, j,                   /* loop indices, checks etc*/
                  ax1     = 0, ax2 = 0,   /* tangent directions */
                  framenr = 0,            /* frame number in trajectory*/
                  slicex, slicey, slicez; /*slice # of x y z position */
-    real ***Densslice = NULL;            /* Density-slice in one frame*/
+    real ***Densslice = nullptr;         /* Density-slice in one frame*/
     real    dscale;                      /*physical scaling factor*/
     real    t, x, y, z;                  /* time and coordinates*/
     rvec    bbww;
@@ -173,7 +173,7 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
     /*Initialize Densdevel and PBC-remove*/
     gpbc = gmx_rmpbc_init(&top->idef, ePBC, top->atoms.nr);
 
-    *Densdevel = NULL;
+    *Densdevel = nullptr;
 
     do
     {
@@ -184,7 +184,7 @@ static void density_in_time (const char *fn, int **index, int gnx[], real bw, re
         /*Reset Densslice every nsttblock steps*/
         /* The first conditional is for clang to understand that this branch is
          * always taken the first time. */
-        if (Densslice == NULL || framenr % nsttblock == 0)
+        if (Densslice == nullptr || framenr % nsttblock == 0)
         {
             snew(Densslice, *xslices);
             for (i = 0; i < *xslices; i++)
@@ -360,11 +360,11 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
     real         *sigma1, *sigma2;
     double        beginfit1[4];
     double        beginfit2[4];
-    double       *fit1 = NULL, *fit2 = NULL;
+    double       *fit1 = nullptr, *fit2 = nullptr;
     const double *avgfit1;
     const double *avgfit2;
     const real    onehalf = 1.00/2.00;
-    t_interf   ***int1    = NULL, ***int2 = NULL; /*Interface matrices [t][x,y] - last index in row-major order*/
+    t_interf   ***int1    = nullptr, ***int2 = nullptr; /*Interface matrices [t][x,y] - last index in row-major order*/
     /*Create int1(t,xy) and int2(t,xy) arrays with correct number of interf_t elements*/
     xysize = xslices*yslices;
     snew(int1, tblocks);
@@ -487,9 +487,9 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
         /*Fit average density in z over whole trajectory to obtain tentative fit-parameters in fit1 and fit2*/
 
         /*Fit 1st half of box*/
-        do_lmfit(zslices, zDensavg, sigma1, binwidth, NULL, startpoint, splitpoint, oenv, FALSE, effnERF, beginfit1, 8, NULL);
+        do_lmfit(zslices, zDensavg, sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE, effnERF, beginfit1, 8, nullptr);
         /*Fit 2nd half of box*/
-        do_lmfit(zslices, zDensavg, sigma2, binwidth, NULL, splitpoint, endpoint, oenv, FALSE, effnERF, beginfit2, 8, NULL);
+        do_lmfit(zslices, zDensavg, sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE, effnERF, beginfit2, 8, nullptr);
 
         /*Initialise the const arrays for storing the average fit parameters*/
         avgfit1 = beginfit1;
@@ -513,10 +513,10 @@ static void interfaces_txy (real ****Densmap, int xslices, int yslices, int zsli
                         fit2[k] = avgfit2[k];
                     }
                     /*Now fit and store in structures in row-major order int[n][i][j]*/
-                    do_lmfit(zslices, Densmap[n][i][j], sigma1, binwidth, NULL, startpoint, splitpoint, oenv, FALSE, effnERF, fit1, 0, NULL);
+                    do_lmfit(zslices, Densmap[n][i][j], sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE, effnERF, fit1, 0, nullptr);
                     int1[n][j+(yslices*i)]->Z = fit1[2];
                     int1[n][j+(yslices*i)]->t = fit1[3];
-                    do_lmfit(zslices, Densmap[n][i][j], sigma2, binwidth, NULL, splitpoint, endpoint, oenv, FALSE, effnERF, fit2, 0, NULL);
+                    do_lmfit(zslices, Densmap[n][i][j], sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE, effnERF, fit2, 0, nullptr);
                     int2[n][j+(yslices*i)]->Z = fit2[2];
                     int2[n][j+(yslices*i)]->t = fit2[3];
                 }
@@ -687,11 +687,11 @@ int gmx_densorder(int argc, char *argv[])
     static gmx_bool    b1d      = FALSE;
     static int         nlevels  = 100;
     /*Densitymap - Densmap[t][x][y][z]*/
-    real           ****Densmap = NULL;
+    real           ****Densmap = nullptr;
     /* Surfaces surf[t][surf_x,surf_y]*/
     t_interf        ***surf1, ***surf2;
 
-    static const char *meth[] = {NULL, "bisect", "functional", NULL};
+    static const char *meth[] = {nullptr, "bisect", "functional", nullptr};
     int                eMeth;
 
     char             **graphfiles, **rawfiles, **spectra; /* Filenames for xpm-surface maps, rawdata and powerspectra */
@@ -722,11 +722,11 @@ int gmx_densorder(int argc, char *argv[])
 
 
     t_filenm fnm[] = {
-        { efTPR, "-s",  NULL, ffREAD },               /* this is for the topology */
-        { efTRX, "-f", NULL, ffREAD },                /* and this for the trajectory */
-        { efNDX, "-n", NULL, ffREAD},                 /* this is to select groups */
+        { efTPR, "-s",  nullptr, ffREAD },            /* this is for the topology */
+        { efTRX, "-f", nullptr, ffREAD },             /* and this for the trajectory */
+        { efNDX, "-n", nullptr, ffREAD},              /* this is to select groups */
         { efDAT, "-o", "Density4D", ffOPTWR},         /* This is for outputting the entire 4D densityfield in binary format */
-        { efOUT, "-or", NULL, ffOPTWRMULT},           /* This is for writing out the entire information in the t_interf arrays */
+        { efOUT, "-or", nullptr, ffOPTWRMULT},        /* This is for writing out the entire information in the t_interf arrays */
         { efXPM, "-og", "interface", ffOPTWRMULT},    /* This is for writing out the interface meshes - one xpm-file per tblock*/
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* This is for the trajectory averaged Fourier-spectra*/
     };
@@ -736,7 +736,7 @@ int gmx_densorder(int argc, char *argv[])
     /* This is the routine responsible for adding default options,
      * calling the X/motif interface, etc. */
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index c9d4bb53de7afff883d10b10935feced9c8ffaf1..11cd32e5f9ce82e3307b0807a0a7725059f2d777 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -133,7 +133,7 @@ real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], r
     }
 
     tmpfp        = gmx_ffopen("integral_smth.xvg", "w");
-    integralSmth = print_and_integrate(tmpfp, nx, x[1]-x[0], combined, NULL, 1);
+    integralSmth = print_and_integrate(tmpfp, nx, x[1]-x[0], combined, nullptr, 1);
     printf("SMOOTH integral = %10.5e\n", integralSmth);
 
     dy[0] = (combined[1]-combined[0])/(x[1]-x[0]);
@@ -314,7 +314,7 @@ int gmx_dielectric(int argc, char *argv[])
     };
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -389,10 +389,10 @@ int gmx_dielectric(int argc, char *argv[])
     snew(y[4], nx);
     snew(y[5], nx);
 
-    integral = print_and_integrate(NULL, calc_nbegin(nx, y[0], tbegin),
-                                   dt, y[1], NULL, 1);
+    integral = print_and_integrate(nullptr, calc_nbegin(nx, y[0], tbegin),
+                                   dt, y[1], nullptr, 1);
     integral += do_lmfit(nx, y[1], y[2], dt, y[0], tbegin, tend,
-                         oenv, TRUE, eFitFn, fitparms, fix, NULL);
+                         oenv, TRUE, eFitFn, fitparms, fix, nullptr);
     for (i = 0; i < nx; i++)
     {
         y[3][i] = fit_function(eFitFn, fitparms, y[0][i]);
@@ -429,7 +429,7 @@ int gmx_dielectric(int argc, char *argv[])
             nx-1, y[0], y[5], eps0, epsRF, oenv);
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy");
-    do_view(oenv, opt2fn("-c", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-c", NFILE, fnm), nullptr);
     do_view(oenv, opt2fn("-d", NFILE, fnm), "-nxy");
 
     return 0;
index f6654953db1a064c2c0ad7c15b047c425da187d4..fc19a482e9ed2cb37b9339e3b2ab5cabd81438d1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -93,9 +93,9 @@ static t_gkrbin *mk_gkrbin(real radius, real rcmax, gmx_bool bPhi, int ndegrees)
 
     snew(gb, 1);
 
-    if ((ptr = getenv("GMX_DIPOLE_SPACING")) != NULL)
+    if ((ptr = getenv("GMX_DIPOLE_SPACING")) != nullptr)
     {
-        double bw = strtod(ptr, NULL);
+        double bw = strtod(ptr, nullptr);
         gb->spacing = bw;
     }
     else
@@ -131,7 +131,7 @@ static void done_gkrbin(t_gkrbin **gb)
     sfree((*gb)->elem);
     sfree((*gb)->count);
     sfree((*gb));
-    *gb = NULL;
+    *gb = nullptr;
 }
 
 static void add2gkr(t_gkrbin *gb, real r, real cosa, real phi)
@@ -178,7 +178,7 @@ static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
                    int mindex[], rvec x[], rvec mu[],
                    int ePBC, const matrix box, const t_atom *atom, const int *nAtom)
 {
-    static rvec *xcm[2] = { NULL, NULL};
+    static rvec *xcm[2] = { nullptr, nullptr};
     int          gi, gj, j0, j1, i, j, k, n, grp0, grp1;
     real         qtot, q, cosa, rr, phi;
     rvec         dx;
@@ -779,14 +779,14 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
     };
 #define NLEGADIP asize(leg_adip)
 
-    FILE          *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
-    FILE          *dip3d = NULL, *adip = NULL;
-    rvec          *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
-    t_gkrbin      *gkrbin = NULL;
-    gmx_enxnm_t   *enm    = NULL;
+    FILE          *outdd, *outmtot, *outaver, *outeps, *caver = nullptr;
+    FILE          *dip3d = nullptr, *adip = nullptr;
+    rvec          *x, *dipole = nullptr, mu_t, quad, *dipsp = nullptr;
+    t_gkrbin      *gkrbin = nullptr;
+    gmx_enxnm_t   *enm    = nullptr;
     t_enxframe    *fr;
     int            nframes = 1000, nre, timecheck = 0, ncolour = 0;
-    ener_file_t    fmu     = NULL;
+    ener_file_t    fmu     = nullptr;
     int            i, n, m, natom = 0, gnx_tot, teller, tel3;
     t_trxstatus   *status;
     int           *dipole_bin, ndipbin, ibin, iVol, idim = -1;
@@ -798,13 +798,13 @@ static void do_dip(const t_topology *top, int ePBC, real volume,
     double         M_diff = 0, epsilon, invtel, vol_aver;
     double         mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
     double         M[3], M2[3], M4[3], Gk = 0, g_k = 0;
-    gmx_stats_t   *Qlsq, mulsq, muframelsq = NULL;
+    gmx_stats_t   *Qlsq, mulsq, muframelsq = nullptr;
     ivec           iMu;
-    real         **muall        = NULL;
-    rvec          *slab_dipoles = NULL;
-    const t_atom  *atom         = NULL;
-    const t_block *mols         = NULL;
-    gmx_rmpbc_t    gpbc         = NULL;
+    real         **muall        = nullptr;
+    rvec          *slab_dipoles = nullptr;
+    const t_atom  *atom         = nullptr;
+    const t_block *mols         = nullptr;
+    gmx_rmpbc_t    gpbc         = nullptr;
 
     gnx_tot = gnx[0];
     if (ncos > 1)
@@ -1543,7 +1543,7 @@ int gmx_dipoles(int argc, char *argv[])
     real              mu_max     = 5, mu_aver = -1, rcmax = 0;
     real              epsilonRF  = 0.0, temp = 300;
     gmx_bool          bPairs     = TRUE, bPhi = FALSE, bQuad = FALSE;
-    const char       *corrtype[] = {NULL, "none", "mol", "molsep", "total", NULL};
+    const char       *corrtype[] = {nullptr, "none", "mol", "molsep", "total", nullptr};
     const char       *axtitle    = "Z";
     int               nslices    = 10; /* nr of slices defined       */
     int               skip       = 0, nFA = 0, nFB = 0, ncos = 1;
@@ -1588,13 +1588,13 @@ int gmx_dipoles(int argc, char *argv[])
     int              *gnx;
     int               nFF[2];
     int             **grpindex;
-    char            **grpname = NULL;
+    char            **grpname = nullptr;
     gmx_bool          bGkr, bMU, bSlab;
     t_filenm          fnm[] = {
-        { efEDR, "-en", NULL,         ffOPTRD },
-        { efTRX, "-f", NULL,           ffREAD },
-        { efTPR, NULL, NULL,           ffREAD },
-        { efNDX, NULL, NULL,           ffOPTRD },
+        { efEDR, "-en", nullptr,         ffOPTRD },
+        { efTRX, "-f", nullptr,           ffREAD },
+        { efTPR, nullptr, nullptr,           ffREAD },
+        { efNDX, nullptr, nullptr,           ffOPTRD },
         { efXVG, "-o",   "Mtot",       ffWRITE },
         { efXVG, "-eps", "epsilon",    ffWRITE },
         { efXVG, "-a",   "aver",       ffWRITE },
@@ -1618,7 +1618,7 @@ int gmx_dipoles(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -1668,8 +1668,8 @@ int gmx_dipoles(int argc, char *argv[])
     }
 
     snew(top, 1);
-    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), NULL, box,
-                        &natoms, NULL, NULL, top);
+    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), nullptr, box,
+                        &natoms, nullptr, nullptr, top);
 
     snew(gnx, ncos);
     snew(grpname, ncos);
index 1248084f35d25c88ff356b6fd871d381dcf5ef7d..31c04743be8d19fe8bbe6378a445b2ccc61ee68d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,7 +81,7 @@ typedef struct {
     real v;
 } t_toppop;
 
-t_toppop *top  = NULL;
+t_toppop *top  = nullptr;
 int       ntop = 0;
 
 typedef struct {
@@ -205,8 +205,8 @@ static void check_viol(FILE *log,
         while (((i+n) < disres->nr) &&
                (forceparams[forceatoms[i+n]].disres.label == label));
 
-        calc_disres_R_6(NULL, n, &forceatoms[i],
-                        (const rvec*)x, pbc, fcd, NULL);
+        calc_disres_R_6(nullptr, n, &forceatoms[i],
+                        (const rvec*)x, pbc, fcd, nullptr);
 
         if (fcd->disres.Rt_6[0] <= 0)
         {
@@ -223,7 +223,7 @@ static void check_viol(FILE *log,
         snew(fshift, SHIFTS);
         interaction_function[F_DISRES].ifunc(n, &forceatoms[i], forceparams,
                                              (const rvec*)x, f, fshift,
-                                             pbc, g, lam, &dvdl, NULL, fcd, NULL);
+                                             pbc, g, lam, &dvdl, nullptr, fcd, nullptr);
         sfree(fshift);
         viol = fcd->disres.sumviol;
 
@@ -540,7 +540,7 @@ static void dump_disre_matrix(const char *fn, t_dr_result *dr, int ndr,
     real     **matrix, *t_res, hi, *w_dr, rav, rviol;
     t_rgb      rlo = { 1, 1, 1 };
     t_rgb      rhi = { 0, 0, 0 };
-    if (fn == NULL)
+    if (fn == nullptr)
     {
         return;
     }
@@ -689,46 +689,46 @@ int gmx_disre(int argc, char *argv[])
           "Use inverse third power averaging or linear for matrix output" }
     };
 
-    FILE             *out = NULL, *aver = NULL, *numv = NULL, *maxxv = NULL, *xvg = NULL;
+    FILE             *out = nullptr, *aver = nullptr, *numv = nullptr, *maxxv = nullptr, *xvg = nullptr;
     t_tpxheader       header;
     gmx_mtop_t        mtop;
     rvec             *xtop;
     gmx_localtop_t   *top;
-    t_atoms          *atoms = NULL;
+    t_atoms          *atoms = nullptr;
     t_fcdata          fcd;
     t_nrnb            nrnb;
     t_graph          *g;
     int               ntopatoms, natoms, i, j, kkk;
     t_trxstatus      *status;
     real              t;
-    rvec             *x, *xav = NULL;
+    rvec             *x, *xav = nullptr;
     rvec4            *f;
     matrix            box;
     gmx_bool          bPDB;
     int               isize;
-    int              *index = NULL, *ind_fit = NULL;
+    int              *index = nullptr, *ind_fit = nullptr;
     char             *grpname;
-    t_cluster_ndx    *clust = NULL;
-    t_dr_result       dr, *dr_clust = NULL;
+    t_cluster_ndx    *clust = nullptr;
+    t_dr_result       dr, *dr_clust = nullptr;
     char            **leg;
-    real             *vvindex = NULL, *w_rls = NULL;
+    real             *vvindex = nullptr, *w_rls = nullptr;
     t_mdatoms        *mdatoms;
     t_pbc             pbc, *pbc_null;
     int               my_clust;
     FILE             *fplog;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTPR, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
         { efXVG, "-ds", "drsum",  ffWRITE },
         { efXVG, "-da", "draver", ffWRITE },
         { efXVG, "-dn", "drnum",  ffWRITE },
         { efXVG, "-dm", "drmax",  ffWRITE },
         { efXVG, "-dr", "restr",  ffWRITE },
         { efLOG, "-l",  "disres", ffWRITE },
-        { efNDX, NULL,  "viol",   ffOPTRD },
+        { efNDX, nullptr,  "viol",   ffOPTRD },
         { efPDB, "-q",  "viol",   ffOPTWR },
         { efNDX, "-c",  "clust",  ffOPTRD },
         { efXPM, "-x",  "matrix", ffOPTWR }
@@ -736,7 +736,7 @@ int gmx_disre(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -753,7 +753,7 @@ int gmx_disre(int argc, char *argv[])
 
     read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &header, FALSE);
     snew(xtop, header.natoms);
-    read_tpx(ftp2fn(efTPR, NFILE, fnm), ir, box, &ntopatoms, xtop, NULL, &mtop);
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), ir, box, &ntopatoms, xtop, nullptr, &mtop);
     bPDB = opt2bSet("-q", NFILE, fnm);
     if (bPDB)
     {
@@ -769,7 +769,7 @@ int gmx_disre(int argc, char *argv[])
         snew(atoms, 1);
         *atoms = gmx_mtop_global_atoms(&mtop);
 
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -778,8 +778,8 @@ int gmx_disre(int argc, char *argv[])
 
     top = gmx_mtop_generate_local_top(&mtop, ir->efep != efepNO);
 
-    g        = NULL;
-    pbc_null = NULL;
+    g        = nullptr;
+    pbc_null = nullptr;
     if (ir->ePBC != epbcNONE)
     {
         if (ir->bPeriodicMols)
@@ -815,7 +815,7 @@ int gmx_disre(int argc, char *argv[])
     }
 
     ir->dr_tau = 0.0;
-    init_disres(fplog, &mtop, ir, NULL, &fcd, NULL, FALSE);
+    init_disres(fplog, &mtop, ir, nullptr, &fcd, nullptr, FALSE);
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
     snew(f, 5*natoms);
@@ -843,7 +843,7 @@ int gmx_disre(int argc, char *argv[])
     }
 
     mdatoms = init_mdatoms(fplog, &mtop, ir->efep != efepNO);
-    atoms2md(&mtop, ir, -1, NULL, mtop.natoms, mdatoms);
+    atoms2md(&mtop, ir, -1, nullptr, mtop.natoms, mdatoms);
     update_mdatoms(mdatoms, ir->fepvals->init_lambda);
     init_nrnb(&nrnb);
     if (ir->ePBC != epbcNONE)
@@ -886,7 +886,7 @@ int gmx_disre(int argc, char *argv[])
         }
         if (bPDB)
         {
-            reset_x(atoms->nr, ind_fit, atoms->nr, NULL, x, w_rls);
+            reset_x(atoms->nr, ind_fit, atoms->nr, nullptr, x, w_rls);
             do_fit(atoms->nr, w_rls, x, x);
             if (j == 0)
             {
@@ -934,12 +934,12 @@ int gmx_disre(int argc, char *argv[])
     {
         dump_stats(fplog, j, fcd.disres.nres, &(top->idef.il[F_DISRES]),
                    top->idef.iparams, &dr, isize, index,
-                   bPDB ? atoms : NULL);
+                   bPDB ? atoms : nullptr);
         if (bPDB)
         {
             write_sto_conf(opt2fn("-q", NFILE, fnm),
                            "Coloured by average violation in Angstrom",
-                           atoms, xav, NULL, ir->ePBC, box);
+                           atoms, xav, nullptr, ir->ePBC, box);
         }
         dump_disre_matrix(opt2fn_null("-x", NFILE, fnm), &dr, fcd.disres.nres,
                           j, &top->idef, &mtop, max_dr, nlevels, bThird);
index f41182e48a5cecfad06423fd2ebb19ddc7756c89..f10286b1421f4aca09f8271330d981829943ab06 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,7 +85,7 @@ static int strip_dssp(char *dsspfile, int nres,
     {
         fgets2(buf, STRLEN, tapeout);
     }
-    while (std::strstr(buf, "KAPPA") == NULL);
+    while (std::strstr(buf, "KAPPA") == nullptr);
     if (bFirst)
     {
         /* Since we also have empty lines in the dssp output (temp) file,
@@ -101,7 +101,7 @@ static int strip_dssp(char *dsspfile, int nres,
     nresidues = 0;
     naccf     = 0;
     naccb     = 0;
-    for (nr = 0; (fgets2(buf, STRLEN, tapeout) != NULL); nr++)
+    for (nr = 0; (fgets2(buf, STRLEN, tapeout) != nullptr); nr++)
     {
         if (buf[13] == '!') /* Chain separator line has '!' at pos. 13 */
         {
@@ -116,7 +116,7 @@ static int strip_dssp(char *dsspfile, int nres,
         buf[39] = '\0';
 
         /* Only calculate solvent accessible area if needed */
-        if ((NULL != acc) && (buf[13] != '!'))
+        if ((nullptr != acc) && (buf[13] != '!'))
         {
             sscanf(&(buf[34]), "%d", &iacc);
             acc[nr] = iacc;
@@ -140,7 +140,7 @@ static int strip_dssp(char *dsspfile, int nres,
 
     if (bFirst)
     {
-        if (0 != acc)
+        if (nullptr != acc)
         {
             fprintf(stderr, "%d residues were classified as hydrophobic and %d as hydrophilic.\n", naccb, naccf);
         }
@@ -156,8 +156,8 @@ static int strip_dssp(char *dsspfile, int nres,
         {
             mat->axis_y[i] = i+1;
         }
-        mat->axis_x = NULL;
-        mat->matrix = NULL;
+        mat->axis_x = nullptr;
+        mat->matrix = nullptr;
         xsize       = 0;
         frame       = 0;
         bFirst      = FALSE;
@@ -288,7 +288,7 @@ void prune_ss_legend(t_matrix *mat)
     }
 
     newnmap = 0;
-    newmap  = NULL;
+    newmap  = nullptr;
     for (i = 0; i < mat->nmap; i++)
     {
         newnum[i] = -1;
@@ -505,17 +505,17 @@ int gmx_do_dssp(int argc, char *argv[])
     int               *index;
     rvec              *xp, *x;
     int               *average_area;
-    real             **accr, *accr_ptr = NULL, *av_area, *norm_av_area;
+    real             **accr, *accr_ptr = nullptr, *av_area, *norm_av_area;
     char               pdbfile[32], tmpfile[32];
     char               dssp[256];
     const char        *dptr;
     gmx_output_env_t  *oenv;
-    gmx_rmpbc_t        gpbc = NULL;
+    gmx_rmpbc_t        gpbc = nullptr;
 
     t_filenm           fnm[] = {
-        { efTRX, "-f",   NULL,      ffREAD },
-        { efTPS, NULL,   NULL,      ffREAD },
-        { efNDX, NULL,   NULL,      ffOPTRD },
+        { efTRX, "-f",   nullptr,      ffREAD },
+        { efTPS, nullptr,   nullptr,      ffREAD },
+        { efNDX, nullptr,   nullptr,      ffOPTRD },
         { efDAT, "-ssdump", "ssdump", ffOPTWR },
         { efMAP, "-map", "ss",      ffLIBRD },
         { efXPM, "-o",   "ss",      ffWRITE },
@@ -528,7 +528,7 @@ int gmx_do_dssp(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -538,7 +538,7 @@ int gmx_do_dssp(int argc, char *argv[])
     fnAArea    = opt2fn_null("-aa", NFILE, fnm);
     bDoAccSurf = (fnArea || fnTArea || fnAArea);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp, nullptr, box, FALSE);
     atoms = &(top.atoms);
     check_oo(atoms);
     bPhbres = bPhobics(atoms);
@@ -558,11 +558,11 @@ int gmx_do_dssp(int argc, char *argv[])
 
     std::strcpy(pdbfile, "ddXXXXXX");
     gmx_tmpnam(pdbfile);
-    if ((tmpf = fopen(pdbfile, "w")) == NULL)
+    if ((tmpf = fopen(pdbfile, "w")) == nullptr)
     {
         sprintf(pdbfile, "%ctmp%cfilterXXXXXX", DIR_SEPARATOR, DIR_SEPARATOR);
         gmx_tmpnam(pdbfile);
-        if ((tmpf = fopen(pdbfile, "w")) == NULL)
+        if ((tmpf = fopen(pdbfile, "w")) == nullptr)
         {
             gmx_fatal(FARGS, "Can not open tmp file %s", pdbfile);
         }
@@ -574,11 +574,11 @@ int gmx_do_dssp(int argc, char *argv[])
 
     std::strcpy(tmpfile, "ddXXXXXX");
     gmx_tmpnam(tmpfile);
-    if ((tmpf = fopen(tmpfile, "w")) == NULL)
+    if ((tmpf = fopen(tmpfile, "w")) == nullptr)
     {
         sprintf(tmpfile, "%ctmp%cfilterXXXXXX", DIR_SEPARATOR, DIR_SEPARATOR);
         gmx_tmpnam(tmpfile);
-        if ((tmpf = fopen(tmpfile, "w")) == NULL)
+        if ((tmpf = fopen(tmpfile, "w")) == nullptr)
         {
             gmx_fatal(FARGS, "Can not open tmp file %s", tmpfile);
         }
@@ -588,7 +588,7 @@ int gmx_do_dssp(int argc, char *argv[])
         fclose(tmpf);
     }
 
-    if ((dptr = getenv("DSSP")) == NULL)
+    if ((dptr = getenv("DSSP")) == nullptr)
     {
         dptr = "/usr/local/bin/dssp";
     }
@@ -623,10 +623,10 @@ int gmx_do_dssp(int argc, char *argv[])
     }
     else
     {
-        fTArea = NULL;
+        fTArea = nullptr;
     }
 
-    mat.map  = NULL;
+    mat.map  = nullptr;
     mat.nmap = readcmap(opt2fn("-map", NFILE, fnm), &(mat.map));
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
@@ -642,7 +642,7 @@ int gmx_do_dssp(int argc, char *argv[])
     snew(average_area, atoms->nres);
     snew(av_area, atoms->nres);
     snew(norm_av_area, atoms->nres);
-    accr  = NULL;
+    accr  = nullptr;
     naccr = 0;
 
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, natoms);
@@ -660,7 +660,7 @@ int gmx_do_dssp(int argc, char *argv[])
         }
         gmx_rmpbc(gpbc, natoms, box, x);
         tapein = gmx_ffopen(pdbfile, "w");
-        write_pdbfile_indexed(tapein, NULL, atoms, x, ePBC, box, ' ', -1, gnx, index, NULL, TRUE);
+        write_pdbfile_indexed(tapein, nullptr, atoms, x, ePBC, box, ' ', -1, gnx, index, nullptr, TRUE);
         gmx_ffclose(tapein);
 
         if (0 != system(dssp))
index 3845ba98ca151538af70ed41abba1208d04ae759..072999b613a6c79732a77b4827e1826b2201f103 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -307,9 +307,9 @@ int gmx_dos(int argc, char *argv[])
     };
 
     t_filenm            fnm[] = {
-        { efTRN, "-f",    NULL,    ffREAD  },
-        { efTPR, "-s",    NULL,    ffREAD  },
-        { efNDX, NULL,    NULL,    ffOPTRD },
+        { efTRN, "-f",    nullptr,    ffREAD  },
+        { efTPR, "-s",    nullptr,    ffREAD  },
+        { efNDX, nullptr,    nullptr,    ffOPTRD },
         { efXVG, "-vacf", "vacf",  ffWRITE },
         { efXVG, "-mvacf", "mvacf", ffWRITE },
         { efXVG, "-dos",  "dos",   ffWRITE },
@@ -339,7 +339,7 @@ int gmx_dos(int argc, char *argv[])
     please_cite(fplog, "Pascal2011a");
     please_cite(fplog, "Caleman2011b");
 
-    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPR, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     /* Handle index groups */
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &grpNatoms, &index, &grpname);
@@ -359,7 +359,7 @@ int gmx_dos(int argc, char *argv[])
     snew(c1, gnx);
     for (i = 0; (i < gnx); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRN, NFILE, fnm), &fr, TRX_NEED_V);
@@ -429,7 +429,7 @@ int gmx_dos(int argc, char *argv[])
     normalizeAutocorrelation = opt2parg_bool("-normalize", npargs, ppa);
 
     /* Note that we always disable normalization here, regardless of user settings */
-    low_do_autocorr(NULL, oenv, NULL, nframes, gnx, nframes, c1, dt, eacNormal, 0, FALSE,
+    low_do_autocorr(nullptr, oenv, nullptr, nframes, gnx, nframes, c1, dt, eacNormal, 0, FALSE,
                     FALSE, FALSE, -1, -1, 0);
     snew(dos, DOS_NR);
     for (j = 0; (j < DOS_NR); j++)
@@ -506,7 +506,7 @@ int gmx_dos(int argc, char *argv[])
         }
     }
     /* Normalize it */
-    dostot = evaluate_integral(nframes/4, nu, dos[DOS], NULL, nframes/4, &stddev);
+    dostot = evaluate_integral(nframes/4, nu, dos[DOS], nullptr, nframes/4, &stddev);
     if (bNormalizeDos)
     {
         for (j = 0; (j < nframes/4); j++)
@@ -585,14 +585,14 @@ int gmx_dos(int argc, char *argv[])
         dos[DOS_E][j]  = (dos[DOS_DIFF][j]*wEdiff +
                           dos[DOS_SOLID][j]*wEsolid(nu[j], beta));
     }
-    DiffCoeff = evaluate_integral(nframes/2, tt, dos[VACF], NULL, nframes/2, &stddev);
+    DiffCoeff = evaluate_integral(nframes/2, tt, dos[VACF], nullptr, nframes/2, &stddev);
     DiffCoeff = 1000*DiffCoeff/3.0;
     fprintf(fplog, "Diffusion coefficient from VACF %g 10^-5 cm^2/s\n",
             DiffCoeff);
     fprintf(fplog, "Diffusion coefficient from DoS %g 10^-5 cm^2/s\n",
             1000*DoS0/(12*tmass*beta));
 
-    cP = BOLTZ * evaluate_integral(nframes/4, nu, dos[DOS_CP], NULL,
+    cP = BOLTZ * evaluate_integral(nframes/4, nu, dos[DOS_CP], nullptr,
                                    nframes/4, &stddev);
     fprintf(fplog, "Heat capacity %g J/mol K\n", 1000*cP/Nmol);
     fprintf(fplog, "\nArrivederci!\n");
index b7af6b5352810d4863954a78e24202f316b749dc..e9c28c71946f384d9c8b8de612bdfac2471d8567 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -87,8 +87,8 @@ int gmx_dyecoupl(int argc, char *argv[])
 
     t_filenm fnm[] =
     {
-        { efTRX, "-f", NULL, ffREAD },
-        { efNDX, NULL, NULL, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffREAD },
         { efXVG, "-ot", "rkappa", ffOPTWR },
         { efXVG, "-oe", "insteff", ffOPTWR },
         { efDAT, "-o", "rkappa", ffOPTWR },
@@ -98,7 +98,7 @@ int gmx_dyecoupl(int argc, char *argv[])
 #define NFILE asize(fnm)
 
 
-    const char  *in_trajfile, *out_xvgrkfile = NULL, *out_xvginstefffile = NULL, *out_xvgrhistfile = NULL, *out_xvgkhistfile = NULL, *out_datfile = NULL;
+    const char  *in_trajfile, *out_xvgrkfile = nullptr, *out_xvginstefffile = nullptr, *out_xvgrhistfile = nullptr, *out_xvgkhistfile = nullptr, *out_datfile = nullptr;
     gmx_bool     bHaveFirstFrame, bHaveNextFrame, indexOK = TRUE;
     int          ndon, nacc;
     int         *donindex, *accindex;
@@ -115,10 +115,10 @@ int gmx_dyecoupl(int argc, char *argv[])
     /*we rely on PBC autodetection (...currently)*/
     int         ePBC = -1;
 
-    real       *rvalues = NULL, *kappa2values = NULL, *rhist = NULL, *khist = NULL;
-    t_pbc      *pbc     = NULL;
+    real       *rvalues = nullptr, *kappa2values = nullptr, *rhist = nullptr, *khist = nullptr;
+    t_pbc      *pbc     = nullptr;
     int         i, bin;
-    FILE       *rkfp = NULL, *rhfp = NULL, *khfp = NULL, *datfp = NULL, *iefp = NULL;
+    FILE       *rkfp = nullptr, *rhfp = nullptr, *khfp = nullptr, *datfp = nullptr, *iefp = nullptr;
     gmx_bool    bRKout, bRhistout, bKhistout, bDatout, bInstEffout, grident;
 
     const char *rkleg[2] = { "R", "\\f{Symbol}k\\f{}\\S2\\N" };
@@ -131,7 +131,7 @@ int gmx_dyecoupl(int argc, char *argv[])
     int         rkcount = 0, rblocksallocated = 0, kblocksallocated = 0;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_BEGIN | PCA_CAN_END | PCA_CAN_VIEW | PCA_TIME_UNIT,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -166,10 +166,10 @@ int gmx_dyecoupl(int argc, char *argv[])
     }
 
     printf("Select group with donor atom pairs defining the transition moment\n");
-    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
+    get_index(nullptr, ftp2fn_null(efNDX, NFILE, fnm), 1, &ndon, &donindex, &grpnm);
 
     printf("Select group with acceptor atom pairs defining the transition moment\n");
-    get_index(NULL, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
+    get_index(nullptr, ftp2fn_null(efNDX, NFILE, fnm), 1, &nacc, &accindex, &grpnm);
 
     /*check if groups are identical*/
     grident = TRUE;
index 362a783db12de13498fa72cfc2d00e12dc179dd6..720496b637bc30dd7a9a600502427736907e900c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -190,7 +190,7 @@ int gmx_dyndom(int argc, char *argv[])
     };
     int               i, j, natoms, isize;
     t_trxstatus      *status;
-    int              *index = NULL, *index_all;
+    int              *index = nullptr, *index_all;
     char             *grpname;
     real              angle, trans;
     rvec             *x, *v, *xout, *vout;
@@ -205,7 +205,7 @@ int gmx_dyndom(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -217,9 +217,9 @@ int gmx_dyndom(int argc, char *argv[])
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, nullptr, &x, &v, box, FALSE);
     t_atoms  &atoms = top->atoms;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
@@ -258,7 +258,7 @@ int gmx_dyndom(int argc, char *argv[])
             atoms.resinfo[atoms.atom[j].resind].chainid = label;
         }
 
-        write_trx(status, atoms.nr, index_all, &atoms, i, angle, box, xout, vout, NULL);
+        write_trx(status, atoms.nr, index_all, &atoms, i, angle, box, xout, vout, nullptr);
     }
     close_trx(status);
 
index 7973df30fd808937ee605b34089edf779d40f330..6eb46c47f29335cc55ef77be18aade0e9b27db48 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -359,7 +359,7 @@ void visualize_images(const char *fn, int ePBC, matrix box)
     }
     calc_triclinic_images(box, img + 1);
 
-    write_sto_conf(fn, "Images", &atoms, img, NULL, ePBC, box);
+    write_sto_conf(fn, "Images", &atoms, img, nullptr, ePBC, box);
 
     done_atom(&atoms);
     sfree(img);
@@ -492,7 +492,7 @@ static void renum_resnr(t_atoms *atoms, int isize, const int *index,
     resind_prev = -1;
     for (i = 0; i < isize; i++)
     {
-        resind = atoms->atom[index == NULL ? i : index[i]].resind;
+        resind = atoms->atom[index == nullptr ? i : index[i]].resind;
         if (resind != resind_prev)
         {
             atoms->resinfo[resind].nr = resnr_start;
@@ -616,7 +616,7 @@ int gmx_editconf(int argc, char *argv[])
     { 0, 0, 0 }, targetvec   =
     { 0, 0, 0 };
     static const char *btype[] =
-    { NULL, "triclinic", "cubic", "dodecahedron", "octahedron", NULL },
+    { nullptr, "triclinic", "cubic", "dodecahedron", "octahedron", nullptr },
     *label             = "A";
     static rvec visbox =
     { 0, 0, 0 };
@@ -699,9 +699,9 @@ int gmx_editconf(int argc, char *argv[])
     FILE             *out;
     const char       *infile, *outfile;
     int               outftp, inftp, natom, i, j, n_bfac, itype, ntype;
-    double           *bfac    = NULL, c6, c12;
-    int              *bfac_nr = NULL;
-    t_topology       *top     = NULL;
+    double           *bfac    = nullptr, c6, c12;
+    int              *bfac_nr = nullptr;
+    t_topology       *top     = nullptr;
     char             *grpname, *sgrpname, *agrpname;
     int               isize, ssize, asize;
     int              *index, *sindex, *aindex;
@@ -717,9 +717,9 @@ int gmx_editconf(int argc, char *argv[])
     gmx_output_env_t *oenv;
     t_filenm          fnm[] =
     {
-        { efSTX, "-f", NULL, ffREAD },
-        { efNDX, "-n", NULL, ffOPTRD },
-        { efSTO, NULL, NULL, ffOPTWR },
+        { efSTX, "-f", nullptr, ffREAD },
+        { efNDX, "-n", nullptr, ffOPTRD },
+        { efSTO, nullptr, nullptr, ffOPTWR },
         { efPQR, "-mead", "mead", ffOPTWR },
         { efDAT, "-bf", "bfact", ffOPTRD }
     };
@@ -754,7 +754,7 @@ int gmx_editconf(int argc, char *argv[])
     bScale    = bScale || bRho;
     bCalcGeom = bCenter || bRotate || bOrient || bScale;
 
-    GMX_RELEASE_ASSERT(btype[0] != NULL, "Option setting inconsistency; btype[0] is NULL");
+    GMX_RELEASE_ASSERT(btype[0] != nullptr, "Option setting inconsistency; btype[0] is NULL");
 
     bCalcDiam = (btype[0][0] == 'c' || btype[0][0] == 'd' || btype[0][0] == 'o');
 
@@ -793,7 +793,7 @@ int gmx_editconf(int argc, char *argv[])
     read_tps_conf(infile, top_tmp, &ePBC, &x, &v, box, FALSE);
     t_atoms  &atoms = top_tmp->atoms;
     natom = atoms.nr;
-    if (atoms.pdbinfo == NULL)
+    if (atoms.pdbinfo == nullptr)
     {
         snew(atoms.pdbinfo, atoms.nr);
     }
@@ -820,7 +820,7 @@ int gmx_editconf(int argc, char *argv[])
 
     if (bMead || bGrasp || bCONECT)
     {
-        top = read_top(infile, NULL);
+        top = read_top(infile, nullptr);
     }
 
     if (bMead || bGrasp)
@@ -924,7 +924,7 @@ int gmx_editconf(int argc, char *argv[])
         else
         {
             ssize  = atoms.nr;
-            sindex = NULL;
+            sindex = nullptr;
         }
         diam = calc_geom(ssize, sindex, x, gc, rmin, rmax, bCalcDiam);
         rvec_sub(rmax, rmin, size);
@@ -962,7 +962,7 @@ int gmx_editconf(int argc, char *argv[])
         get_index(&atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpnames);
 
         /* Orient the principal axes along the coordinate axes */
-        orient_princ(&atoms, isize, index, natom, x, bHaveV ? v : NULL, NULL);
+        orient_princ(&atoms, isize, index, natom, x, bHaveV ? v : nullptr, nullptr);
         sfree(index);
         sfree(grpnames);
     }
@@ -1055,7 +1055,7 @@ int gmx_editconf(int argc, char *argv[])
         else
         {
             ssize  = atoms.nr;
-            sindex = NULL;
+            sindex = nullptr;
         }
         printf("Translating %d atoms (out of %d) by %g %g %g nm\n", ssize, natom,
                translation[XX], translation[YY], translation[ZZ]);
@@ -1097,7 +1097,7 @@ int gmx_editconf(int argc, char *argv[])
         }
     }
 
-    if ((btype[0] != NULL) && (bSetSize || bDist || (btype[0][0] == 't' && bSetAng)))
+    if ((btype[0] != nullptr) && (bSetSize || bDist || (btype[0][0] == 't' && bSetAng)))
     {
         ePBC = epbcXYZ;
         if (!(bSetSize || bDist))
@@ -1231,7 +1231,7 @@ int gmx_editconf(int argc, char *argv[])
     }
     else
     {
-        conect = NULL;
+        conect = nullptr;
     }
 
     if (bIndex)
@@ -1266,14 +1266,14 @@ int gmx_editconf(int argc, char *argv[])
         }
         else
         {
-            write_sto_conf_indexed(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box, isize, index);
+            write_sto_conf_indexed(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : nullptr, ePBC, box, isize, index);
         }
     }
     else
     {
         if (resnr_start >= 0)
         {
-            renum_resnr(&atoms, atoms.nr, NULL, resnr_start);
+            renum_resnr(&atoms, atoms.nr, nullptr, resnr_start);
         }
 
         if ((outftp == efPDB) || (outftp == efPQR))
@@ -1321,12 +1321,12 @@ int gmx_editconf(int argc, char *argv[])
         }
         else
         {
-            write_sto_conf(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : NULL, ePBC, box);
+            write_sto_conf(outfile, *top_tmp->name, &atoms, x, bHaveV ? v : nullptr, ePBC, box);
         }
     }
     gmx_atomprop_destroy(aps);
 
-    do_view(oenv, outfile, NULL);
+    do_view(oenv, outfile, nullptr);
 
     return 0;
 }
index 5c27bcb1c7b38cd47880e7d83ea925240157594f..6d47833172f5b9218bb56cec16555011baf77894 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ static int *select_it(int nre, gmx_enxnm_t *nm, int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -163,7 +163,7 @@ static int scan_ene_files(char **fnms, int nfiles,
     for (f = 0; f < nfiles; f++)
     {
         in  = open_enx(fnms[f], "r");
-        enm = NULL;
+        enm = nullptr;
         do_enxnms(in, &nre, &enm);
 
         if (f == 0)
@@ -191,7 +191,7 @@ static int scan_ene_files(char **fnms, int nfiles,
                 fprintf(stderr,
                         "\nContinue conversion using only the first %d terms (n/y)?\n"
                         "(you should be sure that the energy terms match)\n", nremin);
-                if (NULL == fgets(inputstring, STRLEN-1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN-1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input");
                 }
@@ -252,7 +252,7 @@ static void edit_files(char **fnms, int nfiles, real *readtime,
             ok = FALSE;
             do
             {
-                if (NULL == fgets(inputstring, STRLEN-1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN-1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input");
                 }
@@ -444,8 +444,8 @@ int gmx_eneconv(int argc, char *argv[])
     const char       *bugs[] = {
         "When combining trajectories the sigma and E^2 (necessary for statistics) are not updated correctly. Only the actual energy is correct. One thus has to compute statistics in another way."
     };
-    ener_file_t       in  = NULL, out = NULL;
-    gmx_enxnm_t      *enm = NULL;
+    ener_file_t       in  = nullptr, out = nullptr;
+    gmx_enxnm_t      *enm = nullptr;
 #if 0
     ener_file_t       in, out = NULL;
     gmx_enxnm_t      *enm = NULL;
@@ -455,7 +455,7 @@ int gmx_eneconv(int argc, char *argv[])
     t_energy         *ee_sum;
     gmx_int64_t       lastfilestep, laststep, startstep_file = 0;
     int               noutfr;
-    int               nre, nremax, this_nre, nfile, f, i, kkk, nset, *set = NULL;
+    int               nre, nremax, this_nre, nfile, f, i, kkk, nset, *set = nullptr;
     double            last_t;
     char            **fnms;
     real             *readtime, *settime, timestep, tadjust;
@@ -464,12 +464,12 @@ int gmx_eneconv(int argc, char *argv[])
     gmx_bool          bNewFile, bFirst, bNewOutput;
     gmx_output_env_t *oenv;
     gmx_bool          warned_about_dh = FALSE;
-    t_enxblock       *blocks          = NULL;
+    t_enxblock       *blocks          = nullptr;
     int               nblocks         = 0;
     int               nblocks_alloc   = 0;
 
     t_filenm          fnm[] = {
-        { efEDR, "-f", NULL,    ffRDMULT },
+        { efEDR, "-f", nullptr,    ffRDMULT },
         { efEDR, "-o", "fixed", ffWRITE  },
     };
 
@@ -549,7 +549,7 @@ int gmx_eneconv(int argc, char *argv[])
         bNewFile   = TRUE;
         bNewOutput = TRUE;
         in         = open_enx(fnms[f], "r");
-        enm        = NULL;
+        enm        = nullptr;
         do_enxnms(in, &this_nre, &enm);
         if (f == 0)
         {
index 6c10e09aa2c024a86186c3c5c7bbf7aa3ff9ce9f..23fd17953a70fe842a0f3edec324ce68de2624a4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -150,29 +150,29 @@ int gmx_enemat(int argc, char *argv[])
     ener_file_t       in;
     FILE             *out;
     int               timecheck = 0;
-    gmx_enxnm_t      *enm       = NULL;
+    gmx_enxnm_t      *enm       = nullptr;
     t_enxframe       *fr;
     int               teller = 0;
     real              sum;
     gmx_bool          bCont, bRef;
     gmx_bool          bCutmax, bCutmin;
-    real            **eneset, *time = NULL;
+    real            **eneset, *time = nullptr;
     int              *set, i, j, k, prevk, m = 0, n, nre, nset, nenergy;
-    char            **groups = NULL;
+    char            **groups = nullptr;
     char              groupname[255], fn[255];
     int               ngroups;
     t_rgb             rlo, rhi, rmid;
     real              emax, emid, emin;
     real           ***emat, **etot, *groupnr;
-    double            beta, expE, **e, *eaver, *efree = NULL, edum;
+    double            beta, expE, **e, *eaver, *efree = nullptr, edum;
     char              label[234];
-    char            **ereflines, **erefres = NULL;
-    real             *eref  = NULL, *edif = NULL;
+    char            **ereflines, **erefres = nullptr;
+    real             *eref  = nullptr, *edif = nullptr;
     int               neref = 0;
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efEDR, "-f", NULL, ffOPTRD },
+        { efEDR, "-f", nullptr, ffOPTRD },
         { efDAT, "-groups", "groups", ffREAD },
         { efDAT, "-eref",   "eref",   ffOPTRD },
         { efXPM, "-emat",   "emat",   ffWRITE },
@@ -181,7 +181,7 @@ int gmx_enemat(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -511,7 +511,7 @@ int gmx_enemat(int argc, char *argv[])
 
         out = xvgropen(ftp2fn(efXVG, NFILE, fnm), "Mean Energy", "Residue", "kJ/mol",
                        oenv);
-        xvgr_legend(out, 0, NULL, oenv);
+        xvgr_legend(out, 0, nullptr, oenv);
         j = 0;
         if (output_env_get_print_xvgr_codes(oenv))
         {
index d507bac7ef809b1b84c24186282d3fb7e764d844..a55123d77cce494d318c6e51ba42b893bd1f82d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -118,7 +118,7 @@ static int *select_it(int nre, char *nm[], int *nset)
     int      *set;
     gmx_bool  bVerbose = TRUE;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -186,9 +186,9 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     char       *ptr, buf[STRLEN];
     const char *fm4   = "%3d  %-14s";
     const char *fm2   = "%3d  %-34s";
-    char      **newnm = NULL;
+    char      **newnm = nullptr;
 
-    if ((getenv("GMX_ENER_VERBOSE")) != NULL)
+    if ((getenv("GMX_ENER_VERBOSE")) != nullptr)
     {
         bVerbose = FALSE;
     }
@@ -205,7 +205,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
     {
         newnm[k] = gmx_strdup(nm[k].name);
         /* Insert dashes in all the names */
-        while ((ptr = std::strchr(newnm[k], ' ')) != NULL)
+        while ((ptr = std::strchr(newnm[k], ' ')) != nullptr)
         {
             *ptr = '-';
         }
@@ -325,7 +325,7 @@ static int *select_by_name(int nre, gmx_enxnm_t *nm, int *nset)
                     }
                 }
                 /* Look for the first space, and remove spaces from there */
-                if ((ptr = std::strchr(ptr, ' ')) != NULL)
+                if ((ptr = std::strchr(ptr, ' ')) != nullptr)
                 {
                     trim(ptr);
                 }
@@ -366,7 +366,7 @@ static void get_dhdl_parms(const char *topnm, t_inputrec *ir)
     matrix      box;
 
     /* all we need is the ir to be able to write the label */
-    read_tpx(topnm, ir, box, &natoms, NULL, NULL, &mtop);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, &mtop);
 }
 
 static void get_orires_parms(const char *topnm, t_inputrec *ir,
@@ -380,7 +380,7 @@ static void get_orires_parms(const char *topnm, t_inputrec *ir,
     int             nb;
     matrix          box;
 
-    read_tpx(topnm, ir, box, &natoms, NULL, NULL, &mtop);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, &mtop);
     top = gmx_mtop_generate_local_top(&mtop, ir->efep != efepNO);
 
     ip       = top->idef.iparams;
@@ -425,7 +425,7 @@ static int get_bounds(const char *topnm,
     int             nb, label1;
     matrix          box;
 
-    read_tpx(topnm, ir, box, &natoms, NULL, NULL, mtop);
+    read_tpx(topnm, ir, box, &natoms, nullptr, nullptr, mtop);
     snew(*ltop, 1);
     top   = gmx_mtop_generate_local_top(mtop, ir->efep != efepNO);
     *ltop = top;
@@ -535,7 +535,7 @@ static void analyse_disre(const char *voutfn,    int nframes,
 
     /* Subtract bounds from distances, to calculate violations */
     calc_violations(violaver, violaver,
-                    nbounds, pair, bounds, NULL, &sumt, &sumaver);
+                    nbounds, pair, bounds, nullptr, &sumt, &sumaver);
 
 #ifdef DEBUG
     fprintf(stdout, "\nSum of violations averaged over simulation: %g nm\n",
@@ -957,7 +957,7 @@ static void remove_drift(int nset, int nbmin, int nbmax, real dt, enerdata_t *ed
         {
             delta = edat->s[i].slope*dt;
 
-            if (NULL != debug)
+            if (nullptr != debug)
             {
                 fprintf(debug, "slope for set %d is %g\n", i, edat->s[i].slope);
             }
@@ -1077,7 +1077,7 @@ static void calc_fluctuation_props(FILE *fp,
         fprintf(fp, "WARNING: Please verify that your simulations are converged and perform\n"
                 "a block-averaging error analysis (not implemented in g_energy yet)\n");
 
-        if (debug != NULL)
+        if (debug != nullptr)
         {
             if (varv != NOTSET)
             {
@@ -1145,10 +1145,10 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
     FILE           *fp;
     /* Check out the printed manual for equations! */
     double          Dt, aver, stddev, errest, delta_t, totaldrift;
-    enerdata_t     *esum = NULL;
+    enerdata_t     *esum = nullptr;
     real            integral, intBulk, Temp = 0, Pres = 0;
     real            pr_aver, pr_stddev, pr_errest;
-    double          beta = 0, expE, expEtot, *fee = NULL;
+    double          beta = 0, expE, expEtot, *fee = nullptr;
     gmx_int64_t     nsteps;
     int             nexact, nnotexact;
     int             i, j, nout;
@@ -1263,15 +1263,15 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn,
 
                 fee[i] = std::log(expE/edat->nframes)/beta + aver/nmol;
             }
-            if (std::strstr(leg[i], "empera") != NULL)
+            if (std::strstr(leg[i], "empera") != nullptr)
             {
                 Temp = aver;
             }
-            else if (std::strstr(leg[i], "olum") != NULL)
+            else if (std::strstr(leg[i], "olum") != nullptr)
             {
                 Vaver = aver;
             }
-            else if (std::strstr(leg[i], "essure") != NULL)
+            else if (std::strstr(leg[i], "essure") != nullptr)
             {
                 Pres = aver;
             }
@@ -1486,13 +1486,13 @@ static void fec(const char *ene2fn, const char *runavgfn,
     real         aver, beta;
     real       **eneset2;
     double       dE, sum;
-    gmx_enxnm_t *enm = NULL;
+    gmx_enxnm_t *enm = nullptr;
     t_enxframe  *fr;
     char         buf[22];
 
     /* read second energy file */
     snew(fr, 1);
-    enm = NULL;
+    enm = nullptr;
     enx = open_enx(ene2fn, "r");
     do_enxnms(enx, &(fr->nre), &enm);
 
@@ -1530,7 +1530,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
                         srenew(eneset2[i], maxenergy);
                     }
                 }
-                GMX_RELEASE_ASSERT(time != NULL, "trying to dereference NULL time pointer");
+                GMX_RELEASE_ASSERT(time != nullptr, "trying to dereference NULL time pointer");
 
                 if (fr->t != time[nenergy2])
                 {
@@ -1556,7 +1556,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
     nenergy = std::min(edat->nframes, nenergy2);
 
     /* calculate fe difference dF = -kT ln < exp(-(E_B-E_A)/kT) >_A */
-    fp = NULL;
+    fp = nullptr;
     if (runavgfn)
     {
         fp = xvgropen(runavgfn, "Running average free energy difference",
@@ -1608,8 +1608,8 @@ static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl,
     /* coll data */
     double       temp              = 0, start_time = 0, delta_time = 0, start_lambda = 0;
     static int   setnr             = 0;
-    double      *native_lambda_vec = NULL;
-    const char **lambda_components = NULL;
+    double      *native_lambda_vec = nullptr;
+    const char **lambda_components = nullptr;
     int          n_lambda_vec      = 0;
     bool         firstPass         = true;
 
@@ -1987,47 +1987,47 @@ int gmx_energy(int argc, char *argv[])
         "Volume",  "Pressure"
     };
 
-    FILE              *out     = NULL, *fp_pairs = NULL, *fort = NULL, *fodt = NULL, *foten = NULL;
-    FILE              *fp_dhdl = NULL;
+    FILE              *out     = nullptr, *fp_pairs = nullptr, *fort = nullptr, *fodt = nullptr, *foten = nullptr;
+    FILE              *fp_dhdl = nullptr;
     ener_file_t        fp;
     int                timecheck = 0;
     gmx_mtop_t         mtop;
-    gmx_localtop_t    *top = NULL;
+    gmx_localtop_t    *top = nullptr;
     enerdata_t         edat;
-    gmx_enxnm_t       *enm = NULL;
-    t_enxframe        *frame, *fr = NULL;
+    gmx_enxnm_t       *enm = nullptr;
+    t_enxframe        *frame, *fr = nullptr;
     int                cur = 0;
 #define NEXT (1-cur)
     int                nre, teller, teller_disre, nfr;
     gmx_int64_t        start_step;
     int                nor = 0, nex = 0, norfr = 0, enx_i = 0;
     real               start_t;
-    real              *bounds  = NULL, *violaver = NULL, *oobs = NULL, *orient = NULL, *odrms = NULL;
-    int               *index   = NULL, *pair = NULL, norsel = 0, *orsel = NULL, *or_label = NULL;
+    real              *bounds  = nullptr, *violaver = nullptr, *oobs = nullptr, *orient = nullptr, *odrms = nullptr;
+    int               *index   = nullptr, *pair = nullptr, norsel = 0, *orsel = nullptr, *or_label = nullptr;
     int                nbounds = 0, npairs;
     gmx_bool           bDisRe, bDRAll, bORA, bORT, bODA, bODR, bODT, bORIRE, bOTEN, bDHDL;
     gmx_bool           bFoundStart, bCont, bVisco;
     double             sum, sumaver, sumt, dbl;
-    double            *time = NULL;
+    double            *time = nullptr;
     real               Vaver;
-    int               *set     = NULL, i, j, k, nset, sss;
-    gmx_bool          *bIsEner = NULL;
+    int               *set     = nullptr, i, j, k, nset, sss;
+    gmx_bool          *bIsEner = nullptr;
     char             **pairleg, **odtleg, **otenleg;
-    char             **leg = NULL;
+    char             **leg = nullptr;
     const char        *anm_j, *anm_k, *resnm_j, *resnm_k;
     int                resnr_j, resnr_k;
     const char        *orinst_sub = "@ subtitle \"instantaneous\"\n";
     char               buf[256];
     gmx_output_env_t  *oenv;
-    t_enxblock        *blk       = NULL;
-    t_enxblock        *blk_disre = NULL;
+    t_enxblock        *blk       = nullptr;
+    t_enxblock        *blk_disre = nullptr;
     int                ndisre    = 0;
     int                dh_blocks = 0, dh_hists = 0, dh_samples = 0, dh_lambdas = 0;
 
     t_filenm           fnm[] = {
-        { efEDR, "-f",    NULL,      ffREAD  },
-        { efEDR, "-f2",   NULL,      ffOPTRD },
-        { efTPR, "-s",    NULL,      ffOPTRD },
+        { efEDR, "-f",    nullptr,      ffREAD  },
+        { efEDR, "-f2",   nullptr,      ffOPTRD },
+        { efTPR, "-s",    nullptr,      ffOPTRD },
         { efXVG, "-o",    "energy",  ffWRITE },
         { efXVG, "-viol", "violaver", ffOPTWR },
         { efXVG, "-pairs", "pairs",   ffOPTWR },
@@ -2050,7 +2050,7 @@ int gmx_energy(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -2172,7 +2172,7 @@ int gmx_energy(int argc, char *argv[])
             gmx_fatal(FARGS, "Printing averages can only be done when a single set is selected");
         }
 
-        time = NULL;
+        time = nullptr;
 
         if (bORIRE || bOTEN)
         {
@@ -2204,7 +2204,7 @@ int gmx_energy(int argc, char *argv[])
                 fprintf(stderr, "Select the orientation restraint labels you want (-1 is all)\n");
                 fprintf(stderr, "End your selection with 0\n");
                 j     = -1;
-                orsel = NULL;
+                orsel = nullptr;
                 do
                 {
                     j++;
@@ -2328,9 +2328,9 @@ int gmx_energy(int argc, char *argv[])
     edat.nsteps    = 0;
     edat.npoints   = 0;
     edat.nframes   = 0;
-    edat.step      = NULL;
-    edat.steps     = NULL;
-    edat.points    = NULL;
+    edat.step      = nullptr;
+    edat.steps     = nullptr;
+    edat.points    = nullptr;
     edat.bHaveSums = TRUE;
     snew(edat.s, nset);
 
@@ -2456,7 +2456,7 @@ int gmx_energy(int argc, char *argv[])
              * Define distance restraint legends. Can only be done after
              * the first frame has been read... (Then we know how many there are)
              */
-            blk_disre = find_block_id_enxframe(fr, enxDISRE, NULL);
+            blk_disre = find_block_id_enxframe(fr, enxDISRE, nullptr);
             if (bDisRe && bDRAll && !leg && blk_disre)
             {
                 t_iatom   *fa;
@@ -2525,7 +2525,7 @@ int gmx_energy(int argc, char *argv[])
                      *******************************************/
                     if (ndisre > 0)
                     {
-                        GMX_RELEASE_ASSERT(blk_disre != NULL, "Trying to dereference NULL blk_disre pointer");
+                        GMX_RELEASE_ASSERT(blk_disre != nullptr, "Trying to dereference NULL blk_disre pointer");
  #if !GMX_DOUBLE
                         float  *disre_rt     =     blk_disre->sub[0].fval;
                         float  *disre_rm3tav = blk_disre->sub[1].fval;
@@ -2535,7 +2535,7 @@ int gmx_energy(int argc, char *argv[])
  #endif
 
                         print_time(out, fr->t);
-                        if (violaver == NULL)
+                        if (violaver == nullptr)
                         {
                             snew(violaver, ndisre);
                         }
@@ -2614,7 +2614,7 @@ int gmx_energy(int argc, char *argv[])
                             fprintf(out, "\n");
                         }
                     }
-                    blk = find_block_id_enxframe(fr, enx_i, NULL);
+                    blk = find_block_id_enxframe(fr, enx_i, nullptr);
                     if (bORIRE && blk)
                     {
 #if !GMX_DOUBLE
@@ -2672,7 +2672,7 @@ int gmx_energy(int argc, char *argv[])
                         }
                         norfr++;
                     }
-                    blk = find_block_id_enxframe(fr, enxORT, NULL);
+                    blk = find_block_id_enxframe(fr, enxORT, nullptr);
                     if (bOTEN && blk)
                     {
 #if !GMX_DOUBLE
index ed353329e0cba7ee39cc2e033f95387cbeb1d856..ca7d7c41fdb38e272c327bf2a2068e6aefa96234 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -100,7 +100,7 @@ int gmx_filter(int argc, char *argv[])
     char             *grpname;
     int               isize;
     int              *index;
-    real             *w_rls = NULL;
+    real             *w_rls = nullptr;
     t_trxstatus      *in;
     t_trxstatus      *outl, *outh;
     int               nffr, i, fr, nat, j, d, m;
@@ -108,20 +108,20 @@ int gmx_filter(int argc, char *argv[])
     real              flen, *filt, sum, *t;
     rvec              xcmtop, xcm, **x, *ptr, *xf, *xn, *xp, hbox;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
 #define NLEG asize(leg)
     t_filenm fnm[] = {
-        { efTRX, "-f", NULL, ffREAD  },
-        { efTPS, NULL, NULL, ffOPTRD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD  },
+        { efTPS, nullptr, nullptr, ffOPTRD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efTRO, "-ol", "lowpass",  ffOPTWR },
         { efTRO, "-oh", "highpass", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -140,7 +140,7 @@ int gmx_filter(int argc, char *argv[])
     if (topfile)
     {
         bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
-                             &xtop, NULL, topbox, TRUE);
+                             &xtop, nullptr, topbox, TRUE);
         if (bTop)
         {
             gpbc = gmx_rmpbc_init(&top.idef, ePBC, top.atoms.nr);
@@ -208,7 +208,7 @@ int gmx_filter(int argc, char *argv[])
     }
     else
     {
-        outl = 0;
+        outl = nullptr;
     }
     if (highfile)
     {
@@ -216,7 +216,7 @@ int gmx_filter(int argc, char *argv[])
     }
     else
     {
-        outh = 0;
+        outh = nullptr;
     }
 
     fr = 0;
@@ -301,8 +301,8 @@ int gmx_filter(int argc, char *argv[])
             }
             if (outl && (bLowAll || fr % nf == nf - 1))
             {
-                write_trx(outl, nat, ind, topfile ? &(top.atoms) : NULL,
-                          0, t[nf - 1], bFit ? topbox : boxf, xf, NULL, NULL);
+                write_trx(outl, nat, ind, topfile ? &(top.atoms) : nullptr,
+                          0, t[nf - 1], bFit ? topbox : boxf, xf, nullptr, nullptr);
             }
             if (outh)
             {
@@ -328,8 +328,8 @@ int gmx_filter(int argc, char *argv[])
                         boxf[j][d] = topbox[j][d] + box[nf - 1][j][d] - boxf[j][d];
                     }
                 }
-                write_trx(outh, nat, ind, topfile ? &(top.atoms) : NULL,
-                          0, t[nf - 1], bFit ? topbox : boxf, xf, NULL, NULL);
+                write_trx(outh, nat, ind, topfile ? &(top.atoms) : nullptr,
+                          0, t[nf - 1], bFit ? topbox : boxf, xf, nullptr, nullptr);
             }
         }
         /* Cycle all the pointer and the box by one */
index fb15635a25671dd9ac8844cdbffb37fc575d1264..3a88b6a8f1549bbecfa76e55eed771997f4efafd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,7 +143,7 @@ void sort_ions(int nsa, int nw, int repl[], int index[],
 {
     int    i, j, k, r, np, nn, starta, startr, npi, nni;
     rvec  *xt;
-    char **pptr = NULL, **nptr = NULL, **paptr = NULL, **naptr = NULL;
+    char **pptr = nullptr, **nptr = nullptr, **paptr = nullptr, **naptr = nullptr;
 
     snew(xt, atoms->nr);
 
@@ -239,7 +239,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
                          const char *p_name, const char *n_name, char *grpname)
 {
     FILE    *fpin, *fpout;
-    char     buf[STRLEN], buf2[STRLEN], *temp, **mol_line = NULL;
+    char     buf[STRLEN], buf2[STRLEN], *temp, **mol_line = nullptr;
     int      line, i, nmol_line, sol_line, nsol_last;
     gmx_bool bMolecules;
     char     temporary_filename[STRLEN];
@@ -258,7 +258,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
     {
         line++;
         std::strcpy(buf2, buf);
-        if ((temp = std::strchr(buf2, '\n')) != NULL)
+        if ((temp = std::strchr(buf2, '\n')) != nullptr)
         {
             temp[0] = '\0';
         }
@@ -266,7 +266,7 @@ static void update_topol(const char *topinout, int p_num, int n_num,
         if (buf2[0] == '[')
         {
             buf2[0] = ' ';
-            if ((temp = std::strchr(buf2, '\n')) != NULL)
+            if ((temp = std::strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -396,9 +396,9 @@ int gmx_genion(int argc, char *argv[])
     int                i, nw, nwa, nsa, nsalt, iqtot;
     gmx_output_env_t  *oenv;
     t_filenm           fnm[] = {
-        { efTPR, NULL,  NULL,      ffREAD  },
-        { efNDX, NULL,  NULL,      ffOPTRD },
-        { efSTO, "-o",  NULL,      ffWRITE },
+        { efTPR, nullptr,  nullptr,      ffREAD  },
+        { efNDX, nullptr,  nullptr,      ffOPTRD },
+        { efSTO, "-o",  nullptr,      ffWRITE },
         { efTOP, "-p",  "topol",   ffOPTRW }
     };
 #define NFILE asize(fnm)
@@ -549,9 +549,9 @@ int gmx_genion(int argc, char *argv[])
         }
 
         sfree(atoms.pdbinfo);
-        atoms.pdbinfo = NULL;
+        atoms.pdbinfo = nullptr;
     }
-    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, NULL, ePBC, box);
+    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), *top.name, &atoms, x, nullptr, ePBC, box);
 
     return 0;
 }
index 17641a07dda4981241c462ee720115c18c1ae218..ff988d408c6aac3407bac842b5fc2baba81719d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -110,7 +110,7 @@ int gmx_genpr(int argc, char *argv[])
 #define npargs asize(pa)
 
     gmx_output_env_t *oenv;
-    t_atoms          *atoms = NULL;
+    t_atoms          *atoms = nullptr;
     int               i, j, k;
     FILE             *out;
     int               igrp;
@@ -120,18 +120,18 @@ int gmx_genpr(int argc, char *argv[])
     char             *gn_grp;
     matrix            box;
     gmx_bool          bFreeze;
-    rvec              dx, *x = NULL, *v = NULL;
+    rvec              dx, *x = nullptr, *v = nullptr;
 
     t_filenm          fnm[] = {
-        { efSTX, "-f",  NULL,    ffREAD },
-        { efNDX, "-n",  NULL,    ffOPTRD },
+        { efSTX, "-f",  nullptr,    ffREAD },
+        { efNDX, "-n",  nullptr,    ffOPTRD },
         { efITP, "-o",  "posre", ffWRITE },
         { efNDX, "-of", "freeze",    ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, npargs, pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -141,7 +141,7 @@ int gmx_genpr(int argc, char *argv[])
     xfn     = opt2fn_null("-f", NFILE, fnm);
     nfn     = opt2fn_null("-n", NFILE, fnm);
 
-    if (( nfn == NULL ) && ( xfn == NULL))
+    if (( nfn == nullptr ) && ( xfn == nullptr))
     {
         gmx_fatal(FARGS, "no index file and no structure file supplied");
     }
@@ -156,15 +156,15 @@ int gmx_genpr(int argc, char *argv[])
     }
 
     const char *title = "";
-    if (xfn != NULL)
+    if (xfn != nullptr)
     {
         fprintf(stderr, "\nReading structure file\n");
-        t_topology *top = NULL;
+        t_topology *top = nullptr;
         snew(top, 1);
-        read_tps_conf(xfn, top, NULL, &x, &v, box, FALSE);
+        read_tps_conf(xfn, top, nullptr, &x, &v, box, FALSE);
         title = *top->name;
         atoms = &top->atoms;
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
index 0d7248f8a8ec8f8d4d76b759067aa860b14b8621..ed2f590921999b63581ecd0f83d7650cb74e7cd3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,12 +112,12 @@ void calc_gyro_z(rvec x[], matrix box,
                  int gnx, int index[], t_atom atom[],
                  int nz, real time, FILE *out)
 {
-    static dvec   *inertia = NULL;
-    static double *tm      = NULL;
+    static dvec   *inertia = nullptr;
+    static double *tm      = nullptr;
     int            i, ii, j, zi;
     real           zf, w, sdet, e1, e2;
 
-    if (inertia == NULL)
+    if (inertia == nullptr)
     {
         snew(inertia, nz);
         snew(tm, nz);
@@ -208,7 +208,7 @@ int gmx_gyrate(int argc, char *argv[])
     rvec              xcm, gvec, gvec1;
     matrix            box, trans;
     gmx_bool          bACF;
-    real            **moi_trans = NULL;
+    real            **moi_trans = nullptr;
     int               max_moi   = 0, delta_moi = 100;
     rvec              d, d1; /* eigenvalues of inertia tensor */
     real              t, t0, tm, gyro;
@@ -217,15 +217,15 @@ int gmx_gyrate(int argc, char *argv[])
     int               j, m, gnx, nam, mol;
     int              *index;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc   = NULL;
+    gmx_rmpbc_t       gpbc   = nullptr;
     const char       *leg[]  = { "Rg", "Rg\\sX\\N", "Rg\\sY\\N", "Rg\\sZ\\N" };
     const char       *legI[] = { "Itot", "I1", "I2", "I3" };
 #define NLEG asize(leg)
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
-        { efXVG, NULL,   "gyrate",   ffWRITE },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
+        { efXVG, nullptr,   "gyrate",   ffWRITE },
         { efXVG, "-acf", "moi-acf",  ffOPTWR },
     };
 #define NFILE asize(fnm)
@@ -236,7 +236,7 @@ int gmx_gyrate(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -266,7 +266,7 @@ int gmx_gyrate(int argc, char *argv[])
         printf("Will print radius normalised by charge\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
     if (nmol > gnx || gnx % nmol != 0)
index 615245e667d1defb68071d6ebcf1ab1b8fd8ec3a..498d30aa7d4a6de9893c33b42b5a27b2be6a1f60 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -83,7 +83,7 @@ void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
         i, j, teller = 0,
         slice = 0,       /* current slice number */
     *count;              /* nr. of atoms in one slice */
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     if ((natoms = read_first_x(oenv, &status, fn, &t, &x0, box)) == 0)
     {
@@ -287,24 +287,24 @@ int gmx_h2order(int argc, char *argv[])
     };
 
     gmx_output_env_t  *oenv;
-    real              *slOrder,             /* av. cosine, per slice      */
-                       slWidth = 0.0;       /* width of a slice           */
+    real              *slOrder,               /* av. cosine, per slice      */
+                       slWidth = 0.0;         /* width of a slice           */
     rvec              *slDipole;
-    char              *grpname,             /* groupnames                 */
+    char              *grpname,               /* groupnames                 */
     *micname;
-    int                ngx,                 /* nr. of atomsin sol group   */
-                       nmic = 0;            /* nr. of atoms in micelle    */
-    t_topology        *top;                 /* topology           */
+    int                ngx,                   /* nr. of atomsin sol group   */
+                       nmic = 0;              /* nr. of atoms in micelle    */
+    t_topology        *top;                   /* topology           */
     int                ePBC;
-    int               *index,               /* indices for solvent group  */
-    *micelle                  = NULL;
-    gmx_bool           bMicel =  FALSE;     /* think we're a micel        */
-    t_filenm           fnm[]  = {           /* files for g_order      */
-        { efTRX, "-f", NULL,  ffREAD },     /* trajectory file            */
-        { efNDX, NULL, NULL,  ffREAD },     /* index file         */
-        { efNDX, "-nm", NULL, ffOPTRD },    /* index with micelle atoms   */
-        { efTPR, NULL, NULL,  ffREAD },     /* topology file              */
-        { efXVG, "-o",  "order", ffWRITE }, /* xvgr output file       */
+    int               *index,                 /* indices for solvent group  */
+    *micelle                  = nullptr;
+    gmx_bool           bMicel =  FALSE;       /* think we're a micel        */
+    t_filenm           fnm[]  = {             /* files for g_order      */
+        { efTRX, "-f", nullptr,  ffREAD },    /* trajectory file            */
+        { efNDX, nullptr, nullptr,  ffREAD }, /* index file         */
+        { efNDX, "-nm", nullptr, ffOPTRD },   /* index with micelle atoms   */
+        { efTPR, nullptr, nullptr,  ffREAD }, /* topology file              */
+        { efXVG, "-o",  "order", ffWRITE },   /* xvgr output file       */
     };
 
 #define NFILE asize(fnm)
index 076ebb4616ef8d2ad987af8311a0c3939cd952d4..941f942a7337980fab8116f19c9c79a8c3b836ca 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -217,13 +217,13 @@ static void mk_hbmap(t_hbdata *hb)
     for (i = 0; (i < hb->d.nrd); i++)
     {
         snew(hb->hbmap[i], hb->a.nra);
-        if (hb->hbmap[i] == NULL)
+        if (hb->hbmap[i] == nullptr)
         {
             gmx_fatal(FARGS, "Could not allocate enough memory for hbmap");
         }
         for (j = 0; (j > hb->a.nra); j++)
         {
-            hb->hbmap[i][j] = NULL;
+            hb->hbmap[i][j] = nullptr;
         }
     }
 }
@@ -268,7 +268,7 @@ static gmx_bool is_hb(unsigned int hbexist[], int frame)
 
 static void set_hb(t_hbdata *hb, int id, int ih, int ia, int frame, int ihb)
 {
-    unsigned int *ghptr = NULL;
+    unsigned int *ghptr = nullptr;
 
     if (ihb == hbHB)
     {
@@ -503,7 +503,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
             {
                 try
                 {
-                    if (hb->hbmap[id][ia] == NULL)
+                    if (hb->hbmap[id][ia] == nullptr)
                     {
                         snew(hb->hbmap[id][ia], 1);
                         snew(hb->hbmap[id][ia]->h, hb->maxhydro);
@@ -1184,7 +1184,7 @@ static void free_grid(ivec ngrid, t_gridcell ****grid)
         sfree(g[z]);
     }
     sfree(g);
-    g = NULL;
+    g = nullptr;
 }
 
 static void pbc_correct_gem(rvec dx, matrix box, rvec hbox)
@@ -1470,8 +1470,8 @@ static void merge_hb(t_hbdata *hb, gmx_bool bTwo, gmx_bool bContact)
                     }
                     sfree(hb1->h[0]);
                     sfree(hb1->g[0]);
-                    hb1->h[0]       = NULL;
-                    hb1->g[0]       = NULL;
+                    hb1->h[0]       = nullptr;
+                    hb1->g[0]       = nullptr;
                     hb1->history[0] = hbNo;
                 }
             }
@@ -1768,7 +1768,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
     real       k = 1, kp = 1, kow = 1;
     real       Q = 0, chi2, tau_hb, dtau, tau_rlx, e_1, sigma_k, sigma_kp, ddg;
     double     tmp, sn2 = 0, sc2 = 0, sk2 = 0, scn = 0, sck = 0, snk = 0;
-    gmx_bool   bError = (sigma_ct != NULL) && (sigma_nt != NULL) && (sigma_kt != NULL);
+    gmx_bool   bError = (sigma_ct != nullptr) && (sigma_nt != nullptr) && (sigma_kt != nullptr);
 
     for (i0 = 0; (i0 < n-2) && ((t[i0]-t[0]) < fit_start); i0++)
     {
@@ -1844,7 +1844,7 @@ void analyse_corr(int n, real t[], real ct[], real nt[], real kt[],
                    sc2, sn2, sk2, sck, snk, scn);
         }
         /* Determine integral of the correlation function */
-        tau_hb = evaluate_integral(n, t, ct, NULL, (t[n-1]-t[0])/2, &dtau);
+        tau_hb = evaluate_integral(n, t, ct, nullptr, (t[n-1]-t[0])/2, &dtau);
         printf("Integral   %10.3f   %s%8.3f  %10.3f\n", 1/tau_hb,
                bError ? "       " : "", tau_hb, calc_dg(tau_hb, temp));
         e_1 = std::exp(-1.0);
@@ -1901,7 +1901,7 @@ static void normalizeACF(real *ct, real *gt, int nhb, int len)
     for (i = 0; i < len; i++)
     {
         ct[i] *= ct_fac;
-        if (gt != NULL)
+        if (gt != nullptr)
         {
             gt[i] *= gt_fac;
         }
@@ -1924,15 +1924,15 @@ static void do_hbac(const char *fn, t_hbdata *hb,
     };
     gmx_bool       bNorm = FALSE;
     double         nhb   = 0;
-    real          *rhbex = NULL, *ht, *gt, *ght, *dght, *kt;
+    real          *rhbex = nullptr, *ht, *gt, *ght, *dght, *kt;
     real          *ct, tail, tail2, dtail, *cct;
     const real     tol     = 1e-3;
     int            nframes = hb->nframes;
-    unsigned int **h       = NULL, **g = NULL;
+    unsigned int **h       = nullptr, **g = nullptr;
     int            nh, nhbonds, nhydro;
     t_hbond       *hbh;
     int            acType;
-    int           *dondata      = NULL;
+    int           *dondata      = nullptr;
 
     enum {
         AC_NONE, AC_NN, AC_GEM, AC_LUZAR
@@ -2073,7 +2073,7 @@ static void do_hbac(const char *fn, t_hbdata *hb,
                     }
 
                     /* The autocorrelation function is normalized after summation only */
-                    low_do_autocorr(NULL, oenv, NULL, nframes, 1, -1, &rhbex, hb->time[1]-hb->time[0],
+                    low_do_autocorr(nullptr, oenv, nullptr, nframes, 1, -1, &rhbex, hb->time[1]-hb->time[0],
                                     eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0);
 
                     /* Cross correlation analysis for thermodynamics */
@@ -2150,10 +2150,10 @@ static void do_hbac(const char *fn, t_hbdata *hb,
     }
     xvgrclose(fp);
 
-    analyse_corr(nn, hb->time, ct, ght, kt, NULL, NULL, NULL,
+    analyse_corr(nn, hb->time, ct, ght, kt, nullptr, nullptr, nullptr,
                  fit_start, temp);
 
-    do_view(oenv, fn, NULL);
+    do_view(oenv, fn, nullptr);
     sfree(rhbex);
     sfree(ct);
     sfree(gt);
@@ -2181,12 +2181,12 @@ static FILE *open_donor_properties_file(const char             *fn,
                                         t_hbdata               *hb,
                                         const gmx_output_env_t *oenv)
 {
-    FILE       *fp    = NULL;
+    FILE       *fp    = nullptr;
     const char *leg[] = { "Nbound", "Nfree" };
 
     if (!fn || !hb)
     {
-        return NULL;
+        return nullptr;
     }
 
     fp = xvgropen(fn, "Donor properties", output_env_get_xvgr_tlabel(oenv), "Number", oenv);
@@ -2243,7 +2243,7 @@ static void dump_hbmap(t_hbdata *hb,
     }
     else
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
     for (grp = gr0; grp <= (bTwo ? gr1 : gr0); grp++)
     {
@@ -2483,9 +2483,9 @@ int gmx_hbond(int argc, char *argv[])
         "The option [TT]-sel[tt] that used to work on selected hbonds is out of order, and therefore not available for the time being."
     };
     t_filenm    fnm[] = {
-        { efTRX, "-f",   NULL,     ffREAD  },
-        { efTPR, NULL,   NULL,     ffREAD  },
-        { efNDX, NULL,   NULL,     ffOPTRD },
+        { efTRX, "-f",   nullptr,     ffREAD  },
+        { efTPR, nullptr,   nullptr,     ffREAD  },
+        { efNDX, nullptr,   nullptr,     ffOPTRD },
         /*    { efNDX, "-sel", "select", ffOPTRD },*/
         { efXVG, "-num", "hbnum",  ffWRITE },
         { efLOG, "-g",   "hbond",  ffOPTWR },
@@ -2527,7 +2527,7 @@ int gmx_hbond(int argc, char *argv[])
     int                   grp, nabin, nrbin, resdist, ihb;
     char                **leg;
     t_hbdata             *hb;
-    FILE                 *fp, *fpnhb = NULL, *donor_properties = NULL;
+    FILE                 *fp, *fpnhb = nullptr, *donor_properties = nullptr;
     t_gridcell         ***grid;
     t_ncell              *icell, *jcell;
     ivec                  ngrid;
@@ -2538,8 +2538,8 @@ int gmx_hbond(int argc, char *argv[])
     gmx_bool              bParallel;
     gmx_bool              bEdge_yjj, bEdge_xjj;
 
-    t_hbdata            **p_hb    = NULL;                   /* one per thread, then merge after the frame loop */
-    int                 **p_adist = NULL, **p_rdist = NULL; /* a histogram for each thread. */
+    t_hbdata            **p_hb    = nullptr;                      /* one per thread, then merge after the frame loop */
+    int                 **p_adist = nullptr, **p_rdist = nullptr; /* a histogram for each thread. */
 
     const bool            bOMP = GMX_OPENMP;
 
@@ -2588,7 +2588,7 @@ int gmx_hbond(int argc, char *argv[])
     /* get topology */
     gmx::MDModules  mdModules;
     t_inputrec     *ir = mdModules.inputrec();
-    read_tpx_top(ftp2fn(efTPR, NFILE, fnm), ir, box, &natoms, NULL, NULL, &top);
+    read_tpx_top(ftp2fn(efTPR, NFILE, fnm), ir, box, &natoms, nullptr, nullptr, &top);
 
     snew(grpnames, grNR);
     snew(index, grNR);
@@ -2813,11 +2813,11 @@ int gmx_hbond(int argc, char *argv[])
             snew(p_rdist[i], nrbin+1);
 
             p_hb[i]->max_frames = 0;
-            p_hb[i]->nhb        = NULL;
-            p_hb[i]->ndist      = NULL;
-            p_hb[i]->n_bound    = NULL;
-            p_hb[i]->time       = NULL;
-            p_hb[i]->nhx        = NULL;
+            p_hb[i]->nhb        = nullptr;
+            p_hb[i]->ndist      = nullptr;
+            p_hb[i]->n_bound    = nullptr;
+            p_hb[i]->time       = nullptr;
+            p_hb[i]->nhx        = nullptr;
 
             p_hb[i]->bHBmap     = hb->bHBmap;
             p_hb[i]->bDAnr      = hb->bDAnr;
index e3a10d90187abbbd61bd3f99c244c2ba2924a2ca..71657455a20f47c3ad88a24cf24a2d4d4a64a03f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,23 +120,23 @@ int gmx_helix(int argc, char *argv[])
     } t_xvgrfile;
 
     t_xvgrfile        xf[efhNR] = {
-        { NULL, NULL, TRUE,  "radius",  "Helix radius",               NULL, "r (nm)", 0.0 },
-        { NULL, NULL, TRUE,  "twist",   "Twist per residue",          NULL, "Angle (deg)", 0.0 },
-        { NULL, NULL, TRUE,  "rise",    "Rise per residue",           NULL, "Rise (nm)", 0.0 },
-        { NULL, NULL, FALSE, "len-ahx", "Length of the Helix",        NULL, "Length (nm)", 0.0 },
-        { NULL, NULL, FALSE, "dip-ahx", "Helix Backbone Dipole",      NULL, "rq (nm e)", 0.0 },
-        { NULL, NULL, TRUE,  "rms-ahx", "RMS Deviation from Ideal Helix", NULL, "RMS (nm)", 0.0 },
-        { NULL, NULL, FALSE, "rmsa-ahx", "Average RMSD per Residue",   "Residue", "RMS (nm)", 0.0 },
-        { NULL, NULL, FALSE,  "cd222",   "Ellipticity at 222 nm", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "pprms",   "RMS Distance from \\8a\\4-helix", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "caphi",   "Average Ca-Ca Dihedral",     NULL, "\\8F\\4(deg)", 0.0 },
-        { NULL, NULL, TRUE,  "phi",     "Average \\8F\\4 angles", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "psi",     "Average \\8Y\\4 angles", NULL, "deg", 0.0 },
-        { NULL, NULL, TRUE,  "hb3",     "Average n-n+3 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "hb4",     "Average n-n+4 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, TRUE,  "hb5",     "Average n-n+5 hbond length", NULL, "nm", 0.0 },
-        { NULL, NULL, FALSE,  "JCaHa",   "J-Coupling Values",        "Residue", "Hz", 0.0 },
-        { NULL, NULL, FALSE,  "helicity", "Helicity per Residue",     "Residue", "% of time", 0.0 }
+        { nullptr, nullptr, TRUE,  "radius",  "Helix radius",               nullptr, "r (nm)", 0.0 },
+        { nullptr, nullptr, TRUE,  "twist",   "Twist per residue",          nullptr, "Angle (deg)", 0.0 },
+        { nullptr, nullptr, TRUE,  "rise",    "Rise per residue",           nullptr, "Rise (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "len-ahx", "Length of the Helix",        nullptr, "Length (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "dip-ahx", "Helix Backbone Dipole",      nullptr, "rq (nm e)", 0.0 },
+        { nullptr, nullptr, TRUE,  "rms-ahx", "RMS Deviation from Ideal Helix", nullptr, "RMS (nm)", 0.0 },
+        { nullptr, nullptr, FALSE, "rmsa-ahx", "Average RMSD per Residue",   "Residue", "RMS (nm)", 0.0 },
+        { nullptr, nullptr, FALSE,  "cd222",   "Ellipticity at 222 nm", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "pprms",   "RMS Distance from \\8a\\4-helix", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "caphi",   "Average Ca-Ca Dihedral",     nullptr, "\\8F\\4(deg)", 0.0 },
+        { nullptr, nullptr, TRUE,  "phi",     "Average \\8F\\4 angles", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "psi",     "Average \\8Y\\4 angles", nullptr, "deg", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb3",     "Average n-n+3 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb4",     "Average n-n+4 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, TRUE,  "hb5",     "Average n-n+5 hbond length", nullptr, "nm", 0.0 },
+        { nullptr, nullptr, FALSE,  "JCaHa",   "J-Coupling Values",        "Residue", "Hz", 0.0 },
+        { nullptr, nullptr, FALSE,  "helicity", "Helicity per Residue",     "Residue", "% of time", 0.0 }
     };
 
     gmx_output_env_t *oenv;
@@ -152,18 +152,18 @@ int gmx_helix(int argc, char *argv[])
     real              t;
     real              rms;
     matrix            box;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     gmx_bool          bRange;
     t_filenm          fnm[] = {
-        { efTPR, NULL,  NULL,   ffREAD  },
-        { efNDX, NULL,  NULL,   ffREAD  },
-        { efTRX, "-f",  NULL,   ffREAD  },
+        { efTPR, nullptr,  nullptr,   ffREAD  },
+        { efNDX, nullptr,  nullptr,   ffREAD  },
+        { efTRX, "-f",  nullptr,   ffREAD  },
         { efSTO, "-cz", "zconf", ffWRITE },
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -207,7 +207,7 @@ int gmx_helix(int argc, char *argv[])
     /* Read reference frame from tpx file to compute helix length */
     snew(xref, top->atoms.nr);
     read_tpx(ftp2fn(efTPR, NFILE, fnm),
-             NULL, NULL, &natoms, xref, NULL, NULL);
+             nullptr, nullptr, &natoms, xref, nullptr, nullptr);
     calc_hxprops(nres, bb, xref);
     do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd);
     sfree(xref);
@@ -243,7 +243,7 @@ int gmx_helix(int argc, char *argv[])
             if (teller == 1)
             {
                 write_sto_conf(opt2fn("-cz", NFILE, fnm), "Helix fitted to Z-Axis",
-                               &(top->atoms), x, NULL, ePBC, box);
+                               &(top->atoms), x, nullptr, ePBC, box);
             }
 
             xf[efhRAD].val   = radius(xf[efhRAD].fp2, nca, caindex, x);
index 7f40ea3697004000585111b8b456a05fb48bd1aa..89c0901a8857d6e5c80e3e5bee6d1745e8524f0a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,9 +76,9 @@ int gmx_helixorient(int argc, char *argv[])
         "purposes, we also write out the actual Euler rotation angles as [TT]theta[1-3].xvg[tt]"
     };
 
-    t_topology       *top = NULL;
+    t_topology       *top = nullptr;
     real              t;
-    rvec             *x = NULL;
+    rvec             *x = nullptr;
     matrix            box;
     t_trxstatus      *status;
     int               natoms;
@@ -132,7 +132,7 @@ int gmx_helixorient(int argc, char *argv[])
     int               ePBC;
 
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     static  gmx_bool  bSC          = FALSE;
     static gmx_bool   bIncremental = FALSE;
@@ -146,9 +146,9 @@ int gmx_helixorient(int argc, char *argv[])
 #define NPA asize(pa)
 
     t_filenm fnm[] = {
-        { efTPR, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efDAT, "-oaxis",    "helixaxis", ffWRITE },
         { efDAT, "-ocenter",  "center", ffWRITE },
         { efXVG, "-orise",    "rise", ffWRITE },
@@ -161,7 +161,7 @@ int gmx_helixorient(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index 2b3bafbfd26395539db000e527f40b98e994f7ce..a1ad9703cd9192b13a6b4edf1d886e565e7ba8e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -251,7 +251,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
                                        real sgang1, real sgang2, real ****intfpos,
                                        gmx_output_env_t *oenv)
 {
-    FILE         *fpsg   = NULL, *fpsk = NULL;
+    FILE         *fpsg   = nullptr, *fpsk = nullptr;
     t_topology    top;
     int           ePBC;
     t_trxstatus  *status;
@@ -260,10 +260,10 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
     rvec         *xtop, *x;
     matrix        box;
     real          sg, sk, sgintf;
-    int         **index   = NULL;
-    char        **grpname = NULL;
+    int         **index   = nullptr;
+    char        **grpname = nullptr;
     int           i, j, k, n, *isize, ng, nslicez, framenr;
-    real       ***sg_grid = NULL, ***sk_grid = NULL, ***sg_fravg = NULL, ***sk_fravg = NULL, ****sk_4d = NULL, ****sg_4d = NULL;
+    real       ***sg_grid = nullptr, ***sk_grid = nullptr, ***sg_fravg = nullptr, ***sk_fravg = nullptr, ****sk_4d = nullptr, ****sg_4d = nullptr;
     int          *perm;
     int           ndx1, ndx2;
     int           bins;
@@ -272,7 +272,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
      * i.e 1D Row-major order in (t,x,y) */
 
 
-    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, nullptr, box, FALSE);
 
     *nslicex = static_cast<int>(box[XX][XX]/binw + onehalf); /*Calculate slicenr from binwidth*/
     *nslicey = static_cast<int>(box[YY][YY]/binw + onehalf);
@@ -295,7 +295,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
         gmx_fatal(FARGS, "Topology (%d atoms) does not match trajectory (%d atoms)",
                   top.atoms.nr, natoms);
     }
-    check_index(NULL, ng, index[0], NULL, natoms);
+    check_index(nullptr, ng, index[0], nullptr, natoms);
 
 
     /*Prepare structures for temporary storage of frame info*/
@@ -312,8 +312,8 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
         }
     }
 
-    sg_4d    = NULL;
-    sk_4d    = NULL;
+    sg_4d    = nullptr;
+    sk_4d    = nullptr;
     *nframes = 0;
     framenr  = 0;
 
@@ -341,7 +341,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 
         find_tetra_order_grid(top, ePBC, natoms, box, x, isize[0], index[0],
                               &sg, &sk, *nslicex, *nslicey, nslicez, sg_grid, sk_grid);
-        GMX_RELEASE_ASSERT(sk_fravg != NULL, "Trying to dereference NULL sk_fravg pointer");
+        GMX_RELEASE_ASSERT(sk_fravg != nullptr, "Trying to dereference NULL sk_fravg pointer");
         for (i = 0; i < *nslicex; i++)
         {
             for (j = 0; j < *nslicey; j++)
@@ -358,7 +358,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con
 
         if (framenr%tblock == 0)
         {
-            GMX_RELEASE_ASSERT(sk_4d != NULL, "Trying to dereference NULL sk_4d pointer");
+            GMX_RELEASE_ASSERT(sk_4d != nullptr, "Trying to dereference NULL sk_4d pointer");
             sk_4d[*nframes] = sk_fravg;
             sg_4d[*nframes] = sg_fravg;
             (*nframes)++;
@@ -579,7 +579,7 @@ int gmx_hydorder(int argc, char *argv[])
     static gmx_bool    bRawOut   = FALSE;
     int                frames, xslices, yslices; /* Dimensions of interface arrays*/
     real            ***intfpos;                  /* Interface arrays (intfnr,t,xy) -potentially large */
-    static const char *normal_axis[] = { NULL, "z", "x", "y", NULL };
+    static const char *normal_axis[] = { nullptr, "z", "x", "y", nullptr };
 
     t_pargs            pa[] = {
         { "-d",   FALSE, etENUM, {normal_axis},
@@ -597,9 +597,9 @@ int gmx_hydorder(int argc, char *argv[])
     };
 
     t_filenm           fnm[] = {                      /* files for g_order    */
-        { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
-        { efNDX, "-n", NULL,  ffREAD },               /* index file           */
-        { efTPR, "-s", NULL,  ffREAD },               /* topology file                */
+        { efTRX, "-f", nullptr,  ffREAD },            /* trajectory file              */
+        { efNDX, "-n", nullptr,  ffREAD },            /* index file           */
+        { efTPR, "-s", nullptr,  ffREAD },            /* topology file                */
         { efXPM, "-o", "intf",  ffWRMULT},            /* XPM- surface maps     */
         { efOUT, "-or", "raw", ffOPTWRMULT },         /* xvgr output file           */
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* Fourier spectrum interfaces */
@@ -613,7 +613,7 @@ int gmx_hydorder(int argc, char *argv[])
     gmx_output_env_t *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -630,7 +630,7 @@ int gmx_hydorder(int argc, char *argv[])
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
-    GMX_RELEASE_ASSERT(normal_axis[0] != NULL, "Option setting inconsistency; normal_axis[0] is NULL");
+    GMX_RELEASE_ASSERT(normal_axis[0] != nullptr, "Option setting inconsistency; normal_axis[0] is NULL");
     if (std::strcmp(normal_axis[0], "x") == 0)
     {
         axis = XX;
index efb299333efda11966af49e552884e22d3613575..25ef0044d53974188ad4963706fd13abeff7dcfa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,16 +81,16 @@ static t_liedata *analyze_names(int nre, gmx_enxnm_t *names, const char *ligand)
     snew(ld, 1);
     for (; (i < nre); i++)
     {
-        if ((std::strstr(names[i].name, ligand) != NULL) &&
-            (std::strstr(names[i].name, self) == NULL))
+        if ((std::strstr(names[i].name, ligand) != nullptr) &&
+            (std::strstr(names[i].name, self) == nullptr))
         {
-            if (std::strstr(names[i].name, "LJ") != NULL)
+            if (std::strstr(names[i].name, "LJ") != nullptr)
             {
                 ld->nlj++;
                 srenew(ld->lj, ld->nlj);
                 ld->lj[ld->nlj-1] = i;
             }
-            else if (std::strstr(names[i].name, "Coul") != NULL)
+            else if (std::strstr(names[i].name, "Coul") != nullptr)
             {
                 ld->nqq++;
                 srenew(ld->qq, ld->nqq);
@@ -167,7 +167,7 @@ int gmx_lie(int argc, char *argv[])
     int               nre, nframes = 0, ct = 0;
     ener_file_t       fp;
     t_liedata        *ld;
-    gmx_enxnm_t      *enm = NULL;
+    gmx_enxnm_t      *enm = nullptr;
     t_enxframe       *fr;
     real              lie;
     double            lieaver = 0, lieav2 = 0;
@@ -180,7 +180,7 @@ int gmx_lie(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index ad3d4530b0a81b76dc0d11ecd1fd9c7066a6bd85..41c836aa3cba1ec3bba4a3ba286eaa2594270595 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -148,12 +148,12 @@ int sscan_list(int *list[], const char *str, const char *listname)
     int   number     = 0;
     int   end_number = 0;
 
-    char *start = NULL; /*holds the string of the number behind a ','*/
-    char *end   = NULL; /*holds the string of the number behind a '-' */
+    char *start = nullptr; /*holds the string of the number behind a ','*/
+    char *end   = nullptr; /*holds the string of the number behind a '-' */
 
-    int   nvecs = 0;    /* counts the number of vectors in the list*/
+    int   nvecs = 0;       /* counts the number of vectors in the list*/
 
-    step = NULL;
+    step = nullptr;
     snew(pos, n+4);
     startpos = pos;
     std::strcpy(pos, str);
@@ -161,7 +161,7 @@ int sscan_list(int *list[], const char *str, const char *listname)
     pos[n+1] = '1';
     pos[n+2] = '\0';
 
-    *list = NULL;
+    *list = nullptr;
 
     while ((c = *pos) != 0)
     {
@@ -184,7 +184,7 @@ int sscan_list(int *list[], const char *str, const char *listname)
                 {
                     /*store number*/
                     srenew(*list, nvecs+1);
-                    (*list)[nvecs++] = number = std::strtol(start, NULL, 10);
+                    (*list)[nvecs++] = number = std::strtol(start, nullptr, 10);
                     status           = sBefore;
                     if (number == 0)
                     {
@@ -241,8 +241,8 @@ int sscan_list(int *list[], const char *str, const char *listname)
                 if (c == ',')
                 {
                     /*store numbers*/
-                    end_number = std::strtol(end, NULL, 10);
-                    number     = std::strtol(start, NULL, 10);
+                    end_number = std::strtol(end, nullptr, 10);
+                    number     = std::strtol(start, nullptr, 10);
                     status     = sBefore;
                     if (number == 0)
                     {
@@ -255,8 +255,8 @@ int sscan_list(int *list[], const char *str, const char *listname)
                     srenew(*list, nvecs+end_number-number+1);
                     if (step)
                     {
-                        istep = strtol(step, NULL, 10);
-                        step  = NULL;
+                        istep = strtol(step, nullptr, 10);
+                        step  = nullptr;
                     }
                     else
                     {
@@ -379,12 +379,12 @@ void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
 
     /*Eigenvectors */
 
-    write_eigvec(fp, edpars->ned, eig_listen[evMON], eigvecs, nvec, "COMPONENTS GROUP 1", NULL);
+    write_eigvec(fp, edpars->ned, eig_listen[evMON], eigvecs, nvec, "COMPONENTS GROUP 1", nullptr);
     write_eigvec(fp, edpars->ned, eig_listen[evLINFIX], eigvecs, nvec, "COMPONENTS GROUP 2", evStepList[evLINFIX]);
     write_eigvec(fp, edpars->ned, eig_listen[evLINACC], eigvecs, nvec, "COMPONENTS GROUP 3", evStepList[evLINACC]);
     write_eigvec(fp, edpars->ned, eig_listen[evRADFIX], eigvecs, nvec, "COMPONENTS GROUP 4", evStepList[evRADFIX]);
-    write_eigvec(fp, edpars->ned, eig_listen[evRADACC], eigvecs, nvec, "COMPONENTS GROUP 5", NULL);
-    write_eigvec(fp, edpars->ned, eig_listen[evRADCON], eigvecs, nvec, "COMPONENTS GROUP 6", NULL);
+    write_eigvec(fp, edpars->ned, eig_listen[evRADACC], eigvecs, nvec, "COMPONENTS GROUP 5", nullptr);
+    write_eigvec(fp, edpars->ned, eig_listen[evRADCON], eigvecs, nvec, "COMPONENTS GROUP 6", nullptr);
     write_eigvec(fp, edpars->ned, eig_listen[evFLOOD], eigvecs, nvec, "COMPONENTS GROUP 7", evStepList[evFLOOD]);
 
 
@@ -398,7 +398,7 @@ int read_conffile(const char *confin, rvec **x)
     t_topology  top;
     matrix      box;
     printf("read coordnumber from file %s\n", confin);
-    read_tps_conf(confin, &top, NULL, x, NULL, box, FALSE);
+    read_tps_conf(confin, &top, nullptr, x, nullptr, box, FALSE);
     printf("number of coordinates in file %d\n", top.atoms.nr);
     return top.atoms.nr;
 }
@@ -649,9 +649,9 @@ int gmx_make_edi(int argc, char *argv[])
     enum  {
         evStepNr = evRADFIX + 1
     };
-    static const char* evSelections[evNr]      = {NULL, NULL, NULL, NULL, NULL, NULL};
+    static const char* evSelections[evNr]      = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
     static const char* evOptions[evNr]         = {"-linfix", "-linacc", "-flood", "-radfix", "-radacc", "-radcon", "-mon"};
-    static const char* evParams[evStepNr]      = {NULL, NULL};
+    static const char* evParams[evStepNr]      = {nullptr, nullptr};
     static const char* evStepOptions[evStepNr] = {"-linstep", "-accdir", "-not_used", "-radstep"};
     static const char* ConstForceStr;
     static real      * evStepList[evStepNr];
@@ -723,18 +723,18 @@ int gmx_make_edi(int argc, char *argv[])
 #define NPA asize(pa)
 
     rvec             *xref1;
-    int               nvec1, *eignr1 = NULL;
-    rvec             *xav1, **eigvec1 = NULL;
-    t_atoms          *atoms = NULL;
+    int               nvec1, *eignr1 = nullptr;
+    rvec             *xav1, **eigvec1 = nullptr;
+    t_atoms          *atoms = nullptr;
     int               nav; /* Number of atoms in the average structure */
     char             *grpname;
     const char       *indexfile;
     int               i;
     int              *index, *ifit;
-    int               nfit;           /* Number of atoms in the reference/fit structure */
-    int               ev_class;       /* parameter _class i.e. evMON, evRADFIX etc. */
+    int               nfit;              /* Number of atoms in the reference/fit structure */
+    int               ev_class;          /* parameter _class i.e. evMON, evRADFIX etc. */
     int               nvecs;
-    real             *eigval1 = NULL; /* in V3.3 this is parameter of read_eigenvectors */
+    real             *eigval1 = nullptr; /* in V3.3 this is parameter of read_eigenvectors */
 
     const char       *EdiFile;
     const char       *TargetFile;
@@ -753,8 +753,8 @@ int gmx_make_edi(int argc, char *argv[])
     t_filenm    fnm[] = {
         { efTRN, "-f",    "eigenvec",    ffREAD  },
         { efXVG, "-eig",  "eigenval",    ffOPTRD },
-        { efTPS, NULL,    NULL,          ffREAD },
-        { efNDX, NULL,    NULL,  ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
+        { efNDX, nullptr,    nullptr,  ffOPTRD },
         { efSTX, "-tar", "target", ffOPTRD},
         { efSTX, "-ori", "origin", ffOPTRD},
         { efEDI, "-o", "sam", ffWRITE }
@@ -762,7 +762,7 @@ int gmx_make_edi(int argc, char *argv[])
 #define NFILE asize(fnm)
     edi_params.outfrq = 100; edi_params.slope = 0.0; edi_params.maxedsteps = 0;
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -821,7 +821,7 @@ int gmx_make_edi(int argc, char *argv[])
         }
         else     /* if there are no eigenvectors for this option set list to zero */
         {
-            listen[ev_class] = NULL;
+            listen[ev_class] = nullptr;
             snew(listen[ev_class], 1);
             listen[ev_class][0] = 0;
         }
@@ -846,7 +846,7 @@ int gmx_make_edi(int argc, char *argv[])
                       &xref1, &edi_params.fitmas, &xav1, &edi_params.pcamas, &nvec1, &eignr1, &eigvec1, &eigval1);
 
     read_tps_conf(ftp2fn(efTPS, NFILE, fnm),
-                  &top, &ePBC, &xtop, NULL, topbox, 0);
+                  &top, &ePBC, &xtop, nullptr, topbox, 0);
     atoms = &top.atoms;
 
 
@@ -860,7 +860,7 @@ int gmx_make_edi(int argc, char *argv[])
     printf("\n");
 
 
-    if (xref1 == NULL)
+    if (xref1 == nullptr)
     {
         if (bFit1)
         {
@@ -944,7 +944,7 @@ int gmx_make_edi(int argc, char *argv[])
     }
     else
     {
-        make_t_edx(&edi_params.star, 0, NULL, index);
+        make_t_edx(&edi_params.star, 0, nullptr, index);
     }
 
     /* Store origin positions */
@@ -954,7 +954,7 @@ int gmx_make_edi(int argc, char *argv[])
     }
     else
     {
-        make_t_edx(&edi_params.sori, 0, NULL, index);
+        make_t_edx(&edi_params.sori, 0, nullptr, index);
     }
 
     /* Write edi-file */
index f777dcd1625dc87d792267c2d11fac42330fe8db..eb7552ad086b805b07aa03385ea61d653a05ff34 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -153,7 +153,7 @@ static gmx_bool is_name_char(char c)
      */
     const char *spec = " !&|";
 
-    return (c != '\0' && std::strchr(spec, c) == NULL);
+    return (c != '\0' && std::strchr(spec, c) == nullptr);
 }
 
 static int parse_names(char **string, int *n_names, char **names)
@@ -283,7 +283,7 @@ static gmx_bool parse_string(char **string, int *nr, int ngrps, char **grpname)
         (*string)++;
         s  = gmx_strdup((*string));
         sp = std::strchr(s, c);
-        if (sp != NULL)
+        if (sp != nullptr)
         {
             (*string) += sp-s + 1;
             sp[0]      = '\0';
@@ -816,7 +816,7 @@ static int split_chain(const t_atoms *atoms, const rvec *x,
 {
     char    buf[STRLEN];
     int     j, nchain;
-    int     i, a, natoms, *start = NULL, *end = NULL, ca_start, ca_end;
+    int     i, a, natoms, *start = nullptr, *end = nullptr, ca_start, ca_end;
     rvec    vec;
 
     natoms   = atoms->nr;
@@ -919,7 +919,7 @@ static int split_chain(const t_atoms *atoms, const rvec *x,
 
 static gmx_bool check_have_atoms(const t_atoms *atoms, char *string)
 {
-    if (atoms == NULL)
+    if (atoms == nullptr)
     {
         printf("Can not process '%s' without atom info, use option -f\n", string);
         return FALSE;
@@ -1180,7 +1180,7 @@ static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka
         }
     }
 
-    string = NULL;
+    string = nullptr;
 
     snew(index, natoms);
     snew(index1, natoms);
@@ -1225,7 +1225,7 @@ static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka
         }
         printf("\n");
         printf("> ");
-        if (NULL == fgets(inp_string, STRLEN, stdin))
+        if (nullptr == fgets(inp_string, STRLEN, stdin))
         {
             gmx_fatal(FARGS, "Error reading user input");
         }
@@ -1566,14 +1566,14 @@ int gmx_make_ndx(int argc, char *argv[])
     t_blocka         *block, *block2;
     char            **gnames, **gnames2;
     t_filenm          fnm[] = {
-        { efSTX, "-f", NULL,     ffOPTRD  },
-        { efNDX, "-n", NULL,     ffOPTRDMULT },
-        { efNDX, "-o", NULL,     ffWRITE }
+        { efSTX, "-f", nullptr,     ffOPTRD  },
+        { efNDX, "-n", nullptr,     ffOPTRDMULT },
+        { efNDX, "-o", nullptr,     ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, NPA, pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1602,7 +1602,7 @@ int gmx_make_ndx(int argc, char *argv[])
         fprintf(stderr, "\nReading structure file\n");
         read_tps_conf(stxfile, top, &ePBC, &x, &v, box, FALSE);
         atoms = &top->atoms;
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -1611,13 +1611,13 @@ int gmx_make_ndx(int argc, char *argv[])
     }
     else
     {
-        atoms = NULL;
-        x     = NULL;
+        atoms = nullptr;
+        x     = nullptr;
     }
 
     /* read input file(s) */
     block  = new_blocka();
-    gnames = NULL;
+    gnames = nullptr;
     printf("Going to read %d old index file(s)\n", nndxin);
     if (nndxin)
     {
index f727fe9c267c94b5f8e8b3f3d193174d673624e2..56ee263c2954d6182c840a41eec72028787f3f00 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ int *res_ndx(t_atoms *atoms)
 
     if (atoms->nr <= 0)
     {
-        return NULL;
+        return nullptr;
     }
     snew(rndx, atoms->nr);
     r0 = atoms->atom[0].resind;
@@ -89,7 +89,7 @@ int *res_natm(t_atoms *atoms)
 
     if (atoms->nr <= 0)
     {
-        return NULL;
+        return nullptr;
     }
     snew(natm, atoms->nres);
     r0 = atoms->atom[0].resind;
@@ -194,16 +194,16 @@ int gmx_mdmat(int argc, char *argv[])
           "Discretize distance in this number of levels" }
     };
     t_filenm        fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPS, NULL,  NULL, ffREAD },
-        { efNDX, NULL,  NULL, ffOPTRD },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPS, nullptr,  nullptr, ffREAD },
+        { efNDX, nullptr,  nullptr, ffOPTRD },
         { efXPM, "-mean", "dm", ffWRITE },
         { efXPM, "-frames", "dmf", ffOPTWR },
         { efXVG, "-no", "num", ffOPTWR },
     };
 #define NFILE asize(fnm)
 
-    FILE             *out = NULL, *fp;
+    FILE             *out = nullptr, *fp;
     t_topology        top;
     int               ePBC;
     t_atoms           useatoms;
@@ -225,10 +225,10 @@ int gmx_mdmat(int argc, char *argv[])
     int              *tot_n;
     matrix            box = {{0}};
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
-                           asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -241,7 +241,7 @@ int gmx_mdmat(int argc, char *argv[])
         fprintf(stderr, "Will calculate number of different contacts\n");
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, FALSE);
 
     fprintf(stderr, "Select group for analysis\n");
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
index 078da36b54337d77048d59e966e385457ed46f98..f19124b1f25d2ca07954d3e2977d551e602f6480 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -154,11 +154,11 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     int          natoms, ind_min[2] = {0, 0}, ind_mini = 0, ind_minj = 0;
     real         rmin, rmax, rmint, tmint;
     gmx_bool     bFirst;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     natoms = read_first_x(oenv, &status, trxfn, &t, &x, box);
 
-    check_index(NULL, n, index, NULL, natoms);
+    check_index(nullptr, n, index, nullptr, natoms);
 
     out = xvgropen(outfn, "Minimum distance to periodic image",
                    output_env_get_time_label(oenv), "Distance (nm)", oenv);
@@ -171,7 +171,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     rmint = box[XX][XX];
     tmint = 0;
 
-    if (NULL != top)
+    if (nullptr != top)
     {
         gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
     }
@@ -179,7 +179,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     bFirst = TRUE;
     do
     {
-        if (NULL != top)
+        if (nullptr != top)
         {
             gmx_rmpbc(gpbc, natoms, box, x);
         }
@@ -202,7 +202,7 @@ static void periodic_mindist_plot(const char *trxfn, const char *outfn,
     }
     while (read_next_x(oenv, status, &t, x, box));
 
-    if (NULL != top)
+    if (nullptr != top)
     {
         gmx_rmpbc_done(gpbc);
     }
@@ -262,7 +262,7 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
     for (j = 0; (j < j1); j++)
     {
         jx = index3[j];
-        if (index2 == NULL)
+        if (index2 == nullptr)
         {
             i0 = j + 1;
         }
@@ -337,7 +337,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     t_trxstatus     *trxout;
     char             buf[256];
     char           **leg;
-    real             t, dmin, dmax, **mindres = NULL, **maxdres = NULL;
+    real             t, dmin, dmax, **mindres = nullptr, **maxdres = nullptr;
     int              nmin, nmax;
     t_trxstatus     *status;
     int              i = -1, j, k;
@@ -348,7 +348,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     rvec            *x0;
     matrix           box;
     gmx_bool         bFirst;
-    FILE            *respertime = NULL;
+    FILE            *respertime = nullptr;
 
     if (read_first_x(oenv, &status, fn, &t, &x0, box) == 0)
     {
@@ -358,9 +358,9 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     sprintf(buf, "%simum Distance", bMin ? "Min" : "Max");
     dist = xvgropen(dfile, buf, output_env_get_time_label(oenv), "Distance (nm)", oenv);
     sprintf(buf, "Number of Contacts %s %g nm", bMin ? "<" : ">", rcut);
-    num    = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : NULL;
-    atm    = afile ? gmx_ffopen(afile, "w") : NULL;
-    trxout = xfile ? open_trx(xfile, "w") : NULL;
+    num    = nfile ? xvgropen(nfile, buf, output_env_get_time_label(oenv), "Number", oenv) : nullptr;
+    atm    = afile ? gmx_ffopen(afile, "w") : nullptr;
+    trxout = xfile ? open_trx(xfile, "w") : nullptr;
 
     if (bMat)
     {
@@ -533,7 +533,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
         {
             oindex[0] = bMin ? min1 : max1;
             oindex[1] = bMin ? min2 : max2;
-            write_trx(trxout, 2, oindex, atoms, i, t, box, x0, NULL, NULL);
+            write_trx(trxout, 2, oindex, atoms, i, t, box, x0, nullptr, nullptr);
         }
         bFirst = FALSE;
         /*dmin should be minimum distance for residue and group*/
@@ -693,7 +693,7 @@ int gmx_mindist(int argc, char *argv[])
           "Write residue names" }
     };
     gmx_output_env_t *oenv;
-    t_topology       *top  = NULL;
+    t_topology       *top  = nullptr;
     int               ePBC = -1;
     rvec             *x;
     matrix            box;
@@ -703,11 +703,11 @@ int gmx_mindist(int argc, char *argv[])
     const char       *trxfnm, *tpsfnm, *ndxfnm, *distfnm, *numfnm, *atmfnm, *oxfnm, *resfnm;
     char            **grpname;
     int              *gnx;
-    int             **index, *residues = NULL;
+    int             **index, *residues = nullptr;
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,      ffREAD },
-        { efTPS,  NULL, NULL,      ffOPTRD },
-        { efNDX,  NULL, NULL,      ffOPTRD },
+        { efTRX, "-f",  nullptr,      ffREAD },
+        { efTPS,  nullptr, nullptr,      ffOPTRD },
+        { efNDX,  nullptr, nullptr,      ffOPTRD },
         { efXVG, "-od", "mindist",  ffWRITE },
         { efXVG, "-on", "numcont",  ffOPTWR },
         { efOUT, "-o", "atm-pair", ffOPTWR },
@@ -718,7 +718,7 @@ int gmx_mindist(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -730,7 +730,7 @@ int gmx_mindist(int argc, char *argv[])
     atmfnm  = ftp2fn_null(efOUT, NFILE, fnm);
     oxfnm   = opt2fn_null("-ox", NFILE, fnm);
     resfnm  = opt2fn_null("-or", NFILE, fnm);
-    if (bPI || resfnm != NULL)
+    if (bPI || resfnm != nullptr)
     {
         /* We need a tps file */
         tpsfnm = ftp2fn(efTPS, NFILE, fnm);
@@ -762,13 +762,13 @@ int gmx_mindist(int argc, char *argv[])
     if (tpsfnm || resfnm || !ndxfnm)
     {
         snew(top, 1);
-        bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, NULL, box, FALSE);
+        bTop = read_tps_conf(tpsfnm, top, &ePBC, &x, nullptr, box, FALSE);
         if (bPI && !bTop)
         {
             printf("\nWARNING: Without a run input file a trajectory with broken molecules will not give the correct periodic image distance\n\n");
         }
     }
-    get_index(top ? &(top->atoms) : NULL, ndxfnm, ng, gnx, index, grpname);
+    get_index(top ? &(top->atoms) : nullptr, ndxfnm, ng, gnx, index, grpname);
 
     if (bMat && (ng == 1))
     {
@@ -790,7 +790,7 @@ int gmx_mindist(int argc, char *argv[])
 
     if (resfnm)
     {
-        GMX_RELEASE_ASSERT(top != NULL, "top pointer cannot be NULL when finding residues");
+        GMX_RELEASE_ASSERT(top != nullptr, "top pointer cannot be NULL when finding residues");
         nres = find_residues(&(top->atoms), gnx[0], index[0], &residues);
 
         if (debug)
@@ -806,7 +806,7 @@ int gmx_mindist(int argc, char *argv[])
     else
     {
         dist_plot(trxfnm, atmfnm, distfnm, numfnm, resfnm, oxfnm,
-                  rcutoff, bMat, top ? &(top->atoms) : NULL,
+                  rcutoff, bMat, top ? &(top->atoms) : nullptr,
                   ng, index, gnx, grpname, bSplit, !bMax, nres, residues, bPBC, ePBC,
                   bGroup, bEachResEachTime, bPrintResName, oenv);
     }
index 133c39d11c1a91324fbb9d81dc5a6e860a09db52..0609897bd22badcf2555a879f6cd0821e297e5ae 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -208,7 +208,7 @@ static void fill_ang(int nft, int *ft, int fac,
 
 static int *select_ftype(const char *opt, int *nft, int *mult)
 {
-    int *ft = NULL, ftype;
+    int *ft = nullptr, ftype;
 
     if (opt[0] == 'a')
     {
@@ -255,7 +255,7 @@ int gmx_mk_angndx(int argc, char *argv[])
         "angle distributions etc. It uses a run input file ([REF].tpx[ref]) for the",
         "definitions of the angles, dihedrals etc."
     };
-    static const char *opt[] = { NULL, "angle", "dihedral", "improper", "ryckaert-bellemans", NULL };
+    static const char *opt[] = { nullptr, "angle", "dihedral", "improper", "ryckaert-bellemans", nullptr };
     static gmx_bool    bH    = TRUE;
     static real        hq    = -1;
     t_pargs            pa[]  = {
@@ -277,22 +277,22 @@ int gmx_mk_angndx(int argc, char *argv[])
     int               *nr;
     char             **grpnames;
     t_filenm           fnm[] = {
-        { efTPR, NULL, NULL, ffREAD  },
-        { efNDX, NULL, "angle", ffWRITE }
+        { efTPR, nullptr, nullptr, ffREAD  },
+        { efNDX, nullptr, "angle", ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    GMX_RELEASE_ASSERT(opt[0] != 0, "Options inconsistency; opt[0] is NULL");
+    GMX_RELEASE_ASSERT(opt[0] != nullptr, "Options inconsistency; opt[0] is NULL");
 
     ft = select_ftype(opt[0], &nft, &mult);
 
-    top = read_top(ftp2fn(efTPR, NFILE, fnm), NULL);
+    top = read_top(ftp2fn(efTPR, NFILE, fnm), nullptr);
 
     ntype = calc_ntype(nft, ft, &(top->idef));
     snew(grpnames, ntype);
index 9378205c5cf10406bc7dbbc1cddbf5af9b21a17a..20618e09ad9aa0d473e0583ff8b766fcee7b1ca3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,7 +112,7 @@ int gmx_morph(int argc, char *argv[])
           "Do a least squares fit of the second to the first structure before interpolating" }
     };
     const char       *leg[] = { "Ref = 1\\Sst\\N conf", "Ref = 2\\Snd\\N conf" };
-    FILE             *fp    = NULL;
+    FILE             *fp    = nullptr;
     int               i, isize, is_lsq, nat1, nat2;
     t_trxstatus      *status;
     int              *index, *index_lsq, *index_all, *dummy;
@@ -125,16 +125,16 @@ int gmx_morph(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f1", NFILE, fnm), top, NULL, &x1, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f1", NFILE, fnm), top, nullptr, &x1, nullptr, box, FALSE);
     nat1 = top->atoms.nr;
-    read_tps_conf(opt2fn("-f2", NFILE, fnm), top, NULL, &x2, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f2", NFILE, fnm), top, nullptr, &x2, nullptr, box, FALSE);
     nat2 = top->atoms.nr;
     if (nat1 != nat2)
     {
@@ -183,7 +183,7 @@ int gmx_morph(int argc, char *argv[])
     for (i = 0; (i < ninterm); i++)
     {
         fac = dointerp(nat1, x1, x2, xx, i, ninterm, first, last);
-        write_trx(status, nat1, dummy, &atoms, i, fac, box, xx, NULL, NULL);
+        write_trx(status, nat1, dummy, &atoms, i, fac, box, xx, nullptr, nullptr);
         if (bRMS)
         {
             rms1 = rmsdev_ind(isize, index, mass, x1, xx);
index baba4a16cde6b681740a47ad07b7fc63190ff73d..c654f2a60c7228c5077c179b2cbf6c10dbaf4570 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,8 +124,8 @@ t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
     curr->delta_t    = dt;
     curr->beginfit   = (1 - 2*GMX_REAL_EPS)*beginfit;
     curr->endfit     = (1 + 2*GMX_REAL_EPS)*endfit;
-    curr->x0         = NULL;
-    curr->n_offs     = NULL;
+    curr->x0         = nullptr;
+    curr->n_offs     = nullptr;
     curr->nframes    = 0;
     curr->nlast      = 0;
     curr->dim_factor = dim_factor;
@@ -138,15 +138,15 @@ t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
     }
     for (i = 0; (i < nrgrp); i++)
     {
-        curr->ndata[i] = NULL;
-        curr->data[i]  = NULL;
+        curr->ndata[i] = nullptr;
+        curr->data[i]  = nullptr;
         if (bTen)
         {
-            curr->datam[i] = NULL;
+            curr->datam[i] = nullptr;
         }
     }
-    curr->time = NULL;
-    curr->lsq  = NULL;
+    curr->time = nullptr;
+    curr->lsq  = nullptr;
     curr->nmol = nmol;
     if (curr->nmol > 0)
     {
@@ -553,8 +553,8 @@ static void printmol(t_corr *curr, const char *fn,
     gmx_stats_t lsq1;
     int         i, j;
     real        a, b, D, Dav, D2av, VarD, sqrtD, sqrtD_max, scale;
-    t_pdbinfo  *pdbinfo = NULL;
-    const int  *mol2a   = NULL;
+    t_pdbinfo  *pdbinfo = nullptr;
+    const int  *mol2a   = nullptr;
 
     out = xvgropen(fn, "Diffusion Coefficients / Molecule", "Molecule", "D", oenv);
 
@@ -578,7 +578,7 @@ static void printmol(t_corr *curr, const char *fn,
                 gmx_stats_add_point(lsq1, xx, yy, dx, dy);
             }
         }
-        gmx_stats_get_ab(lsq1, elsqWEIGHT_NONE, &a, &b, NULL, NULL, NULL, NULL);
+        gmx_stats_get_ab(lsq1, elsqWEIGHT_NONE, &a, &b, nullptr, nullptr, nullptr, nullptr);
         gmx_stats_free(lsq1);
         D     = a*FACTOR/curr->dim_factor;
         if (D < 0)
@@ -622,12 +622,12 @@ static void printmol(t_corr *curr, const char *fn,
         {
             scale *= 10;
         }
-        GMX_RELEASE_ASSERT(pdbinfo != NULL, "Internal error - pdbinfo not set for PDB input");
+        GMX_RELEASE_ASSERT(pdbinfo != nullptr, "Internal error - pdbinfo not set for PDB input");
         for (i = 0; i < top->atoms.nr; i++)
         {
             pdbinfo[i].bfac *= scale;
         }
-        write_sto_conf(fn_pdb, "molecular MSD", &top->atoms, x, NULL, ePBC, box);
+        write_sto_conf(fn_pdb, "molecular MSD", &top->atoms, x, nullptr, ePBC, box);
     }
 }
 
@@ -650,13 +650,13 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
 #define        prev (1-cur)
     matrix           box;
     gmx_bool         bFirst;
-    gmx_rmpbc_t      gpbc = NULL;
+    gmx_rmpbc_t      gpbc = nullptr;
 
     natoms = read_first_x(oenv, &status, fn, &curr->t0, &(x[cur]), box);
 #ifdef DEBUG
     fprintf(stderr, "Read %d atoms for first frame\n", natoms);
 #endif
-    if ((gnx_com != NULL) && natoms < top->atoms.nr)
+    if ((gnx_com != nullptr) && natoms < top->atoms.nr)
     {
         fprintf(stderr, "WARNING: The trajectory only contains part of the system (%d of %d atoms) and therefore the COM motion of only this part of the system will be removed\n", natoms, top->atoms.nr);
     }
@@ -680,7 +680,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
     t      = curr->t0;
     if (x_pdb)
     {
-        *x_pdb = NULL;
+        *x_pdb = nullptr;
     }
 
     if (bMol)
@@ -696,7 +696,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
                        t_pdb > t - 0.5*(t - t_prev) &&
                        t_pdb < t + 0.5*(t - t_prev))))
         {
-            if (*x_pdb == NULL)
+            if (*x_pdb == nullptr)
             {
                 snew(*x_pdb, natoms);
             }
@@ -737,14 +737,14 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
             {
                 for (i = 0; (i < curr->ngrp); i++)
                 {
-                    curr->ndata[i] = NULL;
-                    curr->data[i]  = NULL;
+                    curr->ndata[i] = nullptr;
+                    curr->data[i]  = nullptr;
                     if (bTen)
                     {
-                        curr->datam[i] = NULL;
+                        curr->datam[i] = nullptr;
                     }
                 }
-                curr->time = NULL;
+                curr->time = nullptr;
             }
             maxframes += 10;
             for (i = 0; (i < curr->ngrp); i++)
@@ -808,7 +808,7 @@ int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
         for (i = 0; (i < curr->ngrp); i++)
         {
             /* calculate something useful, like mean square displacements */
-            calc_corr(curr, i, gnx[i], index[i], xa[cur], (gnx_com != NULL), com,
+            calc_corr(curr, i, gnx[i], index[i], xa[cur], (gnx_com != nullptr), com,
                       calc1, bTen);
         }
         cur    = prev;
@@ -882,9 +882,9 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
     real          *DD, *SigmaD, a, a2, b, r, chi2;
     rvec          *x;
     matrix         box;
-    int           *gnx_com     = NULL; /* the COM removal group size  */
-    int          **index_com   = NULL; /* the COM removal group atom indices */
-    char         **grpname_com = NULL; /* the COM removal group name */
+    int           *gnx_com     = nullptr; /* the COM removal group size  */
+    int          **index_com   = nullptr; /* the COM removal group atom indices */
+    char         **grpname_com = nullptr; /* the COM removal group name */
 
     snew(gnx, nrgrp);
     snew(index, nrgrp);
@@ -909,14 +909,14 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
     }
 
     msd = init_corr(nrgrp, type, axis, dim_factor,
-                    mol_file == NULL ? 0 : gnx[0], bTen, bMW, dt, top,
+                    mol_file == nullptr ? 0 : gnx[0], bTen, bMW, dt, top,
                     beginfit, endfit);
 
     nat_trx =
         corr_loop(msd, trx_file, top, ePBC, mol_file ? gnx[0] : 0, gnx, index,
-                  (mol_file != NULL) ? calc1_mol : (bMW ? calc1_mw : calc1_norm),
+                  (mol_file != nullptr) ? calc1_mol : (bMW ? calc1_mw : calc1_norm),
                   bTen, gnx_com, index_com, dt, t_pdb,
-                  pdb_file ? &x : NULL, box, oenv);
+                  pdb_file ? &x : nullptr, box, oenv);
 
     /* Correct for the number of points */
     for (j = 0; (j < msd->ngrp); j++)
@@ -933,14 +933,14 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
 
     if (mol_file)
     {
-        if (pdb_file && x == NULL)
+        if (pdb_file && x == nullptr)
         {
             fprintf(stderr, "\nNo frame found need time tpdb = %g ps\n"
                     "Can not write %s\n\n", t_pdb, pdb_file);
         }
         i             = top->atoms.nr;
         top->atoms.nr = nat_trx;
-        if (pdb_file && top->atoms.pdbinfo == NULL)
+        if (pdb_file && top->atoms.pdbinfo == nullptr)
         {
             snew(top->atoms.pdbinfo, top->atoms.nr);
         }
@@ -948,8 +948,8 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
         top->atoms.nr = i;
     }
 
-    DD     = NULL;
-    SigmaD = NULL;
+    DD     = nullptr;
+    SigmaD = nullptr;
 
     if (beginfit == -1)
     {
@@ -1069,8 +1069,8 @@ int gmx_msd(int argc, char *argv[])
         "the diffusion coefficient of the molecule.",
         "This option implies option [TT]-mol[tt]."
     };
-    static const char *normtype[] = { NULL, "no", "x", "y", "z", NULL };
-    static const char *axtitle[]  = { NULL, "no", "x", "y", "z", NULL };
+    static const char *normtype[] = { nullptr, "no", "x", "y", "z", nullptr };
+    static const char *axtitle[]  = { nullptr, "no", "x", "y", "z", nullptr };
     static int         ngroup     = 1;
     static real        dt         = 10;
     static real        t_pdb      = 0;
@@ -1103,10 +1103,10 @@ int gmx_msd(int argc, char *argv[])
     };
 
     t_filenm           fnm[] = {
-        { efTRX, NULL, NULL,  ffREAD },
-        { efTPS, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
-        { efXVG, NULL, "msd", ffWRITE },
+        { efTRX, nullptr, nullptr,  ffREAD },
+        { efTPS, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
+        { efXVG, nullptr, "msd", ffWRITE },
         { efXVG, "-mol", "diff_mol", ffOPTWR },
         { efPDB, "-pdb", "diff_mol", ffOPTWR }
     };
@@ -1124,7 +1124,7 @@ int gmx_msd(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1159,8 +1159,8 @@ int gmx_msd(int argc, char *argv[])
         fprintf(stderr, "Calculating diffusion coefficients for molecules.\n");
     }
 
-    GMX_RELEASE_ASSERT(normtype[0] != 0, "Options inconsistency; normtype[0] is NULL");
-    GMX_RELEASE_ASSERT(axtitle[0] != 0, "Options inconsistency; axtitle[0] is NULL");
+    GMX_RELEASE_ASSERT(normtype[0] != nullptr, "Options inconsistency; normtype[0] is NULL");
+    GMX_RELEASE_ASSERT(axtitle[0] != nullptr, "Options inconsistency; axtitle[0] is NULL");
 
     if (normtype[0][0] != 'n')
     {
@@ -1188,7 +1188,7 @@ int gmx_msd(int argc, char *argv[])
         gmx_fatal(FARGS, "Can only calculate the full tensor for 3D msd");
     }
 
-    bTop = read_tps_conf(tps_file, &top, &ePBC, &xdum, NULL, box, bMW || bRmCOMM);
+    bTop = read_tps_conf(tps_file, &top, &ePBC, &xdum, nullptr, box, bMW || bRmCOMM);
     if (mol_file && !bTop)
     {
         gmx_fatal(FARGS,
index 61f3bd68895b2b9182be697d2faebf07526b7c62..c818723932c8c7bc5914c747441ee1b582d53cff 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -179,7 +179,7 @@ nma_full_hessian(real                      *hess,
     eigensolver(hess, ndim, begin-1, end-1, eigenvalues, eigenvectors);
 
     /* And scale the output eigenvectors */
-    if (bM && eigenvectors != NULL)
+    if (bM && eigenvectors != nullptr)
     {
         for (int i = 0; i < (end-begin+1); i++)
         {
@@ -218,7 +218,7 @@ nma_sparse_hessian(gmx_sparsematrix_t        *sparse_hessian,
     /* Cannot check symmetry since we only store half matrix */
     /* divide elements hess[i][j] by sqrt(mas[i])*sqrt(mas[j]) when required */
 
-    GMX_RELEASE_ASSERT(sparse_hessian != NULL, "NULL matrix pointer provided to nma_sparse_hessian");
+    GMX_RELEASE_ASSERT(sparse_hessian != nullptr, "NULL matrix pointer provided to nma_sparse_hessian");
 
     if (bM)
     {
@@ -245,7 +245,7 @@ nma_sparse_hessian(gmx_sparsematrix_t        *sparse_hessian,
     sparse_eigensolver(sparse_hessian, neig, eigenvalues, eigenvectors, 10000000);
 
     /* Scale output eigenvectors */
-    if (bM && eigenvectors != NULL)
+    if (bM && eigenvectors != nullptr)
     {
         for (i = 0; i < neig; i++)
         {
@@ -361,19 +361,19 @@ int gmx_nmeig(int argc, char *argv[])
     real                   value, omega, nu;
     real                   factor_gmx_to_omega2;
     real                   factor_omega_to_wavenumber;
-    real                  *spectrum = NULL;
+    real                  *spectrum = nullptr;
     real                   wfac;
     gmx_output_env_t      *oenv;
     const char            *qcleg[] = {
         "Heat Capacity cV (J/mol K)",
         "Enthalpy H (kJ/mol)"
     };
-    real *                 full_hessian   = NULL;
-    gmx_sparsematrix_t *   sparse_hessian = NULL;
+    real *                 full_hessian   = nullptr;
+    gmx_sparsematrix_t *   sparse_hessian = nullptr;
 
     t_filenm               fnm[] = {
         { efMTX, "-f", "hessian",    ffREAD  },
-        { efTPR, NULL, NULL,         ffREAD  },
+        { efTPR, nullptr, nullptr,         ffREAD  },
         { efXVG, "-of", "eigenfreq", ffWRITE },
         { efXVG, "-ol", "eigenval",  ffWRITE },
         { efXVG, "-os", "spectrum",  ffOPTWR },
@@ -383,7 +383,7 @@ int gmx_nmeig(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -393,8 +393,8 @@ int gmx_nmeig(int argc, char *argv[])
     snew(top_x, tpx.natoms);
 
     int natoms_tpx;
-    read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms_tpx,
-             top_x, NULL, &mtop);
+    read_tpx(ftp2fn(efTPR, NFILE, fnm), nullptr, box, &natoms_tpx,
+             top_x, nullptr, &mtop);
     int nharm = 0;
     if (bCons)
     {
@@ -430,7 +430,7 @@ int gmx_nmeig(int argc, char *argv[])
      * If this is not valid we convert to full matrix storage,
      * but warn the user that we might run out of memory...
      */
-    if ((sparse_hessian != NULL) && (end == ndim))
+    if ((sparse_hessian != nullptr) && (end == ndim))
     {
         fprintf(stderr, "Cannot use sparse Hessian to calculate all eigenvectors.\n");
 
@@ -463,13 +463,13 @@ int gmx_nmeig(int argc, char *argv[])
             }
         }
         gmx_sparsematrix_destroy(sparse_hessian);
-        sparse_hessian = NULL;
+        sparse_hessian = nullptr;
         fprintf(stderr, "Converted sparse to full matrix storage.\n");
     }
 
     snew(eigenvalues, nrow);
 
-    if (full_hessian != NULL)
+    if (full_hessian != nullptr)
     {
         /* Using full matrix storage */
         eigenvectors = allocateEigenvectors(nrow, begin, end, false);
@@ -534,7 +534,7 @@ int gmx_nmeig(int argc, char *argv[])
     }
     else
     {
-        qc = NULL;
+        qc = nullptr;
     }
     printf("Writing eigenfrequencies - negative eigenvalues will be set to zero.\n");
 
@@ -553,7 +553,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
     }
     /* Spectrum ? */
-    spec = NULL;
+    spec = nullptr;
     if (opt2bSet("-os", NFILE, fnm) && (maxspec > 0))
     {
         snew(spectrum, maxspec);
@@ -590,7 +590,7 @@ int gmx_nmeig(int argc, char *argv[])
         nu    = 1e-12*omega/(2*M_PI);
         value = omega*factor_omega_to_wavenumber;
         fprintf (out, "%6d %15g\n", i, value);
-        if (NULL != spec)
+        if (nullptr != spec)
         {
             wfac = eigenvalues[i-begin]/(width*std::sqrt(2*M_PI));
             for (j = 0; (j < maxspec); j++)
@@ -598,7 +598,7 @@ int gmx_nmeig(int argc, char *argv[])
                 spectrum[j] += wfac*std::exp(-gmx::square(j-value)/(2*gmx::square(width)));
             }
         }
-        if (NULL != qc)
+        if (nullptr != qc)
         {
             qcv = cv_corr(nu, T);
             qu  = u_corr(nu, T);
@@ -613,7 +613,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
     }
     xvgrclose(out);
-    if (NULL != spec)
+    if (nullptr != spec)
     {
         for (j = 0; (j < maxspec); j++)
         {
@@ -621,7 +621,7 @@ int gmx_nmeig(int argc, char *argv[])
         }
         xvgrclose(spec);
     }
-    if (NULL != qc)
+    if (nullptr != qc)
     {
         printf("Quantum corrections for harmonic degrees of freedom\n");
         printf("Use appropriate -first and -last options to get reliable results.\n");
@@ -637,7 +637,7 @@ int gmx_nmeig(int argc, char *argv[])
      * will not be strictly orthogonal in plain cartesian scalar products.
      */
     const real *eigenvectorPtr;
-    if (full_hessian != NULL)
+    if (full_hessian != nullptr)
     {
         eigenvectorPtr = eigenvectors;
     }
@@ -647,7 +647,7 @@ int gmx_nmeig(int argc, char *argv[])
         eigenvectorPtr = eigenvectors + (begin - 1)*atom_index.size();
     }
     write_eigenvectors(opt2fn("-v", NFILE, fnm), atom_index.size(), eigenvectorPtr, FALSE, begin, end,
-                       eWXR_NO, NULL, FALSE, top_x, bM, eigenvalues);
+                       eWXR_NO, nullptr, FALSE, top_x, bM, eigenvalues);
 
     return 0;
 }
index 235f1b20ba9255c09241a2a32983ef14fc162ab9..0157f7d132cecd6e048a1208ae7386063d5feee0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -92,8 +92,8 @@ int gmx_nmens(int argc, char *argv[])
     t_atoms            *atoms;
     rvec               *xtop, *xref, *xav, *xout1, *xout2;
     gmx_bool            bDMR, bDMA, bFit;
-    int                 nvec, *eignr = NULL;
-    rvec              **eigvec = NULL;
+    int                 nvec, *eignr = nullptr;
+    rvec              **eigvec = nullptr;
     matrix              box;
     real               *eigval, *invsqrtm, t, disp;
     int                 natoms;
@@ -113,14 +113,14 @@ int gmx_nmens(int argc, char *argv[])
     t_filenm fnm[] = {
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efXVG, "-e",    "eigenval",    ffREAD  },
-        { efTPS, NULL,    NULL,          ffREAD },
-        { efNDX, NULL,    NULL,          ffOPTRD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
+        { efNDX, nullptr,    nullptr,          ffOPTRD },
         { efTRO, "-o",    "ensemble",    ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -130,7 +130,7 @@ int gmx_nmens(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, bDMA);
     atoms = &top.atoms;
 
     printf("\nSelect an index group of %d elements that corresponds to the eigenvectors\n", natoms);
@@ -176,7 +176,7 @@ int gmx_nmens(int argc, char *argv[])
     {
         printf("Select eigenvectors for output, end your selection with 0\n");
         nout = -1;
-        iout = NULL;
+        iout = nullptr;
         do
         {
             nout++;
@@ -268,7 +268,7 @@ int gmx_nmens(int argc, char *argv[])
             copy_rvec(xout1[i], xout2[index[i]]);
         }
         t = s+1;
-        write_trx(out, natoms, index, atoms, 0, t, box, xout2, NULL, NULL);
+        write_trx(out, natoms, index, atoms, 0, t, box, xout2, nullptr, nullptr);
         fprintf(stderr, "\rGenerated %d structures", s+1);
         fflush(stderr);
     }
index 3870a107450c5258e42dea0d7af9f4db4e488e68..63354ff9e0ee663e856b9a8210e65888d31990f7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -100,8 +100,8 @@ int gmx_nmtraj(int argc, char *argv[])
     int               ePBC;
     t_atoms          *atoms;
     rvec             *xtop, *xref, *xav, *xout;
-    int               nvec, *eignr = NULL;
-    rvec            **eigvec = NULL;
+    int               nvec, *eignr = nullptr;
+    rvec            **eigvec = nullptr;
     matrix            box;
     int               natoms;
     int               i, j, k, kmode, d;
@@ -124,7 +124,7 @@ int gmx_nmtraj(int argc, char *argv[])
 
     t_filenm          fnm[] =
     {
-        { efTPS, NULL,    NULL,          ffREAD },
+        { efTPS, nullptr,    nullptr,          ffREAD },
         { efTRN, "-v",    "eigenvec",    ffREAD  },
         { efTRO, "-o",    "nmtraj",      ffWRITE }
     };
@@ -132,7 +132,7 @@ int gmx_nmtraj(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -140,7 +140,7 @@ int gmx_nmtraj(int argc, char *argv[])
     read_eigenvectors(opt2fn("-v", NFILE, fnm), &natoms, &bFit,
                       &xref, &bDMR, &xav, &bDMA, &nvec, &eignr, &eigvec, &eigval);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, bDMA);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, bDMA);
 
     /* Find vectors and phases */
 
@@ -322,7 +322,7 @@ int gmx_nmtraj(int argc, char *argv[])
                 }
             }
         }
-        write_trx(out, natoms, dummy, atoms, i, static_cast<real>(i)/nframes, box, xout, NULL, NULL);
+        write_trx(out, natoms, dummy, atoms, i, static_cast<real>(i)/nframes, box, xout, nullptr, nullptr);
     }
 
     fprintf(stderr, "\n");
index d48e5d4f907440308c864e991419cb9bc9678126..1d89971cda9f991f3d27240439e28eef7f9c1006 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -258,7 +258,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
                                   const char *sgslfn, const char *skslfn,
                                   const gmx_output_env_t *oenv)
 {
-    FILE        *fpsg = NULL, *fpsk = NULL;
+    FILE        *fpsg = nullptr, *fpsk = nullptr;
     t_topology   top;
     int          ePBC;
     t_trxstatus *status;
@@ -271,10 +271,10 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
     char       **grpname;
     int          i, *isize, ng, nframes;
     real        *sg_slice, *sg_slice_tot, *sk_slice, *sk_slice_tot;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
-    read_tps_conf(fnTPS, &top, &ePBC, &xtop, NULL, box, FALSE);
+    read_tps_conf(fnTPS, &top, &ePBC, &xtop, nullptr, box, FALSE);
 
     snew(sg_slice, nslice);
     snew(sk_slice, nslice);
@@ -295,7 +295,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
         gmx_fatal(FARGS, "Topology (%d atoms) does not match trajectory (%d atoms)",
                   top.atoms.nr, natoms);
     }
-    check_index(NULL, ng, index[0], NULL, natoms);
+    check_index(nullptr, ng, index[0], nullptr, natoms);
 
     fpsg = xvgropen(sgfn, "S\\sg\\N Angle Order Parameter", "Time (ps)", "S\\sg\\N",
                     oenv);
@@ -405,11 +405,11 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
     gmx_bool     use_unitvector         = FALSE; /* use a specified unit vector instead of axis to specify unit normal*/
     rvec         direction, com, dref, dvec;
     int          comsize, distsize;
-    int         *comidx  = NULL, *distidx = NULL;
-    char        *grpname = NULL;
+    int         *comidx  = nullptr, *distidx = nullptr;
+    char        *grpname = nullptr;
     t_pbc        pbc;
     real         arcdist, tmpdist;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     /* PBC added for center-of-mass vector*/
     /* Initiate the pbc structure */
@@ -440,7 +440,7 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
     }
     if (distcalc)
     {
-        if (grpname != NULL)
+        if (grpname != nullptr)
         {
             sfree(grpname);
         }
@@ -739,15 +739,15 @@ void calc_order(const char *fn, int *index, int *a, rvec **order,
 
     sfree(x0); /* free memory used by coordinate arrays */
     sfree(x1);
-    if (comidx != NULL)
+    if (comidx != nullptr)
     {
         sfree(comidx);
     }
-    if (distidx != NULL)
+    if (distidx != nullptr)
     {
         sfree(distidx);
     }
-    if (grpname != NULL)
+    if (grpname != nullptr)
     {
         sfree(grpname);
     }
@@ -854,7 +854,7 @@ void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices,
     frout.natoms = nout;
     frout.bF     = FALSE;
     frout.bV     = FALSE;
-    frout.x      = 0;
+    frout.x      = nullptr;
     snew(frout.x, nout);
 
     init_t_atoms(&useatoms, nout, TRUE);
@@ -887,7 +887,7 @@ void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices,
         }
     }
 
-    write_sto_conf(opt2fn("-ob", nfile, fnm), "Order parameters", &useatoms, frout.x, NULL, frout.ePBC, frout.box);
+    write_sto_conf(opt2fn("-ob", nfile, fnm), "Order parameters", &useatoms, frout.x, nullptr, frout.ePBC, frout.box);
 
     sfree(frout.x);
     done_atom(&useatoms);
@@ -919,7 +919,7 @@ int gmx_order(int argc, char *argv[])
     static int         nslices       = 1;     /* nr of slices defined       */
     static gmx_bool    bSzonly       = FALSE; /* True if only Sz is wanted  */
     static gmx_bool    bUnsat        = FALSE; /* True if carbons are unsat. */
-    static const char *normal_axis[] = { NULL, "z", "x", "y", NULL };
+    static const char *normal_axis[] = { nullptr, "z", "x", "y", nullptr };
     static gmx_bool    permolecule   = FALSE; /*compute on a per-molecule basis */
     static gmx_bool    radial        = FALSE; /*compute a radial membrane normal */
     static gmx_bool    distcalc      = FALSE; /*calculate distance from a reference group */
@@ -955,13 +955,13 @@ int gmx_order(int argc, char *argv[])
     *a;                                               /* atom numbers in each group */
     t_blocka         *block;                          /* data from index file       */
     t_filenm          fnm[] = {                       /* files for g_order    */
-        { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
-        { efNDX, "-n", NULL,  ffREAD },               /* index file           */
-        { efNDX, "-nr", NULL,  ffOPTRD },             /* index for radial axis calculation */
-        { efTPR, NULL, NULL,  ffREAD },               /* topology file                */
+        { efTRX, "-f", nullptr,  ffREAD },            /* trajectory file              */
+        { efNDX, "-n", nullptr,  ffREAD },            /* index file           */
+        { efNDX, "-nr", nullptr,  ffOPTRD },          /* index for radial axis calculation */
+        { efTPR, nullptr, nullptr,  ffREAD },         /* topology file                */
         { efXVG, "-o", "order", ffWRITE },            /* xvgr output file     */
         { efXVG, "-od", "deuter", ffWRITE },          /* xvgr output file           */
-        { efPDB, "-ob", NULL, ffOPTWR },              /* write Scd as B factors to PDB if permolecule           */
+        { efPDB, "-ob", nullptr, ffOPTWR },           /* write Scd as B factors to PDB if permolecule           */
         { efXVG, "-os", "sliced", ffWRITE },          /* xvgr output file           */
         { efXVG, "-Sg", "sg-ang", ffOPTWR },          /* xvgr output file           */
         { efXVG, "-Sk", "sk-dist", ffOPTWR },         /* xvgr output file           */
@@ -970,12 +970,12 @@ int gmx_order(int argc, char *argv[])
     };
     gmx_bool          bSliced = FALSE;                /* True if box is sliced      */
 #define NFILE asize(fnm)
-    real            **distvals = NULL;
+    real            **distvals = nullptr;
     const char       *sgfnm, *skfnm, *ndxfnm, *tpsfnm, *trxfnm;
     gmx_output_env_t *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -990,7 +990,7 @@ int gmx_order(int argc, char *argv[])
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */
-    GMX_RELEASE_ASSERT(normal_axis[0] != NULL, "Options inconsistency; normal_axis[0] is NULL");
+    GMX_RELEASE_ASSERT(normal_axis[0] != nullptr, "Options inconsistency; normal_axis[0] is NULL");
     if (std::strcmp(normal_axis[0], "x") == 0)
     {
         axis = XX;
@@ -1031,12 +1031,12 @@ int gmx_order(int argc, char *argv[])
                               opt2fn("-Sgsl", NFILE, fnm), opt2fn("-Sksl", NFILE, fnm),
                               oenv);
         /* view xvgr files */
-        do_view(oenv, opt2fn("-Sg", NFILE, fnm), NULL);
-        do_view(oenv, opt2fn("-Sk", NFILE, fnm), NULL);
+        do_view(oenv, opt2fn("-Sg", NFILE, fnm), nullptr);
+        do_view(oenv, opt2fn("-Sk", NFILE, fnm), nullptr);
         if (nslices > 1)
         {
-            do_view(oenv, opt2fn("-Sgsl", NFILE, fnm), NULL);
-            do_view(oenv, opt2fn("-Sksl", NFILE, fnm), NULL);
+            do_view(oenv, opt2fn("-Sgsl", NFILE, fnm), nullptr);
+            do_view(oenv, opt2fn("-Sksl", NFILE, fnm), nullptr);
         }
     }
     else
@@ -1110,12 +1110,12 @@ int gmx_order(int argc, char *argv[])
         }
 
 
-        do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);  /* view xvgr file */
-        do_view(oenv, opt2fn("-os", NFILE, fnm), NULL); /* view xvgr file */
-        do_view(oenv, opt2fn("-od", NFILE, fnm), NULL); /* view xvgr file */
+        do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);  /* view xvgr file */
+        do_view(oenv, opt2fn("-os", NFILE, fnm), nullptr); /* view xvgr file */
+        do_view(oenv, opt2fn("-od", NFILE, fnm), nullptr); /* view xvgr file */
     }
 
-    if (distvals != NULL)
+    if (distvals != nullptr)
     {
         for (i = 0; i < nslices; ++i)
         {
index e647bf04b0be6100ece204996d0ce756ed2d40f8..46373cff09fe2490bf824f39fa9077af8d6a72d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -454,7 +454,7 @@ static real estimate_reciprocal(
     real      tmp2   = 0;
     gmx_bool  bFraction;
 
-    int      *numbers = NULL;
+    int      *numbers = nullptr;
 
     /* Index variables for parallel work distribution */
     int startglobal, stopglobal;
@@ -922,17 +922,17 @@ static void estimate_PME_error(t_inputinfo *info, const t_state *state,
                                const gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, unsigned int seed,
                                t_commrec *cr)
 {
-    rvec *x     = NULL; /* The coordinates */
-    real *q     = NULL; /* The charges     */
-    real  edir  = 0.0;  /* real space error */
-    real  erec  = 0.0;  /* reciprocal space error */
-    real  derr  = 0.0;  /* difference of real and reciprocal space error */
-    real  derr0 = 0.0;  /* difference of real and reciprocal space error */
-    real  beta  = 0.0;  /* splitting parameter beta */
-    real  beta0 = 0.0;  /* splitting parameter beta */
-    int   ncharges;     /* The number of atoms with charges */
-    int   nsamples;     /* The number of samples used for the calculation of the
-                         * self-energy error term */
+    rvec *x     = nullptr; /* The coordinates */
+    real *q     = nullptr; /* The charges     */
+    real  edir  = 0.0;     /* real space error */
+    real  erec  = 0.0;     /* reciprocal space error */
+    real  derr  = 0.0;     /* difference of real and reciprocal space error */
+    real  derr0 = 0.0;     /* difference of real and reciprocal space error */
+    real  beta  = 0.0;     /* splitting parameter beta */
+    real  beta0 = 0.0;     /* splitting parameter beta */
+    int   ncharges;        /* The number of atoms with charges */
+    int   nsamples;        /* The number of samples used for the calculation of the
+                            * self-energy error term */
     int   i = 0;
 
     if (MASTER(cr))
@@ -1090,10 +1090,10 @@ int gmx_pme_error(int argc, char *argv[])
     real            user_beta = -1.0;
     real            fracself  = 1.0;
     t_inputinfo     info;
-    t_state         state;     /* The state from the tpr input file */
-    gmx_mtop_t      mtop;      /* The topology from the tpr input file */
-    t_inputrec     *ir = NULL; /* The inputrec from the tpr file */
-    FILE           *fp = NULL;
+    t_state         state;        /* The state from the tpr input file */
+    gmx_mtop_t      mtop;         /* The topology from the tpr input file */
+    t_inputrec     *ir = nullptr; /* The inputrec from the tpr file */
+    FILE           *fp = nullptr;
     t_commrec      *cr;
     unsigned long   PCA_Flags;
     gmx_bool        bTUNE    = FALSE;
@@ -1102,12 +1102,12 @@ int gmx_pme_error(int argc, char *argv[])
 
 
     static t_filenm   fnm[] = {
-        { efTPR, "-s",     NULL,    ffREAD },
+        { efTPR, "-s",     nullptr,    ffREAD },
         { efOUT, "-o",    "error",  ffWRITE },
         { efTPR, "-so",   "tuned",  ffOPTWR }
     };
 
-    gmx_output_env_t *oenv = NULL;
+    gmx_output_env_t *oenv = nullptr;
 
     t_pargs           pa[] = {
         { "-beta",     FALSE, etREAL, {&user_beta},
@@ -1130,7 +1130,7 @@ int gmx_pme_error(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_Flags,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         sfree(cr);
         return 0;
index affd359d0495468615c8e1a6c0aba1f2e70d56bb..f371846364c5fca98ab72bd16d6b741da7de786c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -141,9 +141,9 @@ int gmx_polystat(int argc, char *argv[])
     };
 
     t_filenm        fnm[] = {
-        { efTPR, NULL, NULL,  ffREAD  },
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efNDX, NULL, NULL,  ffOPTRD },
+        { efTPR, nullptr, nullptr,  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
         { efXVG, "-o", "polystat",  ffWRITE },
         { efXVG, "-v", "polyvec", ffOPTWR },
         { efXVG, "-p", "persist",  ffOPTWR },
@@ -158,14 +158,14 @@ int gmx_polystat(int argc, char *argv[])
     char             *grpname;
     t_trxstatus      *status;
     real              t;
-    rvec             *x, *bond = NULL;
+    rvec             *x, *bond = nullptr;
     matrix            box;
     int               natoms, i, j, frame, ind0, ind1, a, d, d2, ord[DIM] = {0};
     dvec              cm, sum_eig = {0, 0, 0};
     double          **gyr, **gyr_all, eig[DIM], **eigv;
     double            sum_eed2, sum_eed2_tot, sum_gyro, sum_gyro_tot, sum_pers_tot;
-    int              *ninp    = NULL;
-    double           *sum_inp = NULL, pers;
+    int              *ninp    = nullptr;
+    double           *sum_inp = nullptr, pers;
     double           *intd, ymax, ymin;
     double            mmol, m;
     char              title[STRLEN];
@@ -176,18 +176,18 @@ int gmx_polystat(int argc, char *argv[])
         "<R\\sg\\N eig1>", "<R\\sg\\N eig2>", "<R\\sg\\N eig3>"
     };
     char            **legp, buf[STRLEN];
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
     snew(top, 1);
     ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
-                        NULL, box, &natoms, NULL, NULL, top);
+                        nullptr, box, &natoms, nullptr, nullptr, top);
 
     fprintf(stderr, "Select a group of polymer mainchain atoms:\n");
     get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm),
@@ -242,7 +242,7 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        outv = NULL;
+        outv = nullptr;
     }
 
     if (opt2bSet("-p", NFILE, fnm))
@@ -255,7 +255,7 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        outp = NULL;
+        outp = nullptr;
     }
 
     if (opt2bSet("-i", NFILE, fnm))
@@ -267,8 +267,8 @@ int gmx_polystat(int argc, char *argv[])
     }
     else
     {
-        intd = NULL;
-        outi = NULL;
+        intd = nullptr;
+        outi = nullptr;
     }
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
index a8258f03608bc924d0cc86599afab1fc7a7a91f4..034ac993b83ac9c366cbfb1e10ec2a0fbdea207a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -122,7 +122,7 @@ void calc_potential(const char *fn, int **index, int gnx[],
     real         t;
     double       z;
     rvec         xcm;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     switch (axis)
     {
@@ -457,9 +457,9 @@ int gmx_potential(int argc, char *argv[])
     int         ePBC;
     int       **index;                         /* indices for all groups     */
     t_filenm    fnm[] = {                      /* files for g_order       */
-        { efTRX, "-f", NULL,  ffREAD },        /* trajectory file             */
-        { efNDX, NULL, NULL,  ffREAD },        /* index file          */
-        { efTPR, NULL, NULL,  ffREAD },        /* topology file               */
+        { efTRX, "-f", nullptr,  ffREAD },     /* trajectory file             */
+        { efNDX, nullptr, nullptr,  ffREAD },  /* index file          */
+        { efTPR, nullptr, nullptr,  ffREAD },  /* topology file               */
         { efXVG, "-o", "potential", ffWRITE }, /* xvgr output file    */
         { efXVG, "-oc", "charge", ffWRITE },   /* xvgr output file    */
         { efXVG, "-of", "field", ffWRITE },    /* xvgr output file    */
@@ -495,9 +495,9 @@ int gmx_potential(int argc, char *argv[])
                    opt2fn("-oc", NFILE, fnm), opt2fn("-of", NFILE, fnm),
                    nslices, ngrps, (const char**)grpname, slWidth, oenv);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);  /* view xvgr file */
-    do_view(oenv, opt2fn("-oc", NFILE, fnm), NULL); /* view xvgr file */
-    do_view(oenv, opt2fn("-of", NFILE, fnm), NULL); /* view xvgr file */
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);  /* view xvgr file */
+    do_view(oenv, opt2fn("-oc", NFILE, fnm), nullptr); /* view xvgr file */
+    do_view(oenv, opt2fn("-of", NFILE, fnm), nullptr); /* view xvgr file */
 
     return 0;
 }
index a6a8a8fb7125c60093fa16a7a6e0d8c7e1bce2b6..149b228b6b4f23e2c816cda4488b409d2a115558 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -102,13 +102,13 @@ int gmx_principal(int argc, char *argv[])
     FILE        *     fmoi;
     matrix            axes, box;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     char   **         legend;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efXVG, "-a1",  "paxis1",   ffWRITE },
         { efXVG, "-a2",  "paxis2",   ffWRITE },
         { efXVG, "-a3",  "paxis3",   ffWRITE },
@@ -118,7 +118,7 @@ int gmx_principal(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -156,7 +156,7 @@ int gmx_principal(int argc, char *argv[])
     }
     sfree(legend);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box, TRUE);
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
index d17df2149f7637dfd860e56062a81c05196afc59..7aa63cbddd0db19914d2f37441d14292a5671e42 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -78,14 +78,14 @@ int gmx_rama(int argc, char *argv[])
     int               j;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD },
-        { efTPR, NULL, NULL,  ffREAD },
-        { efXVG, NULL, "rama", ffWRITE }
+        { efTRX, "-f", nullptr,  ffREAD },
+        { efTPR, nullptr, nullptr,  ffREAD },
+        { efXVG, nullptr, "rama", ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, 0, NULL, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, 0, nullptr, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -114,7 +114,7 @@ int gmx_rama(int argc, char *argv[])
     fprintf(stderr, "\n");
     xvgrclose(out);
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 7d090a335c89ac969e27367ee42997236fe26d21..8b0eb99be07536917fa880aa2ffc905ea743ea65 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -72,7 +72,7 @@ static void norm_princ(const t_atoms *atoms, int isize, int *index, int natoms,
 
     /* equalize principal components: */
     /* orient principal axes, get principal components */
-    orient_princ(atoms, isize, index, natoms, x, NULL, princ);
+    orient_princ(atoms, isize, index, natoms, x, nullptr, princ);
 
     /* calc our own principal components */
     clear_rvec(vec);
@@ -159,15 +159,15 @@ int gmx_rms(int argc, char *argv[])
     };
     int         ewhat;
     const char *what[ewNR + 1] =
-    { NULL, "rmsd", "rho", "rhosc", NULL };
+    { nullptr, "rmsd", "rho", "rhosc", nullptr };
     const char *whatname[ewNR] =
-    { NULL, "RMSD", "Rho", "Rho sc" };
+    { nullptr, "RMSD", "Rho", "Rho sc" };
     const char *whatlabel[ewNR] =
-    { NULL, "RMSD (nm)", "Rho", "Rho sc" };
+    { nullptr, "RMSD (nm)", "Rho", "Rho sc" };
     const char *whatxvgname[ewNR] =
-    { NULL, "RMSD", "\\8r\\4", "\\8r\\4\\ssc\\N" };
+    { nullptr, "RMSD", "\\8r\\4", "\\8r\\4\\ssc\\N" };
     const char *whatxvglabel[ewNR] =
-    { NULL, "RMSD (nm)", "\\8r\\4", "\\8r\\4\\ssc\\N" };
+    { nullptr, "RMSD (nm)", "\\8r\\4", "\\8r\\4\\ssc\\N" };
     /* strings and things for fitting methods */
     enum
     {
@@ -175,9 +175,9 @@ int gmx_rms(int argc, char *argv[])
     };
     int             efit;
     const char     *fit[efNR + 1] =
-    { NULL, "rot+trans", "translation", "none", NULL };
+    { nullptr, "rot+trans", "translation", "none", nullptr };
     const char     *fitgraphlabel[efNR + 1] =
-    { NULL, "lsq fit", "translational fit", "no fit" };
+    { nullptr, "lsq fit", "translational fit", "no fit" };
     static int      nrms          = 1;
     static gmx_bool bMassWeighted = TRUE;
     t_pargs         pa[]          =
@@ -225,44 +225,44 @@ int gmx_rms(int argc, char *argv[])
     int             i, j, k, m, teller, teller2, tel_mat, tel_mat2;
 #define NFRAME 5000
     int             maxframe = NFRAME, maxframe2 = NFRAME;
-    real            t, *w_rls, *w_rms, *w_rls_m = NULL, *w_rms_m = NULL;
+    real            t, *w_rls, *w_rms, *w_rls_m = nullptr, *w_rms_m = nullptr;
     gmx_bool        bNorm, bAv, bFreq2, bFile2, bMat, bBond, bDelta, bMirror, bMass;
     gmx_bool        bFit, bReset;
     t_topology      top;
     int             ePBC;
-    t_iatom        *iatom = NULL;
+    t_iatom        *iatom = nullptr;
 
     matrix          box = {{0}};
-    rvec           *x, *xp, *xm = NULL, **mat_x = NULL, **mat_x2, *mat_x2_j = NULL, vec1,
+    rvec           *x, *xp, *xm = nullptr, **mat_x = nullptr, **mat_x2, *mat_x2_j = nullptr, vec1,
                     vec2;
     t_trxstatus    *status;
     char            buf[256], buf2[256];
     int             ncons = 0;
     FILE           *fp;
-    real            rlstot = 0, **rls, **rlsm = NULL, *time, *time2, *rlsnorm = NULL,
-    **rmsd_mat             = NULL, **bond_mat = NULL, *axis, *axis2, *del_xaxis,
+    real            rlstot = 0, **rls, **rlsm = nullptr, *time, *time2, *rlsnorm = nullptr,
+    **rmsd_mat             = nullptr, **bond_mat = nullptr, *axis, *axis2, *del_xaxis,
     *del_yaxis, rmsd_max, rmsd_min, rmsd_avg, bond_max, bond_min, ang;
-    real            **rmsdav_mat = NULL, av_tot, weight, weight_tot;
-    real            **delta      = NULL, delta_max, delta_scalex = 0, delta_scaley = 0,
+    real            **rmsdav_mat = nullptr, av_tot, weight, weight_tot;
+    real            **delta      = nullptr, delta_max, delta_scalex = 0, delta_scaley = 0,
     *delta_tot;
     int               delta_xsize = 0, del_lev = 100, mx, my, abs_my;
-    gmx_bool          bA1, bA2, bPrev, bTop, *bInMat = NULL;
-    int               ifit, *irms, ibond = 0, *ind_bond1 = NULL, *ind_bond2 = NULL, n_ind_m =
+    gmx_bool          bA1, bA2, bPrev, bTop, *bInMat = nullptr;
+    int               ifit, *irms, ibond = 0, *ind_bond1 = nullptr, *ind_bond2 = nullptr, n_ind_m =
         0;
-    int              *ind_fit, **ind_rms, *ind_m = NULL, *rev_ind_m = NULL, *ind_rms_m =
-        NULL;
+    int              *ind_fit, **ind_rms, *ind_m = nullptr, *rev_ind_m = nullptr, *ind_rms_m =
+        nullptr;
     char             *gn_fit, **gn_rms;
     t_rgb             rlo, rhi;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] =
     {
-        { efTPS, NULL, NULL, ffREAD },
-        { efTRX, "-f", NULL, ffREAD },
-        { efTRX, "-f2", NULL, ffOPTRD },
-        { efNDX, NULL, NULL, ffOPTRD },
-        { efXVG, NULL, "rmsd", ffWRITE },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTRX, "-f2", nullptr, ffOPTRD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
+        { efXVG, nullptr, "rmsd", ffWRITE },
         { efXVG, "-mir", "rmsdmir", ffOPTWR },
         { efXVG, "-a", "avgrp", ffOPTWR },
         { efXVG, "-dist", "rmsd-dist", ffOPTWR },
@@ -273,7 +273,7 @@ int gmx_rms(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -359,7 +359,7 @@ int gmx_rms(int argc, char *argv[])
     }
 
     bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xp,
-                         NULL, box, TRUE);
+                         nullptr, box, TRUE);
     snew(w_rls, top.atoms.nr);
     snew(w_rms, top.atoms.nr);
 
@@ -477,7 +477,7 @@ int gmx_rms(int argc, char *argv[])
     }
     if (bReset)
     {
-        reset_x(ifit, ind_fit, top.atoms.nr, NULL, xp, w_rls);
+        reset_x(ifit, ind_fit, top.atoms.nr, nullptr, xp, w_rls);
     }
     if (bMirror)
     {
@@ -621,7 +621,7 @@ int gmx_rms(int argc, char *argv[])
 
         if (bReset)
         {
-            reset_x(ifit, ind_fit, natoms, NULL, x, w_rls);
+            reset_x(ifit, ind_fit, natoms, nullptr, x, w_rls);
         }
         if (ewhat == ewRhoSc)
         {
@@ -666,7 +666,7 @@ int gmx_rms(int argc, char *argv[])
             }
             if (bReset)
             {
-                reset_x(ifit, ind_fit, natoms, NULL, xp, w_rls);
+                reset_x(ifit, ind_fit, natoms, nullptr, xp, w_rls);
             }
             if (bFit)
             {
@@ -749,7 +749,7 @@ int gmx_rms(int argc, char *argv[])
 
             if (bReset)
             {
-                reset_x(ifit, ind_fit, natoms, NULL, x, w_rls);
+                reset_x(ifit, ind_fit, natoms, nullptr, x, w_rls);
             }
             if (ewhat == ewRhoSc)
             {
@@ -1219,11 +1219,11 @@ int gmx_rms(int argc, char *argv[])
         xvgrclose(fp);
     }
     do_view(oenv, opt2fn_null("-a", NFILE, fnm), "-graphtype bar");
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-mir", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-m", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-bm", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn_null("-dist", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-mir", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-m", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-bm", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn_null("-dist", NFILE, fnm), nullptr);
 
     return 0;
 }
index ddf5a24f449c681a155cb3716f0f9eb9bd1197bb..f12bee4b1733e8e09edfe42af33de1b38f8bee8c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -179,13 +179,13 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
 
     fp    = gmx_ffopen(eq_fn, "r");
     neq   = 0;
-    equiv = NULL;
+    equiv = nullptr;
     while (get_a_line(fp, line, STRLEN))
     {
         lp = line;
         /* this is not efficient, but I'm lazy */
         srenew(equiv, neq+1);
-        equiv[neq] = NULL;
+        equiv[neq] = nullptr;
         na         = 0;
         if (sscanf(lp, "%s %n", atomname, &n) == 1)
         {
@@ -202,7 +202,7 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
                 equiv[neq][na].aname = gmx_strdup(atomname);
                 if (na > 0)
                 {
-                    equiv[neq][na].nname = NULL;
+                    equiv[neq][na].nname = nullptr;
                 }
                 na++;
                 lp += n;
@@ -212,8 +212,8 @@ static int read_equiv(const char *eq_fn, t_equiv ***equivptr)
         srenew(equiv[neq], na+1);
         equiv[neq][na].set   = false;
         equiv[neq][na].rnr   = 0;
-        equiv[neq][na].rname = NULL;
-        equiv[neq][na].aname = NULL;
+        equiv[neq][na].rname = nullptr;
+        equiv[neq][na].aname = nullptr;
 
         /* next */
         neq++;
@@ -304,7 +304,7 @@ static int analyze_noe_equivalent(const char *eq_fn,
         else
         {
             neq   = 0;
-            equiv = NULL;
+            equiv = nullptr;
         }
 
         groupnr = 0;
@@ -671,11 +671,11 @@ int gmx_rmsdist(int argc, char *argv[])
     int              *index, *noe_index;
     char             *grpname;
     real            **d_r, **d, **dtot, **dtot2, **mean, **rms, **rmsc, *resnr;
-    real            **dtot1_3 = NULL, **dtot1_6 = NULL;
+    real            **dtot1_3 = nullptr, **dtot1_6 = nullptr;
     real              rmsnow, meanmax, rmsmax, rmscmax;
     real              max1_3, max1_6;
-    t_noe_gr         *noe_gr = NULL;
-    t_noe           **noe    = NULL;
+    t_noe_gr         *noe_gr = nullptr;
+    t_noe           **noe    = nullptr;
     t_rgb             rlo, rhi;
     gmx_bool          bRMS, bScale, bMean, bNOE, bNMR3, bNMR6, bNMR;
 
@@ -696,11 +696,11 @@ int gmx_rmsdist(int argc, char *argv[])
           "Use periodic boundary conditions when computing distances" }
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
         { efDAT, "-equiv", "equiv",   ffOPTRD },
-        { efXVG, NULL,   "distrmsd", ffWRITE },
+        { efXVG, nullptr,   "distrmsd", ffWRITE },
         { efXPM, "-rms", "rmsdist",  ffOPTWR },
         { efXPM, "-scl", "rmsscale", ffOPTWR },
         { efXPM, "-mean", "rmsmean",  ffOPTWR },
@@ -711,7 +711,7 @@ int gmx_rmsdist(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -736,7 +736,7 @@ int gmx_rmsdist(int argc, char *argv[])
     }
 
     /* get topology and index */
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, FALSE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, FALSE);
 
     if (!bPBC)
     {
@@ -885,7 +885,7 @@ int gmx_rmsdist(int argc, char *argv[])
         write_noe(opt2FILE("-noe", NFILE, fnm, "w"), gnr, noe, noe_gr, scalemax);
     }
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 3a7f4eaa2aa17928f29ac1cbcb7809be7e3400b6..9c3989a279ecb0018b11368faa684bb3e9a8234d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,7 +73,7 @@ static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm)
         if ((ri->nr == atoms->resinfo[atoms->atom[i].resind].nr) &&
             (ri->ic == atoms->resinfo[atoms->atom[i].resind].ic) &&
             (std::strcmp(*atoms->resinfo[atoms->atom[i].resind].name, rresnm) == 0) &&
-            (std::strstr(*atoms->atomname[i], atomnm) != NULL))
+            (std::strstr(*atoms->atomname[i], atomnm) != nullptr))
         {
             break;
         }
@@ -126,13 +126,13 @@ static void average_residues(double f[], double **U, int uind,
     }
     for (i = 0; i < isize; i++)
     {
-        av += w_rls[index[i]]*(f != NULL ? f[i] : U[i][uind]);
+        av += w_rls[index[i]]*(f != nullptr ? f[i] : U[i][uind]);
         m  += w_rls[index[i]];
         if (i+1 == isize ||
             atoms->atom[index[i]].resind != atoms->atom[index[i+1]].resind)
         {
             av /= m;
-            if (f != NULL)
+            if (f != nullptr)
             {
                 for (j = start; j <= i; j++)
                 {
@@ -254,22 +254,22 @@ int gmx_rmsf(int argc, char *argv[])
     real              bfac, pdb_bfac, *Uaver;
     double          **U, *xav;
     int               aid;
-    rvec             *rmsd_x = NULL;
+    rvec             *rmsd_x = nullptr;
     double           *rmsf, invcount, totmass;
     int               d;
     real              count = 0;
     rvec              xcm;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     gmx_output_env_t *oenv;
 
     const char       *leg[2] = { "MD", "X-Ray" };
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,     ffREAD  },
-        { efTPS, NULL,  NULL,     ffREAD  },
-        { efNDX, NULL,  NULL,     ffOPTRD },
-        { efPDB, "-q",  NULL,     ffOPTRD },
+        { efTRX, "-f",  nullptr,     ffREAD  },
+        { efTPS, nullptr,  nullptr,     ffREAD  },
+        { efNDX, nullptr,  nullptr,     ffOPTRD },
+        { efPDB, "-q",  nullptr,     ffOPTRD },
         { efPDB, "-oq", "bfac",   ffOPTWR },
         { efPDB, "-ox", "xaver",  ffOPTWR },
         { efXVG, "-o",  "rmsf",   ffWRITE },
@@ -280,7 +280,7 @@ int gmx_rmsf(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pargs), pargs, asize(desc), desc, 0, NULL,
+                           NFILE, fnm, asize(pargs), pargs, asize(desc), desc, 0, nullptr,
                            &oenv))
     {
         return 0;
@@ -290,7 +290,7 @@ int gmx_rmsf(int argc, char *argv[])
     devfn    = opt2fn_null("-od", NFILE, fnm);
     dirfn    = opt2fn_null("-dir", NFILE, fnm);
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xref, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xref, nullptr, box, TRUE);
     const char *title = *top.name;
     snew(w_rls, top.atoms.nr);
 
@@ -321,10 +321,10 @@ int gmx_rmsf(int argc, char *argv[])
         t_topology *top_pdb;
         snew(top_pdb, 1);
         /* Read coordinates twice */
-        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, NULL, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, nullptr, nullptr, nullptr, pdbbox, FALSE);
         snew(pdbatoms, 1);
         *pdbatoms = top_pdb->atoms;
-        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, NULL, &pdbx, NULL, pdbbox, FALSE);
+        read_tps_conf(opt2fn("-q", NFILE, fnm), top_pdb, nullptr, &pdbx, nullptr, pdbbox, FALSE);
         title = *top_pdb->name;
         snew(refatoms, 1);
         *refatoms = top_pdb->atoms;
@@ -435,7 +435,7 @@ int gmx_rmsf(int argc, char *argv[])
     {
         for (d = 0; d < DIM*DIM; d++)
         {
-            average_residues(NULL, U, d, isize, index, w_rls, &top.atoms);
+            average_residues(nullptr, U, d, isize, index, w_rls, &top.atoms);
         }
     }
 
@@ -533,7 +533,7 @@ int gmx_rmsf(int argc, char *argv[])
         }
         if (bRes)
         {
-            average_residues(rmsf, NULL, 0, isize, index, w_rls, &top.atoms);
+            average_residues(rmsf, nullptr, 0, isize, index, w_rls, &top.atoms);
         }
         /* Write RMSD output */
         fp = xvgropen(devfn, "RMS Deviation", label, "(nm)", oenv);
@@ -557,7 +557,7 @@ int gmx_rmsf(int argc, char *argv[])
             rvec_inc(xref[index[i]], xcm);
         }
         write_sto_conf_indexed(opt2fn("-oq", NFILE, fnm), title, pdbatoms, pdbx,
-                               NULL, ePBC, pdbbox, isize, index);
+                               nullptr, ePBC, pdbbox, isize, index);
     }
     if (opt2bSet("-ox", NFILE, fnm))
     {
@@ -570,7 +570,7 @@ int gmx_rmsf(int argc, char *argv[])
             }
         }
         /* Write a .pdb file with B-factors and optionally anisou records */
-        write_sto_conf_indexed(opt2fn("-ox", NFILE, fnm), title, pdbatoms, xref, NULL,
+        write_sto_conf_indexed(opt2fn("-ox", NFILE, fnm), title, pdbatoms, xref, nullptr,
                                ePBC, pdbbox, isize, index);
     }
     if (bAniso)
index a3c14129d27ddad2a6afa6c3a3dac9ee84498084..c429143af5150df85a9142bb805561c3e5990c0b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -94,13 +94,13 @@ int gmx_rotacf(int argc, char *argv[])
     int               i, m, teller, n_alloc, natoms, nvec, ai, aj, ak;
     unsigned long     mode;
     real              t, t0, t1, dt;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     t_topology       *top;
     int               ePBC;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL,  ffREAD  },
-        { efTPR, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffREAD  },
+        { efTRX, "-f", nullptr,  ffREAD  },
+        { efTPR, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffREAD  },
         { efXVG, "-o", "rotacf",  ffWRITE }
     };
 #define NFILE asize(fnm)
@@ -113,7 +113,7 @@ int gmx_rotacf(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -146,7 +146,7 @@ int gmx_rotacf(int argc, char *argv[])
     snew(c1, nvec);
     for (i = 0; (i < nvec); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
     n_alloc = 0;
 
@@ -230,7 +230,7 @@ int gmx_rotacf(int argc, char *argv[])
                     teller, nvec, c1, dt, mode, bAver);
     }
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index a1d48990c2f043371a0612cac105791a1a15e1fd..a37b4781b1f0659567f2d22fb4986783f3632c5b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,7 +67,7 @@ static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int
     real         xf;
     matrix       box, R;
     real        *w_rls;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
     nfr_all = 0;
@@ -99,7 +99,7 @@ static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int
             {
                 copy_rvec(x[index[i]], xi[nfr][i]);
             }
-            reset_x(gnx, NULL, gnx, NULL, xi[nfr], w_rls);
+            reset_x(gnx, nullptr, gnx, nullptr, xi[nfr], w_rls);
             nfr++;
             if (nfr % 100 == 0)
             {
@@ -204,7 +204,7 @@ int gmx_rotmat(int argc, char *argv[])
         "the rotation matrix."
     };
     const char       *reffit[] =
-    { NULL, "none", "xyz", "xy", NULL };
+    { nullptr, "none", "xyz", "xy", nullptr };
     static int        skip   = 1;
     static gmx_bool   bFitXY = FALSE, bMW = TRUE;
     t_pargs           pa[]   = {
@@ -227,27 +227,27 @@ int gmx_rotmat(int argc, char *argv[])
     int               natoms, i;
     char             *grpname;
     int               gnx;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     int              *index;
     gmx_output_env_t *oenv;
     real             *w_rls;
     const char       *leg[]  = { "xx", "xy", "xz", "yx", "yy", "yz", "zx", "zy", "zz" };
 #define NLEG asize(leg)
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,       ffREAD },
-        { efTPS, NULL,   NULL,       ffREAD },
-        { efNDX, NULL,   NULL,       ffOPTRD },
-        { efXVG, NULL,   "rotmat",   ffWRITE }
+        { efTRX, "-f",   nullptr,       ffREAD },
+        { efTPS, nullptr,   nullptr,       ffREAD },
+        { efNDX, nullptr,   nullptr,       ffOPTRD },
+        { efXVG, nullptr,   "rotmat",   ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x_ref, NULL, box, bMW);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x_ref, nullptr, box, bMW);
 
     gpbc = gmx_rmpbc_init(&top.idef, ePBC, top.atoms.nr);
 
@@ -255,7 +255,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
-    GMX_RELEASE_ASSERT(reffit[0] != NULL, "Options inconsistency; reffit[0] is NULL");
+    GMX_RELEASE_ASSERT(reffit[0] != nullptr, "Options inconsistency; reffit[0] is NULL");
     if (reffit[0][0] != 'n')
     {
         get_refx(oenv, ftp2fn(efTRX, NFILE, fnm), reffit[0][2] == 'z' ? 3 : 2, skip,
@@ -276,7 +276,7 @@ int gmx_rotmat(int argc, char *argv[])
 
     if (reffit[0][0] == 'n')
     {
-        reset_x(gnx, index, natoms, NULL, x_ref, w_rls);
+        reset_x(gnx, index, natoms, nullptr, x_ref, w_rls);
     }
 
     out = xvgropen(ftp2fn(efXVG, NFILE, fnm),
@@ -287,7 +287,7 @@ int gmx_rotmat(int argc, char *argv[])
     {
         gmx_rmpbc(gpbc, natoms, box, x);
 
-        reset_x(gnx, index, natoms, NULL, x, w_rls);
+        reset_x(gnx, index, natoms, nullptr, x, w_rls);
 
         if (bFitXY)
         {
index d3099a577c15ce2eab0811a4029ed857e9aa6a79..b3e33331715dd4d86f5f68bc6301c81b43b1bce6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,7 +61,7 @@ typedef struct {
 
 static t_charge *mk_charge(const t_atoms *atoms, const t_block *cgs, int *nncg)
 {
-    t_charge *cg = NULL;
+    t_charge *cg = nullptr;
     char      buf[32];
     int       i, j, ncg, resnr, anr;
     real      qq;
@@ -148,8 +148,8 @@ int gmx_saltbr(int argc, char *argv[])
           "Use separate files for each interaction (may be MANY)" }
     };
     t_filenm        fnm[] = {
-        { efTRX, "-f",  NULL, ffREAD },
-        { efTPR, NULL,  NULL, ffREAD },
+        { efTRX, "-f",  nullptr, ffREAD },
+        { efTPR, nullptr,  nullptr, ffREAD },
     };
 #define NFILE asize(fnm)
 
@@ -182,7 +182,7 @@ int gmx_saltbr(int argc, char *argv[])
     gmx_output_env_t  *oenv;
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -200,7 +200,7 @@ int gmx_saltbr(int argc, char *argv[])
     read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
 
     teller = 0;
-    time   = NULL;
+    time   = nullptr;
     do
     {
         srenew(time, teller+1);
index b8c523d562ee4a4c7fd7f5e015e82706399ce017..93a8fa4cd2f6881064958a0700a68fe274ff7d0e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,8 +84,8 @@ int gmx_sans(int argc, char *argv[])
     static unsigned int  seed     = 0;
     static int           nthreads = -1;
 
-    static const char   *emode[]   = { NULL, "direct", "mc", NULL };
-    static const char   *emethod[] = { NULL, "debye", "fft", NULL };
+    static const char   *emode[]   = { nullptr, "direct", "mc", nullptr };
+    static const char   *emethod[] = { nullptr, "debye", "fft", nullptr };
 
     gmx_neutron_atomic_structurefactors_t    *gnsf;
     gmx_sans_t                               *gsans;
@@ -119,10 +119,10 @@ int gmx_sans(int argc, char *argv[])
 #endif
     };
     FILE                                 *fp;
-    const char                           *fnTPX, *fnTRX, *fnDAT = NULL;
+    const char                           *fnTPX, *fnTRX, *fnDAT = nullptr;
     t_trxstatus                          *status;
-    t_topology                           *top  = NULL;
-    gmx_rmpbc_t                           gpbc = NULL;
+    t_topology                           *top  = nullptr;
+    gmx_rmpbc_t                           gpbc = nullptr;
     gmx_bool                              bFFT = FALSE, bDEBYE = FALSE;
     gmx_bool                              bMC  = FALSE;
     int                                   ePBC = -1;
@@ -130,23 +130,23 @@ int gmx_sans(int argc, char *argv[])
     rvec                                 *x;
     int                                   natoms;
     real                                  t;
-    char                                **grpname = NULL;
-    int                                  *index   = NULL;
+    char                                **grpname = nullptr;
+    int                                  *index   = nullptr;
     int                                   isize;
     int                                   i;
-    char                                 *hdr            = NULL;
-    char                                 *suffix         = NULL;
-    t_filenm                             *fnmdup         = NULL;
-    gmx_radial_distribution_histogram_t  *prframecurrent = NULL, *pr = NULL;
-    gmx_static_structurefactor_t         *sqframecurrent = NULL, *sq = NULL;
+    char                                 *hdr            = nullptr;
+    char                                 *suffix         = nullptr;
+    t_filenm                             *fnmdup         = nullptr;
+    gmx_radial_distribution_histogram_t  *prframecurrent = nullptr, *pr = nullptr;
+    gmx_static_structurefactor_t         *sqframecurrent = nullptr, *sq = nullptr;
     gmx_output_env_t                     *oenv;
 
 #define NFILE asize(fnm)
 
     t_filenm   fnm[] = {
-        { efTPR,  "-s",       NULL,       ffREAD },
-        { efTRX,  "-f",       NULL,       ffREAD },
-        { efNDX,  NULL,       NULL,       ffOPTRD },
+        { efTPR,  "-s",       nullptr,       ffREAD },
+        { efTRX,  "-f",       nullptr,       ffREAD },
+        { efNDX,  nullptr,       nullptr,       ffOPTRD },
         { efDAT,  "-d",       "nsfactor", ffOPTRD },
         { efXVG,  "-pr",      "pr",       ffWRITE },
         { efXVG,  "-sq",       "sq",      ffWRITE },
@@ -157,7 +157,7 @@ int gmx_sans(int argc, char *argv[])
     nthreads = gmx_omp_get_max_threads();
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -170,7 +170,7 @@ int gmx_sans(int argc, char *argv[])
     gmx_omp_set_num_threads(nthreads);
 
     /* Now try to parse opts for modes */
-    GMX_RELEASE_ASSERT(emethod[0] != NULL, "Options inconsistency; emethod[0] is NULL");
+    GMX_RELEASE_ASSERT(emethod[0] != nullptr, "Options inconsistency; emethod[0] is NULL");
     switch (emethod[0][0])
     {
         case 'd':
@@ -226,7 +226,7 @@ int gmx_sans(int argc, char *argv[])
     snew(grpname, 1);
     snew(index, 1);
 
-    read_tps_conf(fnTPX, top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(fnTPX, top, &ePBC, &x, nullptr, box, TRUE);
 
     printf("\nPlease select group for SANS spectra calculation:\n");
     get_index(&(top->atoms), ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, grpname);
@@ -253,7 +253,7 @@ int gmx_sans(int argc, char *argv[])
             gmx_rmpbc(gpbc, top->atoms.nr, box, x);
         }
         /* allocate memory for pr */
-        if (pr == NULL)
+        if (pr == nullptr)
         {
             /* in case its first frame to read */
             snew(pr, 1);
@@ -262,7 +262,7 @@ int gmx_sans(int argc, char *argv[])
         prframecurrent = calc_radial_distribution_histogram(gsans, x, box, index, isize, binwidth, bMC, bNORM, mcover, seed);
         /* copy prframecurrent -> pr and summ up pr->gr[i] */
         /* allocate and/or resize memory for pr->gr[i] and pr->r[i] */
-        if (pr->gr == NULL)
+        if (pr->gr == nullptr)
         {
             /* check if we use pr->gr first time */
             snew(pr->gr, prframecurrent->grn);
index 61581d7882cfab91c1654129c0e8536d4f59592b..6a7000bf4583eb1b847ddf39f781a46d330b7d28 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,19 +68,19 @@ int gmx_saxs(int argc, char *argv[])
          "Energy of the incoming X-ray (keV) "}
     };
 #define NPA asize(pa)
-    const char       *fnTPS, *fnTRX, *fnNDX, *fnDAT = NULL;
+    const char       *fnTPS, *fnTRX, *fnNDX, *fnDAT = nullptr;
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL,      ffREAD },
-        { efTPS, NULL,  NULL,      ffREAD },
-        { efNDX, NULL,  NULL,      ffOPTRD },
+        { efTRX, "-f",  nullptr,      ffREAD },
+        { efTPS, nullptr,  nullptr,      ffREAD },
+        { efNDX, nullptr,  nullptr,      ffOPTRD },
         { efDAT, "-d",  "sfactor", ffOPTRD },
         { efXVG, "-sq", "sq",      ffWRITE },
     };
 #define NFILE asize(fnm)
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index e8e8146ddac2b95ed8d51dd2790285bb836c092e..14f8d1fb6943e5e05ff82d794c38b4cdcc5347bd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -425,7 +425,7 @@ static void do_sham(const char *fn, const char *ndx,
 {
     FILE        *fp;
     real        *min_eig, *max_eig;
-    real        *axis_x, *axis_y, *axis_z, *axis = NULL;
+    real        *axis_x, *axis_y, *axis_z, *axis = nullptr;
     double      *P;
     real       **PP, *W, *E, **WW, **EE, *S, **SS, *M, *bE;
     rvec         xxx;
@@ -989,7 +989,7 @@ int gmx_sham(int argc, char *argv[])
 
     npargs = asize(pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
-                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1037,7 +1037,7 @@ int gmx_sham(int argc, char *argv[])
     }
     else
     {
-        et_val = NULL;
+        et_val = nullptr;
     }
 
     if (fn_ene && et_val)
@@ -1083,10 +1083,10 @@ int gmx_sham(int argc, char *argv[])
             opt2fn("-ls", NFILE, fnm), opt2fn("-lsh", NFILE, fnm),
             opt2fn("-lss", NFILE, fnm),
             opt2fn("-ls3", NFILE, fnm), opt2fn("-g", NFILE, fnm),
-            n, nset, val, fn_ge != NULL, e_nset, et_val, Tref,
+            n, nset, val, fn_ge != nullptr, e_nset, et_val, Tref,
             pmax, gmax,
-            opt2parg_bSet("-emin", NPA, pa) ? &emin : NULL,
-            opt2parg_bSet("-emax", NPA, pa) ? &emax : NULL,
+            opt2parg_bSet("-emin", NPA, pa) ? &emin : nullptr,
+            opt2parg_bSet("-emax", NPA, pa) ? &emax : nullptr,
             nlevels, pmin,
             idim, ibox,
             opt2parg_bSet("-xmin", NPA, pa), rmin,
index 8b466aa1e75789d08013173c43220ce72bc8c902..a74cb7b9229b7f15d6fc054bd1a7e10bed17171a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -104,7 +104,7 @@ int gmx_sigeps(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, asize(pa), pa, asize(desc),
-                           desc, 0, NULL, &oenv))
+                           desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -184,7 +184,7 @@ int gmx_sigeps(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), NULL);
+    do_view(oenv, ftp2fn(efXVG, NFILE, fnm), nullptr);
 
     return 0;
 }
index 968b57d2cde4de6b40218c59fb4acf97e646653a..757d9e0c8f1e7d1c7cdc9ac256bd4a56632358d6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -135,7 +135,7 @@ int gmx_sorient(int argc, char *argv[])
     char              str[STRLEN];
     gmx_bool          bTPS;
     rvec              xref, dx, dxh1, dxh2, outer;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     t_pbc             pbc;
     const char       *legr[] = {
         "<cos(\\8q\\4\\s1\\N)>",
@@ -187,10 +187,10 @@ int gmx_sorient(int argc, char *argv[])
     };
 
     t_filenm          fnm[] = {
-        { efTRX, NULL,  NULL,  ffREAD },
-        { efTPS, NULL,  NULL,  ffREAD },
-        { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "sori",   ffWRITE },
+        { efTRX, nullptr,  nullptr,  ffREAD },
+        { efTPS, nullptr,  nullptr,  ffREAD },
+        { efNDX, nullptr,  nullptr,  ffOPTRD },
+        { efXVG, nullptr,  "sori",   ffWRITE },
         { efXVG, "-no", "snor",   ffWRITE },
         { efXVG, "-ro", "sord",   ffWRITE },
         { efXVG, "-co", "scum",   ffWRITE },
@@ -199,7 +199,7 @@ int gmx_sorient(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -207,7 +207,7 @@ int gmx_sorient(int argc, char *argv[])
     bTPS = (opt2bSet("-s", NFILE, fnm) || !opt2bSet("-n", NFILE, fnm) || bCom);
     if (bTPS)
     {
-        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box,
+        read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box,
                       bCom);
     }
 
@@ -222,7 +222,7 @@ int gmx_sorient(int argc, char *argv[])
     }
     else
     {
-        get_index(NULL, ftp2fn(efNDX, NFILE, fnm), 2, isize, index, grpname);
+        get_index(nullptr, ftp2fn(efNDX, NFILE, fnm), 2, isize, index, grpname);
     }
 
     if (bCom)
@@ -462,8 +462,8 @@ int gmx_sorient(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
-    do_view(oenv, opt2fn("-no", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
+    do_view(oenv, opt2fn("-no", NFILE, fnm), nullptr);
     do_view(oenv, opt2fn("-ro", NFILE, fnm), "-nxy");
     do_view(oenv, opt2fn("-co", NFILE, fnm), "-nxy");
 
index 40f6299fa0fbf6563f24cbbcd110b4c0fbd6ea4b..1badcc8d64d78a41716f85f9115f5111631b9c07 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2007,2008,2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -145,7 +145,7 @@ int gmx_spatial(int argc, char *argv[])
     int               i, nidx, nidxp;
     int               v;
     int               j, k;
-    int            ***bin = NULL;
+    int            ***bin = nullptr;
     int               nbin[3];
     FILE             *flp;
     int               x, y, z, minx, miny, minz, maxx, maxy, maxz;
@@ -153,12 +153,12 @@ int gmx_spatial(int argc, char *argv[])
     int               tot, maxval, minval;
     double            norm;
     gmx_output_env_t *oenv;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
 
     t_filenm          fnm[] = {
-        { efTPS,  NULL,  NULL, ffREAD }, /* this is for the topology */
-        { efTRX, "-f", NULL, ffREAD },   /* and this for the trajectory */
-        { efNDX, NULL, NULL, ffOPTRD }
+        { efTPS,  nullptr,  nullptr, ffREAD }, /* this is for the topology */
+        { efTRX, "-f", nullptr, ffREAD },      /* and this for the trajectory */
+        { efNDX, nullptr, nullptr, ffOPTRD }
     };
 
 #define NFILE asize(fnm)
@@ -171,7 +171,7 @@ int gmx_spatial(int argc, char *argv[])
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, box, TRUE);
     sfree(xtop);
 
     atoms = &(top.atoms);
index 0009d3ecb05923d7c004019b2ac6c31cff46eee7..8baa73fa7cc00c60135288adba738a7529a559e8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -169,7 +169,7 @@ int gmx_spol(int argc, char *argv[])
     double       sdip, sdip2, sinp, sdinp, nmol;
     int         *hist;
     t_pbc        pbc;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
 
     const char       *desc[] = {
@@ -209,15 +209,15 @@ int gmx_spol(int argc, char *argv[])
     };
 
     t_filenm          fnm[] = {
-        { efTRX, NULL,  NULL,  ffREAD },
-        { efTPR, NULL,  NULL,  ffREAD },
-        { efNDX, NULL,  NULL,  ffOPTRD },
-        { efXVG, NULL,  "scdist",  ffWRITE }
+        { efTRX, nullptr,  nullptr,  ffREAD },
+        { efTPR, nullptr,  nullptr,  ffREAD },
+        { efNDX, nullptr,  nullptr,  ffOPTRD },
+        { efXVG, nullptr,  "scdist",  ffWRITE }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -227,7 +227,7 @@ int gmx_spol(int argc, char *argv[])
     gmx::MDModules mdModules;
     ir = mdModules.inputrec();
     read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
-                 ir, box, &natoms, NULL, NULL, top);
+                 ir, box, &natoms, nullptr, nullptr, top);
 
     /* get index groups */
     printf("Select a group of reference particles and a solvent group:\n");
@@ -390,7 +390,7 @@ int gmx_spol(int argc, char *argv[])
     }
     xvgrclose(fp);
 
-    do_view(oenv, opt2fn("-o", NFILE, fnm), NULL);
+    do_view(oenv, opt2fn("-o", NFILE, fnm), nullptr);
 
     return 0;
 }
index 5d3dd8bf3258ae2dcd5105007487a72298da409a..140be7d22c77731b57b940eb01a91412de714e59 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,9 +79,9 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
                          const char *fn_tcf, const char *fn_cub,
                          const char *fn_vk, const gmx_output_env_t *oenv)
 {
-    FILE  *fp, *fp_vk, *fp_cub = NULL;
+    FILE  *fp, *fp_vk, *fp_cub = nullptr;
     int    nk, ntc;
-    real **tcaf, **tcafc = NULL, eta, *sig;
+    real **tcaf, **tcafc = nullptr, eta, *sig;
     int    i, j, k, kc;
     int    ncorr;
     double fitparms[3];
@@ -208,8 +208,8 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
         tcaf[k][0]   = 1.0;
         fitparms[0]  = 1;
         fitparms[1]  = 1;
-        do_lmfit(ncorr, tcaf[k], sig, dt, 0, 0, ncorr*dt,
-                 oenv, bDebugMode(), effnVAC, fitparms, 0, NULL);
+        do_lmfit(ncorr, tcaf[k], sig, dt, nullptr, 0, ncorr*dt,
+                 oenv, bDebugMode(), effnVAC, fitparms, 0, nullptr);
         eta = 1000*fitparms[1]*rho/
             (4*fitparms[0]*PICO*norm2(kfac[k])/(NANO*NANO));
         fprintf(stdout, "k %6.3f  tau %6.3f  eta %8.5f 10^-3 kg/(m s)\n",
@@ -233,8 +233,8 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
             tcafc[k][0]  = 1.0;
             fitparms[0]  = 1;
             fitparms[1]  = 1;
-            do_lmfit(ncorr, tcafc[k], sig, dt, 0, 0, ncorr*dt,
-                     oenv, bDebugMode(), effnVAC, fitparms, 0, NULL);
+            do_lmfit(ncorr, tcafc[k], sig, dt, nullptr, 0, ncorr*dt,
+                     oenv, bDebugMode(), effnVAC, fitparms, 0, nullptr);
             eta = 1000*fitparms[1]*rho/
                 (4*fitparms[0]*PICO*norm2(kfac[kset_c[k]])/(NANO*NANO));
             fprintf(stdout,
@@ -309,7 +309,7 @@ int gmx_tcaf(int argc, char *argv[])
     matrix            box;
     gmx_bool          bTop;
     int               gnx;
-    int              *index, *atndx = NULL, at;
+    int              *index, *atndx = nullptr, at;
     char             *grpname;
     char              title[256];
     real              t0, t1, dt, m, mtot, sysmass, rho, sx, cx;
@@ -323,9 +323,9 @@ int gmx_tcaf(int argc, char *argv[])
 #define NHISTO 360
 
     t_filenm  fnm[] = {
-        { efTRN, "-f",    NULL,      ffREAD  },
-        { efTPS, NULL,    NULL,      ffOPTRD },
-        { efNDX, NULL,    NULL,      ffOPTRD },
+        { efTRN, "-f",    nullptr,      ffREAD  },
+        { efTPS, nullptr,    nullptr,      ffOPTRD },
+        { efNDX, nullptr,    nullptr,      ffOPTRD },
         { efXVG, "-ot",  "transcur", ffOPTWR },
         { efXVG, "-oa",  "tcaf_all", ffWRITE },
         { efXVG, "-o",   "tcaf",     ffWRITE },
@@ -341,13 +341,13 @@ int gmx_tcaf(int argc, char *argv[])
     ppa    = add_acf_pargs(&npargs, pa);
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
     }
 
-    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
+    bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box,
                          TRUE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
 
index 352ce4fd2b2b0f55a8133ba754cdcd35a99236ad..0d273adb5f6c731a9cb00086fe58c1f66e634121 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -72,7 +72,7 @@ static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index,
     fprintf(fp, " %g", time);
     for (i = 0; i < n; i++)
     {
-        if (index != NULL)
+        if (index != nullptr)
         {
             ii = index[i];
         }
@@ -111,7 +111,7 @@ static void average_data(rvec x[], rvec xav[], real *mass,
         for (i = 0; i < isize[g]; i++)
         {
             ind = index[g][i];
-            if (mass != NULL)
+            if (mass != nullptr)
             {
                 m = mass[ind];
                 svmul(m, x[ind], tmp);
@@ -129,7 +129,7 @@ static void average_data(rvec x[], rvec xav[], real *mass,
                 }
             }
         }
-        if (mass != NULL)
+        if (mass != nullptr)
         {
             for (d = 0; d < DIM; d++)
             {
@@ -151,16 +151,16 @@ static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
                        int ngrps, int isize[], int **index, gmx_bool bDim[],
                        const char *sffmt)
 {
-    static rvec *xav = NULL;
+    static rvec *xav = nullptr;
 
     if (bCom)
     {
-        if (xav == NULL)
+        if (xav == nullptr)
         {
             snew(xav, ngrps);
         }
         average_data(x, xav, mass, ngrps, isize, index);
-        low_print_data(fp, time, xav, ngrps, NULL, bDim, sffmt);
+        low_print_data(fp, time, xav, ngrps, nullptr, bDim, sffmt);
     }
     else
     {
@@ -171,14 +171,14 @@ static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
 static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, gmx_bool bCom,
                         int ngrps, int isize[], int **index)
 {
-    static rvec    *xav   = NULL;
-    static t_atoms *atoms = NULL;
+    static rvec    *xav   = nullptr;
+    static t_atoms *atoms = nullptr;
     t_trxframe      fr_av;
     int             i;
 
     if (bCom)
     {
-        if (xav == NULL)
+        if (xav == nullptr)
         {
             snew(xav, ngrps);
             snew(atoms, 1);
@@ -199,11 +199,11 @@ static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, g
         fr_av.natoms = ngrps;
         fr_av.atoms  = atoms;
         fr_av.x      = xav;
-        write_trxframe(status, &fr_av, NULL);
+        write_trxframe(status, &fr_av, nullptr);
     }
     else
     {
-        write_trxframe_indexed(status, fr, isize[0], index[0], NULL);
+        write_trxframe_indexed(status, fr, isize[0], index[0], nullptr);
     }
 }
 
@@ -260,14 +260,14 @@ static void make_legend(FILE *fp, int ngrps, int isize, int index[],
 
 static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[])
 {
-    static real **TCM = NULL, **L;
+    static real **TCM = nullptr, **L;
     double        tm, m0, lxx, lxy, lxz, lyy, lyz, lzz, ekrot;
     rvec          a0, ocm;
     dvec          dx, b0;
     dvec          xcm, vcm, acm;
     int           i, j, m, n;
 
-    if (TCM == NULL)
+    if (TCM == nullptr)
     {
         snew(TCM, DIM);
         for (i = 0; i < DIM; i++)
@@ -507,7 +507,7 @@ static void write_pdb_bfac(const char *fname, const char *xname,
                *(atoms->resinfo[atoms->atom[maxi].resind].name),
                atoms->resinfo[atoms->atom[maxi].resind].nr);
 
-        if (atoms->pdbinfo == NULL)
+        if (atoms->pdbinfo == nullptr)
         {
             snew(atoms->pdbinfo, atoms->nr);
         }
@@ -535,7 +535,7 @@ static void write_pdb_bfac(const char *fname, const char *xname,
                 atoms->pdbinfo[index[i]].bfac = sum[index[i]][onedim]*scale;
             }
         }
-        write_sto_conf_indexed(fname, title, atoms, x, NULL, ePBC, box, isize, index);
+        write_sto_conf_indexed(fname, title, atoms, x, nullptr, ePBC, box, isize, index);
     }
 }
 
@@ -545,7 +545,7 @@ static void update_histo(int gnx, int index[], rvec v[],
     int  i, m, in, nnn;
     real vn, vnmax;
 
-    if (*histo == NULL)
+    if (*histo == nullptr)
     {
         vnmax = 0;
         for (i = 0; (i < gnx); i++)
@@ -659,20 +659,20 @@ int gmx_traj(int argc, char *argv[])
         { "-scale", FALSE, etREAL, {&scale},
           "Scale factor for [REF].pdb[ref] output, 0 is autoscale" }
     };
-    FILE             *outx   = NULL, *outv = NULL, *outf = NULL, *outb = NULL, *outt = NULL;
-    FILE             *outekt = NULL, *outekr = NULL;
+    FILE             *outx   = nullptr, *outv = nullptr, *outf = nullptr, *outb = nullptr, *outt = nullptr;
+    FILE             *outekt = nullptr, *outekr = nullptr;
     t_topology        top;
     int               ePBC;
     real             *mass, time;
     const char       *indexfn;
     t_trxframe        fr;
-    int               flags, nvhisto = 0, *vhisto = NULL;
-    rvec             *xtop, *xp = NULL;
-    rvec             *sumx = NULL, *sumv = NULL, *sumf = NULL;
+    int               flags, nvhisto = 0, *vhisto = nullptr;
+    rvec             *xtop, *xp = nullptr;
+    rvec             *sumx = nullptr, *sumv = nullptr, *sumf = nullptr;
     matrix            topbox;
     t_trxstatus      *status;
-    t_trxstatus      *status_out = NULL;
-    gmx_rmpbc_t       gpbc       = NULL;
+    t_trxstatus      *status_out = nullptr;
+    gmx_rmpbc_t       gpbc       = nullptr;
     int               i, j;
     int               nr_xfr, nr_vfr, nr_ffr;
     char            **grpname;
@@ -687,9 +687,9 @@ int gmx_traj(int argc, char *argv[])
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPS, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPS, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efXVG, "-ox",  "coord",     ffOPTWR },
         { efTRX, "-oxt", "coord",     ffOPTWR },
         { efXVG, "-ov",  "veloc",     ffOPTWR },
@@ -708,7 +708,7 @@ int gmx_traj(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv,
                            PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -751,7 +751,7 @@ int gmx_traj(int argc, char *argv[])
     sprintf(sffmt6, "%s%s%s%s%s%s", sffmt, sffmt, sffmt, sffmt, sffmt, sffmt);
 
     bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC,
-                         &xtop, NULL, topbox,
+                         &xtop, nullptr, topbox,
                          bCom && (bOX || bOXT || bOV || bOT || bEKT || bEKR));
     sfree(xtop);
     if ((bMol || bCV || bCF) && !bTop)
@@ -814,7 +814,7 @@ int gmx_traj(int argc, char *argv[])
     }
     else
     {
-        mass = NULL;
+        mass = nullptr;
     }
 
     flags = 0;
@@ -986,7 +986,7 @@ int gmx_traj(int argc, char *argv[])
         }
         if (bOF && fr.bF)
         {
-            print_data(outf, time, fr.f, NULL, bCom, ngroups, isize, index, bDim, sffmt);
+            print_data(outf, time, fr.f, nullptr, bCom, ngroups, isize, index, bDim, sffmt);
         }
         if (bOB && fr.bBox)
         {
@@ -1053,7 +1053,7 @@ int gmx_traj(int argc, char *argv[])
     }
     while (read_next_frame(oenv, status, &fr));
 
-    if (gpbc != NULL)
+    if (gpbc != nullptr)
     {
         gmx_rmpbc_done(gpbc);
     }
index 3b5427d5f3f62e6acfa9bc2bde0bc01334b7ee54..9c9bdc6fd3b20e37516c7beb6109e703c8168ab2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -209,7 +209,7 @@ static void edit_files(char **fnms, int nfiles, real *readtime, real *timestep,
             ok = FALSE;
             do
             {
-                if (NULL == fgets(inputstring, STRLEN - 1, stdin))
+                if (nullptr == fgets(inputstring, STRLEN - 1, stdin))
                 {
                     gmx_fatal(FARGS, "Error reading user input" );
                 }
@@ -383,11 +383,11 @@ static void do_demux(int nset, char *fnms[], char *fnms_out[], int nval,
             {
                 if (index)
                 {
-                    write_trxframe_indexed(fp_out[j], &trx[i], isize, index, NULL);
+                    write_trxframe_indexed(fp_out[j], &trx[i], isize, index, nullptr);
                 }
                 else
                 {
-                    write_trxframe(fp_out[j], &trx[i], NULL);
+                    write_trxframe(fp_out[j], &trx[i], nullptr);
                 }
             }
         }
@@ -470,7 +470,7 @@ int gmx_trjcat(int argc, char *argv[])
     };
 #define npargs asize(pa)
     int               ftpin, i, frame, frame_out;
-    t_trxstatus      *status, *trxout = NULL;
+    t_trxstatus      *status, *trxout = nullptr;
     real              t_corr;
     t_trxframe        fr, frout;
     char            **fnms, **fnms_out, *out_file;
@@ -482,16 +482,16 @@ int gmx_trjcat(int argc, char *argv[])
     gmx_bool          lastTimeSet = FALSE;
     real              last_frame_time, searchtime;
     int               isize = 0, j;
-    int              *index = NULL, imax;
+    int              *index = nullptr, imax;
     char             *grpname;
-    real            **val = NULL, *t = NULL, dt_remd;
+    real            **val = nullptr, *t = nullptr, dt_remd;
     int               n, nset, ftpout = -1, prevEndStep = 0, filetype;
     gmx_off_t         fpos;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] =
     {
-        { efTRX, "-f", NULL, ffRDMULT },
-        { efTRO, "-o", NULL, ffWRMULT },
+        { efTRX, "-f", nullptr, ffRDMULT },
+        { efTRO, "-o", nullptr, ffWRMULT },
         { efNDX, "-n", "index", ffOPTRD },
         { efXVG, "-demux", "remd", ffOPTRD }
     };
@@ -499,7 +499,7 @@ int gmx_trjcat(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_TIME_UNIT, NFILE, fnm,
-                           asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -648,13 +648,13 @@ int gmx_trjcat(int argc, char *argv[])
                 }
                 if (bIndex)
                 {
-                    trjtools_gmx_prepare_tng_writing(out_file, 'w', NULL, &trxout,
-                                                     fnms[0], isize, NULL, index, grpname);
+                    trjtools_gmx_prepare_tng_writing(out_file, 'w', nullptr, &trxout,
+                                                     fnms[0], isize, nullptr, index, grpname);
                 }
                 else
                 {
-                    trjtools_gmx_prepare_tng_writing(out_file, 'w', NULL, &trxout,
-                                                     fnms[0], -1, NULL, NULL, NULL);
+                    trjtools_gmx_prepare_tng_writing(out_file, 'w', nullptr, &trxout,
+                                                     fnms[0], -1, nullptr, nullptr, nullptr);
                 }
             }
             else
@@ -894,11 +894,11 @@ int gmx_trjcat(int argc, char *argv[])
                         if (bIndex)
                         {
                             write_trxframe_indexed(trxout, &frout, isize, index,
-                                                   NULL);
+                                                   nullptr);
                         }
                         else
                         {
-                            write_trxframe(trxout, &frout, NULL);
+                            write_trxframe(trxout, &frout, nullptr);
                         }
                         if ( ((frame % 10) == 0) || (frame < 10) )
                         {
index f5781ed25c4807156b6af24cca50f7a7711924bb..92cae1eff5250383ca1415d2b0ae8013591ad5e9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -492,7 +492,7 @@ void do_trunc(const char *fn, real t0)
 
     in   = gmx_trr_open(fn, "r");
     fp   = gmx_fio_getfp(in);
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         fprintf(stderr, "Sorry, can not trunc %s, truncation of this filetype is not supported\n", fn);
         gmx_trr_close(in);
@@ -504,7 +504,7 @@ void do_trunc(const char *fn, real t0)
         bStop = FALSE;
         while (!bStop && gmx_trr_read_frame_header(in, &sh, &bOK))
         {
-            gmx_trr_read_frame_data(in, &sh, NULL, NULL, NULL, NULL);
+            gmx_trr_read_frame_data(in, &sh, nullptr, nullptr, nullptr, nullptr);
             fpos = gmx_ftell(fp);
             t    = sh.t;
             if (t >= t0)
@@ -568,7 +568,7 @@ static gmx_mtop_t *read_mtop_for_tng(const char *tps_file,
                                      const char *input_file,
                                      const char *output_file)
 {
-    gmx_mtop_t *mtop = NULL;
+    gmx_mtop_t *mtop = nullptr;
 
     if (fn2bTPX(tps_file) &&
         efTNG != fn2ftp(input_file) &&
@@ -576,8 +576,8 @@ static gmx_mtop_t *read_mtop_for_tng(const char *tps_file,
     {
         int temp_natoms = -1;
         snew(mtop, 1);
-        read_tpx(tps_file, NULL, NULL, &temp_natoms,
-                 NULL, NULL, mtop);
+        read_tpx(tps_file, nullptr, nullptr, &temp_natoms,
+                 nullptr, nullptr, mtop);
     }
 
     return mtop;
@@ -742,20 +742,20 @@ int gmx_trjconv(int argc, char *argv[])
     };
     const char *pbc_opt[epNR + 1] =
     {
-        NULL, "none", "mol", "res", "atom", "nojump", "cluster", "whole",
-        NULL
+        nullptr, "none", "mol", "res", "atom", "nojump", "cluster", "whole",
+        nullptr
     };
 
     int         unitcell_enum;
     const char *unitcell_opt[euNR+1] =
-    { NULL, "rect", "tric", "compact", NULL };
+    { nullptr, "rect", "tric", "compact", nullptr };
 
     enum
     {
         ecSel, ecTric, ecRect, ecZero, ecNR
     };
     const char *center_opt[ecNR+1] =
-    { NULL, "tric", "rect", "zero", NULL };
+    { nullptr, "tric", "rect", "zero", nullptr };
     int         ecenter;
 
     int         fit_enum;
@@ -765,8 +765,8 @@ int gmx_trjconv(int argc, char *argv[])
     };
     const char *fit[efNR + 1] =
     {
-        NULL, "none", "rot+trans", "rotxy+transxy", "translation", "transxy",
-        "progressive", NULL
+        nullptr, "none", "rot+trans", "rotxy+transxy", "translation", "transxy",
+        "progressive", nullptr
     };
 
     static gmx_bool  bSeparate     = FALSE, bVels = TRUE, bForce = FALSE, bCONECT = FALSE;
@@ -774,7 +774,7 @@ int gmx_trjconv(int argc, char *argv[])
     static int       skip_nr       = 1, ndec = 3, nzero = 0;
     static real      tzero         = 0, delta_t = 0, timestep = 0, ttrunc = -1, tdump = -1, split_t = 0;
     static rvec      newbox        = {0, 0, 0}, shift = {0, 0, 0}, trans = {0, 0, 0};
-    static char     *exec_command  = NULL;
+    static char     *exec_command  = nullptr;
     static real      dropunder     = 0, dropover = 0;
     static gmx_bool  bRound        = FALSE;
 
@@ -858,22 +858,22 @@ int gmx_trjconv(int argc, char *argv[])
     };
 #define NPA asize(pa)
 
-    FILE             *out    = NULL;
-    t_trxstatus      *trxout = NULL;
+    FILE             *out    = nullptr;
+    t_trxstatus      *trxout = nullptr;
     t_trxstatus      *trxin;
     int               file_nr;
     t_trxframe        fr, frout;
     int               flags;
-    rvec             *xmem  = NULL, *vmem = NULL, *fmem = NULL;
-    rvec             *xp    = NULL, x_shift, hbox;
-    real             *w_rls = NULL;
+    rvec             *xmem  = nullptr, *vmem = nullptr, *fmem = nullptr;
+    rvec             *xp    = nullptr, x_shift, hbox;
+    real             *w_rls = nullptr;
     int               m, i, d, frame, outframe, natoms, nout, ncent, newstep = 0, model_nr;
 #define SKIP 10
     t_topology        top;
-    gmx_mtop_t       *mtop  = NULL;
-    gmx_conect        gc    = NULL;
+    gmx_mtop_t       *mtop  = nullptr;
+    gmx_conect        gc    = nullptr;
     int               ePBC  = -1;
-    t_atoms          *atoms = NULL, useatoms;
+    t_atoms          *atoms = nullptr, useatoms;
     matrix            top_box;
     int              *index, *cindex;
     char             *grpnm;
@@ -882,35 +882,35 @@ int gmx_trjconv(int argc, char *argv[])
     int               ifit, my_clust = -1;
     int              *ind_fit;
     char             *gn_fit;
-    t_cluster_ndx    *clust           = NULL;
-    t_trxstatus     **clust_status    = NULL;
-    int              *clust_status_id = NULL;
+    t_cluster_ndx    *clust           = nullptr;
+    t_trxstatus     **clust_status    = nullptr;
+    int              *clust_status_id = nullptr;
     int               ntrxopen        = 0;
-    int              *nfwritten       = NULL;
+    int              *nfwritten       = nullptr;
     int               ndrop           = 0, ncol, drop0 = 0, drop1 = 0, dropuse = 0;
     double          **dropval;
     real              tshift = 0, t0 = -1, dt = 0.001, prec;
     gmx_bool          bFit, bPFit, bReset;
     int               nfitdim;
-    gmx_rmpbc_t       gpbc = NULL;
+    gmx_rmpbc_t       gpbc = nullptr;
     gmx_bool          bRmPBC, bPBCWhole, bPBCcomRes, bPBCcomMol, bPBCcomAtom, bPBC, bNoJump, bCluster;
     gmx_bool          bCopy, bDoIt, bIndex, bTDump, bSetTime, bTPS = FALSE, bDTset = FALSE;
     gmx_bool          bExec, bTimeStep = FALSE, bDumpFrame = FALSE, bSetPrec, bNeedPrec;
     gmx_bool          bHaveFirstFrame, bHaveNextFrame, bSetBox, bSetUR, bSplit = FALSE;
     gmx_bool          bSubTraj = FALSE, bDropUnder = FALSE, bDropOver = FALSE, bTrans = FALSE;
     gmx_bool          bWriteFrame, bSplitHere;
-    const char       *top_file, *in_file, *out_file = NULL;
+    const char       *top_file, *in_file, *out_file = nullptr;
     char              out_file2[256], *charpt;
-    char             *outf_base = NULL;
-    const char       *outf_ext  = NULL;
+    char             *outf_base = nullptr;
+    const char       *outf_ext  = nullptr;
     char              top_title[256], title[256], filemode[5];
     gmx_output_env_t *oenv;
 
     t_filenm          fnm[] = {
-        { efTRX, "-f",   NULL,      ffREAD  },
-        { efTRO, "-o",   NULL,      ffWRITE },
-        { efTPS, NULL,   NULL,      ffOPTRD },
-        { efNDX, NULL,   NULL,      ffOPTRD },
+        { efTRX, "-f",   nullptr,      ffREAD  },
+        { efTRO, "-o",   nullptr,      ffWRITE },
+        { efTPS, nullptr,   nullptr,      ffOPTRD },
+        { efNDX, nullptr,   nullptr,      ffOPTRD },
         { efNDX, "-fr",  "frames",  ffOPTRD },
         { efNDX, "-sub", "cluster", ffOPTRD },
         { efXVG, "-drop", "drop",    ffOPTRD }
@@ -921,7 +921,7 @@ int gmx_trjconv(int argc, char *argv[])
                            PCA_CAN_BEGIN | PCA_CAN_END | PCA_CAN_VIEW |
                            PCA_TIME_UNIT,
                            NFILE, fnm, NPA, pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1030,7 +1030,7 @@ int gmx_trjconv(int argc, char *argv[])
         if (bSeparate || bSplit)
         {
             outf_ext = std::strrchr(out_file, '.');
-            if (outf_ext == NULL)
+            if (outf_ext == nullptr)
             {
                 gmx_fatal(FARGS, "Output file name '%s' does not contain a '.'", out_file);
             }
@@ -1048,7 +1048,7 @@ int gmx_trjconv(int argc, char *argv[])
                 gmx_fatal(FARGS, "Can only use the sub option with output file types "
                           "xtc and trr");
             }
-            clust = cluster_index(NULL, opt2fn("-sub", NFILE, fnm));
+            clust = cluster_index(nullptr, opt2fn("-sub", NFILE, fnm));
 
             /* Check for number of files disabled, as FOPEN_MAX is not the correct
              * number to check for. In my linux box it is only 16.
@@ -1071,7 +1071,7 @@ int gmx_trjconv(int argc, char *argv[])
             snew(nfwritten, clust->clust->nr);
             for (i = 0; (i < clust->clust->nr); i++)
             {
-                clust_status[i]    = NULL;
+                clust_status[i]    = nullptr;
                 clust_status_id[i] = -1;
             }
             bSeparate = bSplit = FALSE;
@@ -1093,7 +1093,7 @@ int gmx_trjconv(int argc, char *argv[])
 
         if (bTPS)
         {
-            read_tps_conf(top_file, &top, &ePBC, &xp, NULL, top_box,
+            read_tps_conf(top_file, &top, &ePBC, &xp, nullptr, top_box,
                           bReset || bPBCcomRes);
             std::strncpy(top_title, *top.name, 255);
             top_title[255] = '\0';
@@ -1124,7 +1124,7 @@ int gmx_trjconv(int argc, char *argv[])
         }
 
         /* get frame number index */
-        frindex = NULL;
+        frindex = nullptr;
         if (opt2bSet("-fr", NFILE, fnm))
         {
             printf("Select groups of frame number indices:\n");
@@ -1215,7 +1215,7 @@ int gmx_trjconv(int argc, char *argv[])
                 gmx_rmpbc(gpbc, top.atoms.nr, top_box, xp);
             }
             copy_rvec(xp[index[0]], x_shift);
-            reset_x_ndim(nfitdim, ifit, ind_fit, atoms->nr, NULL, xp, w_rls);
+            reset_x_ndim(nfitdim, ifit, ind_fit, atoms->nr, nullptr, xp, w_rls);
             rvec_dec(x_shift, xp[index[0]]);
         }
         else
@@ -1336,7 +1336,7 @@ int gmx_trjconv(int argc, char *argv[])
                                                      filemode[0],
                                                      trxin,
                                                      &trxout,
-                                                     NULL,
+                                                     nullptr,
                                                      nout,
                                                      mtop,
                                                      index,
@@ -1344,7 +1344,7 @@ int gmx_trjconv(int argc, char *argv[])
                     break;
                 case efXTC:
                 case efTRR:
-                    out = NULL;
+                    out = nullptr;
                     if (!bSplit && !bSubTraj)
                     {
                         trxout = open_trx(out_file, filemode);
@@ -1514,14 +1514,14 @@ int gmx_trjconv(int argc, char *argv[])
                         gmx_rmpbc_trxfr(gpbc, &fr);
                     }
 
-                    reset_x_ndim(nfitdim, ifit, ind_fit, natoms, NULL, fr.x, w_rls);
+                    reset_x_ndim(nfitdim, ifit, ind_fit, natoms, nullptr, fr.x, w_rls);
                     do_fit(natoms, w_rls, xp, fr.x);
                 }
 
                 /* store this set of coordinates for future use */
                 if (bPFit || bNoJump)
                 {
-                    if (xp == NULL)
+                    if (xp == nullptr)
                     {
                         snew(xp, natoms);
                     }
@@ -1636,7 +1636,7 @@ int gmx_trjconv(int argc, char *argv[])
 
                             if (bReset)
                             {
-                                reset_x_ndim(nfitdim, ifit, ind_fit, natoms, NULL, fr.x, w_rls);
+                                reset_x_ndim(nfitdim, ifit, ind_fit, natoms, nullptr, fr.x, w_rls);
                                 if (bFit)
                                 {
                                     do_fit_ndim(nfitdim, natoms, w_rls, xp, fr.x);
@@ -1787,7 +1787,7 @@ int gmx_trjconv(int argc, char *argv[])
                                              clust->clust->index[my_clust]))
                                         {
                                             close_trx(clust_status[my_clust]);
-                                            clust_status[my_clust]    = NULL;
+                                            clust_status[my_clust]    = nullptr;
                                             clust_status_id[my_clust] = -2;
                                             ntrxopen--;
                                             if (ntrxopen < 0)
@@ -1815,7 +1815,7 @@ int gmx_trjconv(int argc, char *argv[])
                                 {
                                     case efGRO:
                                         write_hconf_p(out, title, &useatoms,
-                                                      frout.x, frout.bV ? frout.v : NULL, frout.box);
+                                                      frout.x, frout.bV ? frout.v : nullptr, frout.box);
                                         break;
                                     case efPDB:
                                         fprintf(out, "REMARK    GENERATED BY TRJCONV\n");
@@ -1854,12 +1854,12 @@ int gmx_trjconv(int argc, char *argv[])
                                             frout.bStep  = TRUE;
                                             frout.bTime  = TRUE;
                                         }
-                                        write_g96_conf(out, &frout, -1, NULL);
+                                        write_g96_conf(out, &frout, -1, nullptr);
                                 }
                                 if (bSeparate || bSplitHere)
                                 {
                                     gmx_ffclose(out);
-                                    out = NULL;
+                                    out = nullptr;
                                 }
                                 break;
                             default:
@@ -1909,7 +1909,7 @@ int gmx_trjconv(int argc, char *argv[])
         {
             close_trx(trxout);
         }
-        else if (out != NULL)
+        else if (out != nullptr)
         {
             gmx_ffclose(out);
         }
@@ -1927,7 +1927,7 @@ int gmx_trjconv(int argc, char *argv[])
 
     sfree(mtop);
 
-    do_view(oenv, out_file, NULL);
+    do_view(oenv, out_file, nullptr);
 
     return 0;
 }
index d43212679140708ab3f51b5754d7651ef397be78..9f1bd408eda3c816910832287a4628ea9cef3de3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -136,24 +136,24 @@ int gmx_trjorder(int argc, char *argv[])
     int               natoms, nwat, ncut;
     char            **grpname;
     int               i, j, d, *isize, isize_ref = 0, isize_sol;
-    int               sa, sr, *swi, **index, *ind_ref = NULL, *ind_sol;
+    int               sa, sr, *swi, **index, *ind_ref = nullptr, *ind_sol;
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD  },
-        { efTPS, NULL, NULL, ffREAD  },
-        { efNDX, NULL, NULL, ffOPTRD },
+        { efTRX, "-f", nullptr, ffREAD  },
+        { efTPS, nullptr, nullptr, ffREAD  },
+        { efNDX, nullptr, nullptr, ffOPTRD },
         { efTRO, "-o", "ordered", ffOPTWR },
         { efXVG, "-nshell", "nshell", ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, NULL, box, TRUE);
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &x, nullptr, box, TRUE);
     sfree(x);
 
     /* get index groups */
@@ -214,8 +214,8 @@ int gmx_trjorder(int argc, char *argv[])
         swi[i] = i;
     }
 
-    out     = NULL;
-    fp      = NULL;
+    out     = nullptr;
+    fp      = nullptr;
     bNShell = ((opt2bSet("-nshell", NFILE, fnm)) ||
                (opt2parg_bSet("-r", asize(pa), pa)));
     bPDBout = FALSE;
@@ -362,7 +362,7 @@ int gmx_trjorder(int argc, char *argv[])
                     }
                 }
             }
-            write_trx(out, natoms, swi, &top.atoms, 0, t, box, x, NULL, NULL);
+            write_trx(out, natoms, swi, &top.atoms, 0, t, box, x, nullptr, nullptr);
         }
     }
     while (read_next_x(oenv, status, &t, x, box));
index 695f199c527c34bddb30d46c9679ffb04c377113..251d81a5eae0180b72e5834f42e692b3cae3b1f0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -168,7 +168,7 @@ static void finalize(const char *fn_out)
     fp = fopen(fn_out, "r");
     fprintf(stdout, "\n\n");
 
-    while (fgets(buf, STRLEN-1, fp) != NULL)
+    while (fgets(buf, STRLEN-1, fp) != nullptr)
     {
         fprintf(stdout, "%s", buf);
     }
@@ -218,13 +218,13 @@ static int parse_logfile(const char *logfile, const char *errfile,
         iFound = eFoundDDStr; /* Skip some case statements */
     }
 
-    while (fgets(line, STRLEN, fp) != NULL)
+    while (fgets(line, STRLEN, fp) != nullptr)
     {
         /* Remove leading spaces */
         ltrim(line);
 
         /* Check for TERM and INT signals from user: */
-        if (std::strstr(line, errSIG) != NULL)
+        if (std::strstr(line, errSIG) != nullptr)
         {
             fclose(fp);
             cleandata(perfdata, test_nr);
@@ -234,7 +234,7 @@ static int parse_logfile(const char *logfile, const char *errfile,
         /* Check whether cycle resetting  worked */
         if (presteps > 0 && !bFoundResetStr)
         {
-            if (std::strstr(line, matchstrcr) != NULL)
+            if (std::strstr(line, matchstrcr) != nullptr)
             {
                 sprintf(dumstring, "step %s", "%" GMX_SCNd64);
                 sscanf(line, dumstring, &resetsteps);
@@ -356,11 +356,11 @@ static int parse_logfile(const char *logfile, const char *errfile,
     if (gmx_fexist(errfile))
     {
         fp = fopen(errfile, "r");
-        while (fgets(line, STRLEN, fp) != NULL)
+        while (fgets(line, STRLEN, fp) != nullptr)
         {
             if (str_starts(line, "Fatal error:") )
             {
-                if (fgets(line, STRLEN, fp) != NULL)
+                if (fgets(line, STRLEN, fp) != nullptr)
                 {
                     fprintf(stderr, "\nWARNING: An error occurred during this benchmark:\n"
                             "%s\n", line);
@@ -607,7 +607,7 @@ static void get_program_paths(gmx_bool bThreads, char *cmd_mpirun[], char *cmd_m
     /* Get the commands we need to set up the runs from environment variables */
     if (!bThreads)
     {
-        if ( (cp = getenv("MPIRUN")) != NULL)
+        if ( (cp = getenv("MPIRUN")) != nullptr)
         {
             *cmd_mpirun = gmx_strdup(cp);
         }
@@ -621,12 +621,12 @@ static void get_program_paths(gmx_bool bThreads, char *cmd_mpirun[], char *cmd_m
         *cmd_mpirun = gmx_strdup(empty_mpirun);
     }
 
-    if (*cmd_mdrun == NULL)
+    if (*cmd_mdrun == nullptr)
     {
         /* The use of MDRUN is deprecated, but made available in 5.1
            for backward compatibility. It may be removed in a future
            version. */
-        if ( (cp = getenv("MDRUN" )) != NULL)
+        if ( (cp = getenv("MDRUN" )) != nullptr)
         {
             *cmd_mdrun = gmx_strdup(cp);
         }
@@ -649,7 +649,7 @@ static void check_mdrun_works(gmx_bool    bThreads,
                               const char *cmd_mdrun,
                               gmx_bool    bNeedGpuSupport)
 {
-    char      *command = NULL;
+    char      *command = nullptr;
     char      *cp;
     char       line[STRLEN];
     FILE      *fp;
@@ -692,7 +692,7 @@ static void check_mdrun_works(gmx_bool    bThreads,
     while (!feof(fp) )
     {
         cp = fgets(line, STRLEN, fp);
-        if (cp != NULL)
+        if (cp != nullptr)
         {
             if (str_starts(line, match_mdrun) )
             {
@@ -1078,7 +1078,7 @@ static void make_benchmark_tprs(
 
             /* Scale the Fourier grid spacing */
             ir->nkx = ir->nky = ir->nkz = 0;
-            calc_grid(NULL, state.box, fourierspacing*fac, &ir->nkx, &ir->nky, &ir->nkz);
+            calc_grid(nullptr, state.box, fourierspacing*fac, &ir->nkx, &ir->nky, &ir->nkz);
 
             /* Adjust other radii since various conditions need to be fulfilled */
             if (eelPME == ir->coulombtype)
@@ -1178,7 +1178,7 @@ static void cleanup(const t_filenm *fnm, int nfile, int k, int nnodes,
 {
     char        numstring[STRLEN];
     char        newfilename[STRLEN];
-    const char *fn = NULL;
+    const char *fn = nullptr;
     int         i;
     const char *opt;
 
@@ -1447,8 +1447,8 @@ static void do_the_tests(
                                                    * constructing mdrun command lines */
 {
     int      i, nr, k, ret, count = 0, totaltests;
-    int     *nPMEnodes = NULL;
-    t_perf  *pd        = NULL;
+    int     *nPMEnodes = nullptr;
+    t_perf  *pd        = nullptr;
     int      cmdline_length;
     char    *command, *cmd_stub;
     char     buf[STRLEN];
@@ -1530,7 +1530,7 @@ static void do_the_tests(
         /* Loop over various numbers of PME nodes: */
         for (i = 0; i < *pmeentries; i++)
         {
-            char *cmd_gpu_ids = NULL;
+            char *cmd_gpu_ids = nullptr;
 
             pd = &perfdata[k][i];
 
@@ -2207,25 +2207,25 @@ int gmx_tune_pme(int argc, char *argv[])
     int             presteps       = 100; /* Do a full cycle reset after presteps steps */
     gmx_bool        bOverwrite     = FALSE, bKeepTPR;
     gmx_bool        bLaunch        = FALSE;
-    char           *ExtraArgs      = NULL;
-    char          **tpr_names      = NULL;
-    const char     *simulation_tpr = NULL;
-    char           *deffnm         = NULL;
+    char           *ExtraArgs      = nullptr;
+    char          **tpr_names      = nullptr;
+    const char     *simulation_tpr = nullptr;
+    char           *deffnm         = nullptr;
     int             best_npme, best_tpr;
     int             sim_part = 1; /* For benchmarks with checkpoint files */
     char            bbuf[STRLEN];
 
 
     /* Default program names if nothing else is found */
-    char               *cmd_mpirun = NULL, *cmd_mdrun = NULL;
+    char               *cmd_mpirun = nullptr, *cmd_mdrun = nullptr;
     char               *cmd_args_bench, *cmd_args_launch;
-    char               *cmd_np           = NULL;
+    char               *cmd_np           = nullptr;
 
     /* IDs of GPUs that are eligible for computation */
-    char               *eligible_gpu_ids = NULL;
-    t_eligible_gpu_ids *gpu_ids          = NULL;
+    char               *eligible_gpu_ids = nullptr;
+    t_eligible_gpu_ids *gpu_ids          = nullptr;
 
-    t_perf            **perfdata = NULL;
+    t_perf            **perfdata = nullptr;
     t_inputinfo        *info;
     int                 i;
     FILE               *fp;
@@ -2239,11 +2239,11 @@ int gmx_tune_pme(int argc, char *argv[])
         { efLOG, "-err",    "bencherr", ffWRITE },
         { efTPR, "-so",     "tuned",    ffWRITE },
         /* mdrun: */
-        { efTPR, NULL,      NULL,       ffREAD },
-        { efTRN, "-o",      NULL,       ffWRITE },
-        { efCOMPRESSED, "-x", NULL,     ffOPTWR },
-        { efCPT, "-cpi",    NULL,       ffOPTRD },
-        { efCPT, "-cpo",    NULL,       ffOPTWR },
+        { efTPR, nullptr,      nullptr,       ffREAD },
+        { efTRN, "-o",      nullptr,       ffWRITE },
+        { efCOMPRESSED, "-x", nullptr,     ffOPTWR },
+        { efCPT, "-cpi",    nullptr,       ffOPTRD },
+        { efCPT, "-cpo",    nullptr,       ffOPTWR },
         { efSTO, "-c",      "confout",  ffWRITE },
         { efEDR, "-e",      "ener",     ffWRITE },
         { efLOG, "-g",      "md",       ffWRITE },
@@ -2297,9 +2297,9 @@ int gmx_tune_pme(int argc, char *argv[])
     int             nthreads = 1;
 
     const char     *procstring[] =
-    { NULL, "np", "n", "none", NULL };
+    { nullptr, "np", "n", "none", nullptr };
     const char     *npmevalues_opt[] =
-    { NULL, "auto", "all", "subset", NULL };
+    { nullptr, "auto", "all", "subset", nullptr };
 
     gmx_bool          bAppendFiles          = TRUE;
     gmx_bool          bKeepAndNumCPT        = FALSE;
@@ -2307,7 +2307,7 @@ int gmx_tune_pme(int argc, char *argv[])
     gmx_bool          bBenchmark            = TRUE;
     gmx_bool          bCheck                = TRUE;
 
-    gmx_output_env_t *oenv = NULL;
+    gmx_output_env_t *oenv = nullptr;
 
     t_pargs           pa[] = {
         /***********************/
@@ -2376,13 +2376,13 @@ int gmx_tune_pme(int argc, char *argv[])
 
     if (!parse_common_args(&argc, argv, PCA_NOEXIT_ON_ARGS,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     // procstring[0] is used inside two different conditionals further down
-    GMX_RELEASE_ASSERT(procstring[0] != NULL, "Options inconsistency; procstring[0] is NULL");
+    GMX_RELEASE_ASSERT(procstring[0] != nullptr, "Options inconsistency; procstring[0] is NULL");
 
     /* Store the remaining unparsed command line entries in a string which
      * is then attached to the mdrun command line */
@@ -2513,7 +2513,7 @@ int gmx_tune_pme(int argc, char *argv[])
     get_program_paths(bThreads, &cmd_mpirun, &cmd_mdrun);
     if (bBenchmark && repeats > 0)
     {
-        check_mdrun_works(bThreads, cmd_mpirun, cmd_np, cmd_mdrun, NULL != eligible_gpu_ids);
+        check_mdrun_works(bThreads, cmd_mpirun, cmd_np, cmd_mdrun, nullptr != eligible_gpu_ids);
     }
 
     /* Print some header info to file */
@@ -2610,7 +2610,7 @@ int gmx_tune_pme(int argc, char *argv[])
     snew(perfdata, ntprs);
     if (bBenchmark)
     {
-        GMX_RELEASE_ASSERT(npmevalues_opt[0] != NULL, "Options inconsistency; npmevalues_opt[0] is NULL");
+        GMX_RELEASE_ASSERT(npmevalues_opt[0] != nullptr, "Options inconsistency; npmevalues_opt[0] is NULL");
         do_the_tests(fp, tpr_names, maxPMEnodes, minPMEnodes, npme_fixed, npmevalues_opt[0], perfdata, &pmeentries,
                      repeats, nnodes, ntprs, bThreads, cmd_mpirun, cmd_np, cmd_mdrun,
                      cmd_args_bench, fnm, NFILE, presteps, cpt_steps, bCheck, gpu_ids);
index 0c660cc4b359639c1366d26a0101d917b5321634..5d7b248a78bbdb3aae607dfef32c04b3695c24d0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -122,9 +122,9 @@ int gmx_vanhove(int argc, char *argv[])
 #define NPA asize(pa)
 
     t_filenm fnm[] = {
-        { efTRX, NULL, NULL,  ffREAD },
-        { efTPS, NULL, NULL,  ffREAD },
-        { efNDX, NULL, NULL,  ffOPTRD },
+        { efTRX, nullptr, nullptr,  ffREAD },
+        { efTPS, nullptr, nullptr,  ffREAD },
+        { efNDX, nullptr, nullptr,  ffOPTRD },
         { efXPM, "-om", "vanhove", ffOPTWR },
         { efXVG, "-or", "vanhove_r", ffOPTWR },
         { efXVG, "-ot", "vanhove_t", ffOPTWR }
@@ -145,13 +145,13 @@ int gmx_vanhove(int argc, char *argv[])
     real             *time, t, invbin = 0, rmax2 = 0, rint2 = 0, d2;
     real              invsbin = 0, matmax, normfac, dt, *tickx, *ticky;
     char              buf[STRLEN], **legend;
-    real            **mat = NULL;
-    int              *pt  = NULL, **pr = NULL, *mcount = NULL, *tcount = NULL, *rcount = NULL;
+    real            **mat = nullptr;
+    int              *pt  = nullptr, **pr = nullptr, *mcount = nullptr, *tcount = nullptr, *rcount = nullptr;
     FILE             *fp;
     t_rgb             rlo = {1, 1, 1}, rhi = {0, 0, 0};
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -181,14 +181,14 @@ int gmx_vanhove(int argc, char *argv[])
         exit(0);
     }
 
-    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, NULL, boxtop,
+    read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtop, nullptr, boxtop,
                   FALSE);
     get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &isize, &index, &grpname);
 
     nalloc = 0;
-    time   = NULL;
-    sbox   = NULL;
-    sx     = NULL;
+    time   = nullptr;
+    sbox   = nullptr;
+    sx     = nullptr;
     clear_mat(avbox);
 
     read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
@@ -202,8 +202,8 @@ int gmx_vanhove(int argc, char *argv[])
             srenew(sbox, nalloc);
             srenew(sx, nalloc);
         }
-        GMX_RELEASE_ASSERT(time != NULL, "Memory allocation failure; time array is NULL");
-        GMX_RELEASE_ASSERT(sbox != NULL, "Memory allocation failure; sbox array is NULL");
+        GMX_RELEASE_ASSERT(time != nullptr, "Memory allocation failure; time array is NULL");
+        GMX_RELEASE_ASSERT(sbox != nullptr, "Memory allocation failure; sbox array is NULL");
 
         time[nfr] = t;
         copy_mat(box, sbox[nfr]);
@@ -481,9 +481,9 @@ int gmx_vanhove(int argc, char *argv[])
         xvgrclose(fp);
     }
 
-    do_view(oenv, matfile, NULL);
-    do_view(oenv, orfile, NULL);
-    do_view(oenv, otfile, NULL);
+    do_view(oenv, matfile, nullptr);
+    do_view(oenv, orfile, nullptr);
+    do_view(oenv, otfile, nullptr);
 
     return 0;
 }
index 6ed7e737f9c62045967926af5b636b4e88f25234..1b0c0f41f82e6aa886ca7d87d5a014fa63810e8a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -218,15 +218,15 @@ int gmx_velacc(int argc, char *argv[])
     rvec              mv_mol;
     /* Array for the correlation function */
     real            **c1;
-    real             *normm = NULL;
+    real             *normm = nullptr;
     gmx_output_env_t *oenv;
 
 #define NHISTO 360
 
     t_filenm  fnm[] = {
-        { efTRN, "-f",    NULL,   ffREAD  },
-        { efTPS, NULL,    NULL,   ffOPTRD },
-        { efNDX, NULL,    NULL,   ffOPTRD },
+        { efTRN, "-f",    nullptr,   ffREAD  },
+        { efTPS, nullptr,    nullptr,   ffOPTRD },
+        { efNDX, nullptr,    nullptr,   ffOPTRD },
         { efXVG, "-o",    "vac",  ffWRITE },
         { efXVG, "-os",   "spectrum", ffOPTWR }
     };
@@ -237,7 +237,7 @@ int gmx_velacc(int argc, char *argv[])
     npargs = asize(pa);
     ppa    = add_acf_pargs(&npargs, pa);
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
-                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, NULL, &oenv))
+                           NFILE, fnm, npargs, ppa, asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(ppa);
         return 0;
@@ -250,7 +250,7 @@ int gmx_velacc(int argc, char *argv[])
 
     if (bTPS)
     {
-        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, NULL, NULL, box,
+        bTop = read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, nullptr, nullptr, box,
                              TRUE);
         get_index(&top.atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &gnx, &index, &grpname);
     }
@@ -274,7 +274,7 @@ int gmx_velacc(int argc, char *argv[])
     snew(c1, gnx);
     for (i = 0; (i < gnx); i++)
     {
-        c1[i] = NULL;
+        c1[i] = nullptr;
     }
 
     read_first_frame(oenv, &status, ftp2fn(efTRN, NFILE, fnm), &fr, TRX_NEED_V);
index 3c20dfe16dcaa45ae5ec77479993f646c84ef087..9748824baa041e3a0f256277a945c59da7fe3003 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -330,15 +330,15 @@ t_UmbrellaWindow * initUmbrellaWindows(int nwin)
     snew(win, nwin);
     for (i = 0; i < nwin; i++)
     {
-        win[i].Histo    = win[i].cum  = 0;
-        win[i].k        = win[i].pos  = win[i].z = 0;
-        win[i].N        = win[i].Ntot = 0;
-        win[i].g        = win[i].tau  = win[i].tausmooth = 0;
-        win[i].bContrib = 0;
-        win[i].ztime    = 0;
-        win[i].forceAv  = 0;
-        win[i].aver     = win[i].sigma = 0;
-        win[i].bsWeight = 0;
+        win[i].Histo    = win[i].cum  = nullptr;
+        win[i].k        = win[i].pos  = win[i].z = nullptr;
+        win[i].N        = win[i].Ntot = nullptr;
+        win[i].g        = win[i].tau  = win[i].tausmooth = nullptr;
+        win[i].bContrib = nullptr;
+        win[i].ztime    = nullptr;
+        win[i].forceAv  = nullptr;
+        win[i].aver     = win[i].sigma = nullptr;
+        win[i].bsWeight = nullptr;
     }
     return win;
 }
@@ -440,7 +440,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     std::istringstream ist;
 
     /*  line 1 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -458,7 +458,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     }
 
     /*  line 2 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -473,7 +473,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     }
 
     /* line3 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -481,7 +481,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     ist >> Buffer0 >> Buffer1 >> header->nSkip;
 
     /* line 4 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -489,7 +489,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
     ist >> Buffer0 >> Buffer1 >> Buffer2 >> header->Reference;
 
     /* line 5 */
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Error reading header from pdo file\n");
     }
@@ -504,7 +504,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
 
     for (i = 0; i < header->nPull; ++i)
     {
-        if (fgets(line, 2048, file) == NULL)
+        if (fgets(line, 2048, file) == nullptr)
         {
             gmx_fatal(FARGS, "Error reading header from pdo file\n");
         }
@@ -520,7 +520,7 @@ void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *
         }
     }
 
-    if (fgets(line, 2048, file) == NULL)
+    if (fgets(line, 2048, file) == nullptr)
     {
         gmx_fatal(FARGS, "Cannot read from file\n");
     }
@@ -538,18 +538,18 @@ static char *fgets3(FILE *fp, char ptr[], int *len)
     char *p;
     int   slen;
 
-    if (fgets(ptr, *len-1, fp) == NULL)
+    if (fgets(ptr, *len-1, fp) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
     p = ptr;
-    while ((std::strchr(ptr, '\n') == NULL) && (!feof(fp)))
+    while ((std::strchr(ptr, '\n') == nullptr) && (!feof(fp)))
     {
         /* This line is longer than len characters, let's increase len! */
         *len += STRLEN;
         p    += STRLEN;
         srenew(ptr, *len);
-        if (fgets(p-1, STRLEN, fp) == NULL)
+        if (fgets(p-1, STRLEN, fp) == nullptr)
         {
             break;
         }
@@ -577,13 +577,13 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
     int                i, inttemp, bins, count, ntot;
     real               minval, maxval, minfound = 1e20, maxfound = -1e20;
     double             temp, time, time0 = 0, dt;
-    char              *ptr    = 0;
-    t_UmbrellaWindow * window = 0;
+    char              *ptr    = nullptr;
+    t_UmbrellaWindow * window = nullptr;
     gmx_bool           timeok, dt_ok = 1;
-    char              *tmpbuf   = 0, fmt[256], fmtign[256], fmtlf[5] = "%lf";
+    char              *tmpbuf   = nullptr, fmt[256], fmtign[256], fmtlf[5] = "%lf";
     int                len      = STRLEN, dstep = 1;
     const int          blocklen = 4096;
-    int               *lennow   = 0;
+    int               *lennow   = nullptr;
 
     if (!bGetMinMax)
     {
@@ -605,7 +605,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
         snew(window->g, window->nPull);
         snew(window->bsWeight, window->nPull);
 
-        window->bContrib = 0;
+        window->bContrib = nullptr;
 
         if (opt->bCalcTauInt)
         {
@@ -613,7 +613,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
         }
         else
         {
-            window->ztime = 0;
+            window->ztime = nullptr;
         }
         snew(lennow, window->nPull);
 
@@ -629,7 +629,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
             window->g[i]    = 1.;
             if (opt->bCalcTauInt)
             {
-                window->ztime[i] = 0;
+                window->ztime[i] = nullptr;
             }
         }
 
@@ -644,7 +644,7 @@ void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
 
     count = 0;
     snew(tmpbuf, len);
-    while ( (ptr = fgets3(file, tmpbuf, &len)) != NULL)
+    while ( (ptr = fgets3(file, tmpbuf, &len)) != nullptr)
     {
         trim(ptr);
 
@@ -1264,8 +1264,8 @@ void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
 {
     int    i, j, k, nbin;
     double last;
-    char  *fn = 0, *buf = 0;
-    FILE  *fp = 0;
+    char  *fn = nullptr, *buf = nullptr;
+    FILE  *fp = nullptr;
 
     if (opt->bs_verbose)
     {
@@ -1505,7 +1505,7 @@ void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thi
 void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows,
                       int bs_index, t_UmbrellaOptions *opt, const char *xlabel)
 {
-    char *fn = 0, *buf = 0, title[256];
+    char *fn = nullptr, *buf = nullptr, title[256];
     FILE *fp;
     int   bins, l, i, j;
 
@@ -1610,7 +1610,7 @@ void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
 {
     t_UmbrellaWindow * synthWindow;
     double            *bsProfile, *bsProfiles_av, *bsProfiles_av2, maxchange = 1e20, tmp, stddev;
-    int                i, j, *randomArray = 0, winid, pullid, ib;
+    int                i, j, *randomArray = nullptr, winid, pullid, ib;
     int                iAllPull, nAllPull, *allPull_winId, *allPull_pullId;
     FILE              *fp;
     gmx_bool           bExact = FALSE;
@@ -1829,14 +1829,14 @@ int whaminFileType(char *fn)
 void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
                   t_UmbrellaOptions *opt)
 {
-    char **filename = 0, tmp[WHAM_MAXFILELEN+2];
+    char **filename = nullptr, tmp[WHAM_MAXFILELEN+2];
     int    nread, sizenow, i, block = 1;
     FILE  *fp;
 
     fp      = gmx_ffopen(fn, "r");
     nread   = 0;
     sizenow = 0;
-    while (fgets(tmp, sizeof(tmp), fp) != NULL)
+    while (fgets(tmp, sizeof(tmp), fp) != nullptr)
     {
         if (std::strlen(tmp) >= WHAM_MAXFILELEN)
         {
@@ -1870,8 +1870,8 @@ void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
 //! Open a file or a pipe to a gzipped file
 FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
 {
-    char            Buffer[1024], gunzip[1024], *Path = 0;
-    FILE           *pipe   = 0;
+    char            Buffer[1024], gunzip[1024], *Path = nullptr;
+    FILE           *pipe   = nullptr;
     static gmx_bool bFirst = 1;
 
     /* gzipped pdo file? */
@@ -1919,7 +1919,7 @@ FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
             printf("Executing command '%s'\n", Buffer);
         }
 #if HAVE_PIPES
-        if ((pipe = popen(Buffer, "r")) == NULL)
+        if ((pipe = popen(Buffer, "r")) == nullptr)
         {
             gmx_fatal(FARGS, "Unable to open pipe to `%s'\n", Buffer);
         }
@@ -1981,7 +1981,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
             }
             read_pdo_header(file, header, opt);
             /* here only determine min and max of this window */
-            read_pdo_data(file, header, i, NULL, opt, TRUE, &mintmp, &maxtmp);
+            read_pdo_data(file, header, i, nullptr, opt, TRUE, &mintmp, &maxtmp);
             if (maxtmp > opt->max)
             {
                 opt->max = maxtmp;
@@ -2023,7 +2023,7 @@ void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
         file = open_pdo_pipe(fn[i], opt, &bPipeOpen);
         read_pdo_header(file, header, opt);
         /* load data into window */
-        read_pdo_data(file, header, i, window, opt, FALSE, NULL, NULL);
+        read_pdo_data(file, header, i, window, opt, FALSE, nullptr, nullptr);
         if ((window+i)->Ntot[0] == 0)
         {
             fprintf(stderr, "\nWARNING, no data points read from file %s (check -b option)\n", fn[i]);
@@ -2057,7 +2057,7 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
     static int      first = 1;
 
     /* printf("Reading %s \n",fn); */
-    read_tpx_state(fn, ir, &state, NULL);
+    read_tpx_state(fn, ir, &state, nullptr);
 
     if (!ir->bPull)
     {
@@ -2108,7 +2108,7 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
     bool geometryIsSet = false;
     for (int i = 0; i < ir->pull->ncoord; i++)
     {
-        if (coordsel == NULL || coordsel->bUse[i])
+        if (coordsel == nullptr || coordsel->bUse[i])
         {
             if (header->pcrd[i].pull_type != epullUMBRELLA)
             {
@@ -2168,7 +2168,7 @@ void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions
                 maxlen+1);
         for (int i = 0; i < ir->pull->ncoord; i++)
         {
-            bool use = (coordsel == NULL || coordsel->bUse[i]);
+            bool use = (coordsel == nullptr || coordsel->bUse[i]);
             printf(fmt,
                    epullg_names[header->pcrd[i].geometry], header->pcrd[i].k, header->pcrd[i].init_dist,
                    int2YN(header->pcrd[i].dim[XX]), int2YN(header->pcrd[i].dim[YY]), int2YN(header->pcrd[i].dim[ZZ]),
@@ -2205,14 +2205,14 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
                   gmx_bool bGetMinMax, real *mintmp, real *maxtmp,
                   t_coordselection *coordsel)
 {
-    double        **y = 0, pos = 0., t, force, time0 = 0., dt;
+    double        **y = nullptr, pos = 0., t, force, time0 = 0., dt;
     int             ny, nt, bins, ibin, i, g, gUsed, dstep = 1;
     int             nColExpect, ntot, column;
     real            min, max, minfound = 1e20, maxfound = -1e20;
     gmx_bool        dt_ok, timeok;
     const char     *quantity;
     const int       blocklen = 4096;
-    int            *lennow   = 0;
+    int            *lennow   = nullptr;
     static gmx_bool bFirst   = TRUE;
 
     /*
@@ -2334,7 +2334,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
         snew(window->Ntot,     window->nPull);
         snew(window->g,        window->nPull);
         snew(window->bsWeight, window->nPull);
-        window->bContrib = 0;
+        window->bContrib = nullptr;
 
         if (opt->bCalcTauInt)
         {
@@ -2342,7 +2342,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
         }
         else
         {
-            window->ztime = NULL;
+            window->ztime = nullptr;
         }
         snew(lennow, window->nPull);
 
@@ -2357,7 +2357,7 @@ void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
 
             if (opt->bCalcTauInt)
             {
-                window->ztime[g] = NULL;
+                window->ztime[g] = nullptr;
             }
         }
 
@@ -2554,13 +2554,13 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
             {
                 gmx_fatal(FARGS, "Expected the %d'th file in input file to be a tpr file\n", i);
             }
-            read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+            read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
             if (whaminFileType(fnPull[i]) != whamin_pullxf)
             {
                 gmx_fatal(FARGS, "Expected the %d'th file in input file to be a xvg (pullx/pullf) file\n", i);
             }
-            read_pull_xf(fnPull[i], header, NULL, opt, TRUE, &mintmp, &maxtmp,
-                         (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+            read_pull_xf(fnPull[i], header, nullptr, opt, TRUE, &mintmp, &maxtmp,
+                         (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
             if (maxtmp > opt->max)
             {
                 opt->max = maxtmp;
@@ -2587,13 +2587,13 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
         {
             gmx_fatal(FARGS, "Expected the %d'th file in input file to be a tpr file\n", i);
         }
-        read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+        read_tpr_header(fnTprs[i], header, opt, (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
         if (whaminFileType(fnPull[i]) != whamin_pullxf)
         {
             gmx_fatal(FARGS, "Expected the %d'th file in input file to be a xvg (pullx/pullf) file\n", i);
         }
-        read_pull_xf(fnPull[i], header, window+i, opt, FALSE, NULL, NULL,
-                     (opt->nCoordsel > 0) ? &opt->coordsel[i] : NULL);
+        read_pull_xf(fnPull[i], header, window+i, opt, FALSE, nullptr, nullptr,
+                     (opt->nCoordsel > 0) ? &opt->coordsel[i] : nullptr);
         if (window[i].Ntot[0] == 0)
         {
             fprintf(stderr, "\nWARNING, no data points read from file %s (check -b option)\n", fnPull[i]);
@@ -2725,7 +2725,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
     int   i, ig, ncorr, ntot, j, k, *count, restart;
     real *corr, c0, dt, tmp;
     real *ztime, av, tausteps;
-    FILE *fp, *fpcorr = 0;
+    FILE *fp, *fpcorr = nullptr;
 
     if (opt->verbose)
     {
@@ -3169,17 +3169,17 @@ void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
 {
     FILE *fp;
     int   i, iline, n, len = STRLEN, temp;
-    char *ptr = 0, *tmpbuf = 0;
+    char *ptr = nullptr, *tmpbuf = nullptr;
     char  fmt[1024], fmtign[1024];
     int   block = 1, sizenow;
 
     fp            = gmx_ffopen(opt->fnCoordSel, "r");
-    opt->coordsel = NULL;
+    opt->coordsel = nullptr;
 
     snew(tmpbuf, len);
     sizenow = 0;
     iline   = 0;
-    while ( (ptr = fgets3(fp, tmpbuf, &len)) != NULL)
+    while ( (ptr = fgets3(fp, tmpbuf, &len)) != nullptr)
     {
         trim(ptr);
         n = wordcount(ptr);
@@ -3406,9 +3406,9 @@ int gmx_wham(int argc, char *argv[])
         "the histograms."
     };
 
-    const char              *en_unit[]       = {NULL, "kJ", "kCal", "kT", NULL};
-    const char              *en_unit_label[] = {"", "E (kJ mol\\S-1\\N)", "E (kcal mol\\S-1\\N)", "E (kT)", NULL};
-    const char              *en_bsMethod[]   = { NULL, "b-hist", "hist", "traj", "traj-gauss", NULL };
+    const char              *en_unit[]       = {nullptr, "kJ", "kCal", "kT", nullptr};
+    const char              *en_unit_label[] = {"", "E (kJ mol\\S-1\\N)", "E (kcal mol\\S-1\\N)", "E (kT)", nullptr};
+    const char              *en_bsMethod[]   = { nullptr, "b-hist", "hist", "traj", "traj-gauss", nullptr };
     static t_UmbrellaOptions opt;
 
     t_pargs                  pa[] = {
@@ -3492,7 +3492,7 @@ int gmx_wham(int argc, char *argv[])
 
     int                      i, j, l, nfiles, nwins, nfiles2;
     t_UmbrellaHeader         header;
-    t_UmbrellaWindow       * window = NULL;
+    t_UmbrellaWindow       * window = nullptr;
     double                  *profile, maxchange = 1e20;
     gmx_bool                 bMinSet, bMaxSet, bAutoSet, bExact = FALSE;
     char                   **fninTpr, **fninPull, **fninPdo;
@@ -3511,7 +3511,7 @@ int gmx_wham(int argc, char *argv[])
     opt.max       = 0;
     opt.bAuto     = TRUE;
     opt.nCoordsel = 0;
-    opt.coordsel  = NULL;
+    opt.coordsel  = nullptr;
 
     /* bootstrapping stuff */
     opt.nBootStrap               = 0;
@@ -3537,7 +3537,7 @@ int gmx_wham(int argc, char *argv[])
     opt.stepUpdateContrib     = 100;
 
     if (!parse_common_args(&argc, argv, 0,
-                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &opt.oenv))
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &opt.oenv))
     {
         return 0;
     }
@@ -3627,7 +3627,7 @@ int gmx_wham(int argc, char *argv[])
         }
 
         /* Read file that selects the pull group to be used */
-        if (opt.fnCoordSel != NULL)
+        if (opt.fnCoordSel != nullptr)
         {
             readPullCoordSelection(&opt, fninTpr, nfiles);
         }
@@ -3637,7 +3637,7 @@ int gmx_wham(int argc, char *argv[])
     }
     else
     {   /* reading pdo files */
-        if  (opt.fnCoordSel != NULL)
+        if  (opt.fnCoordSel != nullptr)
         {
             gmx_fatal(FARGS, "Reading a -is file is not supported with PDO input files.\n"
                       "Use awk or a similar tool to pick the required pull groups from your PDO files\n");
index 90d497be9777bb83a9dbcbbec23ef753b1b83c93..669b75eb7ad041e464db861de657daa67bd3b3ab 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -224,7 +224,7 @@ int gmx_wheel(int argc, char *argv[])
     gmx_output_env_t *oenv;
     static real       rot0  = 0;
     static gmx_bool   bNum  = TRUE;
-    static char      *title = NULL;
+    static char      *title = nullptr;
     static int        r0    = 1;
     t_pargs           pa [] = {
         { "-r0",  FALSE, etINT, {&r0},
@@ -237,8 +237,8 @@ int gmx_wheel(int argc, char *argv[])
           "Toggle numbers" }
     };
     t_filenm          fnm[] = {
-        { efDAT, "-f", NULL,  ffREAD  },
-        { efEPS, "-o", NULL,  ffWRITE }
+        { efDAT, "-f", nullptr,  ffREAD  },
+        { efEPS, "-o", nullptr,  ffWRITE }
     };
 #define NFILE asize(fnm)
 
@@ -246,7 +246,7 @@ int gmx_wheel(int argc, char *argv[])
     char **resnm;
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -255,12 +255,12 @@ int gmx_wheel(int argc, char *argv[])
     {
         if (std::strcmp(argv[i], "-r0") == 0)
         {
-            r0 = std::strtol(argv[++i], NULL, 10);
+            r0 = std::strtol(argv[++i], nullptr, 10);
             fprintf(stderr, "First residue is %d\n", r0);
         }
         else if (std::strcmp(argv[i], "-rot0") == 0)
         {
-            rot0 = strtod(argv[++i], NULL);
+            rot0 = strtod(argv[++i], nullptr);
             fprintf(stderr, "Initial rotation is %g\n", rot0);
         }
         else if (std::strcmp(argv[i], "-T") == 0)
index 49c46ba77521cd326a6cc8cecc524a6d35bd0eb0..cacfcce28bebcf1e38ffe4baf6697c09837e4f62 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,9 +112,9 @@ enum {
 
 void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 {
-    static const char *gmx_bools[BOOL_NR+1]  = { "no", "yes", NULL };
+    static const char *gmx_bools[BOOL_NR+1]  = { "no", "yes", nullptr };
     /* this must correspond to t_rgb *linecolors[] below */
-    static const char *colors[] = { "none", "black", "white", NULL };
+    static const char *colors[] = { "none", "black", "white", nullptr };
     warninp_t          wi;
     t_inpfile         *inp;
     const char        *tmp;
@@ -122,13 +122,13 @@ void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 
     wi = init_warning(FALSE, 0);
 
-    if (mpin != NULL)
+    if (mpin != nullptr)
     {
         inp = read_inpfile(mpin, &ninp, wi);
     }
     else
     {
-        inp = NULL;
+        inp = nullptr;
     }
     ETYPE("black&white",    psr->bw,             gmx_bools);
     RTYPE("linewidth",      psr->linewidth,      1.0);
@@ -174,7 +174,7 @@ void get_params(const char *mpin, const char *mpout, t_psrec *psr)
 
     check_warning_error(wi, FARGS);
 
-    if (mpout != NULL)
+    if (mpout != nullptr)
     {
         write_inpfile(mpout, ninp, inp, TRUE, wi);
     }
@@ -188,7 +188,7 @@ t_rgb red   = { 1, 0, 0 };
 t_rgb blue  = { 0, 0, 1 };
 #define BLACK (&black)
 /* this must correspond to *colors[] in get_params */
-t_rgb *linecolors[] = { NULL, &black, &white, NULL };
+t_rgb *linecolors[] = { nullptr, &black, &white, nullptr };
 
 gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
 {
@@ -278,7 +278,7 @@ void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
         boxxh = fontsize;
     }
 
-    GMX_RELEASE_ASSERT(map != NULL, "NULL map array provided to leg_continuous()");
+    GMX_RELEASE_ASSERT(map != nullptr, "NULL map array provided to leg_continuous()");
 
     /* LANDSCAPE */
     xx0 = x0-((nmap-mapoffset)*boxxh)/2.0;
@@ -682,7 +682,7 @@ void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
     FILE      *out;
     int        i, x, y, col;
     int        nmap;
-    t_mapping *map = NULL;
+    t_mapping *map = nullptr;
 
     out = gmx_ffopen(outf, "w");
 
@@ -794,7 +794,7 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
     real          x0, y0, xx;
     real          w, h, dw, dh;
     int           nmap1 = 0, nmap2 = 0, leg_nmap;
-    t_mapping    *map1  = NULL, *map2 = NULL, *leg_map;
+    t_mapping    *map1  = nullptr, *map2 = nullptr, *leg_map;
     gmx_bool      bMap1, bNextMap1, bDiscrete;
 
     /* memory leak: */
@@ -1005,7 +1005,7 @@ void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
     {
         ps_comment(out, "Now it's legend time!");
         ps_linewidth(out, static_cast<int>(psr->linewidth));
-        if (mat2 == NULL || elegend != elSecond)
+        if (mat2 == nullptr || elegend != elSecond)
         {
             bDiscrete = mat[0].bDiscrete;
             legend    = mat[0].legend;
@@ -1052,7 +1052,7 @@ void make_axis_labels(int nmat, t_matrix *mat)
     for (i = 0; (i < nmat); i++)
     {
         /* Make labels for x axis */
-        if (mat[i].axis_x == NULL)
+        if (mat[i].axis_x == nullptr)
         {
             snew(mat[i].axis_x, mat[i].nx);
             for (j = 0; (j < mat[i].nx); j++)
@@ -1061,7 +1061,7 @@ void make_axis_labels(int nmat, t_matrix *mat)
             }
         }
         /* Make labels for y axis */
-        if (mat[i].axis_y == NULL)
+        if (mat[i].axis_y == nullptr)
         {
             snew(mat[i].axis_y, mat[i].ny);
             for (j = 0; (j < mat[i].ny); j++)
@@ -1186,13 +1186,13 @@ void write_combined_matrix(int ecombine, const char *fn,
                       " not match.\n", k, mat1[k].nx, mat1[k].ny, mat2[k].nx, mat2[k].ny);
         }
         printf("Combining two %dx%d matrices\n", mat1[k].nx, mat1[k].ny);
-        rmat1 = matrix2real(&mat1[k], NULL);
-        rmat2 = matrix2real(&mat2[k], NULL);
-        if (NULL == rmat1 || NULL == rmat2)
+        rmat1 = matrix2real(&mat1[k], nullptr);
+        rmat2 = matrix2real(&mat2[k], nullptr);
+        if (nullptr == rmat1 || nullptr == rmat2)
         {
             gmx_fatal(FARGS, "Could not extract real data from %s xpm matrices. Note that, e.g.,\n"
                       "g_rms and g_mdmat provide such data, but not do_dssp.\n",
-                      (NULL == rmat1 && NULL == rmat2) ? "both" : "one of the" );
+                      (nullptr == rmat1 && nullptr == rmat2) ? "both" : "one of the" );
         }
         rlo = 1e38;
         rhi = -1e38;
@@ -1295,13 +1295,13 @@ void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
         zero_lines(nmat, mat, mat);
     }
 
-    if (epsfile != NULL)
+    if (epsfile != nullptr)
     {
         ps_mat(epsfile, nmat, mat, mat2, bFrame, bDiag, bFirstDiag,
                bTitle, bTitleOnce, bYonce, elegend,
                size, boxx, boxy, m2p, m2pout, mapoffset);
     }
-    if (xpmfile != NULL)
+    if (xpmfile != nullptr)
     {
         xpm_mat(xpmfile, nmat, mat, mat2, bDiag, bFirstDiag);
     }
@@ -1433,9 +1433,9 @@ int gmx_xpm2ps(int argc, char *argv[])
     };
 
     gmx_output_env_t *oenv;
-    const char       *fn, *epsfile = NULL, *xpmfile = NULL;
+    const char       *fn, *epsfile = nullptr, *xpmfile = nullptr;
     int               i, nmat, nmat2, etitle, elegend, ediag, erainbow, ecombine;
-    t_matrix         *mat = NULL, *mat2 = NULL;
+    t_matrix         *mat = nullptr, *mat2 = nullptr;
     gmx_bool          bTitle, bTitleOnce, bDiag, bFirstDiag, bGrad;
     static gmx_bool   bFrame = TRUE, bZeroLine = FALSE, bYonce = FALSE;
     static real       size   = 400, boxx = 0, boxy = 0, cmin = 0, cmax = 0;
@@ -1443,20 +1443,20 @@ int gmx_xpm2ps(int argc, char *argv[])
     enum                    {
         etSel, etTop, etOnce, etYlabel, etNone, etNR
     };
-    const char *title[]   = { NULL, "top", "once", "ylabel", "none", NULL };
+    const char *title[]   = { nullptr, "top", "once", "ylabel", "none", nullptr };
     /* MUST correspond to enum elXxx as defined at top of file */
-    const char *legend[]  = { NULL, "both", "first", "second", "none", NULL };
+    const char *legend[]  = { nullptr, "both", "first", "second", "none", nullptr };
     enum                    {
         edSel, edFirst, edSecond, edNone, edNR
     };
-    const char *diag[]    = { NULL, "first", "second", "none", NULL };
+    const char *diag[]    = { nullptr, "first", "second", "none", nullptr };
     enum                    {
         erSel, erNo, erBlue, erRed, erNR
     };
-    const char *rainbow[] = { NULL, "no", "blue", "red", NULL };
+    const char *rainbow[] = { nullptr, "no", "blue", "red", nullptr };
     /* MUST correspond to enum ecXxx as defined at top of file */
     const char *combine[] = {
-        NULL, "halves", "add", "sub", "mult", "div", NULL
+        nullptr, "halves", "add", "sub", "mult", "div", nullptr
     };
     static int  skip = 1, mapoffset = 0;
     t_pargs     pa[] = {
@@ -1487,18 +1487,18 @@ int gmx_xpm2ps(int argc, char *argv[])
     };
 #define NPA asize(pa)
     t_filenm    fnm[] = {
-        { efXPM, "-f",  NULL,      ffREAD },
+        { efXPM, "-f",  nullptr,      ffREAD },
         { efXPM, "-f2", "root2",   ffOPTRD },
-        { efM2P, "-di", NULL,      ffLIBOPTRD },
+        { efM2P, "-di", nullptr,      ffLIBOPTRD },
         { efM2P, "-do", "out",     ffOPTWR },
-        { efEPS, "-o",  NULL,      ffOPTWR },
-        { efXPM, "-xpm", NULL,      ffOPTWR }
+        { efEPS, "-o",  nullptr,      ffOPTWR },
+        { efXPM, "-xpm", nullptr,      ffOPTWR }
     };
 #define NFILE asize(fnm)
 
     if (!parse_common_args(&argc, argv, PCA_CAN_VIEW,
                            NFILE, fnm, NPA, pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -1524,7 +1524,7 @@ int gmx_xpm2ps(int argc, char *argv[])
 
     epsfile = ftp2fn_null(efEPS, NFILE, fnm);
     xpmfile = opt2fn_null("-xpm", NFILE, fnm);
-    if (epsfile == NULL && xpmfile == NULL)
+    if (epsfile == nullptr && xpmfile == nullptr)
     {
         if (ecombine != ecHalves)
         {
@@ -1541,7 +1541,7 @@ int gmx_xpm2ps(int argc, char *argv[])
                 "WARNING: can only write result of arithmetic combination "
                 "of two matrices to .xpm file\n"
                 "         file %s will not be written\n", epsfile);
-        epsfile = NULL;
+        epsfile = nullptr;
     }
 
     bDiag      = ediag != edNone;
@@ -1603,7 +1603,7 @@ int gmx_xpm2ps(int argc, char *argv[])
         }
     }
 
-    if ((mat2 == NULL) && (elegend != elNone))
+    if ((mat2 == nullptr) && (elegend != elNone))
     {
         elegend = elFirst;
     }
@@ -1611,8 +1611,8 @@ int gmx_xpm2ps(int argc, char *argv[])
     if (ecombine && ecombine != ecHalves)
     {
         write_combined_matrix(ecombine, xpmfile, nmat, mat, mat2,
-                              opt2parg_bSet("-cmin", NPA, pa) ? &cmin : NULL,
-                              opt2parg_bSet("-cmax", NPA, pa) ? &cmax : NULL);
+                              opt2parg_bSet("-cmin", NPA, pa) ? &cmin : nullptr,
+                              opt2parg_bSet("-cmax", NPA, pa) ? &cmax : nullptr);
     }
     else
     {
index 2d09699aee67f60879ef9617ac4d4c7b6b86bcf6..497281d13b6f21030fd99832d22f60cfe1d917b5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -200,7 +200,7 @@ real ca_phi(int gnx, int index[], rvec x[])
         ak  = index[i+2];
         al  = index[i+3];
         phi = RAD2DEG*
-            dih_angle(x[ai], x[aj], x[ak], x[al], NULL,
+            dih_angle(x[ai], x[aj], x[ak], x[al], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         phitot += phi;
@@ -513,11 +513,11 @@ void calc_hxprops(int nres, t_bb bb[], const rvec x[])
         }
 
         bb[i].phi = RAD2DEG*
-            dih_angle(x[bb[i].Cprev], x[bb[i].N], x[bb[i].CA], x[bb[i].C], NULL,
+            dih_angle(x[bb[i].Cprev], x[bb[i].N], x[bb[i].CA], x[bb[i].C], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         bb[i].psi = RAD2DEG*
-            dih_angle(x[bb[i].N], x[bb[i].CA], x[bb[i].C], x[bb[i].Nnext], NULL,
+            dih_angle(x[bb[i].N], x[bb[i].CA], x[bb[i].C], x[bb[i].Nnext], nullptr,
                       r_ij, r_kj, r_kl, m, n,
                       &sign, &t1, &t2, &t3);
         bb[i].pprms2 = gmx::square(bb[i].phi-PHI_AHX)+gmx::square(bb[i].psi-PSI_AHX);
index 5759488a5472586857e67802534b50b4da614bbc..7a95fe66a471ced5f9ddd6b15edb4a61e3d79743 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,7 +76,7 @@ static void calc_dihs(t_xrama *xr)
     rvec         r_ij, r_kj, r_kl, m, n;
     real         sign;
     t_dih       *dd;
-    gmx_rmpbc_t  gpbc = NULL;
+    gmx_rmpbc_t  gpbc = nullptr;
 
     gpbc = gmx_rmpbc_init(xr->idef, xr->ePBC, xr->natoms);
     gmx_rmpbc(gpbc, xr->natoms, xr->box, xr->x);
@@ -87,7 +87,7 @@ static void calc_dihs(t_xrama *xr)
         dd      = &(xr->dih[i]);
         dd->ang = dih_angle(xr->x[dd->ai[0]], xr->x[dd->ai[1]],
                             xr->x[dd->ai[2]], xr->x[dd->ai[3]],
-                            NULL,
+                            nullptr,
                             r_ij, r_kj, r_kl, m, n, &sign, &t1, &t2, &t3);
     }
 }
index 4b7e7356caa98c0fc26f12c083aa6042775af745..d05c9b616212e6f0d12a948c477bd41618f54e79 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -153,7 +153,7 @@ gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const ch
 
 gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
 {
-    gmx_sans_t    *gsans = NULL;
+    gmx_sans_t    *gsans = nullptr;
     int            i, j;
     /* Try to assing scattering length from nsfactor.dat */
     snew(gsans, 1);
@@ -201,7 +201,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
         real         mcover,
         unsigned int seed)
 {
-    gmx_radial_distribution_histogram_t    *pr = NULL;
+    gmx_radial_distribution_histogram_t    *pr = nullptr;
     rvec                                    dist;
     double                                  rmax;
     int                                     i, j;
@@ -209,7 +209,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
     double                                **tgr;
     int                                     tid;
     int                                     nthreads;
-    gmx::DefaultRandomEngine               *trng = NULL;
+    gmx::DefaultRandomEngine               *trng = nullptr;
 #endif
     gmx_int64_t                             mc  = 0, mc_max;
     gmx::DefaultRandomEngine                rng(seed);
@@ -369,7 +369,7 @@ gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
 
 gmx_static_structurefactor_t *convert_histogram_to_intensity_curve (gmx_radial_distribution_histogram_t *pr, double start_q, double end_q, double q_step)
 {
-    gmx_static_structurefactor_t    *sq = NULL;
+    gmx_static_structurefactor_t    *sq = nullptr;
     int         i, j;
     /* init data */
     snew(sq, 1);
index 7972fe364b297f749f150ada1f1283b2e89c2f08..e7da5b98efa0364983fa4bd67ef7e2ca7409065d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -306,10 +306,10 @@ void orient_princ(const t_atoms *atoms, int isize, const int *index,
             trans[ZZ][m] = -trans[ZZ][m];
         }
     }
-    rotate_atoms(natoms, NULL, x, trans);
+    rotate_atoms(natoms, nullptr, x, trans);
     if (v)
     {
-        rotate_atoms(natoms, NULL, v, trans);
+        rotate_atoms(natoms, nullptr, v, trans);
     }
 
     for (i = 0; i < natoms; i++)
index f7d5c314d3df681f2851be33e3212cbb770c9934..c0f7e44ee0f8229c81367fafb3fb2327230556ae 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -282,7 +282,7 @@ extern gmx_structurefactors_t *gmx_structurefactors_init(const char *datfn)
     snew(gsf->b, nralloc);
     snew(gsf->c, nralloc);
     snew(gsf->p, nralloc);
-    gsf->n       = NULL;
+    gsf->n       = nullptr;
     gsf->nratoms = line_no;
     while (get_a_line(fp, line, STRLEN))
     {
@@ -475,7 +475,7 @@ extern int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
     sf->energy = energy;
 
     /* Read the topology informations */
-    read_tps_conf (fnTPS, &top, &ePBC, &xtop, NULL, box, TRUE);
+    read_tps_conf (fnTPS, &top, &ePBC, &xtop, nullptr, box, TRUE);
     sfree (xtop);
 
     /* groups stuff... */
index f6ddd9a1f0de240b7fb01db408f6145e40219a79..920f3fd7e13873f5fcebde5880b983ea66fb7089 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,8 +85,8 @@ t_commrec *init_commrec()
 #if GMX_LIB_MPI
     gmx_fill_commrec_from_mpi(cr);
 #else
-    cr->mpi_comm_mysim   = NULL;
-    cr->mpi_comm_mygroup = NULL;
+    cr->mpi_comm_mysim   = nullptr;
+    cr->mpi_comm_mygroup = nullptr;
     cr->nnodes           = 1;
     cr->sim_nodeid       = 0;
     cr->nodeid           = cr->sim_nodeid;
@@ -113,7 +113,7 @@ t_commrec *init_commrec()
 
 static void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
 {
-    if (NULL != buf)
+    if (nullptr != buf)
     {
         sfree(buf->ibuf);
         sfree(buf->libuf);
@@ -125,12 +125,12 @@ static void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
 
 void done_commrec(t_commrec *cr)
 {
-    if (NULL != cr->dd)
+    if (nullptr != cr->dd)
     {
         // TODO: implement
         // done_domdec(cr->dd);
     }
-    if (NULL != cr->ms)
+    if (nullptr != cr->ms)
     {
         done_mpi_in_place_buf(cr->ms->mpb);
         sfree(cr->ms);
@@ -158,7 +158,7 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 
     return cr;
 #else
-    return NULL;
+    return nullptr;
 #endif
 }
 
@@ -219,7 +219,7 @@ void gmx_setup_nodecomm(FILE gmx_unused *fplog, t_commrec *cr)
                 ng, ni);
     }
 
-    if (getenv("GMX_NO_NODECOMM") == NULL &&
+    if (getenv("GMX_NO_NODECOMM") == nullptr &&
         ((ng > 1 && ng < n) || (ni > 1 && ni < n)))
     {
         nc->bUse = TRUE;
@@ -386,7 +386,7 @@ void gmx_sumd(int gmx_unused nr, double gmx_unused r[], const t_commrec gmx_unus
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_DOUBLE, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_DOUBLE, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_DOUBLE, 0, cr->nc.comm_intra);
     }
@@ -449,7 +449,7 @@ void gmx_sumf(int gmx_unused nr, float gmx_unused r[], const t_commrec gmx_unuse
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_FLOAT, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_FLOAT, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_FLOAT, 0, cr->nc.comm_intra);
     }
@@ -509,7 +509,7 @@ void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_INT, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_INT, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_INT, 0, cr->nc.comm_intra);
     }
@@ -569,7 +569,7 @@ void gmx_sumli(int gmx_unused nr, gmx_int64_t gmx_unused r[], const t_commrec gm
         {
             /* This is here because of the silly MPI specification
                 that MPI_IN_PLACE should be put in sendbuf instead of recvbuf */
-            MPI_Reduce(r, NULL, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
+            MPI_Reduce(r, nullptr, nr, MPI_INT64_T, MPI_SUM, 0, cr->nc.comm_intra);
         }
         MPI_Bcast(r, nr, MPI_INT64_T, 0, cr->nc.comm_intra);
     }
@@ -732,7 +732,7 @@ void gmx_sumli_sim(int gmx_unused nr, gmx_int64_t gmx_unused r[], const gmx_mult
 const char *opt2fn_master(const char *opt, int nfile, const t_filenm fnm[],
                           t_commrec *cr)
 {
-    return SIMMASTER(cr) ? opt2fn(opt, nfile, fnm) : NULL;
+    return SIMMASTER(cr) ? opt2fn(opt, nfile, fnm) : nullptr;
 }
 
 void gmx_fatal_collective(int f_errno, const char *file, int line,
index 97d1e7e0811f6b9fd95212f3434a59fb9ca6766e..db50f9b3c5bd3c60acb35fe3cdc0ab56b17aa239 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -99,7 +99,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     const real *  shiftvec;
     real *        fshift;
     real          tabscale = 0;
-    const real *  VFtab    = NULL;
+    const real *  VFtab    = nullptr;
     const real *  x;
     real *        f;
     real          facel, krf, crf;
@@ -436,7 +436,7 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
             tj[STATE_A]      = ntiA+2*typeA[jnr];
             tj[STATE_B]      = ntiB+2*typeB[jnr];
 
-            if (nlist->excl_fep == NULL || nlist->excl_fep[k])
+            if (nlist->excl_fep == nullptr || nlist->excl_fep[k])
             {
                 c6[STATE_A]      = nbfp[tj[STATE_A]];
                 c6[STATE_B]      = nbfp[tj[STATE_B]];
index ffcfe5549985f5e89b216778dfcef86c1c141352..70244a9f684c1519a1abfdf3c71b5464f308ee28 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -117,7 +117,7 @@ gmx_nb_generic_kernel(t_nblist *                nlist,
     else
     {
         tabscale        = 0;
-        VFtab           = NULL;
+        VFtab           = nullptr;
     }
     ewtab               = fr->ic->tabq_coul_FDV0;
     ewtabscale          = fr->ic->tabq_scale;
index b93f586136ab0f413cc8cbb3c0dba6adfdb10140..9bddb02823cead9390815da173e20b7c8a015116 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -108,7 +108,7 @@ gmx_nb_generic_cg_kernel(t_nblist *                nlist,
     else
     {
         tabscale        = 0;
-        VFtab           = NULL;
+        VFtab           = nullptr;
     }
 
     /* avoid compiler warnings for cases that cannot happen */
index 073711d2957a23cc7bf0fcb0685fab0b7fd40c46..2ee2c6b845f3aa03d83b8c9d437751423058aa88 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,9 +45,9 @@
 
 
 /* Static data structures to find kernels */
-static nb_kernel_info_t *   kernel_list           = NULL;
+static nb_kernel_info_t *   kernel_list           = nullptr;
 static unsigned int         kernel_list_size      = 0;
-static int *                kernel_list_hash      = NULL;
+static int *                kernel_list_hash      = nullptr;
 static unsigned int         kernel_list_hash_size = 0;
 
 static unsigned int
@@ -123,7 +123,7 @@ void
 nb_kernel_list_hash_destroy()
 {
     sfree(kernel_list_hash);
-    kernel_list_hash      = NULL;
+    kernel_list_hash      = nullptr;
     kernel_list_hash_size = 0;
 }
 
@@ -145,7 +145,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
 
     if (kernel_list_hash_size == 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     index = nb_kernel_hash_func(arch,
@@ -157,7 +157,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
                                 other,
                                 vf) % kernel_list_hash_size;
 
-    kernelinfo_ptr = NULL;
+    kernelinfo_ptr = nullptr;
     while ( (i = kernel_list_hash[index]) != -1)
     {
         if (!gmx_strcasecmp_min(kernel_list[i].architecture, arch) &&
@@ -175,7 +175,7 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
         index = (index+1) % kernel_list_hash_size;
     }
 
-    if (debug && kernelinfo_ptr != NULL)
+    if (debug && kernelinfo_ptr != nullptr)
     {
         fprintf(debug,
                 "NB kernel %s() with architecture '%s' used for neighborlist with\n"
@@ -187,5 +187,5 @@ nb_kernel_list_findkernel(FILE gmx_unused *   log,
     }
 
     /* If we did not find any kernel the pointer will still be NULL */
-    return (kernelinfo_ptr != NULL) ? kernelinfo_ptr->kernelptr : NULL;
+    return (kernelinfo_ptr != nullptr) ? kernelinfo_ptr->kernelptr : nullptr;
 }
index 90814968c855ffcdd7ca870c2b7413efea866c9d..2d683c34cb9a636229660b3c049383540bc50344 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -117,7 +117,7 @@ gmx_nonbonded_setup(t_forcerec *   fr,
             /* Add the generic kernels to the structure stored statically in nb_kernel.c */
             nb_kernel_list_add_kernels(kernellist_c, kernellist_c_size);
 
-            if (!(fr != NULL && fr->use_simd_kernels == FALSE))
+            if (!(fr != nullptr && fr->use_simd_kernels == FALSE))
             {
                 /* Add interaction-specific kernels for different architectures */
                 /* Single precision */
@@ -225,15 +225,15 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
         /* We typically call this setup routine before starting timers,
          * but if that has not been done for whatever reason we do it now.
          */
-        gmx_nonbonded_setup(NULL, FALSE);
+        gmx_nonbonded_setup(nullptr, FALSE);
     }
 
     /* Not used yet */
     other = "";
 
-    nl->kernelptr_vf = NULL;
-    nl->kernelptr_v  = NULL;
-    nl->kernelptr_f  = NULL;
+    nl->kernelptr_vf = nullptr;
+    nl->kernelptr_v  = nullptr;
+    nl->kernelptr_f  = nullptr;
 
     elec     = gmx_nbkernel_elec_names[nl->ielec];
     elec_mod = eintmod_names[nl->ielecmod];
@@ -257,20 +257,20 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
     {
         /* Try to find a specific kernel first */
 
-        for (i = 0; i < narch && nl->kernelptr_vf == NULL; i++)
+        for (i = 0; i < narch && nl->kernelptr_vf == nullptr; i++)
         {
             nl->kernelptr_vf       = (void *) nb_kernel_list_findkernel(log, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
             nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
         }
-        for (i = 0; i < narch && nl->kernelptr_f == NULL; i++)
+        for (i = 0; i < narch && nl->kernelptr_f == nullptr; i++)
         {
             nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(log, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "Force");
             nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
 
             /* If there is not force-only optimized kernel, is there a potential & force one? */
-            if (nl->kernelptr_f == NULL)
+            if (nl->kernelptr_f == nullptr)
             {
-                nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(NULL, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
+                nl->kernelptr_f        = (void *) nb_kernel_list_findkernel(nullptr, arch_and_padding[i].arch, elec, elec_mod, vdw, vdw_mod, geom, other, "PotentialAndForce");
                 nl->simd_padding_width = arch_and_padding[i].simd_padding_width;
             }
         }
@@ -290,15 +290,15 @@ gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwS
             (nl->ivdw  != GMX_NBKERNEL_VDW_NONE)  && (nl->ivdwmod  == eintmodPOTSWITCH) &&
             bElecAndVdwSwitchDiffers)
         {
-            nl->kernelptr_vf = NULL;
-            nl->kernelptr_f  = NULL;
+            nl->kernelptr_vf = nullptr;
+            nl->kernelptr_f  = nullptr;
         }
 
         /* Give up, pick a generic one instead.
          * We only do this for particle-particle kernels; by leaving the water-optimized kernel
          * pointers to NULL, the water optimization will automatically be disabled for this interaction.
          */
-        if (nl->kernelptr_vf == NULL && !gmx_strcasecmp_min(geom, "Particle-Particle"))
+        if (nl->kernelptr_vf == nullptr && !gmx_strcasecmp_min(geom, "Particle-Particle"))
         {
             nl->kernelptr_vf       = (void *) gmx_nb_generic_kernel;
             nl->kernelptr_f        = (void *) gmx_nb_generic_kernel;
@@ -326,7 +326,7 @@ void do_nonbonded(t_forcerec *fr,
     int               n, n0, n1, i, i0, i1;
     t_nblists *       nblists;
     nb_kernel_data_t  kernel_data;
-    nb_kernel_t *     kernelptr = NULL;
+    nb_kernel_t *     kernelptr = nullptr;
     rvec *            f;
 
     kernel_data.flags                   = flags;
@@ -414,7 +414,7 @@ void do_nonbonded(t_forcerec *fr,
                         continue;
                     }
                     /* Neighborlists whose kernelptr==NULL will always be empty */
-                    if (kernelptr != NULL)
+                    if (kernelptr != nullptr)
                     {
                         (*kernelptr)(&(nlist[i]), x, f, fr, mdatoms, &kernel_data, nrnb);
                     }
index 4509ac24a80172f627ec4b1f700a682a934190ee..c0509feb606207a47365a3caae88975aab46a620 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -332,19 +332,19 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
     *nbfs = 0.0;
     for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
     {
-        if (std::strstr(nbdata[i].name, "W3-W3") != NULL)
+        if (std::strstr(nbdata[i].name, "W3-W3") != nullptr)
         {
             *nbfs += 9e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W3") != NULL)
+        else if (std::strstr(nbdata[i].name, "W3") != nullptr)
         {
             *nbfs += 3e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W4-W4") != NULL)
+        else if (std::strstr(nbdata[i].name, "W4-W4") != nullptr)
         {
             *nbfs += 10e-6*nrnb->n[i];
         }
-        else if (std::strstr(nbdata[i].name, "W4") != NULL)
+        else if (std::strstr(nbdata[i].name, "W4") != nullptr)
         {
             *nbfs += 4e-6*nrnb->n[i];
         }
@@ -412,7 +412,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
             *mflop += mni*flop;
             frac    = 100.0*mni*flop/tflop;
             tfrac  += frac;
-            if (out != NULL)
+            if (out != nullptr)
             {
                 fprintf(out, " %-32s %16.6f %15.3f  %6.1f\n",
                         nbdata[i].name, mni, mni*flop, frac);
@@ -461,7 +461,7 @@ void print_perf(FILE *out, double time_per_thread, double time_per_node,
             mflop         = mflop/time_per_node;
             wallclocktime = nsteps*delta_t;
 
-            if (getenv("GMX_DETAILED_PERF_STATS") == NULL)
+            if (getenv("GMX_DETAILED_PERF_STATS") == nullptr)
             {
                 fprintf(out, "%12s %12s %12s\n",
                         "", "(ns/day)", "(hour/ns)");
@@ -480,7 +480,7 @@ void print_perf(FILE *out, double time_per_thread, double time_per_node,
         }
         else
         {
-            if (getenv("GMX_DETAILED_PERF_STATS") == NULL)
+            if (getenv("GMX_DETAILED_PERF_STATS") == nullptr)
             {
                 fprintf(out, "%12s %14s\n",
                         "", "(steps/hour)");
index dd8586a89c06b630104d1c87b477d606d41ac3c5..d2c2f2c667b0cdfc82a489c0ab4675b33de33498 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,7 +81,7 @@ void add_param(t_params *ps, int ai, int aj, real *c, char *s)
     ps->param[ps->nr].ai() = ai;
     ps->param[ps->nr].aj() = aj;
     clear_atom_list(2, ps->param[ps->nr].a);
-    if (c == NULL)
+    if (c == nullptr)
     {
         clear_force_param(0, ps->param[ps->nr].c);
     }
index d2660bc772e4f7e2b45b18c577aa8e742ada6f01..0a2f123d115652568d67ea7e3c861ea1041f52a0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -586,13 +586,13 @@ void convert_params(int atnr, t_params nbtypes[],
     ffp           = &mtop->ffparams;
     ffp->ntypes   = 0;
     ffp->atnr     = atnr;
-    ffp->functype = NULL;
-    ffp->iparams  = NULL;
+    ffp->functype = nullptr;
+    ffp->iparams  = nullptr;
     ffp->reppow   = reppow;
 
-    enter_function(&(nbtypes[F_LJ]),  (t_functype)F_LJ,    comb, reppow, ffp, NULL,
+    enter_function(&(nbtypes[F_LJ]),  (t_functype)F_LJ,    comb, reppow, ffp, nullptr,
                    &maxtypes, TRUE, TRUE);
-    enter_function(&(nbtypes[F_BHAM]), (t_functype)F_BHAM,  comb, reppow, ffp, NULL,
+    enter_function(&(nbtypes[F_BHAM]), (t_functype)F_BHAM,  comb, reppow, ffp, nullptr,
                    &maxtypes, TRUE, TRUE);
 
     for (mt = 0; mt < mtop->nmoltype; mt++)
@@ -601,7 +601,7 @@ void convert_params(int atnr, t_params nbtypes[],
         for (i = 0; (i < F_NRE); i++)
         {
             molt->ilist[i].nr     = 0;
-            molt->ilist[i].iatoms = NULL;
+            molt->ilist[i].iatoms = nullptr;
 
             plist = mi[mt].plist;
 
@@ -618,7 +618,7 @@ void convert_params(int atnr, t_params nbtypes[],
     }
 
     mtop->bIntermolecularInteractions = FALSE;
-    if (intermolecular_interactions != NULL)
+    if (intermolecular_interactions != nullptr)
     {
         /* Process the intermolecular interaction list */
         snew(mtop->intermolecular_ilist, F_NRE);
@@ -626,7 +626,7 @@ void convert_params(int atnr, t_params nbtypes[],
         for (i = 0; (i < F_NRE); i++)
         {
             mtop->intermolecular_ilist[i].nr     = 0;
-            mtop->intermolecular_ilist[i].iatoms = NULL;
+            mtop->intermolecular_ilist[i].iatoms = nullptr;
 
             plist = intermolecular_interactions->plist;
 
index 23285ed8ce81e80f8cb54d7422648bb5d02b97f6..c906fea25ea50fec07d9880ad5fa3b57e560d2dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,7 +73,7 @@ void fflib_filename_base(const char *filename, char *filebase, int maxlen)
     char       *ptr;
 
     cptr = strrchr(filename, DIR_SEPARATOR);
-    if (cptr != NULL)
+    if (cptr != nullptr)
     {
         /* Skip the separator */
         cptr += 1;
@@ -90,7 +90,7 @@ void fflib_filename_base(const char *filename, char *filebase, int maxlen)
     strcpy(filebase, cptr);
     /* Remove the extension */
     ptr = strrchr(filebase, '.');
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         ptr[0] = '\0';
     }
@@ -173,7 +173,7 @@ gmx_bool fflib_fexist(const char *file)
 
     file_fullpath = low_gmxlibfn(file, TRUE, FALSE);
 
-    if (file_fullpath == NULL)
+    if (file_fullpath == nullptr)
     {
         return FALSE;
     }
index ed7ccdec712c785a685b0fb2d2190d1fcde2f1ee..0396424d434a3b72fa61c2437fea89e622f60100 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -497,7 +497,7 @@ static int get_impropers(t_atoms *atoms, t_hackblock hb[], t_param **improper,
     /* Add all the impropers from the residue database to the list. */
     nimproper = 0;
     start     = 0;
-    if (hb != NULL)
+    if (hb != nullptr)
     {
         for (i = 0; (i < atoms->nres); i++)
         {
@@ -523,7 +523,7 @@ static int get_impropers(t_atoms *atoms, t_hackblock hb[], t_param **improper,
                         srenew(*improper, nalloc);
                     }
                     /* Not broken out */
-                    set_p(&((*improper)[nimproper]), ai, NULL, impropers->b[j].s);
+                    set_p(&((*improper)[nimproper]), ai, nullptr, impropers->b[j].s);
                     nimproper++;
                 }
             }
index 8c4bed2ee4ad5aee8b3bb900132cafd737977d82..ca209eb4e64c18a5b71d9c06cc50a930f12119f4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -183,7 +183,7 @@ static void read_vsite_database(const char *ddbname,
     snew(vsiteconflist, 1);
     snew(vsitetoplist, 1);
 
-    while (fgets2(pline, STRLEN-2, ddb) != NULL)
+    while (fgets2(pline, STRLEN-2, ddb) != nullptr)
     {
         strip_comment(pline);
         trim(pline);
@@ -192,7 +192,7 @@ static void read_vsite_database(const char *ddbname,
             if (pline[0] == OPENDIR)
             {
                 strncpy(dirstr, pline+1, STRLEN-2);
-                if ((ch = strchr (dirstr, CLOSEDIR)) != NULL)
+                if ((ch = strchr (dirstr, CLOSEDIR)) != nullptr)
                 {
                     (*ch) = 0;
                 }
@@ -292,7 +292,7 @@ static void read_vsite_database(const char *ddbname,
                             srenew(vsitetoplist[i].bond, k+1);
                             strncpy(vsitetoplist[i].bond[k].atom1, s1, MAXNAME-1);
                             strncpy(vsitetoplist[i].bond[k].atom2, s2, MAXNAME-1);
-                            vsitetoplist[i].bond[k].value = strtod(s3, NULL);
+                            vsitetoplist[i].bond[k].value = strtod(s3, nullptr);
                         }
                         else if (n == 4)
                         {
@@ -302,7 +302,7 @@ static void read_vsite_database(const char *ddbname,
                             strncpy(vsitetoplist[i].angle[k].atom1, s1, MAXNAME-1);
                             strncpy(vsitetoplist[i].angle[k].atom2, s2, MAXNAME-1);
                             strncpy(vsitetoplist[i].angle[k].atom3, s3, MAXNAME-1);
-                            vsitetoplist[i].angle[k].value = strtod(s4, NULL);
+                            vsitetoplist[i].angle[k].value = strtod(s4, nullptr);
                         }
                         else
                         {
@@ -363,7 +363,7 @@ static char *get_dummymass_name(t_vsiteconf vsiteconflist[], int nvsiteconf, cha
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -582,7 +582,7 @@ static void my_add_param(t_params *plist, int ai, int aj, real b)
     { NOTSET, NOTSET, NOTSET, NOTSET, NOTSET, NOTSET };
 
     c[0] = b;
-    add_param(plist, ai, aj, c, NULL);
+    add_param(plist, ai, aj, c, nullptr);
 }
 
 static void add_vsites(t_params plist[], int vsite_type[],
@@ -1030,7 +1030,7 @@ static int gen_vsites_trp(gpp_atomtype_t atype, rvec *newx[],
     srenew(*newcgnr, at->nr+*nadd);
     for (j = 0; j < NMASS; j++)
     {
-        (*newatomname)[at->nr+*nadd-1-j] = NULL;
+        (*newatomname)[at->nr+*nadd-1-j] = nullptr;
     }
 
     /* Dummy masses will be placed at the center-of-mass in each ring. */
@@ -1225,7 +1225,7 @@ static int gen_vsites_tyr(gpp_atomtype_t atype, rvec *newx[],
     srenew(*newatomname, at->nr+*nadd);
     srenew(*newvsite_type, at->nr+*nadd);
     srenew(*newcgnr, at->nr+*nadd);
-    (*newatomname)[at->nr+*nadd-1] = NULL;
+    (*newatomname)[at->nr+*nadd-1] = nullptr;
 
     /* Calc the dummy mass initial position */
     rvec_sub(x[ats[atHH]], x[ats[atOH]], r1);
@@ -1536,7 +1536,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
     t_atom           *newatom;
     t_params         *params;
     char           ***newatomname;
-    char             *resnm = NULL;
+    char             *resnm = nullptr;
     int               ndb, f;
     char            **db;
     int               nvsiteconf, nvsitetop, cmplength;
@@ -1576,20 +1576,20 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
         { "CG", /* PHE */
           "CD1", "HD1", "CD2", "HD2",
           "CE1", "HE1", "CE2", "HE2",
-          "CZ", "HZ", NULL },
+          "CZ", "HZ", nullptr },
         { "CB", /* TRP */
           "CG",
           "CD1", "HD1", "CD2",
           "NE1", "HE1", "CE2", "CE3", "HE3",
           "CZ2", "HZ2", "CZ3", "HZ3",
-          "CH2", "HH2", NULL },
+          "CH2", "HH2", nullptr },
         { "CG", /* TYR */
           "CD1", "HD1", "CD2", "HD2",
           "CE1", "HE1", "CE2", "HE2",
-          "CZ", "OH", "HH", NULL },
+          "CZ", "OH", "HH", nullptr },
         { "CG", /* HIS */
           "ND1", "HD1", "CD2", "HD2",
-          "CE1", "HE1", "NE2", "HE2", NULL }
+          "CE1", "HE1", "NE2", "HE2", nullptr }
     };
 
     if (debug)
@@ -1600,9 +1600,9 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
 
     ndb           = fflib_search_file_end(ffdir, ".vsd", FALSE, &db);
     nvsiteconf    = 0;
-    vsiteconflist = NULL;
+    vsiteconflist = nullptr;
     nvsitetop     = 0;
-    vsitetop      = NULL;
+    vsitetop      = nullptr;
     for (f = 0; f < ndb; f++)
     {
         read_vsite_database(db[f], &vsiteconflist, &nvsiteconf, &vsitetop, &nvsitetop);
@@ -1873,7 +1873,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
                     strcpy(nexttpname, get_atomtype_name(get_atype(heavies[0], at, nrtp, rtp, rt), atype));
                     ch = get_dummymass_name(vsiteconflist, nvsiteconf, tpname, nexttpname);
 
-                    if (ch == NULL)
+                    if (ch == nullptr)
                     {
                         if (ndb > 0)
                         {
@@ -1912,7 +1912,7 @@ void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
 
                     for (j = 0; j < NMASS; j++)
                     {
-                        newatomname[at->nr+nadd-1-j] = NULL;
+                        newatomname[at->nr+nadd-1-j] = nullptr;
                     }
 
                     /* calculate starting position for the masses */
index 84587a391e788bbfd541730d61143355e5236297..e652b34dc145bdce94e4a5f1ff7f6df7590d280b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -137,7 +137,7 @@ int gmx_genconf(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efSTX, "-f", "conf", ffREAD  },
         { efSTO, "-o", "out",  ffWRITE },
-        { efTRX, "-trj", NULL,  ffOPTRD }
+        { efTRX, "-trj", nullptr,  ffOPTRD }
     };
 #define NFILE asize(fnm)
     static rvec       nrbox    = {1, 1, 1};
index 88fd8dd49a2f0cfac1cab3b0209275e1dbdac28b..4d58b30b82e98982fa497552fa0d5df019495d53 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -149,11 +149,11 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
     /* first the termini */
     for (i = 0; i < nterpairs; i++)
     {
-        if (ntdb[i] != NULL)
+        if (ntdb[i] != nullptr)
         {
             copy_t_hackblock(ntdb[i], &hb[rN[i]]);
         }
-        if (ctdb[i] != NULL)
+        if (ctdb[i] != nullptr)
         {
             merge_t_hackblock(ctdb[i], &hb[rC[i]]);
         }
@@ -164,7 +164,7 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
         ahptr = search_h_db(nah, ah, *pdba->resinfo[rnr].rtp);
         if (ahptr)
         {
-            if (hb[rnr].name == NULL)
+            if (hb[rnr].name == nullptr)
             {
                 hb[rnr].name = gmx_strdup(ahptr->name);
             }
@@ -210,9 +210,9 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
         }
 
         if (!bIgnore &&
-            ( ( ( hbr->hack[j].tp > 0 || hbr->hack[j].oname == NULL ) &&
+            ( ( ( hbr->hack[j].tp > 0 || hbr->hack[j].oname == nullptr ) &&
                 strcmp(atomname, hbr->hack[j].ai()) == 0 ) ||
-              ( hbr->hack[j].oname != NULL &&
+              ( hbr->hack[j].oname != nullptr &&
                 strcmp(atomname, hbr->hack[j].oname) == 0) ) )
         {
             /* now expand all hacks for this atom */
@@ -227,9 +227,9 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                 (*abi)[*nabi + k].bXSet = FALSE;
                 /* if we're adding (oname==NULL) and don't have a new name (nname)
                    yet, build it from atomname */
-                if ( (*abi)[*nabi + k].nname == NULL)
+                if ( (*abi)[*nabi + k].nname == nullptr)
                 {
-                    if ( (*abi)[*nabi + k].oname == NULL)
+                    if ( (*abi)[*nabi + k].oname == nullptr)
                     {
                         (*abi)[*nabi + k].nname    = gmx_strdup(atomname);
                         (*abi)[*nabi + k].nname[0] = 'H';
@@ -276,7 +276,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
             (*nabi) += hbr->hack[j].nr;
 
             /* add hacks to atoms we've just added */
-            if (hbr->hack[j].tp > 0 || hbr->hack[j].oname == NULL)
+            if (hbr->hack[j].tp > 0 || hbr->hack[j].oname == nullptr)
             {
                 for (k = 0; k < hbr->hack[j].nr; k++)
                 {
@@ -328,10 +328,10 @@ static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[])
         rnr = pdba->atom[i].resind;
         for (j = 0; j < nab[i]; j++)
         {
-            if (ab[i][j].oname == NULL)
+            if (ab[i][j].oname == nullptr)
             {
                 /* we're adding */
-                if (ab[i][j].nname == NULL)
+                if (ab[i][j].nname == nullptr)
                 {
                     gmx_incons("ab[i][j].nname not allocated");
                 }
@@ -355,7 +355,7 @@ static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[])
                     nadd++;
                 }
             }
-            else if (ab[i][j].nname == NULL)
+            else if (ab[i][j].nname == nullptr)
             {
                 /* we're deleting */
                 nadd--;
@@ -383,7 +383,7 @@ static void calc_all_pos(t_atoms *pdba, rvec x[], int nab[], t_hack *ab[],
         for (j = 0; j < nab[i]; j += ab[i][j].nr)
         {
             /* check if we're adding: */
-            if (ab[i][j].oname == NULL && ab[i][j].tp > 0)
+            if (ab[i][j].oname == nullptr && ab[i][j].tp > 0)
             {
                 bFoundAll = TRUE;
                 for (m = 0; (m < ab[i][j].nctl && bFoundAll); m++)
@@ -466,11 +466,11 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                      int **nabptr, t_hack ***abptr,
                      gmx_bool bUpdate_pdba, gmx_bool bKeep_old_pdba)
 {
-    t_atoms        *newpdba = NULL, *pdba = NULL;
+    t_atoms        *newpdba = nullptr, *pdba = nullptr;
     int             nadd;
     int             i, newi, j, natoms, nalreadypresent;
-    int            *nab = NULL;
-    t_hack        **ab  = NULL;
+    int            *nab = nullptr;
+    t_hack        **ab  = nullptr;
     t_hackblock    *hb;
     rvec           *xn;
     gmx_bool        bKeep_ab;
@@ -584,7 +584,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
     for (i = 0; (i < natoms); i++)
     {
         /* check if this atom wasn't scheduled for deletion */
-        if (nab[i] == 0 || (ab[i][0].nname != NULL) )
+        if (nab[i] == 0 || (ab[i][0].nname != nullptr) )
         {
             if (newi >= natoms+nadd)
             {
@@ -613,7 +613,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
             nalreadypresent = 0;
             for (j = 0; j < nab[i]; j++)
             {
-                if (ab[i][j].oname == NULL) /* add */
+                if (ab[i][j].oname == nullptr) /* add */
                 {
                     newi++;
                     if (newi >= natoms+nadd)
@@ -636,12 +636,12 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                         fprintf(debug, " + %d", newi+1);
                     }
                 }
-                if (ab[i][j].nname != NULL &&
-                    (ab[i][j].oname == NULL ||
+                if (ab[i][j].nname != nullptr &&
+                    (ab[i][j].oname == nullptr ||
                      strcmp(ab[i][j].oname, *newpdba->atomname[newi]) == 0))
                 {
                     /* add or replace */
-                    if (ab[i][j].oname == NULL && ab[i][j].bAlreadyPresent)
+                    if (ab[i][j].oname == nullptr && ab[i][j].bAlreadyPresent)
                     {
                         /* This atom is already present, copy it from the input. */
                         nalreadypresent++;
@@ -665,8 +665,8 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                             }
                             snew(newpdba->atomname[newi], 1);
                             *newpdba->atomname[newi] = gmx_strdup(ab[i][j].nname);
-                            if (ab[i][j].oname != NULL && ab[i][j].atom) /* replace */
-                            {                                            /*          newpdba->atom[newi].m    = ab[i][j].atom->m; */
+                            if (ab[i][j].oname != nullptr && ab[i][j].atom) /* replace */
+                            {                                               /*          newpdba->atom[newi].m    = ab[i][j].atom->m; */
 /*        newpdba->atom[newi].q    = ab[i][j].atom->q; */
 /*        newpdba->atom[newi].type = ab[i][j].atom->type; */
                             }
index 6ab3934624849946fcc3c10680f634d2005772cb..2ce02ee6cda4a8c1e633f55480fc21abf7ddc768 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -63,9 +63,9 @@ typedef struct {
 } t_define;
 
 static int        ndef   = 0;
-static t_define  *defs   = NULL;
+static t_define  *defs   = nullptr;
 static int        nincl  = 0;
-static char     **incl   = 0;
+static char     **incl   = nullptr;
 
 /* enum used for handling ifdefs */
 enum {
@@ -93,7 +93,7 @@ static const char *strstrw(const char *buf, const char *word)
 {
     const char *ptr;
 
-    while ((ptr = strstr(buf, word)) != NULL)
+    while ((ptr = strstr(buf, word)) != nullptr)
     {
         /* Check if we did not find part of a longer word */
         if (ptr &&
@@ -105,7 +105,7 @@ static const char *strstrw(const char *buf, const char *word)
 
         buf = ptr + strlen(word);
     }
-    return NULL;
+    return nullptr;
 }
 
 static gmx_bool find_directive(char *buf, char **name, char **val)
@@ -143,7 +143,7 @@ static gmx_bool find_directive(char *buf, char **name, char **val)
         }
     }
     /* Check if anything is remaining */
-    *val = (*buf != 0) ? buf : NULL;
+    *val = (*buf != 0) ? buf : nullptr;
     return TRUE;
 }
 
@@ -156,7 +156,7 @@ static void add_include(const char *include)
 {
     int i;
 
-    if (include == NULL)
+    if (include == nullptr)
     {
         return;
     }
@@ -184,7 +184,7 @@ static void done_includes()
         sfree(incl[i]);
     }
     sfree(incl);
-    incl  = NULL;
+    incl  = nullptr;
     nincl = 0;
 }
 
@@ -220,7 +220,7 @@ static void add_define(const char *name, const char *value)
     }
     else
     {
-        defs[i].def  = NULL;
+        defs[i].def  = nullptr;
     }
 }
 
@@ -233,7 +233,7 @@ static void done_defines()
         sfree(defs[i].def);
     }
     sfree(defs);
-    defs = NULL;
+    defs = nullptr;
     ndef = 0;
 }
 
@@ -269,7 +269,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
                 }
                 else
                 {
-                    add_define(cppopts[i] + 2, NULL);
+                    add_define(cppopts[i] + 2, nullptr);
                 }
             }
             i++;
@@ -282,7 +282,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
 
     snew(cpp, 1);
     *handle      = cpp;
-    cpp->fn      = NULL;
+    cpp->fn      = nullptr;
     /* Find the file. First check whether it is in the current directory. */
     if (gmx_fexist(filenm))
     {
@@ -312,7 +312,7 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     {
         gmx_fatal(FARGS, "Topology include file \"%s\" not found", filenm);
     }
-    if (NULL != debug)
+    if (nullptr != debug)
     {
         fprintf(debug, "GMXCPP: cpp file open %s\n", cpp->fn);
     }
@@ -323,14 +323,14 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
     ptr  = strrchr(cpp->fn, '/');
     ptr2 = strrchr(cpp->fn, DIR_SEPARATOR);
 
-    if (ptr == NULL || (ptr2 != NULL && ptr2 > ptr))
+    if (ptr == nullptr || (ptr2 != nullptr && ptr2 > ptr))
     {
         ptr = ptr2;
     }
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
-        cpp->path = NULL;
-        cpp->cwd  = NULL;
+        cpp->path = nullptr;
+        cpp->cwd  = nullptr;
     }
     else
     {
@@ -340,33 +340,33 @@ int cpp_open_file(const char *filenm, gmx_cpp_t *handle, char **cppopts)
         snew(cpp->cwd, STRLEN);
 
         gmx_getcwd(cpp->cwd, STRLEN);
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: cwd %s\n", cpp->cwd);
         }
         gmx_chdir(cpp->path);
 
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: chdir to %s\n", cpp->path);
         }
     }
     cpp->line_len = 0;
-    cpp->line     = NULL;
+    cpp->line     = nullptr;
     cpp->line_nr  = 0;
     cpp->nifdef   = 0;
-    cpp->ifdefs   = NULL;
-    cpp->child    = NULL;
-    cpp->parent   = NULL;
-    if (cpp->fp == NULL)
+    cpp->ifdefs   = nullptr;
+    cpp->child    = nullptr;
+    cpp->parent   = nullptr;
+    if (cpp->fp == nullptr)
     {
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: opening file %s\n", cpp->fn);
         }
         cpp->fp = fopen(cpp->fn, "r");
     }
-    if (cpp->fp == NULL)
+    if (cpp->fp == nullptr)
     {
         switch (errno)
         {
@@ -500,11 +500,11 @@ process_directive(gmx_cpp_t *handlep, const char *dname, const char *dval)
                     inc_fn, i0, len);
         }
         /* Open include file and store it as a child in the handle structure */
-        status = cpp_open_file(inc_fn, &(handle->child), NULL);
+        status = cpp_open_file(inc_fn, &(handle->child), nullptr);
         sfree(inc_fn);
         if (status != eCPP_OK)
         {
-            handle->child = NULL;
+            handle->child = nullptr;
             return status;
         }
         /* Make a linked list of open files and move on to the include file */
@@ -590,7 +590,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
     if (!bEOF)
     {
         /* Read the actual line now. */
-        if (fgets2(buf, n-1, handle->fp) == NULL)
+        if (fgets2(buf, n-1, handle->fp) == nullptr)
         {
             /* Recheck EOF, since we could have been at the end before
              * the fgets2 call, but we need to read past the end to know.
@@ -608,13 +608,13 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
 
     if (bEOF)
     {
-        if (handle->parent == NULL)
+        if (handle->parent == nullptr)
         {
             return eCPP_EOF;
         }
         cpp_close_file(handlep);
         *handlep      = handle->parent;
-        handle->child = NULL;
+        handle->child = nullptr;
         return cpp_read_line(handlep, n, buf);
     }
     else
@@ -663,7 +663,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
         {
             nn  = 0;
             ptr = buf;
-            while ((ptr = strstrw(ptr, defs[i].name)) != NULL)
+            while ((ptr = strstrw(ptr, defs[i].name)) != nullptr)
             {
                 nn++;
                 ptr += strlen(defs[i].name);
@@ -675,7 +675,7 @@ int cpp_read_line(gmx_cpp_t *handlep, int n, char buf[])
                 len = strlen(buf) + nn*std::max(four, four+strlen(defs[i].def)-strlen(defs[i].name));
                 snew(name, len);
                 ptr = buf;
-                while ((ptr2 = strstrw(ptr, defs[i].name)) != NULL)
+                while ((ptr2 = strstrw(ptr, defs[i].name)) != nullptr)
                 {
                     strncat(name, ptr, (int)(ptr2-ptr));
                     strcat(name, defs[i].def);
@@ -719,9 +719,9 @@ int cpp_close_file(gmx_cpp_t *handlep)
         fprintf(debug, "GMXCPP: closing file %s\n", handle->fn);
     }
     fclose(handle->fp);
-    if (NULL != handle->cwd)
+    if (nullptr != handle->cwd)
     {
-        if (NULL != debug)
+        if (nullptr != debug)
         {
             fprintf(debug, "GMXCPP: chdir to %s\n", handle->cwd);
         }
@@ -748,28 +748,28 @@ int cpp_close_file(gmx_cpp_t *handlep)
                 return eCPP_UNKNOWN;
         }
     }
-    handle->fp      = NULL;
+    handle->fp      = nullptr;
     handle->line_nr = 0;
-    if (NULL != handle->fn)
+    if (nullptr != handle->fn)
     {
         sfree(handle->fn);
-        handle->fn = NULL;
+        handle->fn = nullptr;
     }
-    if (NULL != handle->line)
+    if (nullptr != handle->line)
     {
         sfree(handle->line);
-        handle->line = NULL;
+        handle->line = nullptr;
     }
-    if (NULL != handle->ifdefs)
+    if (nullptr != handle->ifdefs)
     {
         sfree(handle->ifdefs);
     }
     handle->nifdef = 0;
-    if (NULL != handle->path)
+    if (nullptr != handle->path)
     {
         sfree(handle->path);
     }
-    if (NULL != handle->cwd)
+    if (nullptr != handle->cwd)
     {
         sfree(handle->cwd);
     }
index 858e36d7b04443f9394721836eab3af47703f4f8..68538e842636e5c4a841583c3cae4f34413abebb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -92,7 +92,7 @@ char *get_atomtype_name(int nt, gpp_atomtype_t ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
-        return NULL;
+        return nullptr;
     }
 
     return *(ga->atomname[nt]);
@@ -238,16 +238,16 @@ gpp_atomtype_t init_atomtype(void)
     snew(ga, 1);
 
     ga->nr           = 0;
-    ga->atom         = NULL;
-    ga->atomname     = NULL;
-    ga->nb           = NULL;
-    ga->bondatomtype = NULL;
-    ga->radius       = NULL;
-    ga->vol          = NULL;
-    ga->surftens     = NULL;
-    ga->atomnumber   = NULL;
-    ga->gb_radius    = NULL;
-    ga->S_hct        = NULL;
+    ga->atom         = nullptr;
+    ga->atomname     = nullptr;
+    ga->nb           = nullptr;
+    ga->bondatomtype = nullptr;
+    ga->radius       = nullptr;
+    ga->vol          = nullptr;
+    ga->surftens     = nullptr;
+    ga->atomnumber   = nullptr;
+    ga->gb_radius    = nullptr;
+    ga->S_hct        = nullptr;
 
     return ga;
 }
@@ -309,7 +309,7 @@ int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
     {
         if (strcmp(*ga->atomname[i], name) == 0)
         {
-            if (NULL != debug)
+            if (nullptr != debug)
             {
                 fprintf(debug, "Trying to add atomtype %s again. Skipping it.\n", name);
             }
@@ -528,7 +528,7 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
     }
 
     /* Renumber nlist */
-    nbsnew = NULL;
+    nbsnew = nullptr;
     snew(nbsnew, plist[ftype].nr);
 
     nrfp  = NRFP(ftype);
index 0b26182b75420a1dc2dbf50fda3b089a060fc14d..2d79963270a12666b2676a957d49e8e3a3b72ac3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,7 +74,7 @@ char *get_bond_atomtype_name(int nt, t_bond_atomtype at)
 
     if ((nt < 0) || (nt >= ga->nr))
     {
-        return NULL;
+        return nullptr;
     }
 
     return *(ga->atomname[nt]);
@@ -107,5 +107,5 @@ void done_bond_atomtype(t_bond_atomtype *at)
     ga->nr = 0;
     sfree(ga);
 
-    *at = NULL;
+    *at = nullptr;
 }
index e5ab2360cd3dbcd6cf3dda4c4a63e2fd3c8364e3..e088d43be7435c84575bce79be680a5cd2683a41 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -260,7 +260,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
     w_a1      = w_a2 = -1;
     w_period2 = -1.0;
 
-    w_moltype = NULL;
+    w_moltype = nullptr;
     for (molt = 0; molt < mtop->nmoltype; molt++)
     {
         moltype = &mtop->moltype[molt];
@@ -322,7 +322,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
                         }
                     }
                     if (!bFound &&
-                        (w_moltype == NULL || period2 < w_period2))
+                        (w_moltype == nullptr || period2 < w_period2))
                     {
                         w_moltype = moltype;
                         w_a1      = a1;
@@ -334,7 +334,7 @@ static void check_bonds_timestep(gmx_mtop_t *mtop, double dt, warninp_t wi)
         }
     }
 
-    if (w_moltype != NULL)
+    if (w_moltype != nullptr)
     {
         bWarn = (w_period2 < gmx::square(min_steps_warn*dt));
         /* A check that would recognize most water models */
@@ -509,7 +509,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
            gmx_bool bMorse,
            warninp_t wi)
 {
-    t_molinfo      *molinfo = NULL;
+    t_molinfo      *molinfo = nullptr;
     int             nmolblock;
     gmx_molblock_t *molblock, *molbs;
     int             mb, i, nrmols, nmismatch;
@@ -603,11 +603,11 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
     }
 
     t_topology *conftop;
-    rvec       *x = NULL;
-    rvec       *v = NULL;
+    rvec       *x = nullptr;
+    rvec       *v = nullptr;
     snew(conftop, 1);
     init_state(state, 0, 0, 0, 0, 0);
-    read_tps_conf(confin, conftop, NULL, &x, &v, state->box, FALSE);
+    read_tps_conf(confin, conftop, nullptr, &x, &v, state->box, FALSE);
     state->natoms = conftop->atoms.nr;
     if (state->natoms != sys->natoms)
     {
@@ -625,7 +625,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
         copy_rvec(x[i], state->x[i]);
     }
     sfree(x);
-    if (v != NULL)
+    if (v != nullptr)
     {
         state->flags |= (1 << estV);
         state->v.resize(state->natoms);
@@ -844,7 +844,7 @@ static void read_posres(gmx_mtop_t *mtop, t_molinfo *molinfo, gmx_bool bTopB,
     t_atom         *atom;
 
     snew(top, 1);
-    read_tps_conf(fn, top, NULL, &x, &v, box, FALSE);
+    read_tps_conf(fn, top, nullptr, &x, &v, box, FALSE);
     natoms = top->atoms.nr;
     done_top(top);
     sfree(top);
@@ -1613,17 +1613,17 @@ int gmx_grompp(int argc, char *argv[])
     char               warn_buf[STRLEN];
 
     t_filenm           fnm[] = {
-        { efMDP, NULL,  NULL,        ffREAD  },
+        { efMDP, nullptr,  nullptr,        ffREAD  },
         { efMDP, "-po", "mdout",     ffWRITE },
-        { efSTX, "-c",  NULL,        ffREAD  },
-        { efSTX, "-r",  NULL,        ffOPTRD },
-        { efSTX, "-rb", NULL,        ffOPTRD },
-        { efNDX, NULL,  NULL,        ffOPTRD },
-        { efTOP, NULL,  NULL,        ffREAD  },
+        { efSTX, "-c",  nullptr,        ffREAD  },
+        { efSTX, "-r",  nullptr,        ffOPTRD },
+        { efSTX, "-rb", nullptr,        ffOPTRD },
+        { efNDX, nullptr,  nullptr,        ffOPTRD },
+        { efTOP, nullptr,  nullptr,        ffREAD  },
         { efTOP, "-pp", "processed", ffOPTWR },
-        { efTPR, "-o",  NULL,        ffWRITE },
-        { efTRN, "-t",  NULL,        ffOPTRD },
-        { efEDR, "-e",  NULL,        ffOPTRD },
+        { efTPR, "-o",  nullptr,        ffWRITE },
+        { efTRN, "-t",  nullptr,        ffOPTRD },
+        { efEDR, "-e",  nullptr,        ffOPTRD },
         /* This group is needed by the VMD viewer as the start configuration for IMD sessions: */
         { efGRO, "-imd", "imdgroup", ffOPTWR },
         { efTRN, "-ref", "rotref",   ffOPTRW }
@@ -1652,7 +1652,7 @@ int gmx_grompp(int argc, char *argv[])
 
     /* Parse the command line */
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -2095,7 +2095,7 @@ int gmx_grompp(int argc, char *argv[])
             }
             else
             {
-                if (ir->fepvals->all_lambda[i] == NULL)
+                if (ir->fepvals->all_lambda[i] == nullptr)
                 {
                     gmx_fatal(FARGS, "Values of lambda not set for a free energy calculation!");
                 }
@@ -2107,7 +2107,7 @@ int gmx_grompp(int argc, char *argv[])
         }
     }
 
-    struct pull_t *pull = NULL;
+    struct pull_t *pull = nullptr;
 
     if (ir->bPull)
     {
index 50dee9d5e0a558c77140bf1478ecfeef2c0b186f..e1b93ec749ddf5498573568ffca5c3d025de2c1d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -113,11 +113,11 @@ void read_ab(char *line, const char *fn, t_hack *hack)
     }
     for (; i < 4; i++)
     {
-        hack->a[i] = NULL;
+        hack->a[i] = nullptr;
     }
-    hack->oname = NULL;
+    hack->oname = nullptr;
     hack->nname = gmx_strdup(hn);
-    hack->atom  = NULL;
+    hack->atom  = nullptr;
     hack->cgnr  = NOTSET;
     hack->bXSet = FALSE;
     for (i = 0; i < DIM; i++)
@@ -181,7 +181,7 @@ static void read_h_db_file(const char *hfn, int *nahptr, t_hackblock **ah)
                               "while reading Hydrogen Database %s residue %s",
                               nab, i-1, aah[nah].name, hfn);
                 }
-                if (NULL == fgets(buf, STRLEN, in))
+                if (nullptr == fgets(buf, STRLEN, in))
                 {
                     gmx_fatal(FARGS, "Error reading from file %s", hfn);
                 }
@@ -218,7 +218,7 @@ int read_h_db(const char *ffdir, t_hackblock **ah)
      */
     nhdbf = fflib_search_file_end(ffdir, ".hdb", FALSE, &hdbf);
     nah   = 0;
-    *ah   = NULL;
+    *ah   = nullptr;
     for (f = 0; f < nhdbf; f++)
     {
         read_h_db_file(hdbf[f], &nah, ah);
@@ -235,7 +235,7 @@ t_hackblock *search_h_db(int nh, t_hackblock ah[], char *key)
 
     if (nh <= 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     ahkey.name = key;
index 6e8026e922630e83641ecfa8e5dc8f65d4528847..d9d3daf849e7c7cb707188b6c50053a621172151 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -72,7 +72,7 @@ static void free_t_bondeds(t_rbondeds *rbs)
         free_t_bonded(&rbs->b[i]);
     }
     sfree(rbs->b);
-    rbs->b  = NULL;
+    rbs->b  = nullptr;
     rbs->nb = 0;
 }
 
@@ -114,7 +114,7 @@ void free_t_hack(int nh, t_hack **h)
         }
     }
     sfree(*h);
-    *h = NULL;
+    *h = nullptr;
 }
 
 void free_t_hackblock(int nhb, t_hackblock **hb)
@@ -137,14 +137,14 @@ void clear_t_hackblock(t_hackblock *hb)
 {
     int i;
 
-    hb->name    = NULL;
+    hb->name    = nullptr;
     hb->nhack   = 0;
     hb->maxhack = 0;
-    hb->hack    = NULL;
+    hb->hack    = nullptr;
     for (i = 0; i < ebtsNR; i++)
     {
         hb->rb[i].nb = 0;
-        hb->rb[i].b  = NULL;
+        hb->rb[i].b  = nullptr;
     }
 }
 
@@ -153,15 +153,15 @@ void clear_t_hack(t_hack *hack)
     int i;
 
     hack->nr    = 0;
-    hack->oname = NULL;
-    hack->nname = NULL;
-    hack->atom  = NULL;
+    hack->oname = nullptr;
+    hack->nname = nullptr;
+    hack->atom  = nullptr;
     hack->cgnr  = NOTSET;
     hack->tp    = 0;
     hack->nctl  = 0;
     for (i = 0; i < 4; i++)
     {
-        hack->a[i]  = NULL;
+        hack->a[i]  = nullptr;
     }
     for (i = 0; i < DIM; i++)
     {
@@ -346,7 +346,7 @@ void copy_t_restp(t_restp *s, t_restp *d)
     {
         d->rb[i].type = s->rb[i].type;
         d->rb[i].nb   = 0;
-        d->rb[i].b    = NULL;
+        d->rb[i].b    = nullptr;
     }
     merge_t_bondeds(s->rb, d->rb, FALSE, FALSE);
 }
@@ -365,7 +365,7 @@ void copy_t_hack(t_hack *s, t_hack *d)
     }
     else
     {
-        d->atom = NULL;
+        d->atom = nullptr;
     }
     for (i = 0; i < 4; i++)
     {
@@ -407,11 +407,11 @@ void copy_t_hackblock(t_hackblock *s, t_hackblock *d)
     *d       = *s;
     d->name  = safe_strdup(s->name);
     d->nhack = 0;
-    d->hack  = NULL;
+    d->hack  = nullptr;
     for (i = 0; i < ebtsNR; i++)
     {
         d->rb[i].nb = 0;
-        d->rb[i].b  = NULL;
+        d->rb[i].b  = nullptr;
     }
     merge_t_hackblock(s, d);
 }
index 936dd144db6889ed0c21aa12f93442ec54363a59..204ecb711da7bcc755d66222691a9c83a3e981d7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -125,7 +125,7 @@ static void generate_trial_conf(const std::vector<RVec> &xin,
     }
     if (enum_rot == en_rotXYZ || enum_rot == en_rotZ)
     {
-        rotate_conf(xout->size(), as_rvec_array(xout->data()), NULL, alfa, beta, gamma);
+        rotate_conf(xout->size(), as_rvec_array(xout->data()), nullptr, alfa, beta, gamma);
     }
     for (size_t i = 0; i < xout->size(); ++i)
     {
@@ -208,7 +208,7 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
     set_pbc(&pbc, ePBC, box);
 
     /* With -ip, take nmol_insrt from file posfn */
-    double     **rpos              = NULL;
+    double     **rpos              = nullptr;
     const bool   insertAtPositions = !posfn.empty();
     if (insertAtPositions)
     {
@@ -307,7 +307,7 @@ static void insert_mols(int nmol_insrt, int ntry, int seed,
                 originalAtomCount - atoms->nr);
     }
 
-    if (rpos != NULL)
+    if (rpos != nullptr)
     {
         for (int i = 0; i < DIM; ++i)
         {
@@ -329,7 +329,7 @@ class InsertMolecules : public ICommandLineOptionsModule, public ITopologyProvid
         InsertMolecules()
             : bBox_(false), nmolIns_(0), nmolTry_(10), seed_(0),
               defaultDistance_(0.105), scaleFactor_(0.57), enumRot_(en_rotXYZ),
-              top_(NULL), ePBC_(-1)
+              top_(nullptr), ePBC_(-1)
         {
             clear_rvec(newBox_);
             clear_rvec(deltaR_);
@@ -337,7 +337,7 @@ class InsertMolecules : public ICommandLineOptionsModule, public ITopologyProvid
         }
         virtual ~InsertMolecules()
         {
-            if (top_ != NULL)
+            if (top_ != nullptr)
             {
                 done_mtop(top_);
                 sfree(top_);
@@ -509,7 +509,7 @@ void InsertMolecules::optionsFinished()
     snew(top_, 1);
     if (!inputConfFile_.empty())
     {
-        readConformation(inputConfFile_.c_str(), top_, &x_, NULL,
+        readConformation(inputConfFile_.c_str(), top_, &x_, nullptr,
                          &ePBC_, box_, "solute");
         if (top_->natoms == 0)
         {
@@ -560,13 +560,13 @@ int InsertMolecules::run()
         int         ePBC_dummy;
         matrix      box_dummy;
         readConformation(insertConfFile_.c_str(), top_insrt, &x_insrt,
-                         NULL, &ePBC_dummy, box_dummy, "molecule");
+                         nullptr, &ePBC_dummy, box_dummy, "molecule");
         if (top_insrt->atoms.nr == 0)
         {
             gmx_fatal(FARGS, "No molecule in %s, please check your input",
                       insertConfFile_.c_str());
         }
-        if (top_->name == NULL)
+        if (top_->name == nullptr)
         {
             top_->name = top_insrt->name;
         }
@@ -589,7 +589,7 @@ int InsertMolecules::run()
     fprintf(stderr, "Writing generated configuration to %s\n",
             outputConfFile_.c_str());
     write_sto_conf(outputConfFile_.c_str(), *top_->name, &atoms,
-                   as_rvec_array(x_.data()), NULL, ePBC_, box_);
+                   as_rvec_array(x_.data()), nullptr, ePBC_, box_);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
index a68da1fd5419b499d0e07e0320041250d9334c66..25f770f7f068bcc1f4ef6c0e46f618e0efedc982 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,10 +67,10 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
     char          buf[1024], elem[16], type[16], nbbuf[16], **newbuf;
     int           i, nb, nnnm, line = 1;
     double        qq, mm;
-    t_nm2type    *nm2t = NULL;
+    t_nm2type    *nm2t = nullptr;
 
     fp = fflib_open(fn);
-    if (NULL == fp)
+    if (nullptr == fp)
     {
         gmx_fatal(FARGS, "Can not find %s in library directory", fn);
     }
@@ -80,7 +80,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
     do
     {
         /* Read a line from the file */
-        bCont = (fgets2(buf, 1023, fp) != NULL);
+        bCont = (fgets2(buf, 1023, fp) != nullptr);
 
         if (bCont)
         {
@@ -110,7 +110,7 @@ static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
                 }
                 else
                 {
-                    newbuf = NULL;
+                    newbuf = nullptr;
                 }
                 nm2t[nnnm].elem   = gmx_strdup(elem);
                 nm2t[nnnm].type   = gmx_strdup(type);
@@ -138,7 +138,7 @@ t_nm2type *rd_nm2type(const char *ffdir, int *nnm)
 
     nff  = fflib_search_file_end(ffdir, ".n2t", FALSE, &ff);
     *nnm = 0;
-    nm   = NULL;
+    nm   = nullptr;
     for (f = 0; f < nff; f++)
     {
         rd_nm2type_file(ff[f], nnm, &nm);
index 516a4cd6a2c16eb1ae0ddf975ea86870ceb342e0..bc2b891a7f7bb7e62fcdc7afd2818eb8ec106b77 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -276,7 +276,7 @@ static char *search_resrename(int nrr, rtprename_t *rr,
     char *nn;
     int   i;
 
-    nn = NULL;
+    nn = nullptr;
 
     i = 0;
     while (i < nrr && ((!bCompareFFRTPname && strcmp(name, rr[i].gmx)  != 0) ||
@@ -326,7 +326,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
     char    *nn;
     gmx_bool bFFRTPTERRNM;
 
-    bFFRTPTERRNM = (getenv("GMX_NO_FFRTP_TER_RENAME") == NULL);
+    bFFRTPTERRNM = (getenv("GMX_NO_FFRTP_TER_RENAME") == nullptr);
 
     for (r = 0; r < pdba->nres; r++)
     {
@@ -349,7 +349,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
 
         nn = search_resrename(nrr, rr, *pdba->resinfo[r].rtp, bStart, bEnd, FALSE);
 
-        if (bFFRTPTERRNM && nn == NULL && (bStart || bEnd))
+        if (bFFRTPTERRNM && nn == nullptr && (bStart || bEnd))
         {
             /* This is a terminal residue, but the residue name,
              * currently stored in .rtp, is not a standard residue name,
@@ -360,7 +360,7 @@ static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end
                                   *pdba->resinfo[r].rtp, bStart, bEnd, TRUE);
         }
 
-        if (nn != NULL && strcmp(*pdba->resinfo[r].rtp, nn) != 0)
+        if (nn != nullptr && strcmp(*pdba->resinfo[r].rtp, nn) != 0)
         {
             if (bVerbose)
             {
@@ -378,7 +378,7 @@ static void pdbres_to_gmxrtp(t_atoms *pdba)
 
     for (i = 0; (i < pdba->nres); i++)
     {
-        if (pdba->resinfo[i].rtp == NULL)
+        if (pdba->resinfo[i].rtp == nullptr)
         {
             pdba->resinfo[i].rtp = pdba->resinfo[i].name;
         }
@@ -395,7 +395,7 @@ static void rename_pdbres(t_atoms *pdba, const char *oldnm, const char *newnm,
     {
         resnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (gmx_strcasecmp(resnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(resnm, oldnm) != NULL))
+            (!bFullCompare && strstr(resnm, oldnm) != nullptr))
         {
             /* Rename the residue name (not the rtp name) */
             pdba->resinfo[i].name = put_symtab(symtab, newnm);
@@ -414,7 +414,7 @@ static void rename_bb(t_atoms *pdba, const char *oldnm, const char *newnm,
         /* We have not set the rtp name yes, use the residue name */
         bbnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (gmx_strcasecmp(bbnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(bbnm, oldnm) != NULL))
+            (!bFullCompare && strstr(bbnm, oldnm) != nullptr))
         {
             /* Change the rtp builing block name */
             pdba->resinfo[i].rtp = put_symtab(symtab, newnm);
@@ -437,7 +437,7 @@ static void rename_bbint(t_atoms *pdba, const char *oldnm,
         /* We have not set the rtp name yes, use the residue name */
         bbnm = *pdba->resinfo[i].name;
         if ((bFullCompare && (strcmp(bbnm, oldnm) == 0)) ||
-            (!bFullCompare && strstr(bbnm, oldnm) != NULL))
+            (!bFullCompare && strstr(bbnm, oldnm) != nullptr))
         {
             ptr                  = gettp(i, nrr, rr);
             pdba->resinfo[i].rtp = put_symtab(symtab, ptr);
@@ -538,13 +538,13 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     printf("Reading %s...\n", inf);
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(inf, top, ePBC, x, NULL, box, FALSE);
+    read_tps_conf(inf, top, ePBC, x, nullptr, box, FALSE);
     strncpy(title, *top->name, STRLEN);
     title[STRLEN-1] = '\0';
     *atoms          = top->atoms;
     sfree(top);
     natom = atoms->nr;
-    if (atoms->pdbinfo == NULL)
+    if (atoms->pdbinfo == nullptr)
     {
         snew(atoms->pdbinfo, atoms->nr);
     }
@@ -582,8 +582,8 @@ static int read_pdball(const char *inf, const char *outf, char *title,
     rename_pdbres(atoms, "SOL", watres, FALSE, symtab);
     rename_pdbres(atoms, "WAT", watres, FALSE, symtab);
 
-    rename_atoms("xlateat.dat", NULL,
-                 atoms, symtab, NULL, TRUE, rt, TRUE, bVerbose);
+    rename_atoms("xlateat.dat", nullptr,
+                 atoms, symtab, nullptr, TRUE, rt, TRUE, bVerbose);
 
     if (natom == 0)
     {
@@ -592,7 +592,7 @@ static int read_pdball(const char *inf, const char *outf, char *title,
 
     if (outf)
     {
-        write_sto_conf(outf, title, atoms, *x, NULL, *ePBC, box);
+        write_sto_conf(outf, title, atoms, *x, nullptr, *ePBC, box);
     }
 
     return natom;
@@ -716,7 +716,7 @@ static void sort_pdbatoms(t_restp restp[],
 
     pdba   = *pdbaptr;
     natoms = pdba->nr;
-    pdbnew = NULL;
+    pdbnew = nullptr;
     snew(xnew, 1);
     snew(pdbi, natoms);
 
@@ -1009,9 +1009,9 @@ modify_chain_numbers(t_atoms *       pdba,
     old_prev_chainnum = -1;
     new_chainnum      = -1;
 
-    this_atomname       = NULL;
+    this_atomname       = nullptr;
     this_atomnum        = -1;
-    this_resname        = NULL;
+    this_resname        = nullptr;
     this_resnum         = -1;
     this_chainid        = '?';
 
@@ -1028,7 +1028,7 @@ modify_chain_numbers(t_atoms *       pdba,
         prev_chainid       = this_chainid;
 
         this_atomname      = *(pdba->atomname[i]);
-        this_atomnum       = (pdba->pdbinfo != NULL) ? pdba->pdbinfo[i].atomnr : i+1;
+        this_atomnum       = (pdba->pdbinfo != nullptr) ? pdba->pdbinfo[i].atomnr : i+1;
         this_resname       = *ri->name;
         this_resnum        = ri->nr;
         this_chainid       = ri->chainid;
@@ -1072,7 +1072,7 @@ modify_chain_numbers(t_atoms *       pdba,
                                prev_resname, prev_resnum, prev_chainid, prev_atomnum, prev_atomname,
                                this_resname, this_resnum, this_chainid, this_atomnum, this_atomname);
 
-                        if (NULL == fgets(select, STRLEN-1, stdin))
+                        if (nullptr == fgets(select, STRLEN-1, stdin))
                         {
                             gmx_fatal(FARGS, "Error reading from stdin");
                         }
@@ -1233,7 +1233,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     };
 
 
-    FILE             *fp, *top_file, *top_file2, *itp_file = NULL;
+    FILE             *fp, *top_file, *top_file2, *itp_file = nullptr;
     int               natom, nres;
     t_atoms           pdba_all, *pdba;
     t_atoms          *atoms;
@@ -1269,7 +1269,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     int               nrrn;
     char            **rrn;
     int               nrtprename;
-    rtprename_t      *rtprename = NULL;
+    rtprename_t      *rtprename = nullptr;
     int               nah, nNtdb, nCtdb, ntdblist;
     t_hackblock      *ntdb, *ctdb, **tdblist;
     int               nssbonds;
@@ -1305,7 +1305,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     t_filenm          fnm[] = {
         { efSTX, "-f", "eiwit.pdb", ffREAD  },
         { efSTO, "-o", "conf",      ffWRITE },
-        { efTOP, NULL, NULL,        ffWRITE },
+        { efTOP, nullptr, nullptr,        ffWRITE },
         { efITP, "-i", "posre",     ffWRITE },
         { efNDX, "-n", "clean",     ffOPTWR },
         { efSTO, "-q", "clean.pdb", ffOPTWR }
@@ -1324,10 +1324,10 @@ int gmx_pdb2gmx(int argc, char *argv[])
     static gmx_bool    bRenumRes      = FALSE, bRTPresname = FALSE;
     static real        angle          = 135.0, distance = 0.3, posre_fc = 1000;
     static real        long_bond_dist = 0.25, short_bond_dist = 0.05;
-    static const char *vsitestr[]     = { NULL, "none", "hydrogens", "aromatics", NULL };
-    static const char *watstr[]       = { NULL, "select", "none", "spc", "spce", "tip3p", "tip4p", "tip5p", NULL };
-    static const char *chainsep[]     = { NULL, "id_or_ter", "id_and_ter", "ter", "id", "interactive", NULL };
-    static const char *merge[]        = {NULL, "no", "all", "interactive", NULL };
+    static const char *vsitestr[]     = { nullptr, "none", "hydrogens", "aromatics", nullptr };
+    static const char *watstr[]       = { nullptr, "select", "none", "spc", "spce", "tip3p", "tip4p", "tip5p", nullptr };
+    static const char *chainsep[]     = { nullptr, "id_or_ter", "id_and_ter", "ter", "id", "interactive", nullptr };
+    static const char *merge[]        = {nullptr, "no", "all", "interactive", nullptr };
     static const char *ff             = "select";
 
     t_pargs            pa[] = {
@@ -1398,13 +1398,13 @@ int gmx_pdb2gmx(int argc, char *argv[])
 #define NPARGS asize(pa)
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa, asize(desc), desc,
-                           0, NULL, &oenv))
+                           0, nullptr, &oenv))
     {
         return 0;
     }
 
     /* Force field selection, interactive or direct */
-    choose_ff(strcmp(ff, "select") == 0 ? NULL : ff,
+    choose_ff(strcmp(ff, "select") == 0 ? nullptr : ff,
               forcefield, sizeof(forcefield),
               ffdir, sizeof(ffdir));
 
@@ -1481,7 +1481,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     nrrn = fflib_search_file_end(ffdir, ".r2b", FALSE, &rrn);
 
     nrtprename = 0;
-    rtprename  = NULL;
+    rtprename  = nullptr;
     for (i = 0; i < nrrn; i++)
     {
         fp = fflib_open(rrn[i]);
@@ -1507,13 +1507,13 @@ int gmx_pdb2gmx(int argc, char *argv[])
     }
 
     clear_mat(box);
-    if (watermodel != NULL && (strstr(watermodel, "4p") ||
-                               strstr(watermodel, "4P")))
+    if (watermodel != nullptr && (strstr(watermodel, "4p") ||
+                                  strstr(watermodel, "4P")))
     {
         watres = "HO4";
     }
-    else if (watermodel != NULL && (strstr(watermodel, "5p") ||
-                                    strstr(watermodel, "5P")))
+    else if (watermodel != nullptr && (strstr(watermodel, "5p") ||
+                                       strstr(watermodel, "5P")))
     {
         watres = "HO5";
     }
@@ -1539,9 +1539,9 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
     nchainmerges        = 0;
 
-    this_atomname       = NULL;
+    this_atomname       = nullptr;
     this_atomnum        = -1;
-    this_resname        = NULL;
+    this_resname        = nullptr;
     this_resnum         = -1;
     this_chainid        = '?';
     this_chainnumber    = -1;
@@ -1572,7 +1572,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
         }
 
         this_atomname      = *pdba_all.atomname[i];
-        this_atomnum       = (pdba_all.pdbinfo != NULL) ? pdba_all.pdbinfo[i].atomnr : i+1;
+        this_atomnum       = (pdba_all.pdbinfo != nullptr) ? pdba_all.pdbinfo[i].atomnr : i+1;
         this_resname       = *ri->name;
         this_resnum        = ri->nr;
         this_chainid       = ri->chainid;
@@ -1593,7 +1593,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                            prev_resname, prev_resnum, prev_chainid, prev_atomnum, prev_atomname,
                            this_resname, this_resnum, this_chainid, this_atomnum, this_atomname);
 
-                    if (NULL == fgets(select, STRLEN-1, stdin))
+                    if (nullptr == fgets(select, STRLEN-1, stdin))
                     {
                         gmx_fatal(FARGS, "Error reading from stdin");
                     }
@@ -1763,7 +1763,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     printf("Reading residue database... (%s)\n", forcefield);
     nrtpf = fflib_search_file_end(ffdir, ".rtp", TRUE, &rtpf);
     nrtp  = 0;
-    restp = NULL;
+    restp = nullptr;
     for (i = 0; i < nrtpf; i++)
     {
         read_resall(rtpf[i], &nrtp, &restp, atype, &symtab, FALSE);
@@ -1792,8 +1792,8 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
     nincl = 0;
     nmol  = 0;
-    incls = NULL;
-    mols  = NULL;
+    incls = nullptr;
+    mols  = nullptr;
     for (chain = 0; (chain < nch); chain++)
     {
         cc = &(chains[chain]);
@@ -1858,7 +1858,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             {
                 sprintf(fn, "chain_%c%d.pdb", cc->chainid, cc->chainnum);
             }
-            write_sto_conf(fn, title, pdba, x, NULL, ePBC, box);
+            write_sto_conf(fn, title, pdba, x, nullptr, ePBC, box);
         }
 
 
@@ -1881,7 +1881,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                 {
                     printf("No suitable end (N or 5') terminus found in database - assuming this residue\n"
                            "is already in a terminus-specific form and skipping terminus selection.\n");
-                    cc->ntdb[i] = NULL;
+                    cc->ntdb[i] = nullptr;
                 }
                 else
                 {
@@ -1906,7 +1906,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             }
             else
             {
-                cc->ntdb[i] = NULL;
+                cc->ntdb[i] = nullptr;
             }
 
             /* And the C terminus */
@@ -1920,7 +1920,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
                 {
                     printf("No suitable end (C or 3') terminus found in database - assuming this residue\n"
                            "is already in a terminus-specific form and skipping terminus selection.\n");
-                    cc->ctdb[i] = NULL;
+                    cc->ctdb[i] = nullptr;
                 }
                 else
                 {
@@ -1944,7 +1944,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
             }
             else
             {
-                cc->ctdb[i] = NULL;
+                cc->ctdb[i] = nullptr;
             }
         }
         /* lookup hackblocks and rtp for all residues */
@@ -1956,7 +1956,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
            requires some re-thinking of code in gen_vsite.c, which I won't
            do now :( AF 26-7-99 */
 
-        rename_atoms(NULL, ffdir,
+        rename_atoms(nullptr, ffdir,
                      pdba, &symtab, restp_chain, FALSE, rt, FALSE, bVerbose);
 
         match_atomnames_with_rtp(restp_chain, hb_chain, pdba, x, bVerbose);
@@ -1995,12 +1995,12 @@ int gmx_pdb2gmx(int argc, char *argv[])
         printf("Generating any missing hydrogen atoms and/or adding termini.\n");
         natom = add_h(&pdba, &x, nah, ah,
                       cc->nterpairs, cc->ntdb, cc->ctdb, cc->r_start, cc->r_end, bAllowMissing,
-                      NULL, NULL, TRUE, FALSE);
+                      nullptr, nullptr, TRUE, FALSE);
         printf("Now there are %d residues with %d atoms\n",
                pdba->nres, pdba->nr);
         if (debug)
         {
-            write_pdbfile(debug, title, pdba, x, ePBC, box, ' ', 0, NULL, TRUE);
+            write_pdbfile(debug, title, pdba, x, ePBC, box, ' ', 0, nullptr, TRUE);
         }
 
         if (debug)
@@ -2112,7 +2112,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
 
         if (cc->bAllWat)
         {
-            top_file2 = NULL;
+            top_file2 = nullptr;
         }
         else
         if (bITP)
@@ -2157,11 +2157,11 @@ int gmx_pdb2gmx(int argc, char *argv[])
             {
                 sprintf(fn, "chain_%c.pdb", cc->chainid);
             }
-            write_sto_conf(fn, "", pdba, x, NULL, ePBC, box);
+            write_sto_conf(fn, "", pdba, x, nullptr, ePBC, box);
         }
     }
 
-    if (watermodel == NULL)
+    if (watermodel == nullptr)
     {
         for (chain = 0; chain < nch; chain++)
         {
@@ -2245,12 +2245,12 @@ int gmx_pdb2gmx(int argc, char *argv[])
     {
         make_new_box(atoms->nr, x, box, box_space, FALSE);
     }
-    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), title, atoms, x, NULL, ePBC, box);
+    write_sto_conf(ftp2fn(efSTO, NFILE, fnm), title, atoms, x, nullptr, ePBC, box);
 
     printf("\t\t--------- PLEASE NOTE ------------\n");
     printf("You have successfully generated a topology from: %s.\n",
            opt2fn("-f", NFILE, fnm));
-    if (watermodel != NULL)
+    if (watermodel != nullptr)
     {
         printf("The %s force field and the %s water model are used.\n",
                ffname, watermodel);
index 9943fe4cc24ae44cee7c8cda68b580e9968d1291..81ab04fc9f5b2d0c7c5dc552fa0e1da414df8ece 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -155,7 +155,7 @@ choose_ff_impl(const char *ffsel,
     }
 
     int sel;
-    if (ffsel != NULL)
+    if (ffsel != nullptr)
     {
         sel         = -1;
         int cwdsel  = -1;
@@ -277,13 +277,13 @@ choose_ff_impl(const char *ffsel,
         {
             pret = fgets(buf, STRLEN, stdin);
 
-            if (pret != NULL)
+            if (pret != nullptr)
             {
-                sel = strtol(buf, NULL, 10);
+                sel = strtol(buf, nullptr, 10);
                 sel--;
             }
         }
-        while (pret == NULL || (sel < 0) || (sel >= nff));
+        while (pret == nullptr || (sel < 0) || (sel >= nff));
 
         /* Check for a current limitation of the fflib code.
          * It will always read from the first ff directory in the list.
@@ -365,7 +365,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
 
     if (strcmp(wmsel, "none") == 0)
     {
-        *watermodel = NULL;
+        *watermodel = nullptr;
 
         return;
     }
@@ -382,7 +382,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     {
         fprintf(stderr, "No file '%s' found, will not include a water model\n",
                 fn_watermodels);
-        *watermodel = NULL;
+        *watermodel = nullptr;
 
         return;
     }
@@ -390,7 +390,7 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     fp = fflib_open(fn_list);
     printf("\nSelect the Water Model:\n");
     nwm   = 0;
-    model = NULL;
+    model = nullptr;
     while (get_a_line(fp, buf, STRLEN))
     {
         srenew(model, nwm+1);
@@ -415,17 +415,17 @@ void choose_watermodel(const char *wmsel, const char *ffdir,
     {
         pret = fgets(buf, STRLEN, stdin);
 
-        if (pret != NULL)
+        if (pret != nullptr)
         {
-            sel = strtol(buf, NULL, 10);
+            sel = strtol(buf, nullptr, 10);
             sel--;
         }
     }
-    while (pret == NULL || sel < 0 || sel > nwm);
+    while (pret == nullptr || sel < 0 || sel > nwm);
 
     if (sel == nwm)
     {
-        *watermodel = NULL;
+        *watermodel = nullptr;
     }
     else
     {
@@ -560,7 +560,7 @@ void print_top_comment(FILE       *out,
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
-    if (strchr(ffdir, '/') == NULL)
+    if (strchr(ffdir, '/') == nullptr)
     {
         fprintf(out, ";\tForce field was read from the standard GROMACS share directory.\n;\n\n");
     }
@@ -599,7 +599,7 @@ void print_top_header(FILE *out, const char *filename,
     fprintf(out, "; Include forcefield parameters\n");
 
     p = strrchr(ffdir, '/');
-    p = (ffdir[0] == '.' || p == NULL) ? ffdir : p+1;
+    p = (ffdir[0] == '.' || p == nullptr) ? ffdir : p+1;
 
     fprintf(out, "#include \"%s/%s\"\n\n", p, fflib_forcefield_itp());
 }
@@ -620,7 +620,7 @@ static void print_top_water(FILE *out, const char *ffdir, const char *water)
     fprintf(out, "; Include water topology\n");
 
     p = strrchr(ffdir, '/');
-    p = (ffdir[0] == '.' || p == NULL) ? ffdir : p+1;
+    p = (ffdir[0] == '.' || p == nullptr) ? ffdir : p+1;
     fprintf(out, "#include \"%s/%s.itp\"\n", p, water);
 
     fprintf(out, "\n");
@@ -662,7 +662,7 @@ void print_top_mols(FILE *out,
         for (i = 0; (i < nincl); i++)
         {
             incl = strrchr(incls[i], DIR_SEPARATOR);
-            if (incl == NULL)
+            if (incl == nullptr)
             {
                 incl = incls[i];
             }
@@ -753,7 +753,7 @@ static void do_ssbonds(t_params *ps, t_atoms *atoms,
             gmx_fatal(FARGS, "Trying to make impossible special bond (%s-%s)!",
                       ssbonds[i].a1, ssbonds[i].a2);
         }
-        add_param(ps, ai, aj, NULL, NULL);
+        add_param(ps, ai, aj, nullptr, nullptr);
     }
 }
 
@@ -808,7 +808,7 @@ static void at2bonds(t_params *psb, t_hackblock *hb,
                     fprintf(stderr, "Warning: Short Bond (%d-%d = %g nm)\n",
                             ai+1, aj+1, std::sqrt(dist2));
                 }
-                add_param(psb, ai, aj, NULL, hb[resind].rb[ebtsBONDS].b[j].s);
+                add_param(psb, ai, aj, nullptr, hb[resind].rb[ebtsBONDS].b[j].s);
             }
         }
         /* add bonds from list of hacks (each added atom gets a bond) */
@@ -817,20 +817,20 @@ static void at2bonds(t_params *psb, t_hackblock *hb,
             for (j = 0; j < hb[resind].nhack; j++)
             {
                 if ( ( hb[resind].hack[j].tp > 0 ||
-                       hb[resind].hack[j].oname == NULL ) &&
+                       hb[resind].hack[j].oname == nullptr ) &&
                      strcmp(hb[resind].hack[j].a[0], *(atoms->atomname[i])) == 0)
                 {
                     switch (hb[resind].hack[j].tp)
                     {
-                        case 9:                                   /* COOH terminus */
-                            add_param(psb, i, i+1, NULL, NULL);   /* C-O  */
-                            add_param(psb, i, i+2, NULL, NULL);   /* C-OA */
-                            add_param(psb, i+2, i+3, NULL, NULL); /* OA-H */
+                        case 9:                                         /* COOH terminus */
+                            add_param(psb, i, i+1, nullptr, nullptr);   /* C-O  */
+                            add_param(psb, i, i+2, nullptr, nullptr);   /* C-OA */
+                            add_param(psb, i+2, i+3, nullptr, nullptr); /* OA-H */
                             break;
                         default:
                             for (k = 0; (k < hb[resind].hack[j].nr); k++)
                             {
-                                add_param(psb, i, i+k+1, NULL, NULL);
+                                add_param(psb, i, i+k+1, nullptr, nullptr);
                             }
                     }
                 }
@@ -1030,11 +1030,11 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
     /* first the termini */
     for (i = 0; i < nterpairs; i++)
     {
-        if (rn[i] >= 0 && ntdb[i] != NULL)
+        if (rn[i] >= 0 && ntdb[i] != nullptr)
         {
             copy_t_hackblock(ntdb[i], &(*hb)[rn[i]]);
         }
-        if (rc[i] >= 0 && ctdb[i] != NULL)
+        if (rc[i] >= 0 && ctdb[i] != nullptr)
         {
             merge_t_hackblock(ctdb[i], &(*hb)[rc[i]]);
         }
@@ -1077,8 +1077,8 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
         }
         bRM = merge_t_bondeds(res->rb, (*hb)[i].rb, tern >= 0, terc >= 0);
 
-        if (bRM && ((tern >= 0 && ntdb[tern] == NULL) ||
-                    (terc >= 0 && ctdb[terc] == NULL)))
+        if (bRM && ((tern >= 0 && ntdb[tern] == nullptr) ||
+                    (terc >= 0 && ctdb[terc] == nullptr)))
         {
             gmx_fatal(FARGS, "There is a dangling bond at at least one of the terminal ends and the force field does not provide terminal entries or files. Fix your terminal residues so that they match the residue database (.rtp) entries, or provide terminal database entries (.tdb).");
         }
@@ -1102,9 +1102,9 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                 /* find atom in restp */
                 for (l = 0; l < (*restp)[i].natom; l++)
                 {
-                    if ( ( (*hb)[i].hack[j].oname == NULL &&
+                    if ( ( (*hb)[i].hack[j].oname == nullptr &&
                            strcmp((*hb)[i].hack[j].a[0], *(*restp)[i].atomname[l]) == 0 ) ||
-                         ( (*hb)[i].hack[j].oname != NULL &&
+                         ( (*hb)[i].hack[j].oname != nullptr &&
                            strcmp((*hb)[i].hack[j].oname, *(*restp)[i].atomname[l]) == 0 ) )
                     {
                         break;
@@ -1119,22 +1119,22 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                     /* Deleting can happen also only on the input atoms,
                      * not necessarily always on the rtp entry.
                      */
-                    if (!((*hb)[i].hack[j].oname != NULL &&
-                          (*hb)[i].hack[j].nname != NULL) &&
-                        !((*hb)[i].hack[j].oname != NULL &&
-                          (*hb)[i].hack[j].nname == NULL))
+                    if (!((*hb)[i].hack[j].oname != nullptr &&
+                          (*hb)[i].hack[j].nname != nullptr) &&
+                        !((*hb)[i].hack[j].oname != nullptr &&
+                          (*hb)[i].hack[j].nname == nullptr))
                     {
                         gmx_fatal(FARGS,
                                   "atom %s not found in buiding block %d%s "
                                   "while combining tdb and rtp",
-                                  (*hb)[i].hack[j].oname != NULL ?
+                                  (*hb)[i].hack[j].oname != nullptr ?
                                   (*hb)[i].hack[j].oname : (*hb)[i].hack[j].a[0],
                                   i+1, *resinfo[i].rtp);
                     }
                 }
                 else
                 {
-                    if ( (*hb)[i].hack[j].oname == NULL)
+                    if ( (*hb)[i].hack[j].oname == nullptr)
                     {
                         /* we're adding: */
                         add_atom_to_restp(&(*restp)[i], l, &(*hb)[i].hack[j]);
@@ -1142,7 +1142,7 @@ void get_hackblocks_rtp(t_hackblock **hb, t_restp **restp,
                     else
                     {
                         /* oname != NULL */
-                        if ( (*hb)[i].hack[j].nname == NULL)
+                        if ( (*hb)[i].hack[j].nname == nullptr)
                         {
                             /* we're deleting */
                             if (debug)
@@ -1237,7 +1237,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
     bDeleted = FALSE;
     for (j = 0; j < hbr->nhack; j++)
     {
-        if (hbr->hack[j].oname != NULL && hbr->hack[j].nname != NULL &&
+        if (hbr->hack[j].oname != nullptr && hbr->hack[j].nname != nullptr &&
             gmx_strcasecmp(oldnm, hbr->hack[j].oname) == 0)
         {
             /* This is a replace entry. */
@@ -1246,7 +1246,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
             for (k = 0; k < hbr->nhack; k++)
             {
                 if (k != j &&
-                    hbr->hack[k].oname != NULL && hbr->hack[k].nname != NULL &&
+                    hbr->hack[k].oname != nullptr && hbr->hack[k].nname != nullptr &&
                     gmx_strcasecmp(hbr->hack[k].nname, hbr->hack[j].oname) == 0)
                 {
                     /* The replace in hack[j] replaces an atom that
@@ -1283,8 +1283,8 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
                 bFoundInAdd = FALSE;
                 for (k = 0; k < hbr->nhack; k++)
                 {
-                    if (hbr->hack[k].oname == NULL &&
-                        hbr->hack[k].nname != NULL &&
+                    if (hbr->hack[k].oname == nullptr &&
+                        hbr->hack[k].nname != nullptr &&
                         atomname_cmp_nr(newnm, &hbr->hack[k], &anmnr))
                     {
                         if (anmnr <= 1)
@@ -1333,7 +1333,7 @@ static gmx_bool match_atomnames_with_rtp_atom(t_atoms *pdba, rvec *x, int atind,
             snew(pdba->atomname[atind], 1);
             *pdba->atomname[atind] = gmx_strdup(newnm);
         }
-        else if (hbr->hack[j].oname != NULL && hbr->hack[j].nname == NULL &&
+        else if (hbr->hack[j].oname != nullptr && hbr->hack[j].nname == nullptr &&
                  gmx_strcasecmp(oldnm, hbr->hack[j].oname) == 0)
         {
             /* This is a delete entry, check if this atom is present
@@ -1454,8 +1454,8 @@ static void gen_cmap(t_params *psb, t_restp *restp, t_atoms *atoms)
                 /* Skip this CMAP entry if it refers to residues before the
                  * first or after the last residue.
                  */
-                if (((strchr(pname, '-') != NULL) && (residx == 0)) ||
-                    ((strchr(pname, '+') != NULL) && (residx == nres-1)))
+                if (((strchr(pname, '-') != nullptr) && (residx == 0)) ||
+                    ((strchr(pname, '+') != nullptr) && (residx == nres-1)))
                 {
                     bAddCMAP = FALSE;
                     break;
index 7a187208a2e3e2da79762d2cbf3af7bd2d4d2fb3..a4418abf9ab85a3894843dbcd15df63666607fdb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -96,8 +96,8 @@ int search_atom(const char *type, int start,
     t_atom         *at     = atoms->atom;
     char ** const * anm    = atoms->atomname;
 
-    bPrevious = (strchr(type, '-') != NULL);
-    bNext     = (strchr(type, '+') != NULL);
+    bPrevious = (strchr(type, '-') != nullptr);
+    bNext     = (strchr(type, '+') != nullptr);
 
     if (!bPrevious)
     {
index e391d2141cbae10a24f2966d3510b46a2aa6ae75..950f751acbb28347abd8c9f0afd5bdca466c2812 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -80,9 +80,9 @@ void readConformation(const char *confin, gmx_mtop_t *top,
 {
     fprintf(stderr, "Reading %s configuration%s\n", statusTitle,
             v ? " and velocities" : "");
-    rvec                   *x_tmp = NULL, *v_tmp = NULL;
+    rvec                   *x_tmp = nullptr, *v_tmp = nullptr;
     bool                    dummy;
-    readConfAndTopology(confin, &dummy, top, ePBC, x ? &x_tmp : NULL, v ? &v_tmp : NULL, box);
+    readConfAndTopology(confin, &dummy, top, ePBC, x ? &x_tmp : nullptr, v ? &v_tmp : nullptr, box);
     const gmx::sfree_guard  xguard(x_tmp);
     const gmx::sfree_guard  vguard(v_tmp);
     if (x && x_tmp)
@@ -103,8 +103,8 @@ void readConformation(const char *confin, t_topology *top,
 {
     fprintf(stderr, "Reading %s configuration%s\n", statusTitle,
             v ? " and velocities" : "");
-    rvec                   *x_tmp = NULL, *v_tmp = NULL;
-    read_tps_conf(confin, top, ePBC, x ? &x_tmp : NULL, v ? &v_tmp : NULL, box, FALSE);
+    rvec                   *x_tmp = nullptr, *v_tmp = nullptr;
+    read_tps_conf(confin, top, ePBC, x ? &x_tmp : nullptr, v ? &v_tmp : nullptr, box, FALSE);
     const gmx::sfree_guard  xguard(x_tmp);
     const gmx::sfree_guard  vguard(v_tmp);
     if (x && x_tmp)
index aac04e776aa14e5bef314811b63c446879462b32..1c27eb5860953e9b63683bd236b9f65c09b48ae2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -108,7 +108,7 @@ typedef struct t_inputrec_strings
 
 } gmx_inputrec_strings;
 
-static gmx_inputrec_strings *is = NULL;
+static gmx_inputrec_strings *is = nullptr;
 
 void init_inputrec_strings()
 {
@@ -122,7 +122,7 @@ void init_inputrec_strings()
 void done_inputrec_strings()
 {
     sfree(is);
-    is = NULL;
+    is = nullptr;
 }
 
 
@@ -137,11 +137,11 @@ enum {
 };
 
 static const char *constraints[eshNR+1]    = {
-    "none", "h-bonds", "all-bonds", "h-angles", "all-angles", NULL
+    "none", "h-bonds", "all-bonds", "h-angles", "all-angles", nullptr
 };
 
 static const char *couple_lam[ecouplamNR+1]    = {
-    "vdw-q", "vdw", "q", "none", NULL
+    "vdw-q", "vdw", "q", "none", nullptr
 };
 
 void init_ir(t_inputrec *ir, t_gromppopts *opts)
@@ -1067,7 +1067,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         CHECK(EEL_FULL(ir->coulombtype) || ir->implicit_solvent == eisGBSA);
     }
 
-    if (getenv("GMX_DO_GALACTIC_DYNAMICS") == NULL)
+    if (getenv("GMX_DO_GALACTIC_DYNAMICS") == nullptr)
     {
         sprintf(err_buf, "epsilon-r must be >= 0 instead of %g\n", ir->epsilon_r);
         CHECK(ir->epsilon_r < 0);
@@ -1432,7 +1432,7 @@ int str_nelem(const char *str, int maxptr, char *ptr[])
         }
         ltrim(copy);
     }
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         sfree(copy0);
     }
@@ -1649,8 +1649,8 @@ static void do_wall_params(t_inputrec *ir,
     char  *names[MAXPTR];
     double dbl;
 
-    opts->wall_atomtype[0] = NULL;
-    opts->wall_atomtype[1] = NULL;
+    opts->wall_atomtype[0] = nullptr;
+    opts->wall_atomtype[1] = nullptr;
 
     ir->wall_atomtype[0] = -1;
     ir->wall_atomtype[1] = -1;
@@ -1879,9 +1879,9 @@ void get_ir(const char *mdparin, const char *mdparout,
     CCTYPE ("VARIOUS PREPROCESSING OPTIONS");
     CTYPE ("Preprocessor information: use cpp syntax.");
     CTYPE ("e.g.: -I/home/joe/doe -I/home/mary/roe");
-    STYPE ("include", opts->include,  NULL);
+    STYPE ("include", opts->include,  nullptr);
     CTYPE ("e.g.: -DPOSRES -DFLEXIBLE (note these variable names are case sensitive)");
-    STYPE ("define",  opts->define,   NULL);
+    STYPE ("define",  opts->define,   nullptr);
 
     CCTYPE ("RUN CONTROL PARAMETERS");
     EETYPE("integrator",  ir->eI,         ei_names);
@@ -1898,7 +1898,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("number of steps for center of mass motion removal");
     ITYPE ("nstcomm", ir->nstcomm,    100);
     CTYPE ("group(s) for center of mass motion removal");
-    STYPE ("comm-grps",   is->vcm,            NULL);
+    STYPE ("comm-grps",   is->vcm,            nullptr);
 
     CCTYPE ("LANGEVIN DYNAMICS OPTIONS");
     CTYPE ("Friction coefficient (amu/ps) and random seed");
@@ -1937,9 +1937,9 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("This selects the subset of atoms for the compressed");
     CTYPE ("trajectory file. You can select multiple groups. By");
     CTYPE ("default, all atoms will be written.");
-    STYPE ("compressed-x-grps", is->x_compressed_groups, NULL);
+    STYPE ("compressed-x-grps", is->x_compressed_groups, nullptr);
     CTYPE ("Selection of energy groups");
-    STYPE ("energygrps",  is->energy,         NULL);
+    STYPE ("energygrps",  is->energy,         nullptr);
 
     /* Neighbor searching */
     CCTYPE ("NEIGHBORSEARCHING PARAMETERS");
@@ -1981,7 +1981,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("Extension of the potential lookup tables beyond the cut-off");
     RTYPE ("table-extension", ir->tabext, 1.0);
     CTYPE ("Separate tables between energy group pairs");
-    STYPE ("energygrp-table", is->egptable,   NULL);
+    STYPE ("energygrp-table", is->egptable,   nullptr);
     CTYPE ("Spacing for the PME/PPPM FFT grid");
     RTYPE ("fourierspacing", ir->fourier_spacing, 0.12);
     CTYPE ("FFT grid size, when a value is 0 fourierspacing will be used");
@@ -2029,18 +2029,18 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE("nh-chain-length",     ir->opts.nhchainlength, 10);
     EETYPE("print-nose-hoover-chain-variables", ir->bPrintNHChains, yesno_names);
     CTYPE ("Groups to couple separately");
-    STYPE ("tc-grps",     is->tcgrps,         NULL);
+    STYPE ("tc-grps",     is->tcgrps,         nullptr);
     CTYPE ("Time constant (ps) and reference temperature (K)");
-    STYPE ("tau-t",   is->tau_t,      NULL);
-    STYPE ("ref-t",   is->ref_t,      NULL);
+    STYPE ("tau-t",   is->tau_t,      nullptr);
+    STYPE ("ref-t",   is->ref_t,      nullptr);
     CTYPE ("pressure coupling");
     EETYPE("pcoupl",  ir->epc,        epcoupl_names);
     EETYPE("pcoupltype",  ir->epct,       epcoupltype_names);
     ITYPE ("nstpcouple", ir->nstpcouple,  -1);
     CTYPE ("Time constant (ps), compressibility (1/bar) and reference P (bar)");
     RTYPE ("tau-p",   ir->tau_p,  1.0);
-    STYPE ("compressibility", dumstr[0],  NULL);
-    STYPE ("ref-p",       dumstr[1],      NULL);
+    STYPE ("compressibility", dumstr[0],  nullptr);
+    STYPE ("ref-p",       dumstr[1],      nullptr);
     CTYPE ("Scaling of reference coordinates, No, All or COM");
     EETYPE ("refcoord-scaling", ir->refcoord_scaling, erefscaling_names);
 
@@ -2048,41 +2048,41 @@ void get_ir(const char *mdparin, const char *mdparout,
     CCTYPE ("OPTIONS FOR QMMM calculations");
     EETYPE("QMMM", ir->bQMMM, yesno_names);
     CTYPE ("Groups treated Quantum Mechanically");
-    STYPE ("QMMM-grps",  is->QMMM,          NULL);
+    STYPE ("QMMM-grps",  is->QMMM,          nullptr);
     CTYPE ("QM method");
-    STYPE("QMmethod",     is->QMmethod, NULL);
+    STYPE("QMmethod",     is->QMmethod, nullptr);
     CTYPE ("QMMM scheme");
     EETYPE("QMMMscheme",  ir->QMMMscheme,    eQMMMscheme_names);
     CTYPE ("QM basisset");
-    STYPE("QMbasis",      is->QMbasis, NULL);
+    STYPE("QMbasis",      is->QMbasis, nullptr);
     CTYPE ("QM charge");
-    STYPE ("QMcharge",    is->QMcharge, NULL);
+    STYPE ("QMcharge",    is->QMcharge, nullptr);
     CTYPE ("QM multiplicity");
-    STYPE ("QMmult",      is->QMmult, NULL);
+    STYPE ("QMmult",      is->QMmult, nullptr);
     CTYPE ("Surface Hopping");
-    STYPE ("SH",          is->bSH, NULL);
+    STYPE ("SH",          is->bSH, nullptr);
     CTYPE ("CAS space options");
-    STYPE ("CASorbitals",      is->CASorbitals,   NULL);
-    STYPE ("CASelectrons",     is->CASelectrons,  NULL);
-    STYPE ("SAon", is->SAon, NULL);
-    STYPE ("SAoff", is->SAoff, NULL);
-    STYPE ("SAsteps", is->SAsteps, NULL);
+    STYPE ("CASorbitals",      is->CASorbitals,   nullptr);
+    STYPE ("CASelectrons",     is->CASelectrons,  nullptr);
+    STYPE ("SAon", is->SAon, nullptr);
+    STYPE ("SAoff", is->SAoff, nullptr);
+    STYPE ("SAsteps", is->SAsteps, nullptr);
     CTYPE ("Scale factor for MM charges");
     RTYPE ("MMChargeScaleFactor", ir->scalefactor, 1.0);
     CTYPE ("Optimization of QM subsystem");
-    STYPE ("bOPT",          is->bOPT, NULL);
-    STYPE ("bTS",          is->bTS, NULL);
+    STYPE ("bOPT",          is->bOPT, nullptr);
+    STYPE ("bTS",          is->bTS, nullptr);
 
     /* Simulated annealing */
     CCTYPE("SIMULATED ANNEALING");
     CTYPE ("Type of annealing for each temperature group (no/single/periodic)");
-    STYPE ("annealing",   is->anneal,      NULL);
+    STYPE ("annealing",   is->anneal,      nullptr);
     CTYPE ("Number of time points to use for specifying annealing in each group");
-    STYPE ("annealing-npoints", is->anneal_npoints, NULL);
+    STYPE ("annealing-npoints", is->anneal_npoints, nullptr);
     CTYPE ("List of times at the annealing points for each group");
-    STYPE ("annealing-time",       is->anneal_time,       NULL);
+    STYPE ("annealing-time",       is->anneal_time,       nullptr);
     CTYPE ("Temp. at each annealing point, for each group.");
-    STYPE ("annealing-temp",  is->anneal_temp,  NULL);
+    STYPE ("annealing-temp",  is->anneal_temp,  nullptr);
 
     /* Startup run */
     CCTYPE ("GENERATE VELOCITIES FOR STARTUP RUN");
@@ -2116,7 +2116,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     /* Energy group exclusions */
     CCTYPE ("ENERGY GROUP EXCLUSIONS");
     CTYPE ("Pairs of energy groups for which all non-bonded interactions are excluded");
-    STYPE ("energygrp-excl", is->egpexcl,     NULL);
+    STYPE ("energygrp-excl", is->egpexcl,     nullptr);
 
     /* Walls */
     CCTYPE ("WALLS");
@@ -2124,8 +2124,8 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE ("nwall", ir->nwall, 0);
     EETYPE("wall-type",     ir->wall_type,   ewt_names);
     RTYPE ("wall-r-linpot", ir->wall_r_linpot, -1);
-    STYPE ("wall-atomtype", is->wall_atomtype, NULL);
-    STYPE ("wall-density",  is->wall_density,  NULL);
+    STYPE ("wall-atomtype", is->wall_atomtype, nullptr);
+    STYPE ("wall-density",  is->wall_density,  nullptr);
     RTYPE ("wall-ewald-zfac", ir->wall_ewald_zfac, 3);
 
     /* COM pulling */
@@ -2150,7 +2150,7 @@ void get_ir(const char *mdparin, const char *mdparout,
     /* Interactive MD */
     ir->bIMD = FALSE;
     CCTYPE("Group to display and/or manipulate in interactive MD session");
-    STYPE ("IMD-group", is->imd_grp, NULL);
+    STYPE ("IMD-group", is->imd_grp, nullptr);
     if (is->imd_grp[0] != '\0')
     {
         snew(ir->imd, 1);
@@ -2174,14 +2174,14 @@ void get_ir(const char *mdparin, const char *mdparout,
     CTYPE ("Orientation restraints force constant and tau for time averaging");
     RTYPE ("orire-fc",    ir->orires_fc,  0.0);
     RTYPE ("orire-tau",   ir->orires_tau, 0.0);
-    STYPE ("orire-fitgrp", is->orirefitgrp,    NULL);
+    STYPE ("orire-fitgrp", is->orirefitgrp,    nullptr);
     CTYPE ("Output frequency for trace(SD) and S to energy file");
     ITYPE ("nstorireout", ir->nstorireout, 100);
 
     /* free energy variables */
     CCTYPE ("Free energy variables");
     EETYPE("free-energy", ir->efep, efep_names);
-    STYPE ("couple-moltype",  is->couple_moltype,  NULL);
+    STYPE ("couple-moltype",  is->couple_moltype,  nullptr);
     EETYPE("couple-lambda0", opts->couple_lam0, couple_lam);
     EETYPE("couple-lambda1", opts->couple_lam1, couple_lam);
     EETYPE("couple-intramol", opts->bCoupleIntra, yesno_names);
@@ -2192,15 +2192,15 @@ void get_ir(const char *mdparin, const char *mdparout,
     ITYPE ("init-lambda-state", fep->init_fep_state, -1);
     RTYPE ("delta-lambda", fep->delta_lambda, 0.0);
     ITYPE ("nstdhdl", fep->nstdhdl, 50);
-    STYPE ("fep-lambdas", is->fep_lambda[efptFEP], NULL);
-    STYPE ("mass-lambdas", is->fep_lambda[efptMASS], NULL);
-    STYPE ("coul-lambdas", is->fep_lambda[efptCOUL], NULL);
-    STYPE ("vdw-lambdas", is->fep_lambda[efptVDW], NULL);
-    STYPE ("bonded-lambdas", is->fep_lambda[efptBONDED], NULL);
-    STYPE ("restraint-lambdas", is->fep_lambda[efptRESTRAINT], NULL);
-    STYPE ("temperature-lambdas", is->fep_lambda[efptTEMPERATURE], NULL);
+    STYPE ("fep-lambdas", is->fep_lambda[efptFEP], nullptr);
+    STYPE ("mass-lambdas", is->fep_lambda[efptMASS], nullptr);
+    STYPE ("coul-lambdas", is->fep_lambda[efptCOUL], nullptr);
+    STYPE ("vdw-lambdas", is->fep_lambda[efptVDW], nullptr);
+    STYPE ("bonded-lambdas", is->fep_lambda[efptBONDED], nullptr);
+    STYPE ("restraint-lambdas", is->fep_lambda[efptRESTRAINT], nullptr);
+    STYPE ("temperature-lambdas", is->fep_lambda[efptTEMPERATURE], nullptr);
     ITYPE ("calc-lambda-neighbors", fep->lambda_neighbors, 1);
-    STYPE ("init-lambda-weights", is->lambda_weights, NULL);
+    STYPE ("init-lambda-weights", is->lambda_weights, nullptr);
     EETYPE("dhdl-print-energy", fep->edHdLPrintEnergy, edHdLPrintEnergy_names);
     RTYPE ("sc-alpha", fep->sc_alpha, 0.0);
     ITYPE ("sc-power", fep->sc_power, 1);
@@ -2217,12 +2217,12 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* Non-equilibrium MD stuff */
     CCTYPE("Non-equilibrium MD stuff");
-    STYPE ("acc-grps",    is->accgrps,        NULL);
-    STYPE ("accelerate",  is->acc,            NULL);
-    STYPE ("freezegrps",  is->freeze,         NULL);
-    STYPE ("freezedim",   is->frdim,          NULL);
+    STYPE ("acc-grps",    is->accgrps,        nullptr);
+    STYPE ("accelerate",  is->acc,            nullptr);
+    STYPE ("freezegrps",  is->freeze,         nullptr);
+    STYPE ("freezedim",   is->frdim,          nullptr);
     RTYPE ("cos-acceleration", ir->cos_accel, 0);
-    STYPE ("deform",      is->deform,         NULL);
+    STYPE ("deform",      is->deform,         nullptr);
 
     /* simulated tempering variables */
     CCTYPE("simulated tempering variables");
@@ -2285,14 +2285,14 @@ void get_ir(const char *mdparin, const char *mdparout,
             snew(ir->swap->grp[i].molname, STRLEN);
         }
         CTYPE("Two index groups that contain the compartment-partitioning atoms");
-        STYPE("split-group0", ir->swap->grp[eGrpSplit0].molname, NULL);
-        STYPE("split-group1", ir->swap->grp[eGrpSplit1].molname, NULL);
+        STYPE("split-group0", ir->swap->grp[eGrpSplit0].molname, nullptr);
+        STYPE("split-group1", ir->swap->grp[eGrpSplit1].molname, nullptr);
         CTYPE("Use center of mass of split groups (yes/no), otherwise center of geometry is used");
         EETYPE("massw-split0", ir->swap->massw_split[0], yesno_names);
         EETYPE("massw-split1", ir->swap->massw_split[1], yesno_names);
 
         CTYPE("Name of solvent molecules");
-        STYPE("solvent-group", ir->swap->grp[eGrpSolvent].molname, NULL);
+        STYPE("solvent-group", ir->swap->grp[eGrpSolvent].molname, nullptr);
 
         CTYPE("Split cylinder: radius, upper and lower extension (nm) (this will define the channels)");
         CTYPE("Note that the split cylinder settings do not have an influence on the swapping protocol,");
@@ -2315,7 +2315,7 @@ void get_ir(const char *mdparin, const char *mdparout,
             int ig = eSwapFixedGrpNR + i;
 
             sprintf(buf, "iontype%d-name", i);
-            STYPE(buf, ir->swap->grp[ig].molname, NULL);
+            STYPE(buf, ir->swap->grp[ig].molname, nullptr);
             sprintf(buf, "iontype%d-in-A", i);
             ITYPE(buf, ir->swap->grp[ig].nmolReq[0], -1);
             sprintf(buf, "iontype%d-in-B", i);
@@ -2343,8 +2343,8 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* User defined thingies */
     CCTYPE ("User defined thingies");
-    STYPE ("user1-grps",  is->user1,          NULL);
-    STYPE ("user2-grps",  is->user2,          NULL);
+    STYPE ("user1-grps",  is->user1,          nullptr);
+    STYPE ("user2-grps",  is->user2,          nullptr);
     ITYPE ("userint1",    ir->userint1,   0);
     ITYPE ("userint2",    ir->userint2,   0);
     ITYPE ("userint3",    ir->userint3,   0);
@@ -2437,7 +2437,7 @@ void get_ir(const char *mdparin, const char *mdparout,
         ir->nstcomm = 0;
     }
 
-    opts->couple_moltype = NULL;
+    opts->couple_moltype = nullptr;
     if (strlen(is->couple_moltype) > 0)
     {
         if (ir->efep != efepNO)
@@ -2526,7 +2526,7 @@ void get_ir(const char *mdparin, const char *mdparout,
 
     /* ORIENTATION RESTRAINT PARAMETERS */
 
-    if (opts->bOrire && str_nelem(is->orirefitgrp, MAXPTR, NULL) != 1)
+    if (opts->bOrire && str_nelem(is->orirefitgrp, MAXPTR, nullptr) != 1)
     {
         warning_error(wi, "ERROR: Need one orientation restraint fit group\n");
     }
@@ -2779,7 +2779,7 @@ static gmx_bool do_numbering(int natoms, gmx_groups_t *groups, int ng, char *ptr
     {
         /* All atoms are part of one (or no) group, no index required */
         groups->ngrpnr[gtype] = 0;
-        groups->grpnr[gtype]  = NULL;
+        groups->grpnr[gtype]  = nullptr;
     }
     else
     {
@@ -3229,7 +3229,7 @@ void do_index(const char* mdparin, const char *ndx,
     {
         fprintf(stderr, "processing index file...\n");
     }
-    if (ndx == NULL)
+    if (ndx == nullptr)
     {
         snew(grps, 1);
         snew(grps->index, 1);
@@ -3407,8 +3407,8 @@ void do_index(const char* mdparin, const char *ndx,
         {
             ir->opts.annealing[i]      = eannNO;
             ir->opts.anneal_npoints[i] = 0;
-            ir->opts.anneal_time[i]    = NULL;
-            ir->opts.anneal_temp[i]    = NULL;
+            ir->opts.anneal_time[i]    = nullptr;
+            ir->opts.anneal_temp[i]    = nullptr;
         }
         if (nSA > 0)
         {
@@ -3961,7 +3961,7 @@ check_combination_rule_differences(const gmx_mtop_t *mtop, int state,
      */
     tol = 1e-5;
     ptr = getenv("GMX_LJCOMB_TOL");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         double            dbl;
         double gmx_unused canary;
index 4c407ef30edb6d9fdcca21f9d43a05047264f4ae..161674e1be460d65a2d481db5603d5387219ecfa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -363,7 +363,7 @@ char **read_pullparams(int *ninp_p, t_inpfile **inp_p,
         {
             sprintf(wbuf, "%s should contain %d pull group indices with geometry %s",
                     buf, pcrd->ngroup, epullg_names[pcrd->eGeom]);
-            set_warning_line(wi, NULL, -1);
+            set_warning_line(wi, nullptr, -1);
             warning_error(wi, wbuf);
         }
         for (int g = 0; g < pcrd->ngroup; g++)
@@ -513,9 +513,9 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
     double         t_start;
 
     pull      = ir->pull;
-    pull_work = init_pull(NULL, pull, ir, 0, NULL, mtop, NULL, oenv, lambda, FALSE, 0);
-    md        = init_mdatoms(NULL, mtop, ir->efep);
-    atoms2md(mtop, ir, -1, NULL, mtop->natoms, md);
+    pull_work = init_pull(nullptr, pull, ir, 0, nullptr, mtop, nullptr, oenv, lambda, FALSE, 0);
+    md        = init_mdatoms(nullptr, mtop, ir->efep);
+    atoms2md(mtop, ir, -1, nullptr, mtop->natoms, md);
     if (ir->efep)
     {
         update_mdatoms(md, lambda);
@@ -525,7 +525,7 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
 
     t_start = ir->init_t + ir->init_step*ir->delta_t;
 
-    pull_calc_coms(NULL, pull_work, md, &pbc, t_start, x, NULL);
+    pull_calc_coms(nullptr, pull_work, md, &pbc, t_start, x, nullptr);
 
     fprintf(stderr, "Pull group  natoms  pbc atom  distance at start  reference at t=0\n");
     for (c = 0; c < pull->ncoord; c++)
index 91404be809d545dd73f14baed7603f3b648ac9d9..e92b8e45a34c38308454f303aaf8b4b93fe28fc3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -286,7 +286,7 @@ extern void set_reference_positions(
                 gmx_fatal(FARGS, "Number of atoms in file %s (%d) does not match the number of atoms in rotation group (%d)!\n",
                           reffile, header.natoms, rotg->nat);
             }
-            gmx_trr_read_single_frame(reffile, &header.step, &header.t, &header.lambda, f_box, &header.natoms, rotg->x_ref, NULL, NULL);
+            gmx_trr_read_single_frame(reffile, &header.step, &header.t, &header.lambda, f_box, &header.natoms, rotg->x_ref, nullptr, nullptr);
 
             /* Check whether the box is unchanged and output a warning if not: */
             check_box_unchanged(f_box, box, reffile, wi);
@@ -299,7 +299,7 @@ extern void set_reference_positions(
                 ii = rotg->ind[i];
                 copy_rvec(x[ii], rotg->x_ref[i]);
             }
-            gmx_trr_write_single_frame(reffile, g, 0.0, 0.0, box, rotg->nat, rotg->x_ref, NULL, NULL);
+            gmx_trr_write_single_frame(reffile, g, 0.0, 0.0, box, rotg->nat, rotg->x_ref, nullptr, nullptr);
         }
     }
 }
index 44dcc5f4b61e5fa61f190334af2c103aa5d1e791..a821f6461796dfca5f6cc6739ea7916d7a0dbd4e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,7 +79,7 @@ gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
             /* Skip blank or comment-only lines */
             do
             {
-                if (fgets2(buf, STRLEN, in) != NULL)
+                if (fgets2(buf, STRLEN, in) != nullptr)
                 {
                     strip_comment(buf);
                     trim(buf);
@@ -122,7 +122,7 @@ static void print_resatoms(FILE *out, gpp_atomtype_t atype, t_restp *rtp)
     {
         tp   = rtp->atom[j].type;
         tpnm = get_atomtype_name(tp, atype);
-        if (tpnm == NULL)
+        if (tpnm == nullptr)
         {
             gmx_fatal(FARGS, "Incorrect atomtype (%d)", tp);
         }
@@ -140,11 +140,11 @@ static gmx_bool read_atoms(FILE *in, char *line,
 
     /* Read Atoms */
     maxentries   = 0;
-    r0->atom     =     NULL;
-    r0->atomname = NULL;
-    r0->cgnr     =     NULL;
+    r0->atom     =     nullptr;
+    r0->atomname = nullptr;
+    r0->cgnr     =     nullptr;
     i            = 0;
-    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == NULL))
+    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == nullptr))
     {
         if (sscanf(line, "%s%s%lf%d", buf, buf1, &q, &cg) != 4)
         {
@@ -184,7 +184,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
     int  j, n, ni, maxrb;
 
     maxrb = rtp->rb[bt].nb;
-    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == NULL))
+    while (get_a_line(in, line, STRLEN) && (strchr(line, '[') == nullptr))
     {
         if (rtp->rb[bt].nb >= maxrb)
         {
@@ -206,7 +206,7 @@ gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
         }
         for (; j < MAXATOMLIST; j++)
         {
-            rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = NULL;
+            rtp->rb[bt].b[rtp->rb[bt].nb].a[j] = nullptr;
         }
         while (isspace(line[n]))
         {
index 93f9ba6c49e63ffbe7e4880f1ab8d83cab5206cf..f576d62ac120936aa1e7671298bac7a5d9ce6b5f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -86,7 +86,7 @@ static void sort_molecule(t_atoms **atoms_solvt, std::vector<RVec> *x,
     atoms = *atoms_solvt;
 
     /* copy each residue from *atoms to a molecule in *molecule */
-    moltypes   = NULL;
+    moltypes   = nullptr;
     nrmoltypes = 0;
     for (i = 0; i < atoms->nr; i++)
     {
@@ -311,7 +311,7 @@ static void replicateSolventBox(t_atoms *atoms, std::vector<RVec> *x,
     // but not in all).
     t_atoms           newAtoms;
     init_t_atoms(&newAtoms, 0, FALSE);
-    gmx::AtomsBuilder builder(&newAtoms, NULL);
+    gmx::AtomsBuilder builder(&newAtoms, nullptr);
     builder.reserve(atoms->nr * nmol, atoms->nres * nmol);
     std::vector<RVec> newX(atoms->nr * nmol);
     std::vector<RVec> newV(!v->empty() ? atoms->nr * nmol : 0);
@@ -615,7 +615,7 @@ static void add_solv(const char *fn, t_topology *top,
 
     char             *filename = gmxlibfn(fn);
     snew(top_solvt, 1);
-    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : NULL,
+    readConformation(filename, top_solvt, &x_solvt, !v->empty() ? &v_solvt : nullptr,
                      &ePBC_solvt, box_solvt, "solvent");
     t_atoms *atoms_solvt = &top_solvt->atoms;
     if (0 == atoms_solvt->nr)
@@ -732,7 +732,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             bSkip = FALSE;
             line++;
             strcpy(buf2, buf);
-            if ((temp = strchr(buf2, '\n')) != NULL)
+            if ((temp = strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -740,7 +740,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             if (buf2[0] == '[')
             {
                 buf2[0] = ' ';
-                if ((temp = strchr(buf2, '\n')) != NULL)
+                if ((temp = strchr(buf2, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -781,7 +781,7 @@ static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
             }
             if (bSkip)
             {
-                if ((temp = strchr(buf, '\n')) != NULL)
+                if ((temp = strchr(buf, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -876,8 +876,8 @@ int gmx_solvate(int argc, char *argv[])
     t_filenm    fnm[] = {
         { efSTX, "-cp", "protein", ffOPTRD },
         { efSTX, "-cs", "spc216",  ffLIBRD},
-        { efSTO, NULL,  NULL,      ffWRITE},
-        { efTOP, NULL,  NULL,      ffOPTRW},
+        { efSTO, nullptr,  nullptr,      ffWRITE},
+        { efTOP, nullptr,  nullptr,      ffOPTRW},
     };
 #define NFILE asize(fnm)
 
@@ -928,7 +928,7 @@ int gmx_solvate(int argc, char *argv[])
         /* Generate a solute configuration */
         conf_prot = opt2fn("-cp", NFILE, fnm);
         readConformation(conf_prot, top, &x,
-                         bReadV ? &v : NULL, &ePBC, box, "solute");
+                         bReadV ? &v : nullptr, &ePBC, box, "solute");
         if (bReadV && v.empty())
         {
             fprintf(stderr, "Note: no velocities found\n");
@@ -961,7 +961,7 @@ int gmx_solvate(int argc, char *argv[])
     fprintf(stderr, "Writing generated configuration to %s\n", confout);
     const char *outputTitle = (bProt ? *top->name : "Generated by gmx solvate");
     write_sto_conf(confout, outputTitle, &top->atoms, as_rvec_array(x.data()),
-                   !v.empty() ? as_rvec_array(v.data()) : NULL, ePBC, box);
+                   !v.empty() ? as_rvec_array(v.data()) : nullptr, ePBC, box);
 
     /* print size of generated configuration */
     fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
index 74145c5cd244299318a357287c7716edebd75fed..912c9e38bec8b5bd87af0e95fa446eb0c25afcc5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ t_specbond *get_specbonds(int *nspecbond)
 {
     const char  *sbfile = "specbond.dat";
 
-    t_specbond  *sb = NULL;
+    t_specbond  *sb = nullptr;
     char         r1buf[32], r2buf[32], a1buf[32], a2buf[32], nr1buf[32], nr2buf[32];
     double       length;
     int          nb1, nb2;
@@ -226,8 +226,8 @@ static void rename_1res(t_atoms *pdba, int resind, char *newres, gmx_bool bVerbo
 int mk_specbonds(t_atoms *pdba, rvec x[], gmx_bool bInteractive,
                  t_ssbond **specbonds, gmx_bool bVerbose)
 {
-    t_specbond *sb    = NULL;
-    t_ssbond   *bonds = NULL;
+    t_specbond *sb    = nullptr;
+    t_ssbond   *bonds = nullptr;
     int         nsb;
     int         nspec, nbonds;
     int        *specp, *sgp;
index 08643245516406d5b46c9c8561913acbbb4f0c8d..1af82e44cead84faef392e6acd1cb34ca5a86589 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -122,7 +122,7 @@ static void read_atom(char *line, gmx_bool bAdd,
         }
         else
         {
-            *nname = NULL;
+            *nname = nullptr;
         }
     }
     a->type = get_atomtype_type(buf[i++], atype);
@@ -166,19 +166,19 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
         ndel  = 0;
         for (j = 0; j < tb[i].nhack; j++)
         {
-            if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname != NULL)
+            if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname != nullptr)
             {
                 nrepl++;
             }
-            else if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname != NULL)
+            else if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname != nullptr)
             {
                 nadd++;
             }
-            else if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname == NULL)
+            else if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname == nullptr)
             {
                 ndel++;
             }
-            else if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname == NULL)
+            else if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname == nullptr)
             {
                 gmx_fatal(FARGS, "invalid hack (%s) in termini database", tb[i].name);
             }
@@ -188,7 +188,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwRepl-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname != NULL)
+                if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname != nullptr)
                 {
                     fprintf(out, "%s\t", tb[i].hack[j].oname);
                     print_atom(out, tb[i].hack[j].atom, atype);
@@ -200,7 +200,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwAdd-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname == NULL && tb[i].hack[j].nname != NULL)
+                if (tb[i].hack[j].oname == nullptr && tb[i].hack[j].nname != nullptr)
                 {
                     print_ab(out, &(tb[i].hack[j]), tb[i].hack[j].nname);
                     print_atom(out, tb[i].hack[j].atom, atype);
@@ -212,7 +212,7 @@ static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
             fprintf(out, "[ %s ]\n", kw_names[ekwDel-ebtsNR-1]);
             for (j = 0; j < tb[i].nhack; j++)
             {
-                if (tb[i].hack[j].oname != NULL && tb[i].hack[j].nname == NULL)
+                if (tb[i].hack[j].oname != nullptr && tb[i].hack[j].nname == nullptr)
                 {
                     fprintf(out, "%s\n", tb[i].hack[j].oname);
                 }
@@ -255,7 +255,7 @@ static void read_ter_db_file(char *fn,
     fflib_filename_base(fn, filebase, STRLEN);
     /* Remove the C/N termini extension */
     ptr = strrchr(filebase, '.');
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         ptr[0] = '\0';
     }
@@ -314,7 +314,7 @@ static void read_ter_db_file(char *fn,
                 clear_t_hack(&(tb[nb].hack[nh]));
                 for (i = 0; i < 4; i++)
                 {
-                    tb[nb].hack[nh].a[i] = NULL;
+                    tb[nb].hack[nh].a[i] = nullptr;
                 }
                 tb[nb].nhack++;
 
@@ -347,9 +347,9 @@ static void read_ter_db_file(char *fn,
                     read_atom(line+n, kwnr == ekwAdd,
                               &tb[nb].hack[nh].nname, tb[nb].hack[nh].atom, atype,
                               &tb[nb].hack[nh].cgnr);
-                    if (tb[nb].hack[nh].nname == NULL)
+                    if (tb[nb].hack[nh].nname == nullptr)
                     {
-                        if (tb[nb].hack[nh].oname != NULL)
+                        if (tb[nb].hack[nh].oname != nullptr)
                         {
                             tb[nb].hack[nh].nname = gmx_strdup(tb[nb].hack[nh].oname);
                         }
@@ -379,7 +379,7 @@ static void read_ter_db_file(char *fn,
                 }
                 for (; j < MAXATOMLIST; j++)
                 {
-                    tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = NULL;
+                    tb[nb].rb[kwnr].b[tb[nb].rb[kwnr].nb].a[j] = nullptr;
                 }
                 strcpy(buf, "");
                 sscanf(line+n, "%s", buf);
@@ -418,7 +418,7 @@ int read_ter_db(const char *ffdir, char ter,
      */
     ntdbf  = fflib_search_file_end(ffdir, ext, FALSE, &tdbf);
     ntb    = 0;
-    *tbptr = NULL;
+    *tbptr = nullptr;
     for (f = 0; f < ntdbf; f++)
     {
         read_ter_db_file(tdbf[f], &ntb, tbptr, atype);
@@ -472,7 +472,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
     restp         = get_restp(rtpname_match, nrtp, rtp);
 
     n    = 0;
-    list = NULL;
+    list = nullptr;
 
     for (i = 0; i < nb; i++)
     {
@@ -497,13 +497,13 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
             {
                 /* advance to next |-separated field */
                 s = strchr(s, '|');
-                if (s != NULL)
+                if (s != nullptr)
                 {
                     s++;
                 }
             }
         }
-        while (!found && s != NULL);
+        while (!found && s != nullptr);
     }
 
     /* All residue-specific termini have been added. We might have to fall
@@ -536,7 +536,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
                 /* A conjunction hyphen normally indicates a residue-specific
                    terminus, which is named like "GLY-COOH". A generic terminus
                    won't have a hyphen. */
-                bool bFoundAnyHyphen = (c != NULL);
+                bool bFoundAnyHyphen = (c != nullptr);
                 /* '-' as the last character indicates charge, so if that's
                    the only one found e.g. "COO-", then it was not a conjunction
                    hyphen, so this is a generic terminus */
@@ -549,7 +549,7 @@ t_hackblock **filter_ter(int nrtp, t_restp rtp[],
                     /* Check that we haven't already added a residue-specific version
                      * of this terminus.
                      */
-                    for (j = 0; j < n && strstr((*list[j]).name, s) == NULL; j++)
+                    for (j = 0; j < n && strstr((*list[j]).name, s) == nullptr; j++)
                     {
                         ;
                     }
index c2e1ebe4b41eb6ccccb47e1e5fbd5448148e37dc..97523622ec38fb414f814b8c3562ce937627a969 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -65,7 +65,7 @@ static t_2morse *read_dissociation_energies(int *n2morse)
     char        ai[32], aj[32];
     double      e_diss;
     const char *fn     = "edissoc.dat";
-    t_2morse   *t2m    = NULL;
+    t_2morse   *t2m    = nullptr;
     int         maxn2m = 0, n2m = 0;
     int         nread;
 
index 6120e2d155a76b8ac59849e2c8806cce1b170b4a..b955ba2d91ad3dfd5dedff082b2af3d4e3c5ed9f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -331,7 +331,7 @@ directive str2dir (char *dstr)
     return d_invalid;
 }
 
-static directive **necessary = NULL;
+static directive **necessary = nullptr;
 
 static void set_nec(directive **n, ...)
 /* Must always have at least one extra argument */
@@ -353,7 +353,7 @@ static void set_nec(directive **n, ...)
 
 void DS_Init(DirStack **DS)
 {
-    if (necessary == NULL)
+    if (necessary == nullptr)
     {
         int i;
 
@@ -423,7 +423,7 @@ void DS_Init(DirStack **DS)
             }
         }
     }
-    *DS = NULL;
+    *DS = nullptr;
 
 }
 
@@ -431,7 +431,7 @@ void DS_Done (DirStack **DS)
 {
     DirStack *D;
 
-    while (*DS != NULL)
+    while (*DS != nullptr)
     {
         D   = *DS;
         *DS = (*DS)->prev;
@@ -454,12 +454,12 @@ int DS_Search(DirStack *DS, directive d)
     DirStack *D;
 
     D = DS;
-    while ((D != NULL) && (D->d != d))
+    while ((D != nullptr) && (D->d != d))
     {
         D = D->prev;
     }
 
-    return (D != NULL);
+    return (D != nullptr);
 }
 
 int DS_Check_Order(DirStack *DS, directive d)
index 0b2cd30e6d173f776daa11e14d6678792d21434c..be75d31152329a6711ccdad97d5c33d317c863da 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -272,7 +272,7 @@ static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
     }
     if (*nb == -1)
     {
-        *nb = strtol(nb_str, NULL, 10);
+        *nb = strtol(nb_str, nullptr, 10);
     }
     if ((*nb < 1) || (*nb >= eNBF_NR))
     {
@@ -291,7 +291,7 @@ static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
     }
     if (*comb == -1)
     {
-        *comb = strtol(comb_str, NULL, 10);
+        *comb = strtol(comb_str, nullptr, 10);
     }
     if ((*comb < 1) || (*comb >= eCOMB_NR))
     {
@@ -308,7 +308,7 @@ static char ** cpp_opts(const char *define, const char *include,
     int         n, len;
     int         ncppopts = 0;
     const char *cppadds[2];
-    char      **cppopts   = NULL;
+    char      **cppopts   = nullptr;
     const char *option[2] = { "-D", "-I" };
     const char *nopt[2]   = { "define", "include" };
     const char *ptr;
@@ -357,7 +357,7 @@ static char ** cpp_opts(const char *define, const char *include,
         }
     }
     srenew(cppopts, ++ncppopts);
-    cppopts[ncppopts-1] = NULL;
+    cppopts[ncppopts-1] = nullptr;
 
     return cppopts;
 }
@@ -547,7 +547,7 @@ static void make_atoms_sys(int nmolb, const gmx_molblock_t *molb,
     const t_atoms *mol_atoms;
 
     atoms->nr   = 0;
-    atoms->atom = NULL;
+    atoms->atom = nullptr;
 
     for (mb = 0; mb < nmolb; mb++)
     {
@@ -589,14 +589,14 @@ static char **read_topol(const char *infile, const char *outfile,
 {
     FILE           *out;
     int             i, sl, nb_funct;
-    char           *pline = NULL, **title = NULL;
+    char           *pline = nullptr, **title = nullptr;
     char            line[STRLEN], errbuf[256], comb_str[256], nb_str[256];
     char            genpairs[32];
     char           *dirstr, *dummy2;
     int             nrcopies, nmol, nmolb = 0, nscan, ncombs, ncopy;
     double          fLJ, fQQ, fPOW;
-    gmx_molblock_t *molb  = NULL;
-    t_molinfo      *mi0   = NULL;
+    gmx_molblock_t *molb  = nullptr;
+    t_molinfo      *mi0   = nullptr;
     DirStack       *DS;
     directive       d, newd;
     t_nbparam     **nbparam, **pair;
@@ -610,7 +610,7 @@ static char **read_topol(const char *infile, const char *outfile,
     /* File handling variables */
     int             status, done;
     gmx_cpp_t       handle;
-    char           *tmp_line = NULL;
+    char           *tmp_line = nullptr;
     char            warn_buf[STRLEN];
     const char     *floating_point_arithmetic_tip =
         "Total charge should normally be an integer. See\n"
@@ -625,7 +625,7 @@ static char **read_topol(const char *infile, const char *outfile,
     }
     else
     {
-        out = NULL;
+        out = nullptr;
     }
 
     /* open input file */
@@ -639,14 +639,14 @@ static char **read_topol(const char *infile, const char *outfile,
     DS_Init(&DS);         /* directive stack                    */
     nmol     = 0;         /* no molecules yet...                        */
     d        = d_invalid; /* first thing should be a directive   */
-    nbparam  = NULL;      /* The temporary non-bonded matrix       */
-    pair     = NULL;      /* The temporary pair interaction matrix */
-    block2   = NULL;      /* the extra exclusions                       */
+    nbparam  = nullptr;   /* The temporary non-bonded matrix       */
+    pair     = nullptr;   /* The temporary pair interaction matrix */
+    block2   = nullptr;   /* the extra exclusions                       */
     nb_funct = F_LJ;
 
     *reppow  = 12.0;      /* Default value for repulsion power     */
 
-    *intermolecular_interactions = NULL;
+    *intermolecular_interactions = nullptr;
 
     /* Init the number of CMAP torsion angles  and grid spacing */
     plist[F_CMAP].grid_spacing = 0;
@@ -736,7 +736,7 @@ static char **read_topol(const char *infile, const char *outfile,
                      * skip spaces and tabs on either side of directive
                      */
                     dirstr = gmx_strdup((pline+1));
-                    if ((dummy2 = strchr (dirstr, CLOSEDIR)) != NULL)
+                    if ((dummy2 = strchr (dirstr, CLOSEDIR)) != nullptr)
                     {
                         (*dummy2) = 0;
                     }
@@ -770,7 +770,7 @@ static char **read_topol(const char *infile, const char *outfile,
 
                         if (d == d_intermolecular_interactions)
                         {
-                            if (*intermolecular_interactions == NULL)
+                            if (*intermolecular_interactions == nullptr)
                             {
                                 /* We (mis)use the moleculetype processing
                                  * to process the intermolecular interactions
@@ -840,14 +840,14 @@ static char **read_topol(const char *infile, const char *outfile,
                             break;
                         case d_atomtypes:
                             push_at(symtab, atype, batype, pline, nb_funct,
-                                    &nbparam, bGenPairs ? &pair : NULL, wi);
+                                    &nbparam, bGenPairs ? &pair : nullptr, wi);
                             break;
 
                         case d_bondtypes:
-                            push_bt(d, plist, 2, NULL, batype, pline, wi);
+                            push_bt(d, plist, 2, nullptr, batype, pline, wi);
                             break;
                         case d_constrainttypes:
-                            push_bt(d, plist, 2, NULL, batype, pline, wi);
+                            push_bt(d, plist, 2, nullptr, batype, pline, wi);
                             break;
                         case d_pairtypes:
                             if (bGenPairs)
@@ -856,11 +856,11 @@ static char **read_topol(const char *infile, const char *outfile,
                             }
                             else
                             {
-                                push_bt(d, plist, 2, atype, NULL, pline, wi);
+                                push_bt(d, plist, 2, atype, nullptr, pline, wi);
                             }
                             break;
                         case d_angletypes:
-                            push_bt(d, plist, 3, NULL, batype, pline, wi);
+                            push_bt(d, plist, 3, nullptr, batype, pline, wi);
                             break;
                         case d_dihedraltypes:
                             /* Special routine that can read both 2 and 4 atom dihedral definitions. */
@@ -900,14 +900,14 @@ static char **read_topol(const char *infile, const char *outfile,
                             if (!bReadMolType)
                             {
                                 int ntype;
-                                if (opts->couple_moltype != NULL &&
+                                if (opts->couple_moltype != nullptr &&
                                     (opts->couple_lam0 == ecouplamNONE ||
                                      opts->couple_lam0 == ecouplamQ ||
                                      opts->couple_lam1 == ecouplamNONE ||
                                      opts->couple_lam1 == ecouplamQ))
                                 {
                                     dcatt = add_atomtype_decoupled(symtab, atype,
-                                                                   &nbparam, bGenPairs ? &pair : NULL);
+                                                                   &nbparam, bGenPairs ? &pair : nullptr);
                                 }
                                 ntype  = get_atomtype_ntypes(atype);
                                 ncombs = (ntype*(ntype+1))/2;
@@ -1004,7 +1004,7 @@ static char **read_topol(const char *infile, const char *outfile,
                             molb[nmolb].nmol = nrcopies;
                             nmolb++;
 
-                            bCouple = (opts->couple_moltype != NULL &&
+                            bCouple = (opts->couple_moltype != nullptr &&
                                        (gmx_strcasecmp("system", opts->couple_moltype) == 0 ||
                                         strcmp(*(mi0->name), opts->couple_moltype) == 0));
                             if (bCouple)
@@ -1064,7 +1064,7 @@ static char **read_topol(const char *infile, const char *outfile,
                 }
             }
             sfree(pline);
-            pline = NULL;
+            pline = nullptr;
         }
     }
     while (!done);
@@ -1121,7 +1121,7 @@ static char **read_topol(const char *infile, const char *outfile,
 
     done_bond_atomtype(&batype);
 
-    if (*intermolecular_interactions != NULL)
+    if (*intermolecular_interactions != nullptr)
     {
         sfree(mi0->atoms.atom);
     }
@@ -1164,7 +1164,7 @@ char **do_top(gmx_bool          bVerbose,
     }
     else
     {
-        tmpfile = NULL;
+        tmpfile = nullptr;
     }
 
     if (bVerbose)
@@ -1201,7 +1201,7 @@ static void generate_qmexcl_moltype(gmx_moltype_t *molt, unsigned char *grpnr,
      * not by the gromacs routines
      */
     int       qm_max = 0, qm_nr = 0, link_nr = 0, link_max = 0;
-    int      *qm_arr = NULL, *link_arr = NULL;
+    int      *qm_arr = nullptr, *link_arr = nullptr;
     gmx_bool *bQMMM, *blink;
 
     /* First we search and select the QM atoms in an qm_arr array that
index 6b4f40f119a6aea4d1f76f9b5f3ba6b05db06733..8301865531600f2b453ada14c92a0baca9ff41db 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -703,7 +703,7 @@ void push_bt(directive d, t_params bt[], int nral,
         return;
     }
 
-    ft    = strtol(alc[nral], NULL, 10);
+    ft    = strtol(alc[nral], nullptr, 10);
     ftype = ifunc_index(d, ft);
     nrfp  = NRFP(ftype);
     nrfpA = interaction_function[ftype].nrfpA;
@@ -812,7 +812,7 @@ void push_dihedraltype(directive d, t_params bt[],
     if (nn >= 3 && strlen(alc[2]) == 1 && isdigit(alc[2][0]))
     {
         nral  = 2;
-        ft    = strtol(alc[nral], NULL, 10);
+        ft    = strtol(alc[nral], nullptr, 10);
         /* Move atom types around a bit and use 'X' for wildcard atoms
          * to create a 4-atom dihedral definition with arbitrary atoms in
          * position 1 and 4.
@@ -837,7 +837,7 @@ void push_dihedraltype(directive d, t_params bt[],
     else if (nn == 5 && strlen(alc[4]) == 1 && isdigit(alc[4][0]))
     {
         nral  = 4;
-        ft    = strtol(alc[nral], NULL, 10);
+        ft    = strtol(alc[nral], nullptr, 10);
     }
     else
     {
@@ -1111,9 +1111,9 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
     }
     start += nchar_consumed;
 
-    ft     = strtol(alc[nral], NULL, 10);
-    nxcmap = strtol(alc[nral+1], NULL, 10);
-    nycmap = strtol(alc[nral+2], NULL, 10);
+    ft     = strtol(alc[nral], nullptr, 10);
+    nxcmap = strtol(alc[nral+1], nullptr, 10);
+    nycmap = strtol(alc[nral+2], nullptr, 10);
 
     /* Check for equal grid spacing in x and y dims */
     if (nxcmap != nycmap)
@@ -1124,8 +1124,8 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
 
     ncmap  = nxcmap*nycmap;
     ftype  = ifunc_index(d, ft);
-    nrfpA  = strtol(alc[6], NULL, 10)*strtol(alc[6], NULL, 10);
-    nrfpB  = strtol(alc[7], NULL, 10)*strtol(alc[7], NULL, 10);
+    nrfpA  = strtol(alc[6], nullptr, 10)*strtol(alc[6], nullptr, 10);
+    nrfpB  = strtol(alc[7], nullptr, 10)*strtol(alc[7], nullptr, 10);
     nrfp   = nrfpA+nrfpB;
 
     /* Allocate memory for the CMAP grid */
@@ -1142,7 +1142,7 @@ push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
         }
         nn  = sscanf(line+start+sl, " %s ", s);
         sl += strlen(s);
-        bt[F_CMAP].cmap[i+(bt[F_CMAP].ncmap)-nrfp] = strtod(s, NULL);
+        bt[F_CMAP].cmap[i+(bt[F_CMAP].ncmap)-nrfp] = strtod(s, nullptr);
 
         if (nn == 1)
         {
@@ -1263,7 +1263,7 @@ static void push_atom_now(t_symtab *symtab, t_atoms *at, int atomnr,
             warning_error_and_exit(wi, errbuf, FARGS);
         }
     }
-    resnr = strtol(resnumberic, NULL, 10);
+    resnr = strtol(resnumberic, nullptr, 10);
 
     if (nr > 0)
     {
@@ -1460,7 +1460,7 @@ static gmx_bool default_nb_params(int ftype, t_params bt[], t_atoms *at,
 {
     int          i, j, ti, tj, ntype;
     gmx_bool     bFound;
-    t_param     *pi    = NULL;
+    t_param     *pi    = nullptr;
     int          nr    = bt[ftype].nr;
     int          nral  = NRAL(ftype);
     int          nrfp  = interaction_function[ftype].nrfpA;
@@ -1634,8 +1634,8 @@ static gmx_bool default_params(int ftype, t_params bt[],
 {
     int          nparam_found;
     gmx_bool     bFound, bSame;
-    t_param     *pi    = NULL;
-    t_param     *pj    = NULL;
+    t_param     *pi    = nullptr;
+    t_param     *pj    = nullptr;
     int          nr    = bt[ftype].nr;
     int          nral  = NRAL(ftype);
     int          nrfpA = interaction_function[ftype].nrfpA;
@@ -2237,8 +2237,8 @@ void push_vsitesn(directive d, t_params bond[],
 {
     char   *ptr;
     int     type, ftype, j, n, ret, nj, a;
-    int    *atc    = NULL;
-    double *weight = NULL, weight_tot;
+    int    *atc    = nullptr;
+    double *weight = nullptr, weight_tot;
     t_param param;
     char    errbuf[STRLEN];
 
@@ -2411,7 +2411,7 @@ void init_block2(t_block2 *b2, int natom)
     snew(b2->a, b2->nr);
     for (i = 0; (i < b2->nr); i++)
     {
-        b2->a[i] = NULL;
+        b2->a[i] = nullptr;
     }
 }
 
@@ -2664,7 +2664,7 @@ static void convert_pairs_to_pairsQ(t_params *plist,
 
     /* Empty the LJ14 pairlist */
     plist[F_LJ14].nr    = 0;
-    plist[F_LJ14].param = NULL;
+    plist[F_LJ14].param = nullptr;
 }
 
 static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp_t wi)
index ddd2bd95d80545df1878439bac4947369c02459d..1574962e567fe3a95c50caf14aaec8949c50b5d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -119,15 +119,15 @@ void init_plist(t_params plist[])
     {
         plist[i].nr    = 0;
         plist[i].maxnr = 0;
-        plist[i].param = NULL;
+        plist[i].param = nullptr;
 
         /* CMAP */
         plist[i].ncmap        = 0;
-        plist[i].cmap         = NULL;
+        plist[i].cmap         = nullptr;
         plist[i].grid_spacing = 0;
         plist[i].nc           = 0;
         plist[i].nct          = 0;
-        plist[i].cmap_types   = NULL;
+        plist[i].cmap_types   = nullptr;
     }
 }
 
@@ -459,7 +459,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
         {
             ri = at->atom[i].resind;
             if ((i == 0 || ri != at->atom[i-1].resind) &&
-                at->resinfo[ri].rtp != NULL)
+                at->resinfo[ri].rtp != nullptr)
             {
                 qres = get_residue_charge(at, i);
                 fprintf(out, "; residue %3d %-3s rtp %-4s q ",
@@ -477,7 +477,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
                 fprintf(out, "\n");
             }
             tpA = at->atom[i].type;
-            if ((tpnmA = get_atomtype_name(tpA, atype)) == NULL)
+            if ((tpnmA = get_atomtype_name(tpA, atype)) == nullptr)
             {
                 gmx_fatal(FARGS, "tpA = %d, i= %d in print_atoms", tpA, i);
             }
@@ -496,7 +496,7 @@ void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
             if (PERTURBED(at->atom[i]))
             {
                 tpB = at->atom[i].typeB;
-                if ((tpnmB = get_atomtype_name(tpB, atype)) == NULL)
+                if ((tpnmB = get_atomtype_name(tpB, atype)) == nullptr)
                 {
                     gmx_fatal(FARGS, "tpB = %d, i= %d in print_atoms", tpB, i);
                 }
index bd8d37a190670c561689081e1f4b9077fe399ed1..47aa1f1b45b1bd10f245389df1014ecf9fc2b8fb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -873,9 +873,9 @@ int set_vsites(gmx_bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
                     }
 
                     nrbond = nrang = nridih = 0;
-                    bonds  = NULL;
-                    angles = NULL;
-                    idihs  = NULL;
+                    bonds  = nullptr;
+                    angles = nullptr;
+                    idihs  = nullptr;
                     nrset++;
                     /* now set the vsite parameters: */
                     get_bondeds(NRAL(ftype), plist[ftype].param[i].a, at2vb,
@@ -1050,7 +1050,7 @@ static void clean_vsite_bonds(t_params *plist, t_pindex pindex[],
     for (i = 0; (i < ps->nr); i++) /* for all bonds in the plist */
     {
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
 
         bKeep   = FALSE;
         bRemove = FALSE;
@@ -1307,7 +1307,7 @@ static void clean_vsite_angles(t_params *plist, t_pindex pindex[],
     for (i = 0; (i < ps->nr); i++) /* for all angles in the plist */
     {
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
 
         bKeep    = FALSE;
         bAll3FAD = TRUE;
@@ -1443,7 +1443,7 @@ static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
     {
         int            k, m, n, nvsite;
         int            vsnral      = 0;
-        const int     *first_atoms = NULL;
+        const int     *first_atoms = nullptr;
         int            atom;
         gmx_bool       bKeep, bUsed, bPresent;
 
@@ -1561,7 +1561,7 @@ void clean_vsite_bondeds(t_params *plist, int natoms, gmx_bool bRmVSiteBds)
     t_pindex      *pindex;
     at2vsitecon_t *at2vc;
 
-    pindex = 0; /* avoid warnings */
+    pindex = nullptr; /* avoid warnings */
     /* make vsite_type array */
     snew(vsite_type, natoms);
     for (i = 0; i < natoms; i++)
index 6a189d284266d363cf468d7ce8875a4bc33d9455..4f81fb3e5ab4ac9ef300c96ba605953de4cc3405 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -298,7 +298,7 @@ void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPB
         ai = ang->param[i].ai();
         aj = ang->param[i].aj();
         ak = ang->param[i].ak();
-        th = RAD2DEG*bond_angle(x[ai], x[aj], x[ak], bPBC ? &pbc : NULL,
+        th = RAD2DEG*bond_angle(x[ai], x[aj], x[ak], bPBC ? &pbc : nullptr,
                                 r_ij, r_kj, &costh, &t1, &t2);
         if (debug)
         {
@@ -313,7 +313,7 @@ void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPB
         aj = dih->param[i].aj();
         ak = dih->param[i].ak();
         al = dih->param[i].al();
-        ph = RAD2DEG*dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : NULL,
+        ph = RAD2DEG*dih_angle(x[ai], x[aj], x[ak], x[al], bPBC ? &pbc : nullptr,
                                r_ij, r_kj, r_kl, m, n, &sign, &t1, &t2, &t3);
         if (debug)
         {
@@ -379,7 +379,7 @@ static void print_rtp(const char *filenm, const char *title, t_atoms *atoms,
     for (i = 0; (i < atoms->nr); i++)
     {
         tp = atoms->atom[i].type;
-        if ((tpnm = get_atomtype_name(tp, atype)) == NULL)
+        if ((tpnm = get_atomtype_name(tp, atype)) == nullptr)
         {
             gmx_fatal(FARGS, "tp = %d, i = %d in print_rtp", tp, i);
         }
@@ -515,7 +515,7 @@ int gmx_x2top(int argc, char *argv[])
     }
 
     /* Force field selection, interactive or direct */
-    choose_ff(strcmp(ff, "select") == 0 ? NULL : ff,
+    choose_ff(strcmp(ff, "select") == 0 ? nullptr : ff,
               forcefield, sizeof(forcefield),
               ffdir, sizeof(ffdir));
 
@@ -531,10 +531,10 @@ int gmx_x2top(int argc, char *argv[])
     /* Read coordinates */
     t_topology *top;
     snew(top, 1);
-    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &epbc, &x, NULL, box, FALSE);
+    read_tps_conf(opt2fn("-f", NFILE, fnm), top, &epbc, &x, nullptr, box, FALSE);
     t_atoms  *atoms = &top->atoms;
     natoms = atoms->nr;
-    if (atoms->pdbinfo == NULL)
+    if (atoms->pdbinfo == nullptr)
     {
         snew(atoms->pdbinfo, natoms);
     }
@@ -567,7 +567,7 @@ int gmx_x2top(int argc, char *argv[])
     init_nnb(&nnb, atoms->nr, 4);
     gen_nnb(&nnb, plist);
     print_nnb(&nnb, "NNB");
-    gen_pad(&nnb, atoms, &rtp_header_settings, plist, excls, NULL, TRUE);
+    gen_pad(&nnb, atoms, &rtp_header_settings, plist, excls, nullptr, TRUE);
     done_nnb(&nnb);
 
     if (!bPairs)
@@ -599,9 +599,9 @@ int gmx_x2top(int argc, char *argv[])
         fp = ftp2FILE(efTOP, NFILE, fnm, "w");
         print_top_header(fp, ftp2fn(efTOP, NFILE, fnm), TRUE, ffdir, 1.0);
 
-        write_top(fp, NULL, mymol.name, atoms, FALSE, bts, plist, excls, atype,
+        write_top(fp, nullptr, mymol.name, atoms, FALSE, bts, plist, excls, atype,
                   cgnr, rtp_header_settings.nrexcl);
-        print_top_mols(fp, mymol.name, ffdir, NULL, 0, NULL, 1, &mymol);
+        print_top_mols(fp, mymol.name, ffdir, nullptr, 0, nullptr, 1, &mymol);
 
         gmx_ffclose(fp);
     }
index c89244bff66cf17426997fe353a0bfa41aad60fe..760fd0c1d73ecbcc42f018a386483f02b5dfff46 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -98,11 +98,11 @@ static void get_xlatoms(const char *fn, FILE *fp,
         }
         else
         {
-            xl[n].res = NULL;
+            xl[n].res = nullptr;
         }
 
         /* Replace underscores in the string by spaces */
-        while ((_ptr = strchr(abuf, '_')) != 0)
+        while ((_ptr = strchr(abuf, '_')) != nullptr)
         {
             *_ptr = ' ';
         }
@@ -123,7 +123,7 @@ static void done_xlatom(int nxlate, t_xlate_atom *xlatom)
     for (i = 0; (i < nxlate); i++)
     {
         sfree(xlatom[i].filebase);
-        if (xlatom[i].res != NULL)
+        if (xlatom[i].res != nullptr)
         {
             sfree(xlatom[i].res);
         }
@@ -148,8 +148,8 @@ void rename_atoms(const char *xlfile, const char *ffdir,
     gmx_bool      bStartTerm, bEndTerm;
 
     nxlate = 0;
-    xlatom = NULL;
-    if (xlfile != NULL)
+    xlatom = nullptr;
+    if (xlfile != nullptr)
     {
         fp = libopen(xlfile);
         get_xlatoms(xlfile, fp, &nxlate, &xlatom);
@@ -203,11 +203,11 @@ void rename_atoms(const char *xlfile, const char *ffdir,
         for (i = 0; (i < nxlate) && !bRenamed; i++)
         {
             /* Check if the base file name of the rtp and arn entry match */
-            if (restp == NULL ||
+            if (restp == nullptr ||
                 gmx_strcasecmp(restp[resind].filebase, xlatom[i].filebase) == 0)
             {
                 /* Match the residue name */
-                bMatch = (xlatom[i].res == NULL ||
+                bMatch = (xlatom[i].res == nullptr ||
                           (gmx_strcasecmp("protein-nterm", xlatom[i].res) == 0 &&
                            gmx_residuetype_is_protein(rt, rnm) && bStartTerm) ||
                           (gmx_strcasecmp("protein-cterm", xlatom[i].res) == 0 &&
index f2e423edfbea9d0a656dc138b83b55713b0e4147..fcaed80d22eb83c273d185b5d88d3c1456d3d255 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,6 +49,6 @@ void gpu_set_host_malloc_and_free(bool,
                                   gmx_host_alloc_t **nb_alloc,
                                   gmx_host_free_t  **nb_free)
 {
-    *nb_alloc = NULL;
-    *nb_free  = NULL;
+    *nb_alloc = nullptr;
+    *nb_free  = nullptr;
 }
index b2ec55a6683932120b11300b321a29665817ed16..cdb3ae7ffb72513b799d5977e3b03b6ee68f79a4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -776,7 +776,7 @@ detectProcCpuInfoArm(const std::map<std::string, std::string>   &cpuInfo,
     }
     if (cpuInfo.count("CPU architecture"))
     {
-        *family = std::strtol(cpuInfo.at("CPU architecture").c_str(), NULL, 10);
+        *family = std::strtol(cpuInfo.at("CPU architecture").c_str(), nullptr, 10);
         // For some 64-bit CPUs it appears to say 'AArch64' instead
         if (*family == 0 && cpuInfo.at("CPU architecture").find("AArch64") != std::string::npos)
         {
@@ -785,11 +785,11 @@ detectProcCpuInfoArm(const std::map<std::string, std::string>   &cpuInfo,
     }
     if (cpuInfo.count("CPU variant"))
     {
-        *model    = std::strtol(cpuInfo.at("CPU variant").c_str(), NULL, 16);
+        *model    = std::strtol(cpuInfo.at("CPU variant").c_str(), nullptr, 16);
     }
     if (cpuInfo.count("CPU revision"))
     {
-        *stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), NULL, 10);
+        *stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), nullptr, 10);
     }
 
     if (cpuInfo.count("Features"))
index 5a17e09256ee0c255d888168ec6f833ef4c6244f..910021a6bd8c6bf634e21d6938274055f3b872ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -334,7 +334,7 @@ void gmx_check_hw_runconf_consistency(const gmx::MDLogger &mdlog,
 
     /* GPU emulation detection is done later, but we need here as well
      * -- uncool, but there's no elegant workaround */
-    bEmulateGPU       = (getenv("GMX_EMULATE_GPU") != NULL);
+    bEmulateGPU       = (getenv("GMX_EMULATE_GPU") != nullptr);
 
     if (hwinfo->gpu_info.n_dev_compatible > 0)
     {
@@ -958,14 +958,14 @@ gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog, const t_commrec *
         /* detect GPUs */
         hwinfo_g->gpu_info.n_dev            = 0;
         hwinfo_g->gpu_info.n_dev_compatible = 0;
-        hwinfo_g->gpu_info.gpu_dev          = NULL;
+        hwinfo_g->gpu_info.gpu_dev          = nullptr;
 
         /* Run the detection if the binary was compiled with GPU support
          * and we requested detection.
          */
         hwinfo_g->gpu_info.bDetectGPUs =
             (bGPUBinary && bDetectGPUs &&
-             getenv("GMX_DISABLE_GPU_DETECTION") == NULL);
+             getenv("GMX_DISABLE_GPU_DETECTION") == nullptr);
         if (hwinfo_g->gpu_info.bDetectGPUs)
         {
             gmx_detect_gpus(mdlog, cr);
@@ -1220,7 +1220,7 @@ void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
 {
     const gmx::CpuInfo &cpuInfo = *hwinfo_g->cpuInfo;
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         std::string detected;
 
@@ -1275,24 +1275,24 @@ void gmx_parse_gpu_ids(gmx_gpu_opt_t *gpu_opt)
 {
     char *env;
 
-    if (gpu_opt->gpu_id != NULL && !bGPUBinary)
+    if (gpu_opt->gpu_id != nullptr && !bGPUBinary)
     {
         gmx_fatal(FARGS, "GPU ID string set, but %s was compiled without GPU support!",
                   gmx::getProgramContext().displayName());
     }
 
     env = getenv("GMX_GPU_ID");
-    if (env != NULL && gpu_opt->gpu_id != NULL)
+    if (env != nullptr && gpu_opt->gpu_id != nullptr)
     {
         gmx_fatal(FARGS, "GMX_GPU_ID and -gpu_id can not be used at the same time");
     }
-    if (env == NULL)
+    if (env == nullptr)
     {
         env = gpu_opt->gpu_id;
     }
 
     /* parse GPU IDs if the user passed any */
-    if (env != NULL)
+    if (env != nullptr)
     {
         /* Parse a "plain" or comma-separated GPU ID string which contains a
          * sequence of digits corresponding to GPU IDs; the order will
index 7efeeddf097f0b323bee90db0994ddc2b317bfd4..fecd297757dd2cc29da7c27586334e39a1bc17d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -223,7 +223,7 @@ void gmx_select_rank_gpu_ids(const gmx::MDLogger &mdlog, const t_commrec *cr,
 
         sfree(checkres);
     }
-    else if (getenv("GMX_EMULATE_GPU") == NULL)
+    else if (getenv("GMX_EMULATE_GPU") == nullptr)
     {
         pick_compatible_gpus(gpu_info, gpu_opt);
         assign_rank_gpu_ids(gpu_opt, cr->nrank_pp_intranode, cr->rank_pp_intranode);
index dfe5dbaec0144dcaec5ff8e0e38bfc2d9136a36d..44a8a120381d2f3559f057871d5eaf5fce2a5e78 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -299,8 +299,8 @@ parseHwLocCache(const hwloc_topology_t             topo,
 
         if (depth >= 0)
         {
-            hwloc_obj_t cache = hwloc_get_next_obj_by_depth(topo, depth, NULL);
-            if (cache != NULL)
+            hwloc_obj_t cache = hwloc_get_next_obj_by_depth(topo, depth, nullptr);
+            if (cache != nullptr)
             {
                 std::vector<hwloc_obj_t> hwThreads = getHwLocDescendantsByType(cache, HWLOC_OBJ_PU);
 
@@ -376,7 +376,7 @@ parseHwLocNuma(const hwloc_topology_t             topo,
 
         int depth = hwloc_get_type_depth(topo, HWLOC_OBJ_NUMANODE);
         const struct hwloc_distances_s * dist = hwloc_get_whole_distance_matrix_by_depth(topo, depth);
-        if (dist != NULL && dist->nbobjs == hwlocNumaNodes.size())
+        if (dist != nullptr && dist->nbobjs == hwlocNumaNodes.size())
         {
             machine->numa.baseLatency        = dist->latency_base;
             machine->numa.maxRelativeLatency = dist->latency_max;
@@ -398,9 +398,9 @@ parseHwLocNuma(const hwloc_topology_t             topo,
     else
     {
         // No numa nodes found. Use the entire machine as a numa node.
-        const hwloc_obj_t hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, NULL);
+        const hwloc_obj_t hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, nullptr);
 
-        if (hwlocMachine != NULL)
+        if (hwlocMachine != nullptr)
         {
             machine->numa.nodes.resize(1);
             machine->numa.nodes[0].id           = 0;
@@ -462,7 +462,7 @@ parseHwLocDevices(const hwloc_topology_t             topo,
     {
         const hwloc_obj_t ancestor = hwloc_get_ancestor_obj_by_type(topo, HWLOC_OBJ_NUMANODE, p);
         int               numaId;
-        if (ancestor != NULL)
+        if (ancestor != nullptr)
         {
             numaId = ancestor->logical_index;
         }
@@ -506,7 +506,7 @@ parseHwLoc(HardwareTopology::Machine *        machine,
 
     hwloc_topology_set_flags(topo, HWLOC_TOPOLOGY_FLAG_IO_DEVICES);
 
-    if (hwloc_topology_load(topo) != 0 || hwloc_get_root_obj(topo) == NULL)
+    if (hwloc_topology_load(topo) != 0 || hwloc_get_root_obj(topo) == nullptr)
     {
         hwloc_topology_destroy(topo);
         return; // SupportLevel::None.
index 7848a959ac53b5f473ea93535e89761fe68a66fc..1faf0b15609c59575c71701b75cefa4bf21fe233 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -234,7 +234,7 @@ const char *eIMDType_names[IMD_NR + 1] = {
     "IMD_PAUSE",
     "IMD_TRATE",
     "IMD_IOERROR",
-    NULL
+    nullptr
 };
 
 
@@ -492,7 +492,7 @@ static int imd_send_rvecs(IMDSocket *socket, int nat, rvec *x, char *buffer)
 /*! \brief Initializes the IMD private data. */
 static t_gmx_IMD_setup* imd_create(int imdatoms, int nstimddef, int imdport)
 {
-    t_gmx_IMD_setup *IMDsetup = NULL;
+    t_gmx_IMD_setup *IMDsetup = nullptr;
 
 
     snew(IMDsetup, 1);
@@ -582,7 +582,7 @@ static void imd_disconnect(t_gmx_IMD_setup *IMDsetup)
 
     /* then we reset the IMD step to its default, and reset the connection boolean */
     IMDsetup->nstimd_new   = IMDsetup->nstimd_def;
-    IMDsetup->clientsocket = NULL;
+    IMDsetup->clientsocket = nullptr;
     IMDsetup->bConnected   = FALSE;
 }
 
@@ -1051,7 +1051,7 @@ static FILE *open_imd_out(const char             *fn,
     fprintf(stdout, "%s For a log of the IMD pull forces explicitly specify '-if' on the command line.\n"
             "%s (Not possible with energy minimization.)\n", IMDstr, IMDstr);
 
-    return NULL;
+    return nullptr;
 }
 #endif
 
index 0f3905b084aec04639c7fd4eb5a7d122145e038c..06008c35bb87c9922b34cca31953eeaa46c4eeae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -106,7 +106,7 @@ static void print_IMD_error(const char *file, int line, char *msg)
 {
     fprintf(stderr, "%s Error in file %s on line %d.\n", IMDstr, file, line);
 
-    if (NULL != msg)
+    if (nullptr != msg)
     {
         fprintf(stderr, "%s\n", msg);
     }
@@ -141,7 +141,7 @@ static uint16_t gmx_ntohs(uint16_t src)
 
 extern IMDSocket* imdsock_create()
 {
-    IMDSocket *sock = NULL;
+    IMDSocket *sock = nullptr;
 
 
 #ifdef GMX_IMD
@@ -152,7 +152,7 @@ extern IMDSocket* imdsock_create()
         print_IMD_error(ERR_ARGS);
         sfree(sock);
 
-        return NULL;
+        return nullptr;
     }
     else
 #endif
@@ -235,7 +235,7 @@ extern IMDSocket* imdsock_accept(IMDSocket *sock)
     {
         print_IMD_error(ERR_ARGS);
 
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -303,7 +303,7 @@ extern void imdsock_shutdown(IMDSocket *sock)
 
 
     /* is the socket already NULL? */
-    if (sock == NULL)
+    if (sock == nullptr)
     {
         return;
     }
@@ -326,7 +326,7 @@ extern int imdsock_destroy(IMDSocket *sock)
     int ret = -1;
 
 
-    if (sock == NULL)
+    if (sock == nullptr)
     {
         return 1;
     }
@@ -376,7 +376,7 @@ extern int imdsock_tryread(IMDSocket *sock, int timeoutsec, int timeoutusec)
     do
     {
         /* check the set for read readiness. */
-        ret = select(sock->sockfd + 1, &readfds, NULL, NULL, tval);
+        ret = select(sock->sockfd + 1, &readfds, nullptr, nullptr, tval);
         /* redo on system interrupt */
     }
     while (ret < 0 && errno == EINTR);
index 85e625cdf477dad53c3e7e324bec2bb0d874fb6c..2195e5e8adfe9a5c0403445f511ee269d7c48c2b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,7 +76,7 @@ eigensolver(real *   a,
     /* Make jobz point to the character "V" if eigenvectors
      * should be calculated, otherwise "N" (only eigenvalues).
      */
-    jobz = (eigenvectors != NULL) ? "V" : "N";
+    jobz = (eigenvectors != nullptr) ? "V" : "N";
 
     /* allocate lapack stuff */
     snew(isuppz, 2*n);
@@ -293,7 +293,7 @@ sparse_eigensolver(gmx_sparsematrix_t *    A,
     }
 #endif
 
-    if (eigenvectors != NULL)
+    if (eigenvectors != nullptr)
     {
         dovec = 1;
     }
@@ -373,12 +373,12 @@ sparse_eigensolver(gmx_sparsematrix_t *    A,
 
 #if GMX_DOUBLE
     F77_FUNC(dseupd, DSEUPD) (&dovec, "A", select, eigenvalues, eigenvectors,
-                              &n, NULL, "I", &n, "SA", &neig, &abstol,
+                              &n, nullptr, "I", &n, "SA", &neig, &abstol,
                               resid, &ncv, v, &n, iparam, ipntr,
                               workd, workl, &lworkl, &info);
 #else
     F77_FUNC(sseupd, SSEUPD) (&dovec, "A", select, eigenvalues, eigenvectors,
-                              &n, NULL, "I", &n, "SA", &neig, &abstol,
+                              &n, nullptr, "I", &n, "SA", &neig, &abstol,
                               resid, &ncv, v, &n, iparam, ipntr,
                               workd, workl, &lworkl, &info);
 #endif
index 3673fd0bbb0fe6745bb24bd369558c11b13a81c9..bd1b9510a75acc7a0896e8aa496f7e0aef800c55 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -126,7 +126,7 @@ static void dump_matrix(FILE *fp, const char *title, int n, double **a)
 int matrix_invert(FILE *fp, int n, double **a)
 {
     int      i, j, m, lda, *ipiv, lwork, info;
-    double **test = NULL, **id, *work;
+    double **test = nullptr, **id, *work;
 
 #ifdef DEBUG_MATRIX
     if (fp)
index 5dea002f70bdf325b9adcae302f051d6cefedf35..79ec5912f09e9d0e51e19ecbddb2b901d11fcd6c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -62,7 +62,7 @@ gmx_sparsematrix_init(int                    nrow)
     {
         A->ndata[i]    = 0;
         A->nalloc[i]   = 0;
-        A->data[i]     = NULL;
+        A->data[i]     = nullptr;
     }
     return A;
 }
@@ -77,7 +77,7 @@ gmx_sparsematrix_destroy(gmx_sparsematrix_t *   A)
     /* Release each row */
     for (i = 0; i < A->nrow; i++)
     {
-        if (A->data[i] != NULL)
+        if (A->data[i] != nullptr)
         {
             sfree(A->data[i]);
         }
@@ -186,7 +186,7 @@ gmx_sparsematrix_increment_value(gmx_sparsematrix_t *    A,
         if (A->ndata[row] == A->nalloc[row])
         {
             A->nalloc[row] += 100;
-            if (A->data[row] == NULL)
+            if (A->data[row] == nullptr)
             {
                 snew(A->data[row], A->nalloc[row]);
             }
index fd46ab180ae62b6834bcba910daa48525f1aa9ba..0bcb39212a0c9a5995fc3491575df77458f3d6ab 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -947,7 +947,7 @@ real angles(int nbonds,
                 f[aj][m] += f_j[m];
                 f[ak][m] += f_k[m];
             }
-            if (g != NULL)
+            if (g != nullptr)
             {
                 copy_ivec(SHIFT_IVEC(g, aj), jt);
 
index 46ba97584201b7820d74e9390993473b48f2b6f4..2a27f7f1920f0ee6a58e405eb4a8308d6edceef4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -201,7 +201,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
     dd->Rtav_6 = &(dd->Rt_6[dd->nres]);
 
     ptr = getenv("GMX_DISRE_ENSEMBLE_SIZE");
-    if (cr && cr->ms != NULL && ptr != NULL && !bIsREMD)
+    if (cr && cr->ms != nullptr && ptr != nullptr && !bIsREMD)
     {
 #if GMX_MPI
         dd->nsystems = 0;
index 47d20f44d3201c11fd739e039a021ad83de22d3b..8113493caf68f1ebce580ad7b97474232e3676e4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -439,7 +439,7 @@ void calc_listed(const t_commrec             *cr,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
 #ifdef DEBUG
@@ -592,7 +592,7 @@ void calc_listed_lambda(const t_idef *idef,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     /* Copy the whole idef, so we can modify the contents locally */
index fd69378866cd4955e7d251ef4c176f1bc7f2ce4c..ce1dc3003828c0546cb4f5a3644434b4db63995c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,7 +49,7 @@ int glatnr(int *global_atom_index, int i)
 {
     int atnr;
 
-    if (global_atom_index == NULL)
+    if (global_atom_index == nullptr)
     {
         atnr = i + 1;
     }
index afc7e84c73ff5f8ff09a1535dfc3dd79e80e33d3..9ad61308d655ec05bc753ee088a1938cdd70842c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -504,7 +504,7 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
             /* Note that thread 0 uses the global fshift and energy arrays,
              * but to keep the code simple, we initialize all data here.
              */
-            bt->f_t[t].f        = NULL;
+            bt->f_t[t].f        = nullptr;
             bt->f_t[t].f_nalloc = 0;
             snew(bt->f_t[t].fshift, SHIFTS);
             bt->f_t[t].grpp.nener = nenergrp*nenergrp;
@@ -517,8 +517,8 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
     }
 
     bt->nblock_used  = 0;
-    bt->block_index  = NULL;
-    bt->mask         = NULL;
+    bt->block_index  = nullptr;
+    bt->mask         = nullptr;
     bt->block_nalloc = 0;
 
     /* The optimal value after which to switch from uniform to localized
@@ -528,10 +528,10 @@ void init_bonded_threading(FILE *fplog, int nenergrp,
     const int max_nthread_uniform = 4;
     char *    ptr;
 
-    if ((ptr = getenv("GMX_BONDED_NTHREAD_UNIFORM")) != NULL)
+    if ((ptr = getenv("GMX_BONDED_NTHREAD_UNIFORM")) != nullptr)
     {
         sscanf(ptr, "%d", &bt->bonded_max_nthread_uniform);
-        if (fplog != NULL)
+        if (fplog != nullptr)
         {
             fprintf(fplog, "\nMax threads for uniform bonded distribution set to %d by env.var.\n",
                     bt->bonded_max_nthread_uniform);
index 93be131e79b92208f5dbdaad910b82511a9a2fd4..b48ea8a9308853453c05be06c921ab475cb232be 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -99,12 +99,12 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
 
     od->fc  = ir->orires_fc;
     od->nex = 0;
-    od->S   = NULL;
-    od->M   = NULL;
-    od->eig = NULL;
-    od->v   = NULL;
+    od->S   = nullptr;
+    od->M   = nullptr;
+    od->eig = nullptr;
+    od->v   = nullptr;
 
-    nr_ex = NULL;
+    nr_ex = nullptr;
 
     iloop = gmx_mtop_ilistloop_init(mtop);
     while (gmx_mtop_ilistloop_next(iloop, &il, &nmol))
@@ -211,12 +211,12 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
     const t_atom *atom;
     while (gmx_mtop_atomloop_all_next(aloop, &i, &atom))
     {
-        if (mtop->groups.grpnr[egcORFIT] == NULL ||
+        if (mtop->groups.grpnr[egcORFIT] == nullptr ||
             mtop->groups.grpnr[egcORFIT][i] == 0)
         {
             /* Not correct for free-energy with changing masses */
             od->mref[j] = atom->m;
-            if (ms == NULL || MASTERSIM(ms))
+            if (ms == nullptr || MASTERSIM(ms))
             {
                 copy_rvec(xref[i], od->xref[j]);
                 for (d = 0; d < DIM; d++)
@@ -229,7 +229,7 @@ void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
         }
     }
     svmul(1.0/mtot, com, com);
-    if (ms == NULL || MASTERSIM(ms))
+    if (ms == nullptr || MASTERSIM(ms))
     {
         for (j = 0; j < od->nref; j++)
         {
@@ -271,7 +271,7 @@ void diagonalize_orires_tensors(t_oriresdata *od)
     int           ex, i, j, nrot, ord[DIM], t;
     matrix        S, TMP;
 
-    if (od->M == NULL)
+    if (od->M == nullptr)
     {
         snew(od->M, DIM);
         for (i = 0; i < DIM; i++)
index 8a930ccd6a96606c35ff4f7852101d98d370cef7..3f32f7446340e4a59caa531d6f0bf95b2dec39a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -374,8 +374,8 @@ do_pairs_general(int ftype, int nbonds,
             energygrp_vdw  = grppener->ener[egLJSR];
             break;
         default:
-            energygrp_elec = NULL; /* Keep compiler happy */
-            energygrp_vdw  = NULL; /* Keep compiler happy */
+            energygrp_elec = nullptr; /* Keep compiler happy */
+            energygrp_vdw  = nullptr; /* Keep compiler happy */
             gmx_fatal(FARGS, "Unknown function type %d in do_nonbonded14", ftype);
             break;
     }
@@ -668,13 +668,13 @@ do_pairs(int ftype, int nbonds,
         t_pbc        pbc_no;
         const t_pbc *pbc_nonnull;
 
-        if (pbc != NULL)
+        if (pbc != nullptr)
         {
             pbc_nonnull   = pbc;
         }
         else
         {
-            set_pbc(&pbc_no, epbcNONE, NULL);
+            set_pbc(&pbc_no, epbcNONE, nullptr);
             pbc_nonnull   = &pbc_no;
         }
 
index 28084ebf685dd663e5fd68951efbb46833fd2b5b..3706f4016e56965cc6c8b1ee62927fca77d66bf7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -323,7 +323,7 @@ real posres(int nbonds,
     rvec             comA_sc, comB_sc, rdist, dpdl, dx;
     gmx_bool         bForceValid = TRUE;
 
-    if ((f == NULL) || (vir_diag == NULL))    /* should both be null together! */
+    if ((f == nullptr) || (vir_diag == nullptr))    /* should both be null together! */
     {
         bForceValid = FALSE;
     }
@@ -398,7 +398,7 @@ posres_wrapper(t_nrnb             *nrnb,
     v    = posres(idef->il[F_POSRES].nr, idef->il[F_POSRES].iatoms,
                   idef->iparams_posres,
                   x, as_rvec_array(fr->f_novirsum->data()), fr->vir_diag_posres,
-                  fr->ePBC == epbcNONE ? NULL : pbc,
+                  fr->ePBC == epbcNONE ? nullptr : pbc,
                   lambda[efptRESTRAINT], &dvdl,
                   fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
     enerd->term[F_POSRES] += v;
@@ -435,8 +435,8 @@ posres_wrapper_lambda(struct gmx_wallcycle *wcycle,
         lambda_dum = (i == 0 ? lambda[efptRESTRAINT] : fepvals->all_lambda[efptRESTRAINT][i-1]);
         v          = posres(idef->il[F_POSRES].nr, idef->il[F_POSRES].iatoms,
                             idef->iparams_posres,
-                            x, NULL, NULL,
-                            fr->ePBC == epbcNONE ? NULL : pbc, lambda_dum, &dvdl_dum,
+                            x, nullptr, nullptr,
+                            fr->ePBC == epbcNONE ? nullptr : pbc, lambda_dum, &dvdl_dum,
                             fr->rc_scaling, fr->ePBC, fr->posres_com, fr->posres_comB);
         enerd->enerpart_lambda[i] += v;
     }
@@ -457,7 +457,7 @@ void fbposres_wrapper(t_nrnb             *nrnb,
     v = fbposres(idef->il[F_FBPOSRES].nr, idef->il[F_FBPOSRES].iatoms,
                  idef->iparams_fbposres,
                  x, as_rvec_array(fr->f_novirsum->data()), fr->vir_diag_posres,
-                 fr->ePBC == epbcNONE ? NULL : pbc,
+                 fr->ePBC == epbcNONE ? nullptr : pbc,
                  fr->rc_scaling, fr->ePBC, fr->posres_com);
     enerd->term[F_FBPOSRES] += v;
     inc_nrnb(nrnb, eNR_FBPOSRES, idef->il[F_FBPOSRES].nr/2);
index e49f2a2683f2d08c6332b790fd8009297c3dfc2f..65482bb8616977ebe1a76a01d578389cbd340c26 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -147,10 +147,10 @@ class BondedTest : public ::testing::Test
                                                                  iparams,
                                                                  x, f, fshift,
                                                                  &pbc,
-                                                                 /* const struct t_graph *g */ NULL,
+                                                                 /* const struct t_graph *g */ nullptr,
                                                                  lambda, &dvdlambda,
-                                                                 /* const struct t_mdatoms *md */ NULL,
-                                                                 /* struct t_fcdata *fcd */ NULL,
+                                                                 /* const struct t_mdatoms *md */ nullptr,
+                                                                 /* struct t_fcdata *fcd */ nullptr,
                                                                  &ddgatindex);
             checker_.checkReal(energy, interaction_function[ftype].longname);
         }
index 83cd9dc5b4a55094e775516dfa4068d709c1ddd3..64eb87d16d775596c33db3a9b9ee000e22e10263 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -97,7 +97,7 @@ real rmsdev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
 
 real rmsdev(int natoms, real mass[], rvec x[], rvec xp[])
 {
-    return calc_similar_ind(FALSE, natoms, NULL, mass, x, xp);
+    return calc_similar_ind(FALSE, natoms, nullptr, mass, x, xp);
 }
 
 real rhodev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
@@ -107,7 +107,7 @@ real rhodev_ind(int nind, int index[], real mass[], rvec x[], rvec xp[])
 
 real rhodev(int natoms, real mass[], rvec x[], rvec xp[])
 {
-    return calc_similar_ind(TRUE, natoms, NULL, mass, x, xp);
+    return calc_similar_ind(TRUE, natoms, nullptr, mass, x, xp);
 }
 
 void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R)
@@ -305,7 +305,7 @@ void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
     }
     tm = 0.0;
     clear_rvec(xcm);
-    if (ind_cm != NULL)
+    if (ind_cm != nullptr)
     {
         for (i = 0; i < ncm; i++)
         {
@@ -335,7 +335,7 @@ void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
         xcm[m] /= tm;
     }
 
-    if (ind_reset != NULL)
+    if (ind_reset != nullptr)
     {
         for (i = 0; i < nreset; i++)
         {
index 13c34786a3325183332b5428155111344569e7fb..c4fb43ed079df1fac1408a7f06920867379901b9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -132,5 +132,5 @@ const char *unit2string(int unit)
         return eg2c_names[unit];
     }
 
-    return NULL;
+    return nullptr;
 }
index b44e42f979a497ab2425d8596dbaaca39c773eac..ea70c75805a81bd36ebc4109d4d0c9abb4168cc5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -201,7 +201,7 @@ void pr_rvecs(FILE *fp, int indent, const char *title, const rvec vec[], int n)
     const char *format;
     int         i, j;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
@@ -238,7 +238,7 @@ void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, const rvec vec[],
     const char *format;
     int         i, j;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
index 876a8ea454208c73c2eda2c32855581bdec43c8f..c2a09715f5867a5b325a2e849d49625f406654ac 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -59,7 +59,7 @@ static void bc_cstring(const t_commrec *cr, char **s)
 {
     int size = 0;
 
-    if (MASTER(cr) && *s != NULL)
+    if (MASTER(cr) && *s != nullptr)
     {
         /* Size of the char buffer is string length + 1 for '\0' */
         size = strlen(*s) + 1;
@@ -73,10 +73,10 @@ static void bc_cstring(const t_commrec *cr, char **s)
         }
         nblock_bc(cr, size, *s);
     }
-    else if (!MASTER(cr) && *s != NULL)
+    else if (!MASTER(cr) && *s != nullptr)
     {
         sfree(*s);
-        *s = NULL;
+        *s = nullptr;
     }
 }
 
@@ -241,7 +241,7 @@ static void bc_groups(const t_commrec *cr, t_symtab *symtab,
         block_bc(cr, n);
         if (n == 0)
         {
-            groups->grpnr[g] = NULL;
+            groups->grpnr[g] = nullptr;
         }
         else
         {
@@ -511,7 +511,7 @@ static void bc_pull(const t_commrec *cr, pull_params_t *pull)
     {
         if (!MASTER(cr))
         {
-            pull->coord[c].externalPotentialProvider = NULL;
+            pull->coord[c].externalPotentialProvider = nullptr;
         }
         if (pull->coord[c].eType == epullEXTERNAL)
         {
index ae929e3d2f1c67c66e45713eff421b5ea05f77c8..19f8ee73ed028bf5b6f155b93f3f298411c1d0a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -351,10 +351,10 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
     real                          *vsite_m;
     int                            n_nonlin_vsite_mol;
 
-    att  = NULL;
+    att  = nullptr;
     natt = 0;
 
-    if (n_nonlin_vsite != NULL)
+    if (n_nonlin_vsite != nullptr)
     {
         *n_nonlin_vsite = 0;
     }
@@ -420,7 +420,7 @@ static void get_verlet_buffer_atomtypes(const gmx_mtop_t      *mtop,
                          &mtop->ffparams,
                          vsite_m,
                          &n_nonlin_vsite_mol);
-        if (n_nonlin_vsite != NULL)
+        if (n_nonlin_vsite != nullptr)
         {
             *n_nonlin_vsite += nmol*n_nonlin_vsite_mol;
         }
@@ -832,7 +832,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     real                  particle_distance;
     real                  nb_clust_frac_pairs_not_in_list_at_cutoff;
 
-    verletbuf_atomtype_t *att  = NULL;
+    verletbuf_atomtype_t *att  = nullptr;
     int                   natt = -1, i;
     real                  elfac;
     real                  kT_fac, mass_min;
@@ -876,7 +876,7 @@ void calc_verlet_buffer_size(const gmx_mtop_t *mtop, real boxvol,
     resolution = 0.001;
 
     env = getenv("GMX_VERLET_BUFFER_RES");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%lf", &resolution);
     }
index 7a47c46910dfe2874b0a48de03c9e3b1c2ceb024..687a9bc432f2f688316616df8ddb1a8120887a61 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -293,7 +293,7 @@ static void lincs_update_atoms_noind(int ncons, const int *bla,
     int  b, i, j;
     real mvb, im1, im2, tmp0, tmp1, tmp2;
 
-    if (invmass != NULL)
+    if (invmass != nullptr)
     {
         for (b = 0; b < ncons; b++)
         {
@@ -342,7 +342,7 @@ static void lincs_update_atoms_ind(int ncons, const int *ind, const int *bla,
     int  bi, b, i, j;
     real mvb, im1, im2, tmp0, tmp1, tmp2;
 
-    if (invmass != NULL)
+    if (invmass != nullptr)
     {
         for (bi = 0; bi < ncons; bi++)
         {
@@ -637,7 +637,7 @@ static void do_lincsp(rvec *x, rvec *f, rvec *fp, t_pbc *pbc,
      * so we pass invmass=NULL, which results in the use of 1 for all atoms.
      */
     lincs_update_atoms(lincsd, th, 1.0, sol, r,
-                       (econq != econqForce) ? invmass : NULL, fp);
+                       (econq != econqForce) ? invmass : nullptr, fp);
 
     if (bCalcDHDL)
     {
@@ -1042,7 +1042,7 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
                 /* Communicate the corrected non-local coordinates */
                 if (DOMAINDECOMP(cr))
                 {
-                    dd_move_x_constraints(cr->dd, box, xp, NULL, FALSE);
+                    dd_move_x_constraints(cr->dd, box, xp, nullptr, FALSE);
                 }
             }
 #pragma omp barrier
@@ -1089,14 +1089,14 @@ static void do_lincs(rvec *x, rvec *xp, matrix box, t_pbc *pbc,
     }
     /* nit*ncons*(37+9*nrec) flops */
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         /* Update the velocities */
         lincs_update_atoms(lincsd, th, invdt, mlambda, r, invmass, v);
         /* 16 ncons flops */
     }
 
-    if (nlocat != NULL && (bCalcDHDL || bCalcVir))
+    if (nlocat != nullptr && (bCalcDHDL || bCalcVir))
     {
         if (lincsd->bTaskDep)
         {
@@ -2153,7 +2153,7 @@ void set_lincs(const t_idef         *idef,
 
     done_blocka(&at2con);
 
-    if (cr->dd == NULL)
+    if (cr->dd == nullptr)
     {
         /* Since the matrix is static, we should free some memory */
         li->ncc_alloc = li->ncc;
@@ -2167,7 +2167,7 @@ void set_lincs(const t_idef         *idef,
         srenew(li->tmpncc, li->ncc_alloc);
     }
 
-    if (DOMAINDECOMP(cr) && dd_constraints_nlocalatoms(cr->dd) != NULL)
+    if (DOMAINDECOMP(cr) && dd_constraints_nlocalatoms(cr->dd) != nullptr)
     {
         int *nlocat_dd;
 
@@ -2181,7 +2181,7 @@ void set_lincs(const t_idef         *idef,
     }
     else
     {
-        li->nlocat = NULL;
+        li->nlocat = nullptr;
     }
 
     if (debug)
@@ -2297,12 +2297,12 @@ static void cconerr(const struct gmx_lincsdata *lincsd,
             r2  = norm2(dx);
             len = r2*gmx::invsqrt(r2);
             d   = std::abs(len/bllen[b]-1);
-            if (d > ma && (nlocat == NULL || nlocat[b]))
+            if (d > ma && (nlocat == nullptr || nlocat[b]))
             {
                 ma = d;
                 im = b;
             }
-            if (nlocat == NULL)
+            if (nlocat == nullptr)
             {
                 ssd2 += d*d;
                 count++;
@@ -2348,9 +2348,9 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
      * We can also easily check if any constraint length is changed,
      * if not dH/dlambda=0 and we can also set the boolean to FALSE.
      */
-    bCalcDHDL = (ir->efep != efepNO && dvdlambda != NULL);
+    bCalcDHDL = (ir->efep != efepNO && dvdlambda != nullptr);
 
-    if (lincsd->nc == 0 && cr->dd == NULL)
+    if (lincsd->nc == 0 && cr->dd == nullptr)
     {
         if (bLog || bEner)
         {
@@ -2382,7 +2382,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         if (lincsd->ncg_flex)
         {
             /* Set the flexible constraint lengths to the old lengths */
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
                 for (i = 0; i < lincsd->nc; i++)
                 {
index acbcf6db6d8b065a133ec818c3642de363904cf1..f3df0b4f2e384ed810dd7318908d590230ef1834 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,7 @@ double compute_io(t_inputrec *ir, int natoms, gmx_groups_t *groups,
     {
         for (i = 0; i < natoms; i++)
         {
-            if (groups->grpnr[egcCompressedX] == NULL || groups->grpnr[egcCompressedX][i] == 0)
+            if (groups->grpnr[egcCompressedX] == nullptr || groups->grpnr[egcCompressedX][i] == 0)
             {
                 nxtcatoms++;
             }
@@ -145,7 +145,7 @@ double compute_io(t_inputrec *ir, int natoms, gmx_groups_t *groups,
             }
         }
     }
-    if (ir->pull != NULL)
+    if (ir->pull != nullptr)
     {
         cio += div_nsteps(nsteps, ir->pull->nstxout)*20; /* roughly 20 chars per line */
         cio += div_nsteps(nsteps, ir->pull->nstfout)*20; /* roughly 20 chars per line */
index 630e19024807a3486ca7b839d16c73614b05e69f..bdae1014e08bb238c6004ba27419cace70a1f3fb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -186,7 +186,7 @@ static void write_constr_pdb(const char *fn, const char *title,
     gmx_domdec_t *dd;
     const char   *anm, *resnm;
 
-    dd = NULL;
+    dd = nullptr;
     if (DOMAINDECOMP(cr))
     {
         dd = cr->dd;
@@ -211,7 +211,7 @@ static void write_constr_pdb(const char *fn, const char *title,
     int molb = 0;
     for (i = start; i < start+homenr; i++)
     {
-        if (dd != NULL)
+        if (dd != nullptr)
         {
             if (i >= dd->nat_home && i < dd_ac0)
             {
@@ -326,7 +326,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         lambda += delta_step*ir->fepvals->delta_lambda;
     }
 
-    if (vir != NULL)
+    if (vir != nullptr)
     {
         clear_mat(vir_r_m_dr);
     }
@@ -351,7 +351,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
      * For constraints there is both forward and backward communication.
      */
     if (ir->ePBC != epbcNONE &&
-        (cr->dd || bMolPBC) && !(cr->dd && cr->dd->constraint_comm == NULL))
+        (cr->dd || bMolPBC) && !(cr->dd && cr->dd->constraint_comm == nullptr))
     {
         /* With pbc=screw the screw has been changed to a shift
          * by the constraint coordinate communication routine,
@@ -363,7 +363,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     /* Communicate the coordinates required for the non-local constraints
@@ -373,7 +373,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
     {
         dd_move_x_constraints(cr->dd, box, x, xprime, econq == econqCoord);
 
-        if (v != NULL)
+        if (v != nullptr)
         {
             /* We need to initialize the non-local components of v.
              * We never actually use these values, but we do increment them,
@@ -383,17 +383,17 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
     }
 
-    if (constr->lincsd != NULL)
+    if (constr->lincsd != nullptr)
     {
         bOK = constrain_lincs(fplog, bLog, bEner, ir, step, constr->lincsd, md, cr,
                               x, xprime, min_proj,
                               box, pbc_null, lambda, dvdlambda,
-                              invdt, v, vir != NULL, vir_r_m_dr,
+                              invdt, v, vir != nullptr, vir_r_m_dr,
                               econq, nrnb,
                               constr->maxwarn, &constr->warncount_lincs);
         if (!bOK && constr->maxwarn < INT_MAX)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "Constraint error in algorithm %s at step %s\n",
                         econstr_names[econtLINCS], gmx_step_str(step, buf));
@@ -411,7 +411,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               md->invmass, constr->nblocks, constr->sblock,
                               idef, ir, x, xprime, nrnb,
                               constr->lagr, lambda, dvdlambda,
-                              invdt, v, vir != NULL, vir_r_m_dr,
+                              invdt, v, vir != nullptr, vir_r_m_dr,
                               constr->maxwarn < INT_MAX, econq);
                 break;
             case (econqVeloc):
@@ -419,7 +419,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                               md->invmass, constr->nblocks, constr->sblock,
                               idef, ir, x, min_proj, nrnb,
                               constr->lagr, lambda, dvdlambda,
-                              invdt, NULL, vir != NULL, vir_r_m_dr,
+                              invdt, nullptr, vir != nullptr, vir_r_m_dr,
                               constr->maxwarn < INT_MAX, econq);
                 break;
             default:
@@ -429,7 +429,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
 
         if (!bOK && constr->maxwarn < INT_MAX)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "Constraint error in algorithm %s at step %s\n",
                         econstr_names[econtSHAKE], gmx_step_str(step, buf));
@@ -459,19 +459,19 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                                 nth, th,
                                 pbc_null,
                                 x[0], xprime[0],
-                                invdt, v ? v[0] : NULL,
-                                vir != NULL,
+                                invdt, v ? v[0] : nullptr,
+                                vir != nullptr,
                                 th == 0 ? vir_r_m_dr : constr->vir_r_m_dr_th[th],
                                 th == 0 ? &bSettleErrorHasOccurred : &constr->bSettleErrorHasOccurred[th]);
                     }
                     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
                 }
                 inc_nrnb(nrnb, eNR_SETTLE, nsettle);
-                if (v != NULL)
+                if (v != nullptr)
                 {
                     inc_nrnb(nrnb, eNR_CONSTR_V, nsettle*3);
                 }
-                if (vir != NULL)
+                if (vir != nullptr)
                 {
                     inc_nrnb(nrnb, eNR_CONSTR_VIR, nsettle*3);
                 }
@@ -487,7 +487,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                     {
                         int calcvir_atom_end;
 
-                        if (vir == NULL)
+                        if (vir == nullptr)
                         {
                             calcvir_atom_end = 0;
                         }
@@ -527,7 +527,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                 gmx_incons("Unknown constraint quantity for settle");
         }
 
-        if (vir != NULL)
+        if (vir != nullptr)
         {
             /* Reduce the virial contributions over the threads */
             for (int th = 1; th < nth; th++)
@@ -567,7 +567,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
         }
     }
 
-    if (vir != NULL)
+    if (vir != nullptr)
     {
         /* The normal uses of constrain() pass step_scaling = 1.0.
          * The call to constrain() for SD1 that passes step_scaling =
@@ -644,7 +644,7 @@ real *constr_rmsd_data(struct gmx_constr *constr)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
 
@@ -676,7 +676,7 @@ static void make_shake_sblock_serial(struct gmx_constr *constr,
     ncons = idef->il[F_CONSTR].nr/3;
 
     init_blocka(&sblocks);
-    gen_sblocks(NULL, 0, md->homenr, idef, &sblocks, FALSE);
+    gen_sblocks(nullptr, 0, md->homenr, idef, &sblocks, FALSE);
 
     /*
        bstart=(idef->nodeid > 0) ? blocks->multinr[idef->nodeid-1] : 0;
@@ -1156,13 +1156,13 @@ gmx_constr_t init_constraints(FILE *fplog,
     int nsettles =
         gmx_mtop_ftype_count(mtop, F_SETTLE);
 
-    GMX_RELEASE_ASSERT(!ir->bPull || ir->pull_work != NULL, "init_constraints called with COM pulling before/without initializing the pull code");
+    GMX_RELEASE_ASSERT(!ir->bPull || ir->pull_work != nullptr, "init_constraints called with COM pulling before/without initializing the pull code");
 
     if (nconstraints + nsettles == 0 &&
         !(ir->bPull && pull_have_constraint(ir->pull_work)) &&
-        ed == NULL)
+        ed == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     struct gmx_constr *constr;
@@ -1261,7 +1261,7 @@ gmx_constr_t init_constraints(FILE *fplog,
 
         /* Allocate thread-local work arrays */
         int nthreads = gmx_omp_nthreads_get(emntSETTLE);
-        if (nthreads > 1 && constr->vir_r_m_dr_th == NULL)
+        if (nthreads > 1 && constr->vir_r_m_dr_th == nullptr)
         {
             snew(constr->vir_r_m_dr_th, nthreads);
             snew(constr->bSettleErrorHasOccurred, nthreads);
@@ -1302,7 +1302,7 @@ gmx_constr_t init_constraints(FILE *fplog,
     /* Initialize the essential dynamics sampling.
      * Put the pointer to the ED struct in constr */
     constr->ed = ed;
-    if (ed != NULL || state->edsamstate != NULL)
+    if (ed != nullptr || state->edsamstate != nullptr)
     {
         init_edsam(mtop, ir, cr, ed, as_rvec_array(state->x.data()), state->box, state->edsamstate);
     }
index 970b53a21d9aded3ad336f399eca8e6dad2fdc81..8e8eb8b018ddb2e91ff15208167aae9b1ea41776 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,11 +82,11 @@ static const double  sy_const_3[] = { 0.828981543588751, -0.657963087177502, 0.8
 static const double  sy_const_5[] = { 0.2967324292201065, 0.2967324292201065, -0.186929716880426, 0.2967324292201065, 0.2967324292201065 };
 
 static const double* sy_const[] = {
-    NULL,
+    nullptr,
     sy_const_1,
-    NULL,
+    nullptr,
     sy_const_3,
-    NULL,
+    nullptr,
     sy_const_5
 };
 
@@ -125,7 +125,7 @@ static void NHC_trotter(t_grpopts *opts, int nvar, gmx_ekindata_t *ekind, real d
 /* if scalefac is NULL, we are doing the NHC of the barostat */
 
     bBarostat = FALSE;
-    if (scalefac == NULL)
+    if (scalefac == nullptr)
     {
         bBarostat = TRUE;
     }
@@ -675,7 +675,7 @@ void berendsen_pscale(const t_inputrec *ir, const matrix mu,
         // Trivial OpenMP region that does not throw
         int g;
 
-        if (cFREEZE == NULL)
+        if (cFREEZE == nullptr)
         {
             g = 0;
         }
@@ -754,7 +754,7 @@ void berendsen_tcoupl(t_inputrec *ir, gmx_ekindata_t *ekind, real dt)
 void andersen_tcoupl(t_inputrec *ir, gmx_int64_t step,
                      const t_commrec *cr, const t_mdatoms *md, t_state *state, real rate, const gmx_bool *randomize, const real *boltzfac)
 {
-    const int                                 *gatindex = (DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+    const int                                 *gatindex = (DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
     int                                        i;
     int                                        gc = 0;
     gmx::ThreeFry2x64<0>                       rng(ir->andersen_seed, gmx::RandomDomain::Thermostat);
@@ -893,12 +893,12 @@ void trotter_update(t_inputrec *ir, gmx_int64_t step, gmx_ekindata_t *ekind,
             case etrtBARONHC:
             case etrtBARONHC2:
                 NHC_trotter(opts, state->nnhpres, ekind, dt, state->nhpres_xi.data(),
-                            state->nhpres_vxi.data(), NULL, &(state->veta), MassQ, FALSE);
+                            state->nhpres_vxi.data(), nullptr, &(state->veta), MassQ, FALSE);
                 break;
             case etrtNHC:
             case etrtNHC2:
                 NHC_trotter(opts, opts->ngtc, ekind, dt, state->nosehoover_xi.data(),
-                            state->nosehoover_vxi.data(), scalefac, NULL, MassQ, (ir->eI == eiVV));
+                            state->nosehoover_vxi.data(), scalefac, nullptr, MassQ, (ir->eI == eiVV));
                 /* need to rescale the kinetic energies and velocities here.  Could
                    scale the velocities later, but we need them scaled in order to
                    produce the correct outputs, so we'll scale them here. */
index 74e9d498c3722ad6350ba6f0175a5b82289b1bf7..1dbaff73fae5746eca598ffd21d196c57a440ae3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -208,14 +208,14 @@ gmx_settledata_t settle_init(const gmx_mtop_t *mtop)
     real dHH = mtop->ffparams.iparams[settle_type].settle.dhh;
     settleparam_init(&settled->mass1, 1.0, 1.0, 1.0, 1.0, dOH, dHH);
 
-    settled->ow1    = NULL;
-    settled->hw2    = NULL;
-    settled->hw3    = NULL;
-    settled->virfac = NULL;
+    settled->ow1    = nullptr;
+    settled->hw2    = nullptr;
+    settled->hw3    = nullptr;
+    settled->virfac = nullptr;
     settled->nalloc = 0;
 
     /* Without SIMD configured, this bool is not used */
-    settled->bUseSimd = (getenv("GMX_DISABLE_SIMD_KERNELS") == NULL);
+    settled->bUseSimd = (getenv("GMX_DISABLE_SIMD_KERNELS") == nullptr);
 
     return settled;
 }
@@ -348,7 +348,7 @@ void settle_proj(gmx_settledata_t settled, int econq,
         hw2 = iatoms[i*nral1 + 2];
         hw3 = iatoms[i*nral1 + 3];
 
-        if (pbc == NULL)
+        if (pbc == nullptr)
         {
             rvec_sub(x[ow1], x[hw2], roh2);
             rvec_sub(x[ow1], x[hw3], roh3);
@@ -777,7 +777,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
     int settleStart    = ((numSettlePacks* thread      + nthread - 1)/nthread)*packSize;
     int settleEnd      = ((numSettlePacks*(thread + 1) + nthread - 1)/nthread)*packSize;
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         if (!bCalcVirial)
         {
@@ -789,7 +789,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
                 pbc,
                 x, xprime,
                 invdt, v,
-                NULL,
+                nullptr,
                 bErrorHasOccurred);
         }
         else
@@ -818,7 +818,7 @@ static void settleTemplateWrapper(gmx_settledata_t settled,
                 pbc,
                 x, xprime,
                 invdt, v,
-                NULL,
+                nullptr,
                 bErrorHasOccurred);
         }
         else
@@ -869,13 +869,13 @@ void csettle(gmx_settledata_t settled,
         t_pbc        pbcNo;
         const t_pbc *pbcNonNull;
 
-        if (pbc != NULL)
+        if (pbc != nullptr)
         {
             pbcNonNull = pbc;
         }
         else
         {
-            set_pbc(&pbcNo, epbcNONE, NULL);
+            set_pbc(&pbcNo, epbcNONE, nullptr);
             pbcNonNull = &pbcNo;
         }
 
index 9777c3e14241177f0c044d96a22de4a99fcb390e..e882f75eb558bfe8ecfe36f77278163d4e30456a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,7 +79,7 @@ int get_ebin_space(t_ebin *eb, int nener, const char *enm[], const char *unit)
         eb->e_sim[i].eav  = 0;
         eb->e_sim[i].esum = 0;
         eb->enm[i].name   = gmx_strdup(enm[i-index]);
-        if (unit != NULL)
+        if (unit != nullptr)
         {
             eb->enm[i].unit = gmx_strdup(unit);
         }
index 3136c480a0707735719bc42f52220c62e7290a1c..0a6c248e63de75adab8548bd3ab3f827eaeadf1e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1024,7 +1024,7 @@ extern void PrintFreeEnergyInfoToFile(FILE *outfile, t_lambda *fep, t_expanded *
     gmx_bool    bSimTemp            = FALSE;
 
     nlim = fep->n_lambda;
-    if (simtemp != NULL)
+    if (simtemp != nullptr)
     {
         bSimTemp = TRUE;
     }
index 238b5e160b121e02aa7cbf867d6852b12269fec8..c8361b951e4ccbb5551606097d67653fe687f69c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -362,7 +362,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
     do_force_listed(wcycle, box, ir->fepvals, cr,
                     idef, (const rvec *) x, hist, f, fr,
                     &pbc, graph, enerd, nrnb, lambda, md, fcd,
-                    DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL,
+                    DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr,
                     flags);
 
     where();
index ae662ec467d8eb5e97ba585f84d3fa04ec830cc2..2b208cf32b7cfa1be6694111952cc8312aae08b3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 const char *egrp_nm[egNR+1] = {
     "Coul-SR", "LJ-SR", "Buck-SR",
-    "Coul-14", "LJ-14", NULL
+    "Coul-14", "LJ-14", nullptr
 };
 
 t_forcerec *mk_forcerec(void)
@@ -349,7 +349,7 @@ check_solvent_cg(const gmx_moltype_t    *molt,
 
     /* Check if we are doing QM on this group */
     qm = FALSE;
-    if (qm_grpnr != NULL)
+    if (qm_grpnr != nullptr)
     {
         for (j = j0; j < j1 && !qm; j++)
         {
@@ -543,7 +543,7 @@ check_solvent(FILE  *                fp,
     }
 
     n_solvent_parameters = 0;
-    solvent_parameters   = NULL;
+    solvent_parameters   = nullptr;
     /* Allocate temporary array for solvent type */
     snew(cg_sp, mtop->nmolblock);
 
@@ -566,7 +566,7 @@ check_solvent(FILE  *                fp,
             {
                 check_solvent_cg(molt, cg_mol, nmol,
                                  mtop->groups.grpnr[egcQMMM] ?
-                                 mtop->groups.grpnr[egcQMMM]+at_offset+am : 0,
+                                 mtop->groups.grpnr[egcQMMM]+at_offset+am : nullptr,
                                  &mtop->groups.grps[egcQMMM],
                                  fr,
                                  &n_solvent_parameters, &solvent_parameters,
@@ -622,7 +622,7 @@ check_solvent(FILE  *                fp,
     }
     sfree(cg_sp);
 
-    if (bestsol != esolNO && fp != NULL)
+    if (bestsol != esolNO && fp != nullptr)
     {
         fprintf(fp, "\nEnabling %s-like water optimization for %d molecules.\n\n",
                 esol_names[bestsol],
@@ -702,7 +702,7 @@ static cginfo_mb_t *init_cginfo_mb(FILE *fplog, const gmx_mtop_t *mtop,
                 {
                     bId = FALSE;
                 }
-                if (mtop->groups.grpnr[egcQMMM] != NULL)
+                if (mtop->groups.grpnr[egcQMMM] != nullptr)
                 {
                     for (ai = a0; ai < a1; ai++)
                     {
@@ -991,7 +991,7 @@ void update_forcerec(t_forcerec *fr, matrix box)
 {
     if (fr->eeltype == eelGRF)
     {
-        calc_rffac(NULL, fr->eeltype, fr->epsilon_r, fr->epsilon_rf,
+        calc_rffac(nullptr, fr->eeltype, fr->epsilon_r, fr->epsilon_rf,
                    fr->rcoulomb, fr->temp, fr->zsquare, box,
                    &fr->kappa, &fr->k_rf, &fr->c_rf);
     }
@@ -1007,7 +1007,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop)
     int             ntp, *typecount;
     gmx_bool        bBHAM;
     real           *nbfp;
-    real           *nbfp_comb = NULL;
+    real           *nbfp_comb = nullptr;
 
     ntp   = fr->ntype;
     bBHAM = fr->bBHAM;
@@ -1214,7 +1214,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr, const gmx_mtop_t *mtop)
         sfree(nbfp_comb);
     }
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         if (fr->eDispCorr == edispcAllEner ||
             fr->eDispCorr == edispcAllEnerPres)
@@ -1296,7 +1296,7 @@ static void make_nbf_tables(FILE *fp,
     char buf[STRLEN];
     int  i, j;
 
-    if (tabfn == NULL)
+    if (tabfn == nullptr)
     {
         if (debug)
         {
@@ -1433,10 +1433,10 @@ static bondedtable_t *make_bonded_tables(FILE *fplog,
     int            ncount, *count;
     bondedtable_t *tab;
 
-    tab = NULL;
+    tab = nullptr;
 
     ncount = 0;
-    count  = NULL;
+    count  = nullptr;
     count_tables(ftype1, ftype2, mtop, &ncount, &count);
 
     // Are there any relevant tabulated bond interactions?
@@ -1536,7 +1536,7 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
              (ir->implicit_solvent == eisGBSA && (ir->gb_algorithm == egbSTILL ||
                                                   ir->gb_algorithm == egbHCT   ||
                                                   ir->gb_algorithm == egbOBC))) &&
-            getenv("GMX_NO_ALLVSALL") == NULL
+            getenv("GMX_NO_ALLVSALL") == nullptr
         );
 
     if (bAllvsAll && ir->opts.ngener > 1)
@@ -1545,7 +1545,7 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
 
         if (bPrintNote)
         {
-            if (fp != NULL)
+            if (fp != nullptr)
             {
                 fprintf(fp, "\n%s\n", note);
             }
@@ -1647,7 +1647,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 #endif  /* GMX_NBNXN_SIMD_2XNN && GMX_NBNXN_SIMD_4XN */
 
 
-        if (getenv("GMX_NBNXN_SIMD_4XN") != NULL)
+        if (getenv("GMX_NBNXN_SIMD_4XN") != nullptr)
         {
 #ifdef GMX_NBNXN_SIMD_4XN
             *kernel_type = nbnxnk4xN_SIMD_4xN;
@@ -1655,7 +1655,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
             gmx_fatal(FARGS, "SIMD 4xN kernels requested, but GROMACS has been compiled without support for these kernels");
 #endif
         }
-        if (getenv("GMX_NBNXN_SIMD_2XNN") != NULL)
+        if (getenv("GMX_NBNXN_SIMD_2XNN") != nullptr)
         {
 #ifdef GMX_NBNXN_SIMD_2XNN
             *kernel_type = nbnxnk4xN_SIMD_2xNN;
@@ -1676,11 +1676,11 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
         (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE) || GMX_SIMD_IBM_QPX
         *ewald_excl = ewaldexclAnalytical;
 #endif
-        if (getenv("GMX_NBNXN_EWALD_TABLE") != NULL)
+        if (getenv("GMX_NBNXN_EWALD_TABLE") != nullptr)
         {
             *ewald_excl = ewaldexclTable;
         }
-        if (getenv("GMX_NBNXN_EWALD_ANALYTICAL") != NULL)
+        if (getenv("GMX_NBNXN_EWALD_ANALYTICAL") != nullptr)
         {
             *ewald_excl = ewaldexclAnalytical;
         }
@@ -1692,7 +1692,7 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused *ir,
 
 const char *lookup_nbnxn_kernel_name(int kernel_type)
 {
-    const char *returnvalue = NULL;
+    const char *returnvalue = nullptr;
     switch (kernel_type)
     {
         case nbnxnkNotSet:
@@ -1715,7 +1715,7 @@ const char *lookup_nbnxn_kernel_name(int kernel_type)
         case nbnxnkNR:
         default:
             gmx_fatal(FARGS, "Illegal kernel type selected");
-            returnvalue = NULL;
+            returnvalue = nullptr;
             break;
     }
     return returnvalue;
@@ -1763,7 +1763,7 @@ static void pick_nbnxn_kernel(FILE                *fp,
         }
     }
 
-    if (bDoNonbonded && fp != NULL)
+    if (bDoNonbonded && fp != nullptr)
     {
         fprintf(fp, "\nUsing %s %dx%d non-bonded kernels\n\n",
                 lookup_nbnxn_kernel_name(*kernel_type),
@@ -1794,7 +1794,7 @@ static void pick_nbnxn_resources(const gmx::MDLogger &mdlog,
 
     *bUseGPU = FALSE;
 
-    bEmulateGPUEnvVarSet = (getenv("GMX_EMULATE_GPU") != NULL);
+    bEmulateGPUEnvVarSet = (getenv("GMX_EMULATE_GPU") != nullptr);
 
     /* Run GPU emulation mode if GMX_EMULATE_GPU is defined. Because
      * GPUs (currently) only handle non-bonded calculations, we will
@@ -1915,7 +1915,7 @@ void init_interaction_const_tables(FILE                *fp,
     {
         init_ewald_f_table(ic, rtab);
 
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "Initialized non-bonded Ewald correction tables, spacing: %.2e size: %d\n\n",
                     1/ic->tabq_scale, ic->tabq_size);
@@ -2073,7 +2073,7 @@ init_interaction_const(FILE                       *fp,
         }
     }
 
-    if (fp != NULL)
+    if (fp != nullptr)
     {
         real dispersion_shift;
 
@@ -2124,14 +2124,14 @@ static void init_nb_verlet(FILE                *fp,
                          &bEmulateGPU,
                          fr->gpu_opt);
 
-    nbv->nbs             = NULL;
+    nbv->nbs             = nullptr;
     nbv->min_ci_balanced = 0;
 
     nbv->ngrp = (DOMAINDECOMP(cr) ? 2 : 1);
     for (i = 0; i < nbv->ngrp; i++)
     {
         nbv->grp[i].nbl_lists.nnbl = 0;
-        nbv->grp[i].nbat           = NULL;
+        nbv->grp[i].nbat           = nullptr;
         nbv->grp[i].kernel_type    = nbnxnkNotSet;
 
         if (i == 0) /* local */
@@ -2144,7 +2144,7 @@ static void init_nb_verlet(FILE                *fp,
         }
         else /* non-local */
         {
-            if (nbpu_opt != NULL && strcmp(nbpu_opt, "gpu_cpu") == 0)
+            if (nbpu_opt != nullptr && strcmp(nbpu_opt, "gpu_cpu") == 0)
             {
                 /* Use GPU for local, select a CPU kernel for non-local */
                 pick_nbnxn_kernel(fp, mdlog, fr->use_simd_kernels,
@@ -2165,8 +2165,8 @@ static void init_nb_verlet(FILE                *fp,
     }
 
     nbnxn_init_search(&nbv->nbs,
-                      DOMAINDECOMP(cr) ? &cr->dd->nc : NULL,
-                      DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : NULL,
+                      DOMAINDECOMP(cr) ? &cr->dd->nc : nullptr,
+                      DOMAINDECOMP(cr) ? domdec_zones(cr->dd) : nullptr,
                       bFEP_NonBonded,
                       gmx_omp_nthreads_get(emntPairsearch));
 
@@ -2192,7 +2192,7 @@ static void init_nb_verlet(FILE                *fp,
             if (fr->vdwtype == evdwCUT &&
                 (fr->vdw_modifier == eintmodNONE ||
                  fr->vdw_modifier == eintmodPOTSHIFT) &&
-                getenv("GMX_NO_LJ_COMB_RULE") == NULL)
+                getenv("GMX_NO_LJ_COMB_RULE") == nullptr)
             {
                 /* Plain LJ cut-off: we can optimize with combination rules */
                 enbnxninitcombrule = enbnxninitcombruleDETECT;
@@ -2264,7 +2264,7 @@ static void init_nb_verlet(FILE                *fp,
         }
 #endif  /* GMX_THREAD_MPI */
 
-        if ((env = getenv("GMX_NB_MIN_CI")) != NULL)
+        if ((env = getenv("GMX_NB_MIN_CI")) != nullptr)
         {
             char *end;
 
@@ -2297,7 +2297,7 @@ static void init_nb_verlet(FILE                *fp,
 
 gmx_bool usingGpu(nonbonded_verlet_t *nbv)
 {
-    return nbv != NULL && nbv->bUseGPU;
+    return nbv != nullptr && nbv->bUseGPU;
 }
 
 void init_forcerec(FILE                *fp,
@@ -2325,7 +2325,7 @@ void init_forcerec(FILE                *fp,
     gmx_bool       bFEP_NonBonded;
     int           *nm_ind, egp_flags;
 
-    if (fr->hwinfo == NULL)
+    if (fr->hwinfo == nullptr)
     {
         /* Detect hardware, gather information.
          * In mdrun, hwinfo has already been set before calling init_forcerec.
@@ -2408,7 +2408,7 @@ void init_forcerec(FILE                *fp,
     fr->sc_sigma6_def = gmx::power6(ir->fepvals->sc_sigma);
 
     env = getenv("GMX_SCSIGMA_MIN");
-    if (env != NULL)
+    if (env != nullptr)
     {
         dbl = 0;
         sscanf(env, "%20lf", &dbl);
@@ -2420,7 +2420,7 @@ void init_forcerec(FILE                *fp,
     }
 
     fr->bNonbonded = TRUE;
-    if (getenv("GMX_NO_NONBONDED") != NULL)
+    if (getenv("GMX_NO_NONBONDED") != nullptr)
     {
         /* turn off non-bonded calculations */
         fr->bNonbonded = FALSE;
@@ -2435,9 +2435,9 @@ void init_forcerec(FILE                *fp,
      * can be used with water optimization, and disable it if that is not the case.
      */
 
-    if (getenv("GMX_NB_GENERIC") != NULL)
+    if (getenv("GMX_NB_GENERIC") != nullptr)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "Found environment variable GMX_NB_GENERIC.\n"
@@ -2452,10 +2452,10 @@ void init_forcerec(FILE                *fp,
         bNoSolvOpt         = TRUE;
     }
 
-    if ( (getenv("GMX_DISABLE_SIMD_KERNELS") != NULL) || (getenv("GMX_NOOPTIMIZEDKERNELS") != NULL) )
+    if ( (getenv("GMX_DISABLE_SIMD_KERNELS") != nullptr) || (getenv("GMX_NOOPTIMIZEDKERNELS") != nullptr) )
     {
         fr->use_simd_kernels = FALSE;
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "\nFound environment variable GMX_DISABLE_SIMD_KERNELS.\n"
@@ -2467,16 +2467,16 @@ void init_forcerec(FILE                *fp,
     fr->bBHAM = (mtop->ffparams.functype[0] == F_BHAM);
 
     /* Check if we can/should do all-vs-all kernels */
-    fr->bAllvsAll       = can_use_allvsall(ir, FALSE, NULL, NULL);
-    fr->AllvsAll_work   = NULL;
-    fr->AllvsAll_workgb = NULL;
+    fr->bAllvsAll       = can_use_allvsall(ir, FALSE, nullptr, nullptr);
+    fr->AllvsAll_work   = nullptr;
+    fr->AllvsAll_workgb = nullptr;
 
     /* All-vs-all kernels have not been implemented in 4.6 and later.
      * See Redmine #1249. */
     if (fr->bAllvsAll)
     {
         fr->bAllvsAll            = FALSE;
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp,
                     "\nYour simulation settings would have triggered the efficient all-vs-all\n"
@@ -2500,7 +2500,7 @@ void init_forcerec(FILE                *fp,
         {
             fprintf(stderr, "\n%s\n", note);
         }
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "\n%s\n", note);
         }
@@ -2540,7 +2540,7 @@ void init_forcerec(FILE                *fp,
             {
                 fr->bMolPBC = TRUE;
 
-                if (getenv("GMX_USE_GRAPH") != NULL)
+                if (getenv("GMX_USE_GRAPH") != nullptr)
                 {
                     fr->bMolPBC = FALSE;
                     if (fp)
@@ -2838,17 +2838,17 @@ void init_forcerec(FILE                *fp,
         fr->cg_nalloc = ncg_mtop(mtop);
         srenew(fr->cg_cm, fr->cg_nalloc);
     }
-    if (fr->shift_vec == NULL)
+    if (fr->shift_vec == nullptr)
     {
         snew(fr->shift_vec, SHIFTS);
     }
 
-    if (fr->fshift == NULL)
+    if (fr->fshift == nullptr)
     {
         snew(fr->fshift, SHIFTS);
     }
 
-    if (fr->nbfp == NULL)
+    if (fr->nbfp == nullptr)
     {
         fr->ntype = mtop->ffparams.atnr;
         fr->nbfp  = mk_nbfp(&mtop->ffparams, fr->bBHAM);
@@ -3047,7 +3047,7 @@ void init_forcerec(FILE                *fp,
         /* make tables for ordinary interactions */
         if (bSomeNormalNbListsAreInUse)
         {
-            make_nbf_tables(fp, fr, rtab, tabfn, NULL, NULL, &fr->nblists[0]);
+            make_nbf_tables(fp, fr, rtab, tabfn, nullptr, nullptr, &fr->nblists[0]);
             m = 1;
         }
         else
@@ -3153,7 +3153,7 @@ void init_forcerec(FILE                *fp,
                                    &fr->bExcl_IntraCGAll_InterCGNone);
     if (DOMAINDECOMP(cr))
     {
-        fr->cginfo = NULL;
+        fr->cginfo = nullptr;
     }
     else
     {
index bc43ba9076603902c3e661784e632dd32608d274..38ee8a833fd665e364553f6da5399bfd4de3eff9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -103,11 +103,11 @@ static int init_gb_nblist(int natoms, t_nblist *nl)
     nl->maxnrj      = 0;
     nl->nri         = 0;
     nl->nrj         = 0;
-    nl->iinr        = NULL;
-    nl->gid         = NULL;
-    nl->shift       = NULL;
-    nl->jindex      = NULL;
-    nl->jjnr        = NULL;
+    nl->iinr        = nullptr;
+    nl->gid         = nullptr;
+    nl->shift       = nullptr;
+    nl->jindex      = nullptr;
+    nl->jjnr        = nullptr;
     /*nl->nltype      = nltype;*/
 
     srenew(nl->iinr,   nl->maxnri);
@@ -265,11 +265,11 @@ int init_gb(gmx_genborn_t **p_born,
     snew(fr->invsqrta, natoms);
     snew(fr->dvda,     natoms);
 
-    fr->dadx              = NULL;
-    fr->dadx_rawptr       = NULL;
+    fr->dadx              = nullptr;
+    fr->dadx_rawptr       = nullptr;
     fr->nalloc_dadx       = 0;
-    born->gpol_still_work = NULL;
-    born->gpol_hct_work   = NULL;
+    born->gpol_still_work = nullptr;
+    born->gpol_hct_work   = nullptr;
 
     /* snew(born->asurf,natoms); */
     /* snew(born->dasurf,natoms); */
@@ -927,7 +927,7 @@ int calc_gb_rad(t_commrec *cr, t_forcerec *fr, t_inputrec *ir, gmx_localtop_t *t
     int   cnt;
     int   ndadx;
 
-    if (fr->bAllvsAll && fr->dadx == NULL)
+    if (fr->bAllvsAll && fr->dadx == nullptr)
     {
         /* We might need up to 8 atoms of padding before and after,
          * and another 4 units to guarantee SSE alignment.
@@ -1355,7 +1355,7 @@ calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (sa_algorithm == esaAPPROX)
@@ -1426,7 +1426,7 @@ static gbtmpnbl_t *find_gbtmplist(struct gbtmpnbls *lists, int shift)
             srenew(lists->list, lists->list_nalloc);
             for (i = lists->nlist; i < lists->list_nalloc; i++)
             {
-                lists->list[i].aj        = NULL;
+                lists->list[i].aj        = nullptr;
                 lists->list[i].aj_nalloc = 0;
             }
 
@@ -1455,7 +1455,7 @@ static void add_bondeds_to_gblist(t_ilist *il,
         aj = il->iatoms[ind+2];
 
         int shift = CENTRAL;
-        if (g != NULL)
+        if (g != nullptr)
         {
             rvec_sub(x[ai], x[aj], dx);
             ivec_sub(SHIFT_IVEC(g, ai), SHIFT_IVEC(g, aj), dt);
@@ -1504,7 +1504,7 @@ int make_gb_nblist(t_commrec *cr, int gb_algorithm,
     t_pbc             pbc;
 
     struct gbtmpnbls *nls;
-    gbtmpnbl_t       *list = NULL;
+    gbtmpnbl_t       *list = nullptr;
 
     set_pbc(&pbc, fr->ePBC, box);
     nls   = born->nblist_work;
@@ -1620,7 +1620,7 @@ int make_gb_nblist(t_commrec *cr, int gb_algorithm,
 void make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm)
 {
     int           i, at0, at1;
-    gmx_domdec_t *dd = NULL;
+    gmx_domdec_t *dd = nullptr;
 
     if (DOMAINDECOMP(cr))
     {
index e459f597f2f9e9cc9509b8843a544f2b0c2c5eca..1d96860895bcb9c0fe0e05868ccd7cdeeb8f634a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2009, The GROMACS Development Team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -377,7 +377,7 @@ genborn_allvsall_calc_still_radii(t_forcerec *           fr,
 
     aadata = *((gmx_allvsallgb2_data_t **)work);
 
-    if (aadata == NULL)
+    if (aadata == nullptr)
     {
         genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
                                FALSE, FALSE, TRUE);
@@ -590,7 +590,7 @@ genborn_allvsall_calc_hct_obc_radii(t_forcerec *           fr,
 
     aadata = *((gmx_allvsallgb2_data_t **)work);
 
-    if (aadata == NULL)
+    if (aadata == nullptr)
     {
         genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
                                TRUE, TRUE, TRUE);
index f4aa5a919cebca88cfc268d40b38d26d341a7b2c..211bc2b9515d52aba59e86bd2a5e93f8e3c113d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,7 +124,7 @@ static void pick_module_nthreads(const gmx::MDLogger &mdlog, int m,
     }
 
     /* check the environment variable */
-    if ((env = getenv(modth_env_var[m])) != NULL)
+    if ((env = getenv(modth_env_var[m])) != nullptr)
     {
         sscanf(env, "%d", &nth);
 
@@ -138,7 +138,7 @@ static void pick_module_nthreads(const gmx::MDLogger &mdlog, int m,
 
         /* with the verlet codepath, when any GMX_*_NUM_THREADS env var is set,
          * OMP_NUM_THREADS also has to be set */
-        if (bFullOmpSupport && getenv("OMP_NUM_THREADS") == NULL)
+        if (bFullOmpSupport && getenv("OMP_NUM_THREADS") == nullptr)
         {
             gmx_warning("%s=%d is set, the default number of threads also "
                         "needs to be set with OMP_NUM_THREADS!",
@@ -184,7 +184,7 @@ void gmx_omp_nthreads_read_env(int     *nthreads_omp,
 
     GMX_RELEASE_ASSERT(nthreads_omp, "nthreads_omp must be a non-NULL pointer");
 
-    if ((env = getenv("OMP_NUM_THREADS")) != NULL)
+    if ((env = getenv("OMP_NUM_THREADS")) != nullptr)
     {
         int nt_omp;
 
@@ -283,7 +283,7 @@ static void manage_number_of_openmp_threads(const gmx::MDLogger &mdlog,
      * - 1
      */
     nth = 1;
-    if ((env = getenv("OMP_NUM_THREADS")) != NULL)
+    if ((env = getenv("OMP_NUM_THREADS")) != nullptr)
     {
         if (!bOMP && (std::strncmp(env, "1", 1) != 0))
         {
index 72da57236925941987e081d94957c990577d6d36..f12d6f49c5d682ac47efdec1b8cdefef77d2f2d2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,7 +84,7 @@ void dd_make_local_group_indices(gmx_ga2la_t     *ga2la,
             /* Save the atoms index in the local atom numbers array */
             (*anrs_loc)[localnr] = ii;
 
-            if (coll_ind != NULL)
+            if (coll_ind != nullptr)
             {
                 /* Keep track of where this local atom belongs in the collective index array.
                  * This is needed when reducing the local arrays to a collective/global array
@@ -233,7 +233,7 @@ extern void communicate_group_positions(
      * The rest of the code is for making the group whole again in case atoms changed
      * their PBC representation / crossed a box boundary. We only do that if the
      * shifts array is allocated. */
-    if (NULL != shifts)
+    if (nullptr != shifts)
     {
         /* To make the group whole, start with a whole group and each
          * step move the assembled positions at closest distance to the positions
@@ -281,7 +281,7 @@ extern double get_sum_of_positions(rvec x[], real weight[], const int nat, dvec
     clear_dvec(dsumvec);
 
     /* Loop over all atoms and add their weighted position vectors */
-    if (weight != NULL)
+    if (weight != nullptr)
     {
         for (i = 0; i < nat; i++)
         {
@@ -314,7 +314,7 @@ extern void get_center(rvec x[], real weight[], const int nr, rvec rcenter)
 
     weight_sum = get_sum_of_positions(x, weight, nr, dcenter);
 
-    if (weight != NULL)
+    if (weight != nullptr)
     {
         denom = weight_sum; /* Divide by the sum of weight */
     }
@@ -367,7 +367,7 @@ extern void get_center_comm(
         weight_sum  = buf[3];
     }
 
-    if (weight_loc != NULL)
+    if (weight_loc != nullptr)
     {
         denom = 1.0/weight_sum; /* Divide by the sum of weight to get center of mass e.g. */
     }
index bc812c25c2d8e0da6dbe5c6e3c4e81a7bcc27d05..06fef9dbf8ed645fbaed30dcd3a211334a6a75d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,12 +74,12 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val,
     int     *ibuf, p;
     gmx_bool bCompatible;
 
-    if (NULL != log && !bQuiet)
+    if (nullptr != log && !bQuiet)
     {
         fprintf(log, "Multi-checking %s ... ", name);
     }
 
-    if (ms == NULL)
+    if (ms == nullptr)
     {
         gmx_fatal(FARGS,
                   "check_multi_int called with a NULL communication pointer");
@@ -97,14 +97,14 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms, int val,
 
     if (bCompatible)
     {
-        if (NULL != log && !bQuiet)
+        if (nullptr != log && !bQuiet)
         {
             fprintf(log, "OK\n");
         }
     }
     else
     {
-        if (NULL != log)
+        if (nullptr != log)
         {
             fprintf(log, "\n%s is not equal for all subsystems\n", name);
             for (p = 0; p < ms->nsim; p++)
@@ -127,12 +127,12 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
     int               p;
     gmx_bool          bCompatible;
 
-    if (NULL != log && !bQuiet)
+    if (nullptr != log && !bQuiet)
     {
         fprintf(log, "Multi-checking %s ... ", name);
     }
 
-    if (ms == NULL)
+    if (ms == nullptr)
     {
         gmx_fatal(FARGS,
                   "check_multi_int called with a NULL communication pointer");
@@ -150,7 +150,7 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
 
     if (bCompatible)
     {
-        if (NULL != log && !bQuiet)
+        if (nullptr != log && !bQuiet)
         {
             fprintf(log, "OK\n");
         }
@@ -159,7 +159,7 @@ void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
     {
         // TODO Part of this error message would also be good to go to
         // stderr (from one rank of one sim only)
-        if (NULL != log)
+        if (nullptr != log)
         {
             fprintf(log, "\n%s is not equal for all subsystems\n", name);
             for (p = 0; p < ms->nsim; p++)
@@ -232,7 +232,7 @@ void gmx_log_close(FILE *fp)
 {
     if (fp)
     {
-        gmx_fatal_set_log_file(NULL);
+        gmx_fatal_set_log_file(nullptr);
         gmx_fio_fclose(fp);
     }
 }
index 5ef335d81b0c374e5de865a5120067afe0117b96..af7db38b2d73ea02be4a8405c8a744d834452594 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -224,7 +224,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
             {
                 wallcycle_start(wcycle, ewcMoveE);
                 global_stat(gstat, cr, enerd, force_vir, shake_vir, mu_tot,
-                            ir, ekind, constr, bStopCM ? vcm : NULL,
+                            ir, ekind, constr, bStopCM ? vcm : nullptr,
                             signalBuffer.size(), signalBuffer.data(),
                             totalNumberOfBondedInteractions,
                             *bSumEkinhOld, flags);
@@ -631,7 +631,7 @@ void set_state_entries(t_state *state, const t_inputrec *ir)
     }
     if (ir->eSwapCoords != eswapNO)
     {
-        if (state->swapstate == NULL)
+        if (state->swapstate == nullptr)
         {
             snew(state->swapstate, 1);
         }
index bbcba4bfaee2e1e580f9798c272f6a1a78eaaa6f..15cca135cbe945af7e828da005dd24261d1b6417 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -204,11 +204,11 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
          * Therefore, when adding code, the user should use something like:
          * gprnrU1 = (md->cU1==NULL ? 0 : md->cU1[localatindex])
          */
-        if (mtop->groups.grpnr[egcUser1] != NULL)
+        if (mtop->groups.grpnr[egcUser1] != nullptr)
         {
             srenew(md->cU1, md->nalloc);
         }
-        if (mtop->groups.grpnr[egcUser2] != NULL)
+        if (mtop->groups.grpnr[egcUser2] != nullptr)
         {
             srenew(md->cU2, md->nalloc);
         }
@@ -232,7 +232,7 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
             real     mA, mB, fac;
             real     c6, c12;
 
-            if (index == NULL)
+            if (index == nullptr)
             {
                 ag = i;
             }
@@ -397,7 +397,7 @@ void atoms2md(const gmx_mtop_t *mtop, const t_inputrec *ir,
 
             if (ir->bQMMM)
             {
-                if (groups->grpnr[egcQMMM] == 0 ||
+                if (groups->grpnr[egcQMMM] == nullptr ||
                     groups->grpnr[egcQMMM][ag] < groups->grps[egcQMMM].nr-1)
                 {
                     md->bQM[i]      = TRUE;
index e654ae5c49c4879d4635ecf6d417788326df8131..1c6308ca4af2f351b4618cf685f2e32836831540 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -169,7 +169,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         {
             md->nCrmsd = 1;
         }
-        md->bConstrVir = (getenv("GMX_CONSTRAINTVIR") != NULL);
+        md->bConstrVir = (getenv("GMX_CONSTRAINTVIR") != nullptr);
     }
     else
     {
@@ -311,7 +311,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
     /* Pass NULL for unit to let get_ebin_space determine the units
      * for interaction_function[i].longname
      */
-    md->ie    = get_ebin_space(md->ebin, md->f_nre, ener_nm, NULL);
+    md->ie    = get_ebin_space(md->ebin, md->f_nre, ener_nm, nullptr);
     if (md->nCrmsd)
     {
         /* This should be called directly after the call for md->ie,
@@ -567,10 +567,10 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         do_enxnms(fp_ene, &md->ebin->nener, &md->ebin->enm);
     }
 
-    md->print_grpnms = NULL;
+    md->print_grpnms = nullptr;
 
     /* check whether we're going to write dh histograms */
-    md->dhc = NULL;
+    md->dhc = nullptr;
     if (ir->fepvals->separate_dhdl_file == esepdhdlfileNO)
     {
         /* Currently dh histograms are only written with dynamics */
@@ -580,7 +580,7 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
 
             mde_delta_h_coll_init(md->dhc, ir);
         }
-        md->fp_dhdl = NULL;
+        md->fp_dhdl = nullptr;
         snew(md->dE, ir->fepvals->n_lambda);
     }
     else
@@ -1105,7 +1105,7 @@ void upd_mdebin(t_mdebin       *md,
         {
             /* zero for simulated tempering */
             md->dE[i] = enerd->enerpart_lambda[i+1]-enerd->enerpart_lambda[0];
-            if (md->temperatures != NULL)
+            if (md->temperatures != nullptr)
             {
                 /* MRS: is this right, given the way we have defined the exchange probabilities? */
                 /* is this even useful to have at all? */
@@ -1437,7 +1437,7 @@ void print_ebin(ener_file_t fp_ene, gmx_bool bEne, gmx_bool bDR, gmx_bool bOR,
 
             if (md->nE > 1)
             {
-                if (md->print_grpnms == NULL)
+                if (md->print_grpnms == nullptr)
                 {
                     snew(md->print_grpnms, md->nE);
                     n = 0;
index 00835be260df2d94c32d9e2775fe176a5040bedc..f50e0c61dcd0f27b4a6ede9a78da38d783ef40af 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,7 +85,7 @@ static void mde_delta_h_init(t_mde_delta_h *dh, int nbins,
     dh->ndhmax = ndhmax+2;
     for (i = 0; i < 2; i++)
     {
-        dh->bin[i] = NULL;
+        dh->bin[i] = nullptr;
     }
 
     snew(dh->dh, dh->ndhmax);
@@ -265,7 +265,7 @@ void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
         {
             blk->sub[2].nr   = 0;
             blk->sub[2].type = xdr_datatype_float;
-            blk->sub[2].fval = NULL;
+            blk->sub[2].fval = nullptr;
         }
     }
     else
@@ -410,9 +410,9 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
     else
     {
         /* don't allocate the meta-data subblocks for lambda vectors */
-        dhc->native_lambda_vec        = NULL;
+        dhc->native_lambda_vec        = nullptr;
         dhc->n_lambda_vec             = 0;
-        dhc->native_lambda_components = 0;
+        dhc->native_lambda_components = nullptr;
         dhc->lambda_index             = -1;
     }
     /* allocate metadata subblocks */
@@ -422,9 +422,9 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
     /* now decide which data to write out */
     dhc->nlambda     = 0;
     dhc->ndhdl       = 0;
-    dhc->dh_expanded = NULL;
-    dhc->dh_energy   = NULL;
-    dhc->dh_pv       = NULL;
+    dhc->dh_expanded = nullptr;
+    dhc->dh_energy   = nullptr;
+    dhc->dh_pv       = nullptr;
 
     /* total number of raw data point collections in the sample */
     dhc->ndh = 0;
@@ -486,7 +486,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_expanded = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtEXPANDED, 0, 0, NULL);
+                             dhbtEXPANDED, 0, 0, nullptr);
             n++;
         }
         if (bEnergy)
@@ -494,7 +494,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_energy = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtEN, 0, 0, NULL);
+                             dhbtEN, 0, 0, nullptr);
             n++;
         }
         /* add the dhdl's */
@@ -553,7 +553,7 @@ void mde_delta_h_coll_init(t_mde_delta_h_coll *dhc, const t_inputrec *ir)
             dhc->dh_pv = dhc->dh+n;
             mde_delta_h_init(dhc->dh+n, ir->fepvals->dh_hist_size,
                              ir->fepvals->dh_hist_spacing, ndhmax,
-                             dhbtPV, 0, 0, NULL);
+                             dhbtPV, 0, 0, nullptr);
             n++;
         }
     }
@@ -584,15 +584,15 @@ void mde_delta_h_coll_add_dh(t_mde_delta_h_coll *dhc,
     {
         mde_delta_h_add_dh(dhc->dh_du+i, foreign_dU[i]);
     }
-    if (dhc->dh_pv != NULL)
+    if (dhc->dh_pv != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_pv, pV);
     }
-    if (dhc->dh_energy != NULL)
+    if (dhc->dh_energy != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_energy, energy);
     }
-    if (dhc->dh_expanded != NULL)
+    if (dhc->dh_expanded != nullptr)
     {
         mde_delta_h_add_dh(dhc->dh_expanded, fep_state);
     }
@@ -614,7 +614,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
 
     /* only allocate lambda vector component blocks if they must be written out
        for backward compatibility */
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         add_subblocks_enxblock(blk, 2);
     }
@@ -629,7 +629,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
     dhc->subblock_d[3] = dhc->start_lambda; /* old-style lambda at starttime */
     dhc->subblock_d[4] = dhc->delta_lambda; /* lambda diff. between samples */
     /* set the lambda vector components if they exist */
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         for (i = 0; i < dhc->n_lambda_vec; i++)
         {
@@ -641,7 +641,7 @@ void mde_delta_h_coll_handle_block(t_mde_delta_h_coll *dhc,
     blk->sub[0].type = xdr_datatype_double;
     blk->sub[0].dval = dhc->subblock_d;
 
-    if (dhc->native_lambda_components != NULL)
+    if (dhc->native_lambda_components != nullptr)
     {
         dhc->subblock_i[0] = dhc->lambda_index;
         /* set the lambda vector component IDs if they exist */
index 80f2d5d407e80220e9fb927aa078defbdec5ca59..cd6767c76948c4c378dba4bf5398705c56c1ed84 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -90,12 +90,12 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
 
     snew(of, 1);
 
-    of->fp_trn       = NULL;
-    of->fp_ene       = NULL;
-    of->fp_xtc       = NULL;
-    of->tng          = NULL;
-    of->tng_low_prec = NULL;
-    of->fp_dhdl      = NULL;
+    of->fp_trn       = nullptr;
+    of->fp_ene       = nullptr;
+    of->fp_xtc       = nullptr;
+    of->tng          = nullptr;
+    of->tng_low_prec = nullptr;
+    of->fp_dhdl      = nullptr;
 
     of->eIntegrator             = ir->eI;
     of->bExpanded               = ir->bExpanded;
@@ -103,7 +103,7 @@ gmx_mdoutf_t init_mdoutf(FILE *fplog, int nfile, const t_filenm fnm[],
     of->simulation_part         = ir->simulation_part;
     of->x_compression_precision = static_cast<int>(ir->x_compression_precision);
     of->wcycle                  = wcycle;
-    of->f_global                = NULL;
+    of->f_global                = nullptr;
 
     if (MASTER(cr))
     {
@@ -300,9 +300,9 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
 
         if (mdof_flags & (MDOF_X | MDOF_V | MDOF_F))
         {
-            const rvec *x = (mdof_flags & MDOF_X) ? as_rvec_array(state_global->x.data()) : NULL;
-            const rvec *v = (mdof_flags & MDOF_V) ? as_rvec_array(state_global->v.data()) : NULL;
-            const rvec *f = (mdof_flags & MDOF_F) ? f_global : NULL;
+            const rvec *x = (mdof_flags & MDOF_X) ? as_rvec_array(state_global->x.data()) : nullptr;
+            const rvec *v = (mdof_flags & MDOF_V) ? as_rvec_array(state_global->v.data()) : nullptr;
+            const rvec *f = (mdof_flags & MDOF_F) ? f_global : nullptr;
 
             if (of->fp_trn)
             {
@@ -336,7 +336,7 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
         }
         if (mdof_flags & MDOF_X_COMPRESSED)
         {
-            rvec *xxtc = NULL;
+            rvec *xxtc = nullptr;
 
             if (of->natoms_x_compressed == of->natoms_global)
             {
@@ -373,8 +373,8 @@ void mdoutf_write_to_trajectory_files(FILE *fplog, t_commrec *cr,
                            state_local->box,
                            of->natoms_x_compressed,
                            xxtc,
-                           NULL,
-                           NULL);
+                           nullptr,
+                           nullptr);
             if (of->natoms_x_compressed != of->natoms_global)
             {
                 sfree(xxtc);
@@ -396,7 +396,7 @@ void mdoutf_tng_close(gmx_mdoutf_t of)
 
 void done_mdoutf(gmx_mdoutf_t of, const t_inputrec *ir)
 {
-    if (of->fp_ene != NULL)
+    if (of->fp_ene != nullptr)
     {
         close_enx(of->fp_ene);
     }
@@ -408,12 +408,12 @@ void done_mdoutf(gmx_mdoutf_t of, const t_inputrec *ir)
     {
         gmx_trr_close(of->fp_trn);
     }
-    if (of->fp_dhdl != NULL)
+    if (of->fp_dhdl != nullptr)
     {
         gmx_fio_fclose(of->fp_dhdl);
     }
     ir->efield->finishOutput();
-    if (of->f_global != NULL)
+    if (of->f_global != nullptr)
     {
         sfree(of->f_global);
     }
index 3636544d43c178347189b12fe9cf64371fdbfa39..bbc42e576222656dfa7be88cc2963c55bf4b0bf8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,7 +82,7 @@ void mdAlgorithmsSetupAtomData(t_commrec         *cr,
     else
     {
         numAtomIndex = -1;
-        atomIndex    = NULL;
+        atomIndex    = nullptr;
         numHomeAtoms = top_global->natoms;
     }
     atoms2md(top_global, ir, numAtomIndex, atomIndex, numHomeAtoms, mdatoms);
@@ -123,11 +123,11 @@ void mdAlgorithmsSetupAtomData(t_commrec         *cr,
     {
         GMX_ASSERT(graph != NULL, "We use a graph with PBC (no periodic mols) and without DD");
 
-        *graph = mk_graph(NULL, &(top->idef), 0, top_global->natoms, FALSE, FALSE);
+        *graph = mk_graph(nullptr, &(top->idef), 0, top_global->natoms, FALSE, FALSE);
     }
-    else if (graph != NULL)
+    else if (graph != nullptr)
     {
-        *graph = NULL;
+        *graph = nullptr;
     }
 
     /* Note that with DD only flexible constraints, not shells, are supported
index 2dcdc2e22853ae57a1b7d1cbf4ed3643ca6b88df..b3529be7ca456cbb6aebbc94146c952b06df4ea5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -343,13 +343,13 @@ void init_em(FILE *fplog, const char *title,
     state_global->ngtc = 0;
 
     /* Initialize lambda variables */
-    initialize_lambdas(fplog, ir, &(state_global->fep_state), &state_global->lambda, NULL);
+    initialize_lambdas(fplog, ir, &(state_global->fep_state), &state_global->lambda, nullptr);
 
     init_nrnb(nrnb);
 
     /* Interactive molecular dynamics */
     init_IMD(ir, cr, top_global, fplog, 1, as_rvec_array(state_global->x.data()),
-             nfile, fnm, NULL, imdport, Flags);
+             nfile, fnm, nullptr, imdport, Flags);
 
     if (ir->eI == eiNM)
     {
@@ -368,9 +368,9 @@ void init_em(FILE *fplog, const char *title,
         /* With energy minimization, shells and flexible constraints are
          * automatically minimized when treated like normal DOFS.
          */
-        if (shellfc != NULL)
+        if (shellfc != nullptr)
         {
-            *shellfc = NULL;
+            *shellfc = nullptr;
         }
     }
 
@@ -385,10 +385,10 @@ void init_em(FILE *fplog, const char *title,
                             state_global, top_global, ir,
                             &ems->s, &ems->f, mdatoms, *top,
                             fr, vsite, constr,
-                            nrnb, NULL, FALSE);
+                            nrnb, nullptr, FALSE);
         dd_store_state(cr->dd, &ems->s);
 
-        *graph = NULL;
+        *graph = nullptr;
     }
     else
     {
@@ -403,7 +403,7 @@ void init_em(FILE *fplog, const char *title,
         snew(*top, 1);
         mdAlgorithmsSetupAtomData(cr, ir, top_global, *top, fr,
                                   graph, mdatoms,
-                                  vsite, shellfc ? *shellfc : NULL);
+                                  vsite, shellfc ? *shellfc : nullptr);
 
         update_mdatoms(mdatoms, state_global->lambda[efptFEP]);
 
@@ -431,14 +431,14 @@ void init_em(FILE *fplog, const char *title,
         {
             /* Constrain the starting coordinates */
             dvdl_constr = 0;
-            constrain(PAR(cr) ? NULL : fplog, TRUE, TRUE, constr, &(*top)->idef,
+            constrain(PAR(cr) ? nullptr : fplog, TRUE, TRUE, constr, &(*top)->idef,
                       ir, cr, -1, 0, 1.0, mdatoms,
                       as_rvec_array(ems->s.x.data()),
                       as_rvec_array(ems->s.x.data()),
-                      NULL,
+                      nullptr,
                       fr->bMolPBC, ems->s.box,
                       ems->s.lambda[efptFEP], &dvdl_constr,
-                      NULL, NULL, nrnb, econqCoord);
+                      nullptr, nullptr, nrnb, econqCoord);
         }
     }
 
@@ -448,19 +448,19 @@ void init_em(FILE *fplog, const char *title,
     }
     else
     {
-        *gstat = NULL;
+        *gstat = nullptr;
     }
 
-    *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, NULL, wcycle);
+    *outf = init_mdoutf(fplog, nfile, fnm, 0, cr, ir, top_global, nullptr, wcycle);
 
     snew(*enerd, 1);
     init_enerdata(top_global->groups.grps[egcENER].nr, ir->fepvals->n_lambda,
                   *enerd);
 
-    if (mdebin != NULL)
+    if (mdebin != nullptr)
     {
         /* Init bin for energy stuff */
-        *mdebin = init_mdebin(mdoutf_get_fp_ene(*outf), top_global, ir, NULL);
+        *mdebin = init_mdebin(mdoutf_get_fp_ene(*outf), top_global, ir, nullptr);
     }
 
     clear_rvec(mu_tot);
@@ -525,7 +525,7 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
                                      &state->s, state_global, energyHistory,
                                      &state->f);
 
-    if (confout != NULL && MASTER(cr))
+    if (confout != nullptr && MASTER(cr))
     {
         if (ir->ePBC != epbcNONE && !ir->bPeriodicMols && DOMAINDECOMP(cr))
         {
@@ -536,7 +536,7 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
 
         write_sto_conf_mtop(confout,
                             *top_global->name, top_global,
-                            as_rvec_array(state_global->x.data()), NULL, ir->ePBC, state_global->box);
+                            as_rvec_array(state_global->x.data()), nullptr, ir->ePBC, state_global->box);
     }
 }
 
@@ -661,12 +661,12 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
         validStep   =
-            constrain(NULL, TRUE, TRUE, constr, &top->idef,
+            constrain(nullptr, TRUE, TRUE, constr, &top->idef,
                       ir, cr, count, 0, 1.0, md,
                       as_rvec_array(s1->x.data()), as_rvec_array(s2->x.data()),
-                      NULL, bMolPBC, s2->box,
+                      nullptr, bMolPBC, s2->box,
                       s2->lambda[efptBONDED], &dvdl_constr,
-                      NULL, NULL, nrnb, econqCoord);
+                      nullptr, nullptr, nrnb, econqCoord);
         wallcycle_stop(wcycle, ewcCONSTR);
 
         // We should move this check to the different minimizers
@@ -690,7 +690,7 @@ static void em_dd_partition_system(FILE *fplog, int step, t_commrec *cr,
 {
     /* Repartition the domain decomposition */
     dd_partition_system(fplog, step, cr, FALSE, 1,
-                        NULL, top_global, ir,
+                        nullptr, top_global, ir,
                         &ems->s, &ems->f,
                         mdatoms, top, fr, vsite, constr,
                         nrnb, wcycle, FALSE);
@@ -737,7 +737,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
 
     if (vsite)
     {
-        construct_vsites(vsite, as_rvec_array(ems->s.x.data()), 1, NULL,
+        construct_vsites(vsite, as_rvec_array(ems->s.x.data()), 1, nullptr,
                          top->idef.iparams, top->idef.il,
                          fr->ePBC, fr->bMolPBC, cr, ems->s.box);
     }
@@ -758,7 +758,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
              count, nrnb, wcycle, top, &top_global->groups,
              ems->s.box, &ems->s.x, &ems->s.hist,
              &ems->f, force_vir, mdatoms, enerd, fcd,
-             &ems->s.lambda, graph, fr, vsite, mu_tot, t, NULL, TRUE,
+             &ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr, TRUE,
              GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES |
              GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY |
              (bNS ? GMX_FORCE_NS : 0));
@@ -773,8 +773,8 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         wallcycle_start(wcycle, ewcMoveE);
 
         global_stat(gstat, cr, enerd, force_vir, shake_vir, mu_tot,
-                    inputrec, NULL, NULL, NULL, 1, &terminate,
-                    NULL, FALSE,
+                    inputrec, nullptr, nullptr, nullptr, 1, &terminate,
+                    nullptr, FALSE,
                     CGLO_ENERGY |
                     CGLO_PRESSURE |
                     CGLO_CONSTRAINT);
@@ -798,12 +798,12 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         wallcycle_start(wcycle, ewcCONSTR);
         dvdl_constr = 0;
         rvec *f_rvec = as_rvec_array(ems->f.data());
-        constrain(NULL, FALSE, FALSE, constr, &top->idef,
+        constrain(nullptr, FALSE, FALSE, constr, &top->idef,
                   inputrec, cr, count, 0, 1.0, mdatoms,
                   as_rvec_array(ems->s.x.data()), f_rvec, f_rvec,
                   fr->bMolPBC, ems->s.box,
                   ems->s.lambda[efptBONDED], &dvdl_constr,
-                  NULL, &shake_vir, nrnb, econqForceDispl);
+                  nullptr, &shake_vir, nrnb, econqForceDispl);
         enerd->term[F_DVDL_CONSTR] += dvdl_constr;
         m_add(force_vir, shake_vir, vir);
         wallcycle_stop(wcycle, ewcCONSTR);
@@ -1032,7 +1032,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
     init_em(fplog, CG, cr, inputrec,
             state_global, top_global, s_min, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
-            vsite, constr, NULL,
+            vsite, constr, nullptr,
             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
 
     /* Print to log file */
@@ -1066,7 +1066,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         /* Copy stuff to the energy bin for easy printing etc. */
         upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                    mdatoms->tmass, enerd, &s_min->s, inputrec->fepvals, inputrec->expandedvals, s_min->s.box,
-                   NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                   nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
         print_ebin_header(fplog, step, step);
         print_ebin(mdoutf_get_fp_ene(outf), TRUE, FALSE, FALSE, fplog, step, step, eprNORMAL,
@@ -1138,7 +1138,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         }
 
         /* Calculate the norm of the search vector */
-        get_f_norm_max(cr, &(inputrec->opts), mdatoms, pm, &pnorm, NULL, NULL);
+        get_f_norm_max(cr, &(inputrec->opts), mdatoms, pm, &pnorm, nullptr, nullptr);
 
         /* Just in case stepsize reaches zero due to numerical precision... */
         if (stepsize <= 0)
@@ -1194,7 +1194,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         do_x = do_per_step(step, inputrec->nstxout);
         do_f = do_per_step(step, inputrec->nstfout);
 
-        write_em_traj(fplog, cr, outf, do_x, do_f, NULL,
+        write_em_traj(fplog, cr, outf, do_x, do_f, nullptr,
                       top_global, inputrec, step,
                       s_min, state_global, energyHistory);
 
@@ -1497,7 +1497,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
             /* Store the new (lower) energies */
             upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                        mdatoms->tmass, enerd, &s_min->s, inputrec->fepvals, inputrec->expandedvals, s_min->s.box,
-                       NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                       nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
             do_log = do_per_step(step, inputrec->nstlog);
             do_ene = do_per_step(step, inputrec->nstenergy);
@@ -1510,7 +1510,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                 print_ebin_header(fplog, step, step);
             }
             print_ebin(mdoutf_get_fp_ene(outf), do_ene, FALSE, FALSE,
-                       do_log ? fplog : NULL, step, step, eprNORMAL,
+                       do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
 
@@ -1559,7 +1559,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         {
             /* Write final energy file entries */
             print_ebin(mdoutf_get_fp_ene(outf), !do_ene, FALSE, FALSE,
-                       !do_log ? fplog : NULL, step, step, eprNORMAL,
+                       !do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
     }
@@ -1673,7 +1673,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
         gmx_fatal(FARGS, "Cannot do parallel L-BFGS Minimization - yet.\n");
     }
 
-    if (NULL != constr)
+    if (nullptr != constr)
     {
         gmx_fatal(FARGS, "The combination of constraints and L-BFGS minimization is not implemented. Either do not use constraints, or use another minimizer (e.g. steepest descent).");
     }
@@ -1706,7 +1706,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
     init_em(fplog, LBFGS, cr, inputrec,
             state_global, top_global, &ems, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
-            vsite, constr, NULL,
+            vsite, constr, nullptr,
             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
 
     start = 0;
@@ -1755,7 +1755,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
 
     if (vsite)
     {
-        construct_vsites(vsite, as_rvec_array(state_global->x.data()), 1, NULL,
+        construct_vsites(vsite, as_rvec_array(state_global->x.data()), 1, nullptr,
                          top->idef.iparams, top->idef.il,
                          fr->ePBC, fr->bMolPBC, cr, state_global->box);
     }
@@ -1777,7 +1777,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
         /* Copy stuff to the energy bin for easy printing etc. */
         upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                    mdatoms->tmass, enerd, state_global, inputrec->fepvals, inputrec->expandedvals, state_global->box,
-                   NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                   nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
         print_ebin_header(fplog, step, step);
         print_ebin(mdoutf_get_fp_ene(outf), TRUE, FALSE, FALSE, fplog, step, step, eprNORMAL,
@@ -2278,7 +2278,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
             /* Store the new (lower) energies */
             upd_mdebin(mdebin, FALSE, FALSE, (double)step,
                        mdatoms->tmass, enerd, state_global, inputrec->fepvals, inputrec->expandedvals, state_global->box,
-                       NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                       nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
             do_log = do_per_step(step, inputrec->nstlog);
             do_ene = do_per_step(step, inputrec->nstenergy);
             if (do_log)
@@ -2286,7 +2286,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
                 print_ebin_header(fplog, step, step);
             }
             print_ebin(mdoutf_get_fp_ene(outf), do_ene, FALSE, FALSE,
-                       do_log ? fplog : NULL, step, step, eprNORMAL,
+                       do_log ? fplog : nullptr, step, step, eprNORMAL,
                        mdebin, fcd, &(top_global->groups), &(inputrec->opts));
         }
 
@@ -2334,7 +2334,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
     if (!do_ene || !do_log) /* Write final energy file entries */
     {
         print_ebin(mdoutf_get_fp_ene(outf), !do_ene, FALSE, FALSE,
-                   !do_log ? fplog : NULL, step, step, eprNORMAL,
+                   !do_log ? fplog : nullptr, step, step, eprNORMAL,
                    mdebin, fcd, &(top_global->groups), &(inputrec->opts));
     }
 
@@ -2442,7 +2442,7 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
     init_em(fplog, SD, cr, inputrec,
             state_global, top_global, s_try, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
-            vsite, constr, NULL,
+            vsite, constr, nullptr,
             nfile, fnm, &outf, &mdebin, imdport, Flags, wcycle);
 
     /* Print to log file  */
@@ -2530,7 +2530,7 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
                 /* Store the new (lower) energies  */
                 upd_mdebin(mdebin, FALSE, FALSE, (double)count,
                            mdatoms->tmass, enerd, &s_try->s, inputrec->fepvals, inputrec->expandedvals,
-                           s_try->s.box, NULL, NULL, vir, pres, NULL, mu_tot, constr);
+                           s_try->s.box, nullptr, nullptr, vir, pres, nullptr, mu_tot, constr);
 
                 /* Prepare IMD energy record, if bIMD is TRUE. */
                 IMD_fill_energy_record(inputrec->bIMD, inputrec->imd, enerd, count, TRUE);
@@ -2568,7 +2568,7 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
             /* Write to trn, if necessary */
             do_x = do_per_step(steps_accepted, inputrec->nstxout);
             do_f = do_per_step(steps_accepted, inputrec->nstfout);
-            write_em_traj(fplog, cr, outf, do_x, do_f, NULL,
+            write_em_traj(fplog, cr, outf, do_x, do_f, nullptr,
                           top_global, inputrec, count,
                           s_min, state_global, energyHistory);
         }
@@ -2598,8 +2598,8 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
         {
             if (MASTER(cr))
             {
-                warn_step(stderr, inputrec->em_tol, count == nsteps, constr != NULL);
-                warn_step(fplog, inputrec->em_tol, count == nsteps, constr != NULL);
+                warn_step(stderr, inputrec->em_tol, count == nsteps, constr != nullptr);
+                warn_step(fplog, inputrec->em_tol, count == nsteps, constr != nullptr);
             }
             bAbort = TRUE;
         }
@@ -2698,8 +2698,8 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     rvec                *fneg, *dfdx;
     gmx_bool             bSparse; /* use sparse matrix storage format */
     size_t               sz;
-    gmx_sparsematrix_t * sparse_matrix           = NULL;
-    real           *     full_matrix             = NULL;
+    gmx_sparsematrix_t * sparse_matrix           = nullptr;
+    real           *     full_matrix             = nullptr;
 
     /* added with respect to mdrun */
     int                       row, col;
@@ -2707,7 +2707,7 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     real                      x_min;
     bool                      bIsMaster = MASTER(cr);
 
-    if (constr != NULL)
+    if (constr != nullptr)
     {
         gmx_fatal(FARGS, "Constraints present with Normal Mode Analysis, this combination is not supported");
     }
@@ -2721,7 +2721,7 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             state_global, top_global, &state_work, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdatoms, &gstat,
             vsite, constr, &shellfc,
-            nfile, fnm, &outf, NULL, imdport, Flags, wcycle);
+            nfile, fnm, &outf, nullptr, imdport, Flags, wcycle);
 
     std::vector<size_t> atom_index = get_atom_index(top_global);
     snew(fneg, atom_index.size());
index 39a84ed5768fd52b2c8deec1baa94001b9222f52..d4e1a6dab8429b5a3f6a73919bb9f78346c299b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -89,7 +89,7 @@ void nbnxn_realloc_void(void **ptr,
 
     ma(&ptr_new, nbytes_new);
 
-    if (nbytes_new > 0 && ptr_new == NULL)
+    if (nbytes_new > 0 && ptr_new == nullptr)
     {
         gmx_fatal(FARGS, "Allocation of %d bytes failed", nbytes_new);
     }
@@ -102,7 +102,7 @@ void nbnxn_realloc_void(void **ptr,
         }
         memcpy(ptr_new, *ptr, nbytes_copy);
     }
-    if (*ptr != NULL)
+    if (*ptr != nullptr)
     {
         mf(*ptr);
     }
@@ -157,7 +157,7 @@ static void nbnxn_atomdata_output_init(nbnxn_atomdata_output_t *out,
                                        int nenergrp, int stride,
                                        nbnxn_alloc_t *ma)
 {
-    out->f = NULL;
+    out->f = nullptr;
     ma((void **)&out->fshift, SHIFTS*DIM*sizeof(*out->fshift));
     out->nV = nenergrp*nenergrp;
     ma((void **)&out->Vvdw, out->nV*sizeof(*out->Vvdw));
@@ -557,7 +557,7 @@ void nbnxn_atomdata_init(FILE *fp,
     char    *ptr;
     gmx_bool simple, bCombGeom, bCombLB, bSIMD;
 
-    if (alloc == NULL)
+    if (alloc == nullptr)
     {
         nbat->alloc = nbnxn_alloc_aligned;
     }
@@ -565,7 +565,7 @@ void nbnxn_atomdata_init(FILE *fp,
     {
         nbat->alloc = alloc;
     }
-    if (free == NULL)
+    if (free == nullptr)
     {
         nbat->free = nbnxn_free_aligned;
     }
@@ -588,7 +588,7 @@ void nbnxn_atomdata_init(FILE *fp,
      */
     tol = 1e-5;
     ptr = getenv("GMX_LJCOMB_TOL");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         double dbl;
 
@@ -723,8 +723,8 @@ void nbnxn_atomdata_init(FILE *fp,
     set_lj_parameter_data(nbat, bSIMD);
 
     nbat->natoms  = 0;
-    nbat->type    = NULL;
-    nbat->lj_comb = NULL;
+    nbat->type    = nullptr;
+    nbat->lj_comb = nullptr;
     if (simple)
     {
         int pack_x;
@@ -757,12 +757,12 @@ void nbnxn_atomdata_init(FILE *fp,
         nbat->XFormat = nbatXYZQ;
         nbat->FFormat = nbatXYZ;
     }
-    nbat->q        = NULL;
+    nbat->q        = nullptr;
     nbat->nenergrp = n_energygroups;
     if (!simple)
     {
         /* Energy groups not supported yet for super-sub lists */
-        if (n_energygroups > 1 && fp != NULL)
+        if (n_energygroups > 1 && fp != nullptr)
         {
             fprintf(fp, "\nNOTE: With GPUs, reporting energy group contributions is not supported\n\n");
         }
@@ -778,11 +778,11 @@ void nbnxn_atomdata_init(FILE *fp,
     {
         nbat->neg_2log++;
     }
-    nbat->energrp = NULL;
+    nbat->energrp = nullptr;
     nbat->alloc((void **)&nbat->shift_vec, SHIFTS*sizeof(*nbat->shift_vec));
     nbat->xstride = (nbat->XFormat == nbatXYZQ ? STRIDE_XYZQ : DIM);
     nbat->fstride = (nbat->FFormat == nbatXYZQ ? STRIDE_XYZQ : DIM);
-    nbat->x       = NULL;
+    nbat->x       = nullptr;
 
 #if GMX_SIMD
     if (simple)
@@ -802,15 +802,15 @@ void nbnxn_atomdata_init(FILE *fp,
                                    nbat->nenergrp, 1<<nbat->neg_2log,
                                    nbat->alloc);
     }
-    nbat->buffer_flags.flag        = NULL;
+    nbat->buffer_flags.flag        = nullptr;
     nbat->buffer_flags.flag_nalloc = 0;
 
     nth = gmx_omp_nthreads_get(emntNonbonded);
 
     ptr = getenv("GMX_USE_TREEREDUCE");
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
-        nbat->bUseTreeReduce = strtol(ptr, 0, 10);
+        nbat->bUseTreeReduce = strtol(ptr, nullptr, 10);
     }
 #if defined __MIC__
     else if (nth > 8) /*on the CPU we currently don't benefit even at 32*/
index 2727b06c9854e838b7068fe3ce686fee5ca32692..39198000157b602c1a06c031602620291b411545 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -65,11 +65,11 @@ struct gmx_domdec_zones_t;
 
 static void nbnxn_grid_init(nbnxn_grid_t * grid)
 {
-    grid->cxy_na      = NULL;
-    grid->cxy_ind     = NULL;
+    grid->cxy_na      = nullptr;
+    grid->cxy_ind     = nullptr;
     grid->cxy_nalloc  = 0;
-    grid->bb          = NULL;
-    grid->bbj         = NULL;
+    grid->bb          = nullptr;
+    grid->bbj         = nullptr;
     grid->nc_nalloc   = 0;
 }
 
@@ -1008,7 +1008,7 @@ static void sort_columns_simple(const nbnxn_search_t nbs,
 
             fill_cell(nbs, grid, nbat,
                       ash_c, ash_c+na_c, atinfo, x,
-                      NULL);
+                      nullptr);
 
             /* This copy to bbcz is not really necessary.
              * But it allows to use the same grid search code
@@ -1162,7 +1162,7 @@ static void calc_column_indices(nbnxn_grid_t *grid,
         /* Home zone */
         for (int i = n0; i < n1; i++)
         {
-            if (move == NULL || move[i] >= 0)
+            if (move == nullptr || move[i] >= 0)
             {
                 /* We need to be careful with rounding,
                  * particles might be a few bits outside the local zone.
@@ -1562,14 +1562,14 @@ void nbnxn_put_on_grid_nonlocal(nbnxn_search_t                   nbs,
             c1[d] = zones->size[zone].bb_x1[d];
         }
 
-        nbnxn_put_on_grid(nbs, nbs->ePBC, NULL,
+        nbnxn_put_on_grid(nbs, nbs->ePBC, nullptr,
                           zone, c0, c1,
                           zones->cg_range[zone],
                           zones->cg_range[zone+1],
                           -1,
                           atinfo,
                           x,
-                          0, NULL,
+                          0, nullptr,
                           nb_kernel_type,
                           nbat);
     }
index 92946aeea5a130fd80765f7af7cacc5632703ab3..818982c539baa6eef69a8ab1617a2e02165f81f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -72,7 +72,7 @@ nbnxn_kernel_gpu_ref(const nbnxn_pairlist_t     *nbl,
     const real         *x;
     gmx_bool            bEner;
     gmx_bool            bEwald;
-    const real         *Ftab = NULL;
+    const real         *Ftab = nullptr;
     real                rcut2, rvdw2, rlist2;
     int                 ntype;
     real                facel;
index 1173f432fa54bc79dadf5112c92f6ac85db65d04..9e956ec2237c12b4df090f33d540f1d3ceb5e805 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -380,7 +380,7 @@ NBK_FUNC_NAME(_VgrpF)
             }
         }
 #ifdef CALC_SHIFTFORCES
-        if (fshift != NULL)
+        if (fshift != nullptr)
         {
             /* Add i forces to shifted force list */
             for (i = 0; i < UNROLLI; i++)
index 86bf7e8897f1f3f7b65e8908cf9776baacf74ecf..e7e5842086a0487e5e3efb6eaa49f4cfbe8afc41 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #else
         const real *nbfp0     = nbfp_ptr + type[sci  ]*nbat->ntype*c_simdBestPairAlignment;
         const real *nbfp1     = nbfp_ptr + type[sci+1]*nbat->ntype*c_simdBestPairAlignment;
-        const real *nbfp2     = NULL, *nbfp3 = NULL;
+        const real *nbfp2     = nullptr, *nbfp3 = nullptr;
         if (!half_LJ)
         {
             nbfp2 = nbfp_ptr + type[sci+2]*nbat->ntype*c_simdBestPairAlignment;
index 99a30929e3f8816cfae8d80b9b8251e696c0964c..739a19432d7c6177ea57268ceafb775c61360786 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -275,12 +275,12 @@ static void nbnxn_init_pairlist_fep(t_nblist *nl)
     nl->maxnrj      = 0;
     nl->nri         = 0;
     nl->nrj         = 0;
-    nl->iinr        = NULL;
-    nl->gid         = NULL;
-    nl->shift       = NULL;
-    nl->jindex      = NULL;
-    nl->jjnr        = NULL;
-    nl->excl_fep    = NULL;
+    nl->iinr        = nullptr;
+    nl->gid         = nullptr;
+    nl->shift       = nullptr;
+    nl->jindex      = nullptr;
+    nl->jjnr        = nullptr;
+    nl->excl_fep    = nullptr;
 
 }
 
@@ -298,7 +298,7 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
 
     nbs->bFEP   = bFEP;
 
-    nbs->DomDec = (n_dd_cells != NULL);
+    nbs->DomDec = (n_dd_cells != nullptr);
 
     clear_ivec(nbs->dd_dim);
     ngrid = 1;
@@ -319,9 +319,9 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
 
     nbnxn_grids_init(nbs, ngrid);
 
-    nbs->cell        = NULL;
+    nbs->cell        = nullptr;
     nbs->cell_nalloc = 0;
-    nbs->a           = NULL;
+    nbs->a           = nullptr;
     nbs->a_nalloc    = 0;
 
     nbs->nthread_max = nthread_max;
@@ -330,9 +330,9 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
     snew(nbs->work, nbs->nthread_max);
     for (int t = 0; t < nbs->nthread_max; t++)
     {
-        nbs->work[t].cxy_na           = NULL;
+        nbs->work[t].cxy_na           = nullptr;
         nbs->work[t].cxy_na_nalloc    = 0;
-        nbs->work[t].sort_work        = NULL;
+        nbs->work[t].sort_work        = nullptr;
         nbs->work[t].sort_work_nalloc = 0;
 
         snew(nbs->work[t].nbl_fep, 1);
@@ -340,7 +340,7 @@ void nbnxn_init_search(nbnxn_search_t           * nbs_ptr,
     }
 
     /* Initialize detailed nbsearch cycle counting */
-    nbs->print_cycles = (getenv("GMX_NBNXN_CYCLE") != 0);
+    nbs->print_cycles = (getenv("GMX_NBNXN_CYCLE") != nullptr);
     nbs->search_count = 0;
     nbs_cycle_clear(nbs->cc);
     for (int t = 0; t < nbs->nthread_max; t++)
@@ -793,7 +793,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
                                 nbnxn_alloc_t    *alloc,
                                 nbnxn_free_t     *free)
 {
-    if (alloc == NULL)
+    if (alloc == nullptr)
     {
         nbl->alloc = nbnxn_alloc_aligned;
     }
@@ -801,7 +801,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
     {
         nbl->alloc = alloc;
     }
-    if (free == NULL)
+    if (free == nullptr)
     {
         nbl->free = nbnxn_free_aligned;
     }
@@ -815,19 +815,19 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
     nbl->na_ci       = 0;
     nbl->na_cj       = 0;
     nbl->nci         = 0;
-    nbl->ci          = NULL;
+    nbl->ci          = nullptr;
     nbl->ci_nalloc   = 0;
     nbl->nsci        = 0;
-    nbl->sci         = NULL;
+    nbl->sci         = nullptr;
     nbl->sci_nalloc  = 0;
     nbl->ncj         = 0;
     nbl->ncjInUse    = 0;
-    nbl->cj          = NULL;
+    nbl->cj          = nullptr;
     nbl->cj_nalloc   = 0;
     nbl->ncj4        = 0;
     /* We need one element extra in sj, so alloc initially with 1 */
     nbl->cj4_nalloc  = 0;
-    nbl->cj4         = NULL;
+    nbl->cj4         = nullptr;
     nbl->nci_tot     = 0;
 
     if (!nbl->bSimple)
@@ -837,7 +837,7 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
         GMX_ASSERT(sizeof(nbl->cj4[0].imei[0].imask)*8 >= c_nbnxnGpuJgroupSize*c_gpuNumClusterPerCell, "The i super-cluster cluster interaction mask does not contain a sufficient number of bits");
         GMX_ASSERT(sizeof(nbl->excl[0])*8 >= c_nbnxnGpuJgroupSize*c_gpuNumClusterPerCell, "The GPU exclusion mask does not contain a sufficient number of bits");
 
-        nbl->excl        = NULL;
+        nbl->excl        = nullptr;
         nbl->excl_nalloc = 0;
         nbl->nexcl       = 0;
         check_excl_space(nbl, 1);
@@ -868,9 +868,9 @@ static void nbnxn_init_pairlist(nbnxn_pairlist_t *nbl,
 #endif
     snew_aligned(nbl->work->d2, c_gpuNumClusterPerCell, NBNXN_SEARCH_BB_MEM_ALIGN);
 
-    nbl->work->sort            = NULL;
+    nbl->work->sort            = nullptr;
     nbl->work->sort_nalloc     = 0;
-    nbl->work->sci_sort        = NULL;
+    nbl->work->sci_sort        = nullptr;
     nbl->work->sci_sort_nalloc = 0;
 }
 
@@ -915,11 +915,11 @@ void nbnxn_init_pairlist_set(nbnxn_pairlist_set_t *nbl_list,
             }
             else
             {
-                nbnxn_init_pairlist(nbl_list->nbl[i], nbl_list->bSimple, NULL, NULL);
+                nbnxn_init_pairlist(nbl_list->nbl[i], nbl_list->bSimple, nullptr, nullptr);
                 if (bSimple && nbl_list->nnbl > 1)
                 {
                     snew(nbl_list->nbl_work[i], 1);
-                    nbnxn_init_pairlist(nbl_list->nbl_work[i], nbl_list->bSimple, NULL, NULL);
+                    nbnxn_init_pairlist(nbl_list->nbl_work[i], nbl_list->bSimple, nullptr, nullptr);
                 }
             }
 
@@ -2401,7 +2401,7 @@ static void clear_pairlist_fep(t_nblist *nl)
 {
     nl->nri = 0;
     nl->nrj = 0;
-    if (nl->jindex == NULL)
+    if (nl->jindex == nullptr)
     {
         snew(nl->jindex, 1);
     }
@@ -3173,9 +3173,9 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
     int               shift;
     real              shx, shy, shz;
     int               conv_i, cell0_i;
-    const nbnxn_bb_t *bb_i = NULL;
+    const nbnxn_bb_t *bb_i = nullptr;
 #if NBNXN_BBXXXX
-    const float      *pbb_i = NULL;
+    const float      *pbb_i = nullptr;
 #endif
     const float      *bbcz_i, *bbcz_j;
     const int        *flags_i;
@@ -3187,7 +3187,7 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
     int               ndistc;
     int               ncpcheck;
     int               gridi_flag_shift = 0, gridj_flag_shift = 0;
-    gmx_bitmask_t    *gridj_flag       = NULL;
+    gmx_bitmask_t    *gridj_flag       = nullptr;
     int               ncj_old_i, ncj_old_j;
 
     nbs_cycle_start(&work->cc[enbsCCsearch]);
index 9615331d465dd45669d4cd916db7904eb6c293f0..9cca369a9af99f658252d7f0a20bfe5b34f63ad5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,7 +143,7 @@ static void init_nblist(FILE *log, t_nblist *nl_sr,
         nl     = nl_sr;
         homenr = maxsr;
 
-        if (nl == NULL)
+        if (nl == nullptr)
         {
             return;
         }
@@ -177,12 +177,12 @@ static void init_nblist(FILE *log, t_nblist *nl_sr,
         nl->maxnrj      = 0;
         nl->nri         = -1;
         nl->nrj         = 0;
-        nl->iinr        = NULL;
-        nl->gid         = NULL;
-        nl->shift       = NULL;
-        nl->jindex      = NULL;
-        nl->jjnr        = NULL;
-        nl->excl_fep    = NULL;
+        nl->iinr        = nullptr;
+        nl->gid         = nullptr;
+        nl->shift       = nullptr;
+        nl->jindex      = nullptr;
+        nl->jjnr        = nullptr;
+        nl->excl_fep    = nullptr;
         reallocate_nblist(nl);
         nl->jindex[0] = 0;
 
@@ -225,7 +225,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     type                     = GMX_NBLIST_INTERACTION_STANDARD;
     bElecAndVdwSwitchDiffers = ( (fr->rcoulomb_switch != fr->rvdw_switch) || (fr->rcoulomb != fr->rvdw));
 
-    fr->ns->bCGlist = (getenv("GMX_NBLISTCG") != 0);
+    fr->ns->bCGlist = (getenv("GMX_NBLISTCG") != nullptr);
     if (!fr->ns->bCGlist)
     {
         igeometry_def = GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE;
@@ -233,7 +233,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     else
     {
         igeometry_def = GMX_NBLIST_GEOMETRY_CG_CG;
-        if (log != NULL)
+        if (log != nullptr)
         {
             fprintf(log, "\nUsing charge-group - charge-group neighbor lists and kernels\n\n");
         }
@@ -270,13 +270,13 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
                     maxsr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_ww, type, bElecAndVdwSwitchDiffers);
 
         /* Did we get the solvent loops so we can use optimized water kernels? */
-        if (nbl->nlist_sr[eNL_VDWQQ_WATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_QQ_WATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_VDWQQ_WATERWATER].kernelptr_vf == NULL
-            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == NULL)
+        if (nbl->nlist_sr[eNL_VDWQQ_WATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_QQ_WATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_VDWQQ_WATERWATER].kernelptr_vf == nullptr
+            || nbl->nlist_sr[eNL_QQ_WATERWATER].kernelptr_vf == nullptr)
         {
             fr->solvent_opt = esolNO;
-            if (log != NULL)
+            if (log != nullptr)
             {
                 fprintf(log, "Note: The available nonbonded kernels do not support water optimization - disabling.\n");
             }
@@ -295,7 +295,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
     /* QMMM MM list */
     if (fr->bQMMM && fr->qr->QMMMscheme != eQMMMschemeoniom)
     {
-        if (NULL == fr->QMMMlist)
+        if (nullptr == fr->QMMMlist)
         {
             snew(fr->QMMMlist, 1);
         }
@@ -303,7 +303,7 @@ void init_neighbor_list(FILE *log, t_forcerec *fr, int homenr)
                     maxsr, 0, 0, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_STANDARD, bElecAndVdwSwitchDiffers);
     }
 
-    if (log != NULL)
+    if (log != nullptr)
     {
         fprintf(log, "\n");
     }
@@ -564,11 +564,11 @@ put_in_list_at(gmx_bool              bHaveVdW[],
     t_nblist  *   vdwc;
     t_nblist  *   vdw;
     t_nblist  *   coul;
-    t_nblist  *   vdwc_free  = NULL;
-    t_nblist  *   vdw_free   = NULL;
-    t_nblist  *   coul_free  = NULL;
-    t_nblist  *   vdwc_ww    = NULL;
-    t_nblist  *   coul_ww    = NULL;
+    t_nblist  *   vdwc_free  = nullptr;
+    t_nblist  *   vdw_free   = nullptr;
+    t_nblist  *   coul_free  = nullptr;
+    t_nblist  *   vdwc_ww    = nullptr;
+    t_nblist  *   coul_ww    = nullptr;
 
     int           i, j, jcg, igid, gid, nbl_ind;
     int           jj, jj0, jj1, i_atom;
@@ -2132,7 +2132,7 @@ void init_ns(FILE *fplog, const t_commrec *cr,
     }
 
     ns->nra_alloc = 0;
-    ns->bexcl     = NULL;
+    ns->bexcl     = nullptr;
     if (!DOMAINDECOMP(cr))
     {
         ns_realloc_natoms(ns, mtop->natoms);
@@ -2145,7 +2145,7 @@ void init_ns(FILE *fplog, const t_commrec *cr,
         char *ptr = getenv("GMX_DUMP_NL");
         if (ptr)
         {
-            ns->dump_nl = strtol(ptr, NULL, 10);
+            ns->dump_nl = strtol(ptr, nullptr, 10);
             if (fplog)
             {
                 fprintf(fplog, "GMX_DUMP_NL = %d", ns->dump_nl);
@@ -2224,12 +2224,12 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         }
         else
         {
-            dd_zones = NULL;
+            dd_zones = nullptr;
 
-            get_nsgrid_boundaries(grid->nboundeddim, box, NULL, NULL, NULL, NULL,
+            get_nsgrid_boundaries(grid->nboundeddim, box, nullptr, nullptr, nullptr, nullptr,
                                   cgs->nr, fr->cg_cm, grid_x0, grid_x1, &grid_dens);
 
-            grid_first(log, grid, NULL, NULL, box, grid_x0, grid_x1,
+            grid_first(log, grid, nullptr, nullptr, box, grid_x0, grid_x1,
                        fr->rlist, grid_dens);
         }
 
@@ -2245,7 +2245,7 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         }
         else
         {
-            fill_grid(NULL, grid, cgs->nr, fr->cg0, fr->hcg, fr->cg_cm);
+            fill_grid(nullptr, grid, cgs->nr, fr->cg0, fr->hcg, fr->cg_cm);
             grid->icg0 = fr->cg0;
             grid->icg1 = fr->hcg;
         }
@@ -2265,7 +2265,7 @@ int search_neighbours(FILE *log, t_forcerec *fr,
         /* Set the grid cell index for the test particle only.
          * The cell to cg index is not corrected, but that does not matter.
          */
-        fill_grid(NULL, ns->grid, fr->hcg, fr->hcg-1, fr->hcg, fr->cg_cm);
+        fill_grid(nullptr, ns->grid, fr->hcg, fr->hcg-1, fr->hcg, fr->cg_cm);
     }
 
     if (!fr->ns->bCGlist)
index 94e43163d419e2f53e4b4aa5a46242d0fdea8fec..8b6b40f0a97b4c1e22ff65a7fda1b215dd797a4d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -148,13 +148,13 @@ void get_nsgrid_boundaries(int nboundeddim, matrix box,
     {
         if (d < nboundeddim)
         {
-            grid_x0[d] = (gr0 != NULL ? (*gr0)[d] : 0);
-            grid_x1[d] = (gr1 != NULL ? (*gr1)[d] : box[d][d]);
+            grid_x0[d] = (gr0 != nullptr ? (*gr0)[d] : 0);
+            grid_x1[d] = (gr1 != nullptr ? (*gr1)[d] : box[d][d]);
             vol       *= (grid_x1[d] - grid_x0[d]);
         }
         else
         {
-            if (ddbox == NULL)
+            if (ddbox == nullptr)
             {
                 get_nsgrid_boundaries_vac(av[d], stddev[d],
                                           &grid_x0[d], &grid_x1[d],
@@ -173,13 +173,13 @@ void get_nsgrid_boundaries(int nboundeddim, matrix box,
                 bdens1 = grid_x1[d];
             }
             /* Check for a DD cell not at a lower edge */
-            if (dd != NULL && gr0 != NULL && dd->ci[d] > 0)
+            if (dd != nullptr && gr0 != nullptr && dd->ci[d] > 0)
             {
                 grid_x0[d] = (*gr0)[d];
                 bdens0     = (*gr0)[d];
             }
             /* Check for a DD cell not at a higher edge */
-            if (dd != NULL && gr1 != NULL && dd->ci[d] < dd->nc[d]-1)
+            if (dd != nullptr && gr1 != nullptr && dd->ci[d] < dd->nc[d]-1)
             {
                 grid_x1[d] = (*gr1)[d];
                 bdens1     = (*gr1)[d];
@@ -683,7 +683,7 @@ void fill_grid(gmx_domdec_zones_t *dd_zones,
         fprintf(debug, "Filling grid from %d to %d\n", cg0, cg1);
     }
 
-    if (dd_zones == NULL)
+    if (dd_zones == nullptr)
     {
         for (cg = cg0; cg < cg1; cg++)
         {
index d6140720d6ea8197d2a3c2e8b4f0c5ecfde168c1..ea4549eaf2b01a61f1d18e14f195952eea28f93c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -267,11 +267,11 @@ void count_bonded_distances(const gmx_mtop_t *mtop, const t_inputrec *ir,
         fprintf(debug, "nr. of distance calculations in bondeds: C %.1f SIMD %.1f\n", ndtot_c, ndtot_simd);
     }
 
-    if (ndistance_c    != NULL)
+    if (ndistance_c    != nullptr)
     {
         *ndistance_c    = ndtot_c;
     }
-    if (ndistance_simd != NULL)
+    if (ndistance_simd != nullptr)
     {
         *ndistance_simd = ndtot_simd;
     }
index fb4bc9dd620e889ccf30c920404ef3ea983a5a19..57d5e9fd1c49c1718ede1cd517749a21b7d8ce8e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,11 +131,11 @@ void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
 
     /* here we include the insertion of the additional orca-input */
     snew(buf, 200);
-    if (addInputFile != NULL)
+    if (addInputFile != nullptr)
     {
         while (!feof(addInputFile))
         {
-            if (fgets(buf, 200, addInputFile) != NULL)
+            if (fgets(buf, 200, addInputFile) != nullptr)
             {
                 fputs(buf, out);
             }
@@ -278,17 +278,17 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
     {
         sprintf(orca_xyzFilename, "%s.xyz", qm->orca_basename);
         xyz = fopen(orca_xyzFilename, "r");
-        if (fgets(buf, 300, xyz) == NULL)
+        if (fgets(buf, 300, xyz) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
-        if (fgets(buf, 300, xyz) == NULL)
+        if (fgets(buf, 300, xyz) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
         for (i = 0; i < qm->nrQMatoms; i++)
         {
-            if (fgets(buf, 300, xyz) == NULL)
+            if (fgets(buf, 300, xyz) == nullptr)
             {
                 gmx_fatal(FARGS, "Unexpected end of ORCA output");
             }
@@ -320,14 +320,14 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
      */
     for (j = 0; j < 7; j++)
     {
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
     }
     /* now comes the energy
      */
-    if (fgets(buf, 300, engrad) == NULL)
+    if (fgets(buf, 300, engrad) == nullptr)
     {
         gmx_fatal(FARGS, "Unexpected end of ORCA output");
     }
@@ -340,7 +340,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
      */
     for (j = 0; j < 3; j++)
     {
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
@@ -353,7 +353,7 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
     for (i = 0; i < 3*qm->nrQMatoms; i++)
     {
         k = i/3;
-        if (fgets(buf, 300, engrad) == NULL)
+        if (fgets(buf, 300, engrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
@@ -397,13 +397,13 @@ real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
          */
         /* we can skip the first line
          */
-        if (fgets(buf, 300, pcgrad) == NULL)
+        if (fgets(buf, 300, pcgrad) == nullptr)
         {
             gmx_fatal(FARGS, "Unexpected end of ORCA output");
         }
         for (i = 0; i < mm->nrMMatoms; i++)
         {
-            if (fgets(buf, 300, pcgrad) == NULL)
+            if (fgets(buf, 300, pcgrad) == nullptr)
             {
                 gmx_fatal(FARGS, "Unexpected end of ORCA output");
             }
index a5ad681b1844a7451ae195047f81f1627592ccee..7342b77999055a8ea88f6b4f265e86d1eae49c49 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -250,9 +250,9 @@ static void punch_QMMM_excl(t_QMrec *qm, t_MMrec *mm, t_blocka *excls)
      * Only needed in case of QM/MM optimizations
      */
     FILE
-       *out = NULL;
+       *out = nullptr;
     int
-        i, j, k, nrexcl = 0, *excluded = NULL, max_excl = 0;
+        i, j, k, nrexcl = 0, *excluded = nullptr, max_excl = 0;
 
 
     out = fopen("QMMMexcl.dat", "w");
@@ -455,7 +455,7 @@ void init_QMMMrec(t_commrec  *cr,
      */
 
     gmx_groups_t            *groups;
-    int                     *qm_arr = NULL, vsite, ai, aj;
+    int                     *qm_arr = nullptr, vsite, ai, aj;
     int                      qm_max = 0, qm_nr = 0, i, j, jmax, k, l, nrvsite2 = 0;
     t_QMMMrec               *qr;
     t_MMrec                 *mm;
@@ -663,7 +663,7 @@ void init_QMMMrec(t_commrec  *cr,
         for (k = 0; k < qm_nr; k++)
         {
             int     indexInMolecule;
-            mtopGetMolblockIndex(mtop, qm_arr[k], &molb, NULL, &indexInMolecule);
+            mtopGetMolblockIndex(mtop, qm_arr[k], &molb, nullptr, &indexInMolecule);
             t_atom *atom = &mtop->moltype[mtop->molblock[molb].type].atoms.atom[indexInMolecule];
             atom->q  = 0.0;
             atom->qB = 0.0;
@@ -687,7 +687,7 @@ void init_QMMMrec(t_commrec  *cr,
          */
         for (i = 0; i < qm_nr; i++)
         {
-            mtopGetMolblockIndex(mtop, qm_arr[i], &molb, NULL, &a_offset);
+            mtopGetMolblockIndex(mtop, qm_arr[i], &molb, nullptr, &a_offset);
             ilist_mol = mtop->moltype[mtop->molblock[molb].type].ilist;
             nrvsite2  = ilist_mol[F_VSITE2].nr;
             iatoms    = ilist_mol[F_VSITE2].iatoms;
@@ -782,7 +782,7 @@ void update_QMMMrec(t_commrec      *cr,
     int
         mm_max = 0, mm_nr = 0, mm_nr_new, i, j, is, k, shift;
     t_j_particle
-       *mm_j_particles = NULL, *qm_i_particles = NULL;
+       *mm_j_particles = nullptr, *qm_i_particles = nullptr;
     t_QMMMrec
        *qr;
     t_nblist
@@ -796,7 +796,7 @@ void update_QMMMrec(t_commrec      *cr,
     t_pbc
         pbc;
     int
-       *parallelMMarray = NULL;
+       *parallelMMarray = nullptr;
     real
         c12au, c6au;
 
@@ -1087,10 +1087,10 @@ real calculate_QMMM(t_commrec *cr,
     t_QMrec
     *qm, *qm2;
     t_MMrec
-    *mm = NULL;
+    *mm = nullptr;
     rvec
-    *forces  = NULL, *fshift = NULL,
-    *forces2 = NULL, *fshift2 = NULL; /* needed for multilayer ONIOM */
+    *forces  = nullptr, *fshift = nullptr,
+    *forces2 = nullptr, *fshift2 = nullptr; /* needed for multilayer ONIOM */
     int
         i, j, k;
     /* make a local copy the QMMMrec pointer
index d5b320b821fcefc1ce8bcdb782d14e166106bd5a..adeb79f39428d8a0c6acecd8a552bb2b543ef8c1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,10 +66,10 @@ gmx_shakedata_t shake_init()
     snew(d, 1);
 
     d->nalloc                      = 0;
-    d->rij                         = NULL;
-    d->half_of_reduced_mass        = NULL;
-    d->distance_squared_tolerance  = NULL;
-    d->constraint_distance_squared = NULL;
+    d->rij                         = nullptr;
+    d->half_of_reduced_mass        = nullptr;
+    d->distance_squared_tolerance  = nullptr;
+    d->constraint_distance_squared = nullptr;
 
     /* SOR initialization */
     d->delta = 0.1;
@@ -301,7 +301,7 @@ int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
         i     = ia[1];
         j     = ia[2];
 
-        if ((econq == econqCoord) && v != NULL)
+        if ((econq == econqCoord) && v != nullptr)
         {
             /* Correct the velocities */
             mm = scaled_lagrange_multiplier[ll]*invmass[i]*invdt;
index a92d32503f76bbbe9979b6dd14eeef46ed148e7e..3b76afe5dcd0e52a77ed01f5eb19a7f0eac56c40 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -297,7 +297,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
 {
     gmx_shellfc_t            *shfc;
     t_shell                  *shell;
-    int                      *shell_index = NULL, *at2cg;
+    int                      *shell_index = nullptr, *at2cg;
     const t_atom             *atom;
 
     int                       ns, nshell, nsi;
@@ -319,7 +319,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     if (nshell == 0 && nflexcon == 0)
     {
         /* We're not doing shells or flexible constraints */
-        return NULL;
+        return nullptr;
     }
 
     snew(shfc, 1);
@@ -550,7 +550,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     shfc->shell_gl       = shell;
     shfc->shell_index_gl = shell_index;
 
-    shfc->bPredict     = (getenv("GMX_NOPREDICT") == NULL);
+    shfc->bPredict     = (getenv("GMX_NOPREDICT") == nullptr);
     shfc->bRequireInit = FALSE;
     if (!shfc->bPredict)
     {
@@ -561,7 +561,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     }
     else
     {
-        shfc->bRequireInit = (getenv("GMX_REQUIRE_SHELL_INIT") != NULL);
+        shfc->bRequireInit = (getenv("GMX_REQUIRE_SHELL_INIT") != nullptr);
         if (shfc->bRequireInit && fplog)
         {
             fprintf(fplog, "\nWill always initiate shell positions\n");
@@ -594,7 +594,7 @@ void make_local_shells(t_commrec *cr, t_mdatoms *md,
 {
     t_shell      *shell;
     int           a0, a1, *ind, nshell, i;
-    gmx_domdec_t *dd = NULL;
+    gmx_domdec_t *dd = nullptr;
 
     if (DOMAINDECOMP(cr))
     {
@@ -943,13 +943,13 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
         }
     }
     constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
-              x, xnold, NULL, bMolPBC, box,
+              x, xnold, nullptr, bMolPBC, box,
               (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
     constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
-              x, xnew, NULL, bMolPBC, box,
+              x, xnew, nullptr, bMolPBC, box,
               (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
 
     for (n = 0; n < end; n++)
     {
@@ -966,7 +966,7 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
     constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
               x_old, xnew, acc_dir, bMolPBC, box,
               (*lambda)[efptBONDED], &(dvdlambda[efptBONDED]),
-              NULL, NULL, nrnb, econqDeriv_FlexCon);
+              nullptr, nullptr, nrnb, econqDeriv_FlexCon);
 }
 
 void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
@@ -990,7 +990,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     int        nshell;
     t_shell   *shell;
     t_idef    *idef;
-    rvec      *acc_dir = NULL, *x_old = NULL;
+    rvec      *acc_dir = nullptr, *x_old = nullptr;
     real       Epot[2], df[2];
     real       sf_dir, invdt;
     real       ftol, dum = 0;
@@ -1094,7 +1094,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     if (shfc->bPredict && !bCont)
     {
         predict_shells(fplog, as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), inputrec->delta_t, nshell, shell,
-                       md->massT, NULL, bInit);
+                       md->massT, nullptr, bInit);
     }
 
     /* do_force expected the charge groups to be in the box */
@@ -1112,7 +1112,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
              state->box, &state->x, &state->hist,
              force[Min], force_vir, md, enerd, fcd,
              &state->lambda, graph,
-             fr, vsite, mu_tot, t, NULL, bBornRadii,
+             fr, vsite, mu_tot, t, nullptr, bBornRadii,
              (bDoNS ? GMX_FORCE_NS : 0) | force_flags);
 
     sf_dir = 0;
@@ -1214,7 +1214,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
                  top, groups, state->box, pos[Try], &state->hist,
                  force[Try], force_vir,
                  md, enerd, fcd, &state->lambda, graph,
-                 fr, vsite, mu_tot, t, NULL, bBornRadii,
+                 fr, vsite, mu_tot, t, nullptr, bBornRadii,
                  force_flags);
 
         if (gmx_debug_at)
index ae5a06d66b4b8d48fe5d05db62c6b2e60df325b8..abf37009cc274329e112d35e528821087fcdef65 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -117,7 +117,7 @@ static void gmx_signal(int signum)
     act.sa_handler = signal_handler;
     sigemptyset(&act.sa_mask);
     act.sa_flags = SA_RESTART;
-    sigaction(signum, &act, NULL);
+    sigaction(signum, &act, nullptr);
 #else
     signal(signum, signal_handler);
 #endif
@@ -125,7 +125,7 @@ static void gmx_signal(int signum)
 
 void signal_handler_install(void)
 {
-    if (getenv("GMX_NO_TERM") == NULL)
+    if (getenv("GMX_NO_TERM") == nullptr)
     {
         if (debug)
         {
@@ -133,7 +133,7 @@ void signal_handler_install(void)
         }
         gmx_signal(SIGTERM);
     }
-    if (getenv("GMX_NO_INT") == NULL)
+    if (getenv("GMX_NO_INT") == nullptr)
     {
         if (debug)
         {
@@ -142,7 +142,7 @@ void signal_handler_install(void)
         gmx_signal(SIGINT);
     }
 #if HAVE_SIGUSR1
-    if (getenv("GMX_NO_USR1") == NULL)
+    if (getenv("GMX_NO_USR1") == nullptr)
     {
         if (debug)
         {
index 7353e0d7d5b4a537cf19de972df40743f43709ef..e026136e56d26fac0d5911e9d5f50a4d3ce8451c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -368,7 +368,7 @@ static void post_process_forces(t_commrec *cr,
              * if the constructing atoms aren't local.
              */
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, as_rvec_array(fr->f_novirsum->data()), NULL,
+            spread_vsite_f(vsite, x, as_rvec_array(fr->f_novirsum->data()), nullptr,
                            (flags & GMX_FORCE_VIRIAL), fr->vir_el_recip,
                            nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
@@ -666,7 +666,7 @@ static void do_nb_verlet_fep(nbnxn_pairlist_set_t *nbl_lists,
 
 gmx_bool use_GPU(const nonbonded_verlet_t *nbv)
 {
-    return nbv != NULL && nbv->bUseGPU;
+    return nbv != nullptr && nbv->bUseGPU;
 }
 
 static gmx_inline void clear_rvecs_omp(int n, rvec v[])
@@ -864,7 +864,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
             nbnxn_put_on_grid(nbv->nbs, fr->ePBC, box,
                               0, vzero, box_diag,
                               0, mdatoms->homenr, -1, fr->cginfo, x,
-                              0, NULL,
+                              0, nullptr,
                               nbv->grp[eintLocal].kernel_type,
                               nbv->grp[eintLocal].nbat);
             wallcycle_sub_stop(wcycle, ewcsNBS_GRID_LOCAL);
@@ -1395,7 +1395,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         if (vsite && !(fr->bF_NoVirSum && !(flags & GMX_FORCE_VIRIAL)))
         {
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, NULL, nrnb,
+            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, nullptr, nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
             wallcycle_stop(wcycle, ewcVSITESPREAD);
         }
@@ -1762,7 +1762,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
             if (EEL_FULL(fr->eeltype) && cr->dd->n_intercg_excl &&
                 (flags & GMX_FORCE_VIRIAL))
             {
-                dd_move_f(cr->dd, as_rvec_array(fr->f_novirsum->data()), NULL);
+                dd_move_f(cr->dd, as_rvec_array(fr->f_novirsum->data()), nullptr);
             }
             wallcycle_stop(wcycle, ewcMOVEF);
         }
@@ -1773,7 +1773,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         if (vsite && !(fr->bF_NoVirSum && !(flags & GMX_FORCE_VIRIAL)))
         {
             wallcycle_start(wcycle, ewcVSITESPREAD);
-            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, NULL, nrnb,
+            spread_vsite_f(vsite, x, f, fr->fshift, FALSE, nullptr, nrnb,
                            &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
             wallcycle_stop(wcycle, ewcVSITESPREAD);
         }
@@ -1934,22 +1934,22 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
     dvdl_dum = 0;
 
     /* constrain the current position */
-    constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+    constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
               ir, cr, step, 0, 1.0, md,
-              as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), NULL,
+              as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), nullptr,
               fr->bMolPBC, state->box,
               state->lambda[efptBONDED], &dvdl_dum,
-              NULL, NULL, nrnb, econqCoord);
+              nullptr, nullptr, nrnb, econqCoord);
     if (EI_VV(ir->eI))
     {
         /* constrain the inital velocity, and save it */
         /* also may be useful if we need the ekin from the halfstep for velocity verlet */
-        constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+        constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
                   ir, cr, step, 0, 1.0, md,
                   as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), as_rvec_array(state->v.data()),
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
-                  NULL, NULL, nrnb, econqVeloc);
+                  nullptr, nullptr, nrnb, econqVeloc);
     }
     /* constrain the inital velocities at t-dt/2 */
     if (EI_STATE_VELOCITY(ir->eI) && ir->eI != eiVV)
@@ -1974,12 +1974,12 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
                     gmx_step_str(step, buf));
         }
         dvdl_dum = 0;
-        constrain(NULL, TRUE, FALSE, constr, &(top->idef),
+        constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
                   ir, cr, step, -1, 1.0, md,
-                  as_rvec_array(state->x.data()), savex, NULL,
+                  as_rvec_array(state->x.data()), savex, nullptr,
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
-                  as_rvec_array(state->v.data()), NULL, nrnb, econqCoord);
+                  as_rvec_array(state->v.data()), nullptr, nrnb, econqCoord);
 
         for (i = start; i < end; i++)
         {
@@ -2410,7 +2410,7 @@ static void low_do_pbc_mtop(FILE *fplog, int ePBC, matrix box,
         else
         {
             /* Pass NULL iso fplog to avoid graph prints for each molecule type */
-            mk_graph_ilist(NULL, mtop->moltype[molb->type].ilist,
+            mk_graph_ilist(nullptr, mtop->moltype[molb->type].ilist,
                            0, molb->natoms_mol, FALSE, FALSE, graph);
 
             for (mol = 0; mol < molb->nmol; mol++)
@@ -2471,7 +2471,7 @@ void finish_run(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
                 nonbonded_verlet_t *nbv,
                 gmx_bool bWriteStat)
 {
-    t_nrnb *nrnb_tot = NULL;
+    t_nrnb *nrnb_tot = nullptr;
     double  delta_t  = 0;
     double  nbfs     = 0, mflop = 0;
     double  elapsed_time,
@@ -2539,7 +2539,7 @@ void finish_run(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
 
     if (SIMMASTER(cr))
     {
-        struct gmx_wallclock_gpu_t* gputimes = use_GPU(nbv) ? nbnxn_gpu_get_timings(nbv->gpu_nbv) : NULL;
+        struct gmx_wallclock_gpu_t* gputimes = use_GPU(nbv) ? nbnxn_gpu_get_timings(nbv->gpu_nbv) : nullptr;
 
         wallcycle_print(fplog, mdlog, cr->nnodes, cr->npmenodes, nthreads_pp, nthreads_pme,
                         elapsed_time_over_all_ranks,
@@ -2617,7 +2617,7 @@ extern void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, std:
     }
 
     /* Send to the log the information on the current lambdas */
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         fprintf(fplog, "Initial vector of lambda components:[ ");
         for (int i = 0; i < efptNR; i++)
@@ -2667,10 +2667,10 @@ void init_md(FILE *fplog,
     }
     if (*bSimAnn)
     {
-        update_annealing_target_temp(ir, ir->init_t, upd ? *upd : NULL);
+        update_annealing_target_temp(ir, ir->init_t, upd ? *upd : nullptr);
     }
 
-    if (vcm != NULL)
+    if (vcm != nullptr)
     {
         *vcm = init_vcm(fplog, &mtop->groups, ir);
     }
@@ -2696,7 +2696,7 @@ void init_md(FILE *fplog,
     {
         *outf = init_mdoutf(fplog, nfile, fnm, Flags, cr, ir, mtop, oenv, wcycle);
 
-        *mdebin = init_mdebin((Flags & MD_APPENDFILES) ? NULL : mdoutf_get_fp_ene(*outf),
+        *mdebin = init_mdebin((Flags & MD_APPENDFILES) ? nullptr : mdoutf_get_fp_ene(*outf),
                               mtop, ir, mdoutf_get_fp_dhdl(*outf));
     }
 
index 1bbbd9ed097093364b27d4a5f93f03dad2dea898..c8d55bf8da3f56546f2309df0a83c8d1a5fa84f3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -135,9 +135,9 @@ static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[])
 static int mk_sblocks(FILE *fp, t_graph *g, int maxsid, t_sid sid[])
 {
     int     ng, nnodes;
-    int     nW, nG, nB; /* Number of Grey, Black, White        */
-    int     fW, fG;     /* First of each category      */
-    egCol  *egc = NULL; /* The colour of each node     */
+    int     nW, nG, nB;    /* Number of Grey, Black, White     */
+    int     fW, fG;        /* First of each category   */
+    egCol  *egc = nullptr; /* The colour of each node  */
     int     g0, nblock;
 
     if (!g->nbound)
@@ -363,7 +363,7 @@ void gen_sblocks(FILE *fp, int at_start, int at_end,
     t_sid   *sid;
     int      nsid;
 
-    g = mk_graph(NULL, idef, at_start, at_end, TRUE, bSettle);
+    g = mk_graph(nullptr, idef, at_start, at_end, TRUE, bSettle);
     if (debug)
     {
         p_graph(debug, "Graaf Dracula", g);
index 7c6de83ec44ef1f4b8290d8e7a9c4f8ea2eee051..0db91f37e4645b6d98b402a4172a4745336391bd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -156,7 +156,7 @@ void global_stat(gmx_global_stat_t gs,
     int        inn[egNR];
     real       copyenerd[F_NRE];
     int        nener, j;
-    real      *rmsd_data = NULL;
+    real      *rmsd_data = nullptr;
     double     nb;
     gmx_bool   bVV, bTemp, bEner, bPres, bConstrVir, bEkinAveVel, bReadEkin;
     bool       checkNumberOfBondedInteractions = flags & CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS;
index b35c713802fef64086cca845abd91bc30cfee003..bced9d71f7913e04a7d63ac21653cd4559aa192c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -184,12 +184,12 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
     gmx_int64_t      nsteps, stepblocksize = 0, step;
     gmx_int64_t      seed;
     int              i;
-    FILE            *fp_tpi = NULL;
+    FILE            *fp_tpi = nullptr;
     char            *ptr, *dump_pdb, **leg, str[STRLEN], str2[STRLEN];
     double           dbl, dump_ener;
     gmx_bool         bCavity;
     int              nat_cavity  = 0, d;
-    real            *mass_cavity = NULL, mass_tot;
+    real            *mass_cavity = nullptr, mass_tot;
     int              nbin;
     double           invbinw, *bin, refvolshift, logV, bUlogV;
     real             prescorr, enercorr, dvdlcorr;
@@ -217,7 +217,7 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
     if (bCavity)
     {
         ptr = getenv("GMX_TPIC_MASSES");
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             nat_cavity = 1;
         }
@@ -285,7 +285,7 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         sscanf(dump_pdb, "%20lf", &dump_ener);
     }
 
-    atoms2md(top_global, inputrec, -1, NULL, top_global->natoms, mdatoms);
+    atoms2md(top_global, inputrec, -1, nullptr, top_global->natoms, mdatoms);
     update_mdatoms(mdatoms, inputrec->fepvals->init_lambda);
 
     snew(enerd, 1);
@@ -630,7 +630,7 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                     copy_rvec(x_mol[i-a_tp0], state_global->x[i]);
                 }
                 /* Rotate the molecule randomly */
-                rotate_conf(a_tp1-a_tp0, as_rvec_array(state_global->x.data())+a_tp0, NULL,
+                rotate_conf(a_tp1-a_tp0, as_rvec_array(state_global->x.data())+a_tp0, nullptr,
                             2*M_PI*dist(rng),
                             2*M_PI*dist(rng),
                             2*M_PI*dist(rng));
@@ -663,7 +663,7 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                      state_global->box, &state_global->x, &state_global->hist,
                      &f, force_vir, mdatoms, enerd, fcd,
                      &state_global->lambda,
-                     NULL, fr, NULL, mu_tot, t, NULL, FALSE,
+                     nullptr, fr, nullptr, mu_tot, t, nullptr, FALSE,
                      GMX_FORCE_NONBONDED | GMX_FORCE_ENERGY |
                      (bNS ? GMX_FORCE_DYNAMICBOX | GMX_FORCE_NS : 0) |
                      (bStateChanged ? GMX_FORCE_STATECHANGED : 0));
@@ -833,12 +833,12 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
 
     close_trj(status);
 
-    if (fp_tpi != NULL)
+    if (fp_tpi != nullptr)
     {
         xvgrclose(fp_tpi);
     }
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         fprintf(fplog, "\n");
         fprintf(fplog, "  <V>  = %12.5e nm^3\n", V_all/frame);
index 93025b5bddc7517991ea845890f04f4c484e2485..740b761654aaa220e2ddcb6d09c94558b7f189d9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -77,7 +77,7 @@ do_md_trajectory_writing(FILE             *fplog,
                          )
 {
     int   mdof_flags;
-    rvec *x_for_confout = NULL;
+    rvec *x_for_confout = nullptr;
 
     mdof_flags = 0;
     if (do_per_step(step, ir->nstxout))
index c7c9556ddff69542b23cb4394aaad2d51f02c1ba..079e3d992d0458263c9f896d7d5d1499affca26e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -471,7 +471,7 @@ static void do_update_md(int                         start,
                 <NumTempScaleValues::single,
                  ApplyParrinelloRahmanVScaling::no>
                     (start, nrend, dt, dtPressureCouple,
-                    invMassPerDim, tcstat, cTC, NULL, x, xprime, v, f);
+                    invMassPerDim, tcstat, cTC, nullptr, x, xprime, v, f);
             }
             else
             {
@@ -479,7 +479,7 @@ static void do_update_md(int                         start,
                 <NumTempScaleValues::multiple,
                  ApplyParrinelloRahmanVScaling::no>
                     (start, nrend, dt, dtPressureCouple,
-                    invMassPerDim, tcstat, cTC, NULL, x, xprime, v, f);
+                    invMassPerDim, tcstat, cTC, nullptr, x, xprime, v, f);
             }
         }
     }
@@ -1413,21 +1413,21 @@ void update_constraints(FILE             *fplog,
         wallcycle_start(wcycle, ewcCONSTR);
         if (EI_VV(inputrec->eI) && bFirstHalf)
         {
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 1.0, md,
                       as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), as_rvec_array(state->v.data()),
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      NULL, bCalcVir ? &vir_con : NULL, nrnb, econqVeloc);
+                      nullptr, bCalcVir ? &vir_con : nullptr, nrnb, econqVeloc);
         }
         else
         {
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 1.0, md,
-                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), NULL,
+                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      as_rvec_array(state->v.data()), bCalcVir ? &vir_con : NULL, nrnb, econqCoord);
+                      as_rvec_array(state->v.data()), bCalcVir ? &vir_con : nullptr, nrnb, econqCoord);
         }
         wallcycle_stop(wcycle, ewcCONSTR);
 
@@ -1473,7 +1473,7 @@ void update_constraints(FILE             *fplog,
                               as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), as_rvec_array(state->v.data()), as_rvec_array(force->data()),
                               bDoConstr, FALSE,
                               step, inputrec->ld_seed,
-                              DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                              DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
             }
             GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
         }
@@ -1485,12 +1485,12 @@ void update_constraints(FILE             *fplog,
             /* Constrain the coordinates upd->xp for half a time step */
             wallcycle_start(wcycle, ewcCONSTR);
 
-            constrain(NULL, bLog, bEner, constr, idef,
+            constrain(nullptr, bLog, bEner, constr, idef,
                       inputrec, cr, step, 1, 0.5, md,
-                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), NULL,
+                      as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
-                      as_rvec_array(state->v.data()), NULL, nrnb, econqCoord);
+                      as_rvec_array(state->v.data()), nullptr, nrnb, econqCoord);
 
             wallcycle_stop(wcycle, ewcCONSTR);
         }
@@ -1508,7 +1508,7 @@ void update_constraints(FILE             *fplog,
          */
         wallcycle_start_nocount(wcycle, ewcUPDATE);
 
-        if (md->cFREEZE != NULL && constr != NULL)
+        if (md->cFREEZE != nullptr && constr != nullptr)
         {
             /* If we have atoms that are frozen along some, but not all
              * dimensions, the constraints will have moved them also along
@@ -1673,7 +1673,7 @@ void update_pcouple_after_coordinates(FILE             *fplog,
     }
     where();
     dump_it_all(fplog, "After update",
-                state->natoms, &state->x, &upd->xp, &state->v, NULL);
+                state->natoms, &state->x, &upd->xp, &state->v, nullptr);
 }
 
 void update_coords(FILE             *fplog,
@@ -1690,7 +1690,7 @@ void update_coords(FILE             *fplog,
                    t_commrec        *cr, /* these shouldn't be here -- need to think about it */
                    gmx_constr_t      constr)
 {
-    gmx_bool bDoConstr = (NULL != constr);
+    gmx_bool bDoConstr = (nullptr != constr);
 
     /* Running the velocity half does nothing except for velocity verlet */
     if ((UpdatePart == etrtVELOCITY1 || UpdatePart == etrtVELOCITY2) &&
@@ -1755,7 +1755,7 @@ void update_coords(FILE             *fplog,
                                   md->cFREEZE, md->cACC, md->cTC,
                                   x_rvec, xp_rvec, v_rvec, f_rvec,
                                   bDoConstr, TRUE,
-                                  step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                                  step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
                     break;
                 case (eiBD):
                     do_update_bd(start_th, end_th, dt,
@@ -1764,7 +1764,7 @@ void update_coords(FILE             *fplog,
                                  x_rvec, xp_rvec, v_rvec, f_rvec,
                                  inputrec->bd_fric,
                                  upd->sd->bd_rf,
-                                 step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : NULL);
+                                 step, inputrec->ld_seed, DOMAINDECOMP(cr) ? cr->dd->gatindex : nullptr);
                     break;
                 case (eiVV):
                 case (eiVVAK):
@@ -1867,7 +1867,7 @@ extern gmx_bool update_randomize_velocities(t_inputrec *ir, gmx_int64_t step, co
 
     real rate = (ir->delta_t)/ir->opts.tau_t[0];
 
-    if (ir->etc == etcANDERSEN && constr != NULL)
+    if (ir->etc == etcANDERSEN && constr != nullptr)
     {
         /* Currently, Andersen thermostat does not support constrained
            systems. Functionality exists in the andersen_tcoupl
index c776d3011d0e2c78ebf31d8f6ec340ec949c464f..800a5c80674b69d1fd873b8277ac65c8835d301b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -90,7 +90,7 @@ static void init_ilist(t_ilist *ilist)
     {
         ilist[i].nr     = 0;
         ilist[i].nalloc = 0;
-        ilist[i].iatoms = NULL;
+        ilist[i].iatoms = nullptr;
     }
 }
 
@@ -432,7 +432,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
     const t_pbc *pbc_null2;
     int         *vsite_pbc;
 
-    if (v != NULL)
+    if (v != nullptr)
     {
         inv_dt = 1.0/dt;
     }
@@ -441,10 +441,10 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
         inv_dt = 1.0;
     }
 
-    bPBCAll = (pbc_null != NULL && !vsite->bHaveChargeGroups);
+    bPBCAll = (pbc_null != nullptr && !vsite->bHaveChargeGroups);
 
-    pbc_null2 = NULL;
-    vsite_pbc = NULL;
+    pbc_null2 = nullptr;
+    vsite_pbc = nullptr;
     for (int ftype = c_ftypeVsiteStart; ftype < c_ftypeVsiteEnd; ftype++)
     {
         if (ilist[ftype].nr == 0)
@@ -463,7 +463,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
             {
                 pbc_null2 = pbc_null;
             }
-            else if (pbc_null != NULL)
+            else if (pbc_null != nullptr)
             {
                 vsite_pbc = vsite->vsite_pbc_loc[ftype - c_ftypeVsiteStart];
             }
@@ -485,7 +485,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                     pbc_atom = avsite;
                     copy_rvec(x[avsite], xpbc);
                 }
-                else if (vsite_pbc != NULL)
+                else if (vsite_pbc != nullptr)
                 {
                     pbc_atom = vsite_pbc[i/(1 + nra)];
                     if (pbc_atom > -2)
@@ -502,7 +502,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                     }
                     else
                     {
-                        pbc_null2 = NULL;
+                        pbc_null2 = nullptr;
                     }
                 }
                 else
@@ -583,7 +583,7 @@ static void construct_vsites_thread(const gmx_vsite_t *vsite,
                         rvec_add(xpbc, dx, x[avsite]);
                     }
                 }
-                if (v != NULL)
+                if (v != nullptr)
                 {
                     /* Calculate velocity of vsite... */
                     rvec vv;
@@ -624,7 +624,7 @@ void construct_vsites(const gmx_vsite_t *vsite,
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (bDomDec)
@@ -732,9 +732,9 @@ void construct_vsites_mtop(gmx_vsite_t *vsite,
         const gmx_moltype_t  *molt = &mtop->moltype[molb->type];
         for (int mol = 0; mol < molb->nmol; mol++)
         {
-            construct_vsites(vsite, x+as, 0.0, NULL,
+            construct_vsites(vsite, x+as, 0.0, nullptr,
                              mtop->ffparams.iparams, molt->ilist,
-                             epbcNONE, TRUE, NULL, NULL);
+                             epbcNONE, TRUE, nullptr, nullptr);
             as += molt->atoms.nr;
         }
     }
@@ -1452,12 +1452,12 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
     const t_pbc *pbc_null2;
     const int   *vsite_pbc;
 
-    bPBCAll = (pbc_null != NULL && !vsite->bHaveChargeGroups);
+    bPBCAll = (pbc_null != nullptr && !vsite->bHaveChargeGroups);
 
     /* this loop goes backwards to be able to build *
      * higher type vsites from lower types         */
-    pbc_null2 = NULL;
-    vsite_pbc = NULL;
+    pbc_null2 = nullptr;
+    vsite_pbc = nullptr;
     for (int ftype = c_ftypeVsiteEnd - 1; ftype >= c_ftypeVsiteStart; ftype--)
     {
         if (ilist[ftype].nr == 0)
@@ -1476,14 +1476,14 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
             {
                 pbc_null2 = pbc_null;
             }
-            else if (pbc_null != NULL)
+            else if (pbc_null != nullptr)
             {
                 vsite_pbc = vsite->vsite_pbc_loc[ftype - c_ftypeVsiteStart];
             }
 
             for (int i = 0; i < nr; )
             {
-                if (vsite_pbc != NULL)
+                if (vsite_pbc != nullptr)
                 {
                     if (vsite_pbc[i/(1 + nra)] > -2)
                     {
@@ -1491,7 +1491,7 @@ static void spread_vsite_f_thread(const gmx_vsite_t *vsite,
                     }
                     else
                     {
-                        pbc_null2 = NULL;
+                        pbc_null2 = nullptr;
                     }
                 }
 
@@ -1582,11 +1582,11 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
         /* This is wasting some CPU time as we now do this multiple times
          * per MD step.
          */
-        pbc_null = set_pbc_dd(&pbc, ePBC, cr->dd ? cr->dd->nc : NULL, FALSE, box);
+        pbc_null = set_pbc_dd(&pbc, ePBC, cr->dd ? cr->dd->nc : nullptr, FALSE, box);
     }
     else
     {
-        pbc_null = NULL;
+        pbc_null = nullptr;
     }
 
     if (DOMAINDECOMP(cr))
@@ -1628,7 +1628,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                 VsiteThread *tData  = vsite->tData[thread];
 
                 rvec        *fshift_t;
-                if (thread == 0 || fshift == NULL)
+                if (thread == 0 || fshift == nullptr)
                 {
                     fshift_t = fshift;
                 }
@@ -1717,7 +1717,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
             GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
         }
 
-        if (fshift != NULL)
+        if (fshift != nullptr)
         {
             for (int th = 1; th < vsite->nthreads; th++)
             {
@@ -1974,7 +1974,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
 
     if (nvsite == 0)
     {
-        return NULL;
+        return nullptr;
     }
 
     snew(vsite, 1);
@@ -1997,7 +1997,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
             int *a2cg = atom2cg(&molt->cgs);
             vsite->vsite_pbc_molt[mt] = get_vsite_pbc(mtop->ffparams.iparams,
                                                       molt->ilist,
-                                                      molt->atoms.atom, NULL,
+                                                      molt->atoms.atom, nullptr,
                                                       &molt->cgs, a2cg);
             sfree(a2cg);
         }
@@ -2037,7 +2037,7 @@ gmx_vsite_t *init_vsite(const gmx_mtop_t *mtop, t_commrec *cr,
         }
     }
 
-    vsite->taskIndex       = NULL;
+    vsite->taskIndex       = nullptr;
     vsite->taskIndexNalloc = 0;
 
     return vsite;
@@ -2539,7 +2539,7 @@ void set_vsite_top(gmx_vsite_t *vsite, gmx_localtop_t *top, t_mdatoms *md,
             /* Make an atom to charge group index */
             int *a2cg = atom2cg(&top->cgs);
             vsite->vsite_pbc_loc = get_vsite_pbc(top->idef.iparams,
-                                                 top->idef.il, NULL, md,
+                                                 top->idef.il, nullptr, md,
                                                  &top->cgs, a2cg);
             sfree(a2cg);
         }
index c434fff3274d0ca00f2b01afecea145d0d31ac6e..f35b36d2e91678beaaeaf93e6b01c8a6066a6cad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -205,8 +205,8 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                  */
                 strcpy(suf_up, part_suffix);
                 upstring(suf_up);
-                *bAddPart = (strstr(fn, part_suffix) != NULL ||
-                             strstr(fn, suf_up) != NULL);
+                *bAddPart = (strstr(fn, part_suffix) != nullptr ||
+                             strstr(fn, suf_up) != nullptr);
             }
 
             sfree(outputfiles);
@@ -270,7 +270,7 @@ handleRestart(t_commrec *cr,
             }
             else
             {
-                fpmulti = NULL;
+                fpmulti = nullptr;
             }
             check_multi_int(fpmulti, cr->ms, sim_part, "simulation part", TRUE);
         }
index 83bee6730c0ca72d8343c327e23506d13786a685..a65d8997a99a296d4743d766d32e896a81fcfa7b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -154,7 +154,7 @@ get_thread_affinity_layout(FILE *fplog, const gmx::MDLogger &mdlog,
     {
         /* topology information not available or invalid, ignore it */
         hwThreads       = hwTop.machine().logicalProcessorCount;
-        *localityOrder  = NULL;
+        *localityOrder  = nullptr;
     }
     // Only warn about the first problem per node.  Otherwise, the first test
     // failing would essentially always cause also the other problems get
@@ -246,7 +246,7 @@ get_thread_affinity_layout(FILE *fplog, const gmx::MDLogger &mdlog,
     }
     validLayout = validLayout && !invalidValue;
 
-    if (validLayout && fplog != NULL)
+    if (validLayout && fplog != nullptr)
     {
         fprintf(fplog, "Pinning threads with a%s logical core stride of %d\n",
                 bPickPinStride ? "n auto-selected" : " user-specified",
index e77586e1572e52ade5e422de61daeb6507deb48f..c6a5242954de202ee645696764c4be132dc9106c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -59,18 +59,18 @@ static void zero_history(history_t *hist)
 {
     hist->disre_initf  = 0;
     hist->ndisrepairs  = 0;
-    hist->disre_rm3tav = NULL;
+    hist->disre_rm3tav = nullptr;
     hist->orire_initf  = 0;
     hist->norire_Dtav  = 0;
-    hist->orire_Dtav   = NULL;
+    hist->orire_Dtav   = nullptr;
 }
 
 static void zero_ekinstate(ekinstate_t *eks)
 {
     eks->ekin_n         = 0;
-    eks->ekinh          = NULL;
-    eks->ekinf          = NULL;
-    eks->ekinh_old      = NULL;
+    eks->ekinh          = nullptr;
+    eks->ekinf          = nullptr;
+    eks->ekinh_old      = nullptr;
     eks->ekinscalef_nhc.resize(0);
     eks->ekinscaleh_nhc.resize(0);
     eks->vscale_nhc.resize(0);
@@ -85,15 +85,15 @@ static void init_swapstate(swapstate_t *swapstate)
     swapstate->nIonTypes              = 0;
     swapstate->nAverage               = 0;
     swapstate->fluxleak               = 0;
-    swapstate->fluxleak_p             = NULL;
+    swapstate->fluxleak_p             = nullptr;
     swapstate->bFromCpt               = 0;
     swapstate->nat[eChan0]            = 0;
     swapstate->nat[eChan1]            = 0;
-    swapstate->xc_old_whole[eChan0]   = NULL;
-    swapstate->xc_old_whole[eChan1]   = NULL;
-    swapstate->xc_old_whole_p[eChan0] = NULL;
-    swapstate->xc_old_whole_p[eChan1] = NULL;
-    swapstate->ionType                = NULL;
+    swapstate->xc_old_whole[eChan0]   = nullptr;
+    swapstate->xc_old_whole[eChan1]   = nullptr;
+    swapstate->xc_old_whole_p[eChan0] = nullptr;
+    swapstate->xc_old_whole_p[eChan1] = nullptr;
+    swapstate->ionType                = nullptr;
 }
 
 void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength)
@@ -146,10 +146,10 @@ void init_state(t_state *state, int natoms, int ngtc, int nnhpres, int nhchainle
     }
     else
     {
-        state->dfhist = NULL;
+        state->dfhist = nullptr;
     }
-    state->swapstate       = NULL;
-    state->edsamstate      = NULL;
+    state->swapstate       = nullptr;
+    state->edsamstate      = nullptr;
     state->ddp_count       = 0;
     state->ddp_count_cg_gl = 0;
     state->cg_gl.resize(0);
index 2648150a59626b8727a697d77bab56ee3f8419d2..777ad247dd83b6160a3370f4d1425f3756192d87 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,7 @@ class TextTableFormatter::Impl
         {
             //! Initializes a text table column with given values.
             ColumnData(const char *title, int width, bool bWrap)
-                : title_(title != NULL ? title : ""),
+                : title_(title != nullptr ? title : ""),
                   width_(width), bWrap_(bWrap), firstLine_(0),
                   nextLineIndex_(0), nextLineOffset_(0)
             {
@@ -225,7 +225,7 @@ TextTableFormatter::~TextTableFormatter()
 
 void TextTableFormatter::addColumn(const char *title, int width, bool bWrap)
 {
-    if (title != NULL && title[0] != '\0')
+    if (title != nullptr && title[0] != '\0')
     {
         impl_->bPrintHeader_ = true;
     }
index 60a8b7f48ed1cbeb63bb45226d58678706ac9d58..cc4c9d75f48af846ce519d39d7f8cef757e5c9bb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -136,7 +136,7 @@ void HelpManager::enterTopic(const char *name)
                                        impl_->currentTopicAsString().c_str())));
     }
     const IHelpTopic *newTopic = topic.findSubTopic(name);
-    if (newTopic == NULL)
+    if (newTopic == nullptr)
     {
         if (impl_->isAtRootTopic())
         {
@@ -163,7 +163,7 @@ void HelpManager::writeCurrentTopic() const
     const IHelpTopic         &topic = impl_->currentTopic();
     const char               *title = topic.title();
     HelpWriterContext         context(impl_->rootContext_);
-    context.enterSubSection(title != NULL ? title : "");
+    context.enterSubSection(title != nullptr ? title : "");
     topic.writeHelp(context);
 }
 
index 167e8214fa2c2c43e98503d5c298562130c169bc..6126171739dfb7c7fdef4f7c01ec004fbf7c0ee1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,7 @@ bool AbstractSimpleHelpTopic::hasSubTopics() const
 const IHelpTopic *
 AbstractSimpleHelpTopic::findSubTopic(const char * /* name */) const
 {
-    return NULL;
+    return nullptr;
 }
 
 void AbstractSimpleHelpTopic::writeHelp(const HelpWriterContext &context) const
@@ -131,7 +131,7 @@ AbstractCompositeHelpTopic::findSubTopic(const char *name) const
     Impl::SubTopicMap::const_iterator topic = impl_->subTopicMap_.find(name);
     if (topic == impl_->subTopicMap_.end())
     {
-        return NULL;
+        return nullptr;
     }
     return topic->second;
 }
@@ -182,8 +182,8 @@ AbstractCompositeHelpTopic::writeSubTopicList(const HelpWriterContext &context,
     }
     TextWriter        &file = context.outputFile();
     TextTableFormatter formatter;
-    formatter.addColumn(NULL, maxNameLength + 1, false);
-    formatter.addColumn(NULL, 72 - maxNameLength, true);
+    formatter.addColumn(nullptr, maxNameLength + 1, false);
+    formatter.addColumn(nullptr, 72 - maxNameLength, true);
     formatter.setFirstColumnIndent(4);
     file.writeLine(title);
     for (topic = impl_->subTopicMap_.begin(); topic != impl_->subTopicMap_.end(); ++topic)
index 5e7e3a7d9cc8281a435c4a0564cf4a56f1e01eab..dcc655e3d23ba025f660ed2630443ded26e13170 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -457,10 +457,10 @@ class HelpWriterContext::Impl
                     {
                         consoleOptionsFormatter_.reset(new TextTableFormatter());
                         consoleOptionsFormatter_->setFirstColumnIndent(1);
-                        consoleOptionsFormatter_->addColumn(NULL, 7, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 18, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 16, false);
-                        consoleOptionsFormatter_->addColumn(NULL, 28, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 7, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 18, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 16, false);
+                        consoleOptionsFormatter_->addColumn(nullptr, 28, false);
                     }
                     return *consoleOptionsFormatter_;
                 }
@@ -540,7 +540,7 @@ class HelpWriterContext::Impl
 std::string HelpWriterContext::Impl::replaceLinks(const std::string &input) const
 {
     std::string result(input);
-    if (state_->links_ != NULL)
+    if (state_->links_ != nullptr)
     {
         HelpLinks::Impl::LinkList::const_iterator link;
         for (link  = state_->links_->impl_->links_.begin();
@@ -603,7 +603,7 @@ void HelpWriterContext::Impl::processMarkup(const std::string &text,
  */
 
 HelpWriterContext::HelpWriterContext(TextWriter *writer, HelpOutputFormat format)
-    : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, NULL)), 0))
+    : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, nullptr)), 0))
 {
 }
 
@@ -611,7 +611,7 @@ HelpWriterContext::HelpWriterContext(TextWriter *writer, HelpOutputFormat format
                                      const HelpLinks *links)
     : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(writer, format, links)), 0))
 {
-    if (links != NULL)
+    if (links != nullptr)
     {
         GMX_RELEASE_ASSERT(links->impl_->format_ == format,
                            "Links must have the same output format as the context");
index 797593e6b899116ce3be98d93d914d508c279996..f48ffbebbf08f5b3c7d7813a255e7b4b789eb71d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -88,9 +88,9 @@ TEST_F(TextTableFormatterTest, HandlesBasicCase)
 
 TEST_F(TextTableFormatterTest, HandlesEmptyColumnTitles)
 {
-    formatter_.addColumn(NULL, 4, false);
+    formatter_.addColumn(nullptr, 4, false);
     formatter_.addColumn("", 4, false);
-    formatter_.addColumn(NULL, 14, true);
+    formatter_.addColumn(nullptr, 14, true);
     formatter_.addColumn("", 14, true);
 
     formatter_.clear();
index c9f171f9e6b5e3b93e72c00e07cbd64fc1374c96..19a19fce27b648da0dedcb99c42967f21e1c7a8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,7 +76,7 @@ class HelpTestBase : public gmx::test::StringTestBase
 };
 
 HelpTestBase::HelpTestBase()
-    : rootTopic_("", NULL, "Root topic text"),
+    : rootTopic_("", nullptr, "Root topic text"),
       writer_(&helpFile_),
       context_(&writer_, gmx::eHelpOutputFormat_Console),
       manager_(rootTopic_, context_)
@@ -100,10 +100,10 @@ TEST_F(HelpManagerTest, HandlesRootTopic)
 TEST_F(HelpManagerTest, HandlesSubTopics)
 {
     MockHelpTopic &first =
-        rootTopic_.addSubTopic("first", "First topic", NULL);
+        rootTopic_.addSubTopic("first", "First topic", nullptr);
     MockHelpTopic &firstSub =
-        first.addSubTopic("firstsub", "First subtopic", NULL);
-    rootTopic_.addSubTopic("second", "Second topic", NULL);
+        first.addSubTopic("firstsub", "First subtopic", nullptr);
+    rootTopic_.addSubTopic("second", "Second topic", nullptr);
 
     using ::testing::_;
     EXPECT_CALL(firstSub, writeHelp(_));
@@ -115,9 +115,9 @@ TEST_F(HelpManagerTest, HandlesSubTopics)
 TEST_F(HelpManagerTest, HandlesInvalidTopics)
 {
     MockHelpTopic &first =
-        rootTopic_.addSubTopic("first", "First topic", NULL);
-    first.addSubTopic("firstsub", "First subtopic", NULL);
-    rootTopic_.addSubTopic("second", "Second topic", NULL);
+        rootTopic_.addSubTopic("first", "First topic", nullptr);
+    first.addSubTopic("firstsub", "First subtopic", nullptr);
+    rootTopic_.addSubTopic("second", "Second topic", nullptr);
 
     ASSERT_THROW_GMX(manager_.enterTopic("unknown"), gmx::InvalidInputError);
     ASSERT_NO_THROW_GMX(manager_.enterTopic("first"));
index d41ca87f6b2a9317e3682e81a53970b71ae7aa82..205906f435e2f2542b0cbfa1974d4bc870d4645f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,10 +67,10 @@ class HelpWriterContextTest : public gmx::test::StringTestBase
                             gmx::HelpOutputFormat  format,
                             const char            *id)
         {
-            gmx::HelpWriterContext context(NULL, format);
+            gmx::HelpWriterContext context(nullptr, format);
             std::string            result
                 = context.substituteMarkupAndWrapToString(settings_, text);
-            if (id == NULL)
+            if (id == nullptr)
             {
                 switch (format)
                 {
@@ -89,8 +89,8 @@ class HelpWriterContextTest : public gmx::test::StringTestBase
         void testFormatting(const gmx::ConstArrayRef<const char *> &text)
         {
             std::string testText = gmx::joinStrings(text, "\n");
-            testFormatting(testText, gmx::eHelpOutputFormat_Console, NULL);
-            testFormatting(testText, gmx::eHelpOutputFormat_Rst, NULL);
+            testFormatting(testText, gmx::eHelpOutputFormat_Console, nullptr);
+            testFormatting(testText, gmx::eHelpOutputFormat_Rst, nullptr);
         }
 
         gmx::TextLineWrapperSettings settings_;
index 3579fc7d829f11eb2aca10145651cc02abaa4856..49decf9b1ad1bd50e56cf218e7f71d59c3d09896 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,7 +69,7 @@ MockHelpTopic::addSubTopic(gmx::AbstractCompositeHelpTopic *parent,
 }
 
 MockHelpTopic::MockHelpTopic(const char *name, const char *title, const char *text)
-    : name_(name), title_(title), text_(text != NULL ? text : "")
+    : name_(name), title_(title), text_(text != nullptr ? text : "")
 {
     if (!isNullOrEmpty(text))
     {
index 1439837fdee251798c4a2bca175f8a57d8a9d63f..6b8c75bfec264ee6b73c54c114b8c321746531f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -72,15 +72,15 @@ AbstractOptionStorage::AbstractOptionStorage(const AbstractOption &settings,
         GMX_THROW(APIError("Inconsistent value counts for vector values"));
     }
 
-    if (settings.name_ != NULL)
+    if (settings.name_ != nullptr)
     {
         name_  = settings.name_;
     }
-    if (settings.descr_ != NULL)
+    if (settings.descr_ != nullptr)
     {
         descr_ = settings.descr_;
     }
-    if (storeIsSet_ != NULL)
+    if (storeIsSet_ != nullptr)
     {
         *storeIsSet_ = false;
     }
@@ -93,7 +93,7 @@ AbstractOptionStorage::~AbstractOptionStorage()
 
 bool AbstractOptionStorage::isBoolean() const
 {
-    return dynamic_cast<const BooleanOptionStorage *>(this) != NULL;
+    return dynamic_cast<const BooleanOptionStorage *>(this) != nullptr;
 }
 
 void AbstractOptionStorage::startSource()
@@ -134,7 +134,7 @@ void AbstractOptionStorage::appendValue(const Variant &value)
 void AbstractOptionStorage::markAsSet()
 {
     setFlag(efOption_Set);
-    if (storeIsSet_ != NULL)
+    if (storeIsSet_ != nullptr)
     {
         *storeIsSet_ = true;
     }
index d3f8050b6f00b5a73a676f2a4641a4892745cf20..575cd6efaddffba760057f6e1ef5f8fff885bfb4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -102,7 +102,7 @@ class AbstractOption
         //! Initializes the name and default values for an option.
         explicit AbstractOption(const char *name)
             : minValueCount_(1), maxValueCount_(1),
-              name_(name), descr_(NULL), storeIsSet_(NULL)
+              name_(name), descr_(nullptr), storeIsSet_(nullptr)
         { }
 
         /*! \brief
@@ -360,8 +360,8 @@ class OptionTemplate : public AbstractOption
         //! Initializes the name and default values for an option.
         explicit OptionTemplate(const char *name)
             : AbstractOption(name),
-              defaultValue_(NULL), defaultValueIfSet_(NULL), store_(NULL),
-              countptr_(NULL), storeVector_(NULL)
+              defaultValue_(nullptr), defaultValueIfSet_(nullptr), store_(nullptr),
+              countptr_(nullptr), storeVector_(nullptr)
         { }
 
         /*! \brief
@@ -448,7 +448,7 @@ class OptionInfo
         template <class InfoType>
         bool isType() const
         {
-            return toType<InfoType>() != NULL;
+            return toType<InfoType>() != nullptr;
         }
         /*! \brief
          * Convert the info object to a particular type if the type is correct.
index 4e2d83eb8c6246905453b3ca9543bcbda77f7f3f..86022b3d7578b5e74af38884d23c38e6ee6ff225 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -445,24 +445,24 @@ FloatOption::createStorage(const OptionManagerContainer & /*managers*/) const
 StringOptionStorage::StringOptionStorage(const StringOption &settings)
     : MyBase(settings), info_(this)
 {
-    if (settings.defaultEnumIndex_ >= 0 && settings.enumValues_ == NULL)
+    if (settings.defaultEnumIndex_ >= 0 && settings.enumValues_ == nullptr)
     {
         GMX_THROW(APIError("Cannot set default enum index without enum values"));
     }
-    if (settings.enumValues_ != NULL)
+    if (settings.enumValues_ != nullptr)
     {
         int count = settings.enumValuesCount_;
         if (count < 0)
         {
             count = 0;
-            while (settings.enumValues_[count] != NULL)
+            while (settings.enumValues_[count] != nullptr)
             {
                 ++count;
             }
         }
         for (int i = 0; i < count; ++i)
         {
-            if (settings.enumValues_[i] == NULL)
+            if (settings.enumValues_[i] == nullptr)
             {
                 GMX_THROW(APIError("Enumeration value cannot be NULL"));
             }
@@ -475,7 +475,7 @@ StringOptionStorage::StringOptionStorage(const StringOption &settings)
                 GMX_THROW(APIError("Default enumeration index is out of range"));
             }
             const std::string *defaultValue = settings.defaultValue();
-            if (defaultValue != NULL && *defaultValue != allowed_[settings.defaultEnumIndex_])
+            if (defaultValue != nullptr && *defaultValue != allowed_[settings.defaultEnumIndex_])
             {
                 GMX_THROW(APIError("Conflicting default values"));
             }
@@ -558,7 +558,7 @@ EnumOptionStorage::EnumOptionStorage(const AbstractOption &settings,
                                      StorePointer store)
     : MyBase(settings, std::move(store)), info_(this)
 {
-    if (enumValues == NULL)
+    if (enumValues == nullptr)
     {
         GMX_THROW(APIError("Allowed values must be provided to EnumOption"));
     }
@@ -566,14 +566,14 @@ EnumOptionStorage::EnumOptionStorage(const AbstractOption &settings,
     if (count < 0)
     {
         count = 0;
-        while (enumValues[count] != NULL)
+        while (enumValues[count] != nullptr)
         {
             ++count;
         }
     }
     for (int i = 0; i < count; ++i)
     {
-        if (enumValues[i] == NULL)
+        if (enumValues[i] == nullptr)
         {
             GMX_THROW(APIError("Enumeration value cannot be NULL"));
         }
index 0976f2bcb477e134a3bfa123d69025ce58df7629..9b96025ad3835d995fcac913d303f883fc599ab2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -298,7 +298,7 @@ class StringOption : public OptionTemplate<std::string, StringOption>
 
         //! Initializes an option with the given name.
         explicit StringOption(const char *name)
-            : MyBase(name), enumValues_(NULL), enumValuesCount_(0),
+            : MyBase(name), enumValues_(nullptr), enumValuesCount_(0),
               defaultEnumIndex_(-1)
         {
         }
@@ -515,7 +515,7 @@ class EnumOption : public OptionTemplate<EnumType, EnumOption<EnumType> >
 
         //! Initializes an option with the given name.
         explicit EnumOption(const char *name)
-            : MyBase(name), enumValues_(NULL), enumValuesCount_(0)
+            : MyBase(name), enumValues_(nullptr), enumValuesCount_(0)
         {
         }
 
@@ -564,7 +564,7 @@ class EnumOption : public OptionTemplate<EnumType, EnumOption<EnumType> >
         //! Helper function to convert default values for storate initialization.
         static int convertToInt(const EnumType *defaultValue)
         {
-            return defaultValue != NULL ? static_cast<int>(*defaultValue) : -1;
+            return defaultValue != nullptr ? static_cast<int>(*defaultValue) : -1;
         }
 
         //! Creates a EnumOptionStorage object.
index 746ea5d2f8ae63930a34377c1cb8401c6f0cb113..e1e431a88cf57e1349568184786af738dcb63d32 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -141,7 +141,7 @@ class FileTypeHandler
 };
 
 FileTypeHandler::FileTypeHandler(int fileType)
-    : fileType_(fileType), extensionCount_(0), genericTypes_(NULL)
+    : fileType_(fileType), extensionCount_(0), genericTypes_(nullptr)
 {
     if (fileType_ >= 0)
     {
@@ -166,7 +166,7 @@ int FileTypeHandler::extensionCount() const
 const char *FileTypeHandler::extension(int i) const
 {
     GMX_ASSERT(i >= 0 && i < extensionCount_, "Invalid extension index");
-    if (genericTypes_ != NULL)
+    if (genericTypes_ != nullptr)
     {
         return ftp2ext_with_dot(genericTypes_[i]);
     }
@@ -176,7 +176,7 @@ const char *FileTypeHandler::extension(int i) const
 bool
 FileTypeHandler::isValidType(int fileType) const
 {
-    if (genericTypes_ != NULL)
+    if (genericTypes_ != nullptr)
     {
         for (int i = 0; i < extensionCount(); ++i)
         {
@@ -240,7 +240,7 @@ FileNameOptionStorage::FileNameOptionStorage(const FileNameOption  &settings,
     {
         defaultExtension_ = typeHandler.extension(0);
     }
-    if (settings.defaultBasename_ != NULL)
+    if (settings.defaultBasename_ != nullptr)
     {
         std::string defaultValue(settings.defaultBasename_);
         int         type = fn2ftp(settings.defaultBasename_);
@@ -319,7 +319,7 @@ void FileNameOptionStorage::initConverter(ConverterType * /*converter*/)
 
 std::string FileNameOptionStorage::processValue(const std::string &value) const
 {
-    if (manager_ != NULL)
+    if (manager_ != nullptr)
     {
         std::string processedValue = manager_->completeFileName(value, info_);
         if (!processedValue.empty())
@@ -377,7 +377,7 @@ std::string FileNameOptionStorage::processValue(const std::string &value) const
 
 void FileNameOptionStorage::processAll()
 {
-    if (manager_ != NULL && hasFlag(efOption_HasDefaultValue))
+    if (manager_ != nullptr && hasFlag(efOption_HasDefaultValue))
     {
         ArrayRef<std::string> valueList = values();
         GMX_RELEASE_ASSERT(valueList.size() == 1,
index 478147ef97a9b11a4d1c5f9581b627efe6662e7a..b0a60ae54768f78e9f6dbd8e46a0b6fe01b3814a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,7 +74,7 @@ class FileNameOption : public OptionTemplate<std::string, FileNameOption>
         //! Initializes an option with the given name.
         explicit FileNameOption(const char *name)
             : MyBase(name), optionType_(eftUnknown), legacyType_(-1),
-              defaultBasename_(NULL), defaultType_(-1),
+              defaultBasename_(nullptr), defaultType_(-1),
               bLegacyOptionalBehavior_(false),
               bRead_(false), bWrite_(false), bLibrary_(false),
               bAllowMissing_(false)
index cfecedaa58ab36e4b271e68e3001cf75617b90eb..b700f481f11f3e56db7c1a987430e7b7e58910c0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -96,13 +96,13 @@ class OptionManagerContainer
         template <class ManagerType>
         ManagerType *get() const
         {
-            ManagerType *result = NULL;
+            ManagerType *result = nullptr;
             for (ListType::const_iterator i = list_.begin(); i != list_.end(); ++i)
             {
                 ManagerType *curr = dynamic_cast<ManagerType *>(*i);
-                if (curr != NULL)
+                if (curr != nullptr)
                 {
-                    GMX_RELEASE_ASSERT(result == NULL,
+                    GMX_RELEASE_ASSERT(result == nullptr,
                                        "More than one applicable option manager is set");
                     result = curr;
                 }
index 4fdf0efd342f9f882d380774272ac26307447e83..f063820c227809a126af59588c3aa738c2580bd3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -111,7 +111,7 @@ OptionSectionImpl::addSectionImpl(const AbstractOptionSection &section)
 {
     const char *name = section.name_;
     // Make sure that there are no duplicate sections.
-    GMX_RELEASE_ASSERT(findSection(name) == NULL, "Duplicate subsection name");
+    GMX_RELEASE_ASSERT(findSection(name) == nullptr, "Duplicate subsection name");
     std::unique_ptr<IOptionSectionStorage> storage(section.createStorage());
     subsections_.push_back(SectionPointer(new OptionSectionImpl(managers_, std::move(storage), name)));
     return subsections_.back().get();
index 7763f25961431f0c486fde8a6f7319a30e4e6c0d..45cd89a55596a72cb46921893c3053a1f648233d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -115,7 +115,7 @@ class OptionsAssigner::Impl
 
 OptionsAssigner::Impl::Impl(Options *options)
     : options_(*options), bAcceptBooleanNoPrefix_(false),
-      currentOption_(NULL), currentValueCount_(0), reverseBoolean_(false)
+      currentOption_(nullptr), currentValueCount_(0), reverseBoolean_(false)
 {
     sectionStack_.push_back(&options_.impl_->rootSection_);
 }
@@ -123,22 +123,22 @@ OptionsAssigner::Impl::Impl(Options *options)
 AbstractOptionStorage *
 OptionsAssigner::Impl::findOption(const char *name)
 {
-    GMX_RELEASE_ASSERT(currentOption_ == NULL,
+    GMX_RELEASE_ASSERT(currentOption_ == nullptr,
                        "Cannot search for another option while processing one");
     const Section         &section = currentSection();
     AbstractOptionStorage *option  = section.findOption(name);
-    if (option == NULL && bAcceptBooleanNoPrefix_)
+    if (option == nullptr && bAcceptBooleanNoPrefix_)
     {
         if (name[0] == 'n' && name[1] == 'o')
         {
             option = section.findOption(name + 2);
-            if (option != NULL && option->isBoolean())
+            if (option != nullptr && option->isBoolean())
             {
                 reverseBoolean_ = true;
             }
             else
             {
-                option = NULL;
+                option = nullptr;
             }
         }
     }
@@ -171,7 +171,7 @@ void OptionsAssigner::start()
 void OptionsAssigner::startSection(const char *name)
 {
     Impl::Section *section = impl_->currentSection().findSection(name);
-    if (section == NULL)
+    if (section == nullptr)
     {
         GMX_THROW(InvalidInputError("Unknown subsection"));
     }
@@ -189,9 +189,9 @@ void OptionsAssigner::startOption(const char *name)
 
 bool OptionsAssigner::tryStartOption(const char *name)
 {
-    GMX_RELEASE_ASSERT(impl_->currentOption_ == NULL, "finishOption() not called");
+    GMX_RELEASE_ASSERT(impl_->currentOption_ == nullptr, "finishOption() not called");
     AbstractOptionStorage *option = impl_->findOption(name);
-    if (option == NULL)
+    if (option == nullptr)
     {
         return false;
     }
@@ -209,7 +209,7 @@ void OptionsAssigner::appendValue(const std::string &value)
 void OptionsAssigner::appendValue(const Variant &value)
 {
     AbstractOptionStorage *option = impl_->currentOption_;
-    GMX_RELEASE_ASSERT(option != NULL, "startOption() not called");
+    GMX_RELEASE_ASSERT(option != nullptr, "startOption() not called");
     ++impl_->currentValueCount_;
     option->appendValue(value);
 }
@@ -217,7 +217,7 @@ void OptionsAssigner::appendValue(const Variant &value)
 void OptionsAssigner::finishOption()
 {
     AbstractOptionStorage *option = impl_->currentOption_;
-    GMX_RELEASE_ASSERT(option != NULL, "startOption() not called");
+    GMX_RELEASE_ASSERT(option != nullptr, "startOption() not called");
     bool                   bBoolReverseValue = false;
     if (option->isBoolean())
     {
@@ -231,7 +231,7 @@ void OptionsAssigner::finishOption()
             bBoolReverseValue = true;
         }
     }
-    impl_->currentOption_  = NULL;
+    impl_->currentOption_  = nullptr;
     impl_->reverseBoolean_ = false;
     option->finishSet();
     if (bBoolReverseValue)
@@ -251,7 +251,7 @@ void OptionsAssigner::finishSection()
 
 void OptionsAssigner::finish()
 {
-    GMX_RELEASE_ASSERT(impl_->currentOption_ == NULL, "finishOption() not called");
+    GMX_RELEASE_ASSERT(impl_->currentOption_ == nullptr, "finishOption() not called");
     GMX_RELEASE_ASSERT(!impl_->inSection(), "finishSection() not called");
 }
 
index 6ccc2915150da27b609d89ccfa1317bf9438f74a..2dae1aa9f4958be60c129a992b60543792c6e095 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -395,19 +395,19 @@ OptionStorageTemplate<T>::OptionStorageTemplate(const OptionTemplate<T, U> &sett
                           settings.maxValueCount_ : settings.minValueCount_)))
 {
     if (hasFlag(efOption_NoDefaultValue)
-        && (settings.defaultValue_ != NULL
-            || settings.defaultValueIfSet_ != NULL))
+        && (settings.defaultValue_ != nullptr
+            || settings.defaultValueIfSet_ != nullptr))
     {
         GMX_THROW(APIError("Option does not support default value, but one is set"));
     }
     if (!hasFlag(efOption_NoDefaultValue))
     {
         setFlag(efOption_HasDefaultValue);
-        if (settings.defaultValue_ != NULL)
+        if (settings.defaultValue_ != nullptr)
         {
             setDefaultValue(*settings.defaultValue_);
         }
-        if (settings.defaultValueIfSet_ != NULL)
+        if (settings.defaultValueIfSet_ != nullptr)
         {
             setDefaultValueIfSet(*settings.defaultValueIfSet_);
         }
@@ -492,7 +492,7 @@ std::vector<std::string> OptionStorageTemplate<T>::defaultValuesAsStrings() cons
     if (result.empty() || (result.size() == 1 && result[0].empty()))
     {
         result.clear();
-        if (defaultValueIfSet_.get() != NULL)
+        if (defaultValueIfSet_.get() != nullptr)
         {
             result.push_back(formatSingleValue(*defaultValueIfSet_));
         }
@@ -512,7 +512,7 @@ template <typename T>
 void OptionStorageTemplate<T>::processSet()
 {
     processSetValues(&setValues_);
-    if (setValues_.empty() && defaultValueIfSet_.get() != NULL)
+    if (setValues_.empty() && defaultValueIfSet_.get() != nullptr)
     {
         addValue(*defaultValueIfSet_);
         setFlag(efOption_HasDefaultValue);
index e14856be7710e9f1bef4ab54cad635eaa735301e..0f1adf33dfc1e1bca2247b0fdfd5c7366ab1abb1 100644 (file)
@@ -214,7 +214,7 @@ class OptionsModifyingTypeVisitor : public OptionsModifyingVisitor
         virtual void visitOption(OptionInfo *option)
         {
             InfoType *subtype = option->toType<InfoType>();
-            if (subtype != NULL)
+            if (subtype != nullptr)
             {
                 visitOptionType(subtype);
             }
index e13a17ecdb631438bf03b7d6093f7b7ad97ddc0e..e8de95d92fe9ec807e3e76ad0cabec773c512d82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -768,7 +768,7 @@ TEST(OptionsAssignerStringTest, HandlesEnumValueFromNullTerminatedArray)
 {
     gmx::Options           options;
     std::string            value;
-    const char * const     allowed[] = { "none", "test", "value", NULL };
+    const char * const     allowed[] = { "none", "test", "value", nullptr };
     using gmx::StringOption;
     ASSERT_NO_THROW(options.addOption(
                             StringOption("p").store(&value)
index 8136f80681eabfcdd88fda6916b7e4071f96b654..4a4e9af6f5036278783d978ef4202c0884b9ae57 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -123,7 +123,7 @@ double TimeUnitManager::inverseTimeScaleFactor() const
  */
 
 TimeUnitBehavior::TimeUnitBehavior()
-    : timeUnit_(TimeUnit_Default), timeUnitStore_(NULL)
+    : timeUnit_(TimeUnit_Default), timeUnitStore_(nullptr)
 {
 }
 
@@ -132,7 +132,7 @@ void TimeUnitBehavior::setTimeUnit(TimeUnit timeUnit)
     GMX_RELEASE_ASSERT(timeUnit >= 0 && timeUnit <= TimeUnit_s,
                        "Invalid time unit");
     timeUnit_ = timeUnit;
-    if (timeUnitStore_ != NULL)
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = timeUnit;
     }
@@ -147,7 +147,7 @@ void TimeUnitBehavior::setTimeUnitStore(TimeUnit *store)
 void TimeUnitBehavior::setTimeUnitFromEnvironment()
 {
     const char *const value = std::getenv("GMXTIMEUNIT");
-    if (value != NULL)
+    if (value != nullptr)
     {
         ConstArrayRef<const char *>                 timeUnits(g_timeUnits);
         ConstArrayRef<const char *>::const_iterator i =
@@ -216,7 +216,7 @@ void TimeUnitBehavior::optionsFinishing(Options *options)
     double factor = TimeUnitManager(timeUnit()).timeScaleFactor();
     TimeOptionScaler<DoubleOptionInfo>(factor).visitSection(&options->rootSection());
     TimeOptionScaler<FloatOptionInfo>(factor).visitSection(&options->rootSection());
-    if (timeUnitStore_ != NULL)
+    if (timeUnitStore_ != nullptr)
     {
         *timeUnitStore_ = static_cast<TimeUnit>(timeUnit_);
     }
index b184267a7a1b0ff99b5c9d9721872b9e14b0ddc1..fd3c858611aebd3248b90b31fb6ac3c61ca94124 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -100,7 +100,7 @@ void preserve_box_shape(const t_inputrec *ir, matrix box_rel, matrix b)
 void set_box_rel(const t_inputrec *ir, t_state *state)
 {
     /* Make sure the box obeys the restrictions before we fix the ratios */
-    correct_box(NULL, 0, state->box, NULL);
+    correct_box(nullptr, 0, state->box, nullptr);
 
     clear_mat(state->box_rel);
 
index d551166a29752e9d00700e4b03f639c1eab2d559..236848fcdc3523976f855406a3b23cd67eebf9a1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,7 +120,7 @@ static void mk_igraph(t_graph *g, int ftype, const t_ilist *il,
                 add_gbond(g, ia[1], ia[2]);
                 add_gbond(g, ia[1], ia[3]);
             }
-            else if (part == NULL)
+            else if (part == nullptr)
             {
                 /* Simply add this bond */
                 for (j = 1; j < np; j++)
@@ -412,7 +412,7 @@ void mk_graph_ilist(FILE *fplog,
             {
                 if (interaction_function[i].flags & IF_CHEMBOND)
                 {
-                    mk_igraph(g, i, &(ilist[i]), at_start, at_end, NULL);
+                    mk_igraph(g, i, &(ilist[i]), at_start, at_end, nullptr);
                 }
             }
 
@@ -442,10 +442,10 @@ void mk_graph_ilist(FILE *fplog,
         else
         {
             /* This is a special thing used in splitter.c to generate shake-blocks */
-            mk_igraph(g, F_CONSTR, &(ilist[F_CONSTR]), at_start, at_end, NULL);
+            mk_igraph(g, F_CONSTR, &(ilist[F_CONSTR]), at_start, at_end, nullptr);
             if (bSettle)
             {
-                mk_igraph(g, F_SETTLE, &(ilist[F_SETTLE]), at_start, at_end, NULL);
+                mk_igraph(g, F_SETTLE, &(ilist[F_SETTLE]), at_start, at_end, nullptr);
             }
         }
         g->nbound = 0;
@@ -459,7 +459,7 @@ void mk_graph_ilist(FILE *fplog,
     }
 
     g->negc = 0;
-    g->egc  = NULL;
+    g->egc  = nullptr;
 
     sfree(nbond);
 
index c56fa0f8c848067a892f53392aa198566f1dea0b..fb9addd5655fadf2d2a79946bda98833a3ebfc34 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,7 +54,7 @@ void set_pbc_simd(const t_pbc gmx_unused *pbc,
                   real gmx_unused        *pbc_simd)
 {
 #if GMX_SIMD_HAVE_REAL
-    if (pbc != NULL && pbc->ePBC != epbcNONE)
+    if (pbc != nullptr && pbc->ePBC != epbcNONE)
     {
         rvec inv_box_diag = {0, 0, 0};
 
index a793b2ba7a10120b0a5100d4acdcc7c1d9398f2b..e06e9ea1746c74c23d91e49d731908deac5dd073 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -64,7 +64,7 @@
 
 const char *epbc_names[epbcNR+1] =
 {
-    "xyz", "no", "xy", "screw", NULL
+    "xyz", "no", "xy", "screw", nullptr
 };
 
 /* Skip 0 so we have more chance of detecting if we forgot to call set_pbc. */
@@ -140,7 +140,7 @@ const char *check_box(int ePBC, const matrix box)
 
     if (ePBC == epbcNONE)
     {
-        return NULL;
+        return nullptr;
     }
 
     if ((box[XX][YY] != 0) || (box[XX][ZZ] != 0) || (box[YY][ZZ] != 0))
@@ -160,7 +160,7 @@ const char *check_box(int ePBC, const matrix box)
     }
     else
     {
-        ptr = NULL;
+        ptr = nullptr;
     }
 
     return ptr;
@@ -390,7 +390,7 @@ static void low_set_pbc(t_pbc *pbc, int ePBC,
     }
     else
     {
-        if (ePBC == epbcSCREW && NULL != dd_pbc)
+        if (ePBC == epbcSCREW && nullptr != dd_pbc)
         {
             /* This combinated should never appear here */
             gmx_incons("low_set_pbc called with screw pbc and dd_nc != NULL");
@@ -612,7 +612,7 @@ void set_pbc(t_pbc *pbc, int ePBC, const matrix box)
         ePBC = guess_ePBC(box);
     }
 
-    low_set_pbc(pbc, ePBC, NULL, box);
+    low_set_pbc(pbc, ePBC, nullptr, box);
 }
 
 t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
@@ -623,12 +623,12 @@ t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
     {
         pbc->ePBC = ePBC;
 
-        return NULL;
+        return nullptr;
     }
 
     if (nullptr == domdecCells)
     {
-        low_set_pbc(pbc, ePBC, NULL, box);
+        low_set_pbc(pbc, ePBC, nullptr, box);
     }
     else
     {
@@ -661,7 +661,7 @@ t_pbc *set_pbc_dd(t_pbc *pbc, int ePBC,
         }
     }
 
-    return (pbc->ePBC != epbcNONE ? pbc : NULL);
+    return (pbc->ePBC != epbcNONE ? pbc : nullptr);
 }
 
 void pbc_dx(const t_pbc *pbc, const rvec x1, const rvec x2, rvec dx)
index 0a8df5247c2bdd83cb4350fe85b92ad4c73a54e0..baa8c0e197232efe151a98770229ec3498944ed4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,14 +73,14 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
     rmpbc_graph_t *gr;
 
     if (ePBC == epbcNONE
-        || NULL == gpbc
-        || NULL == gpbc->idef
+        || nullptr == gpbc
+        || nullptr == gpbc->idef
         || gpbc->idef->ntypes <= 0)
     {
-        return NULL;
+        return nullptr;
     }
 
-    gr = NULL;
+    gr = nullptr;
     for (i = 0; i < gpbc->ngraph; i++)
     {
         if (natoms == gpbc->graph[i].natoms)
@@ -88,7 +88,7 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
             gr = &gpbc->graph[i];
         }
     }
-    if (gr == NULL)
+    if (gr == nullptr)
     {
         /* We'd like to check with the number of atoms in the topology,
          * but we don't have that available.
@@ -103,7 +103,7 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
         srenew(gpbc->graph, gpbc->ngraph);
         gr         = &gpbc->graph[gpbc->ngraph-1];
         gr->natoms = natoms;
-        gr->gr     = mk_graph(NULL, gpbc->idef, 0, natoms, FALSE, FALSE);
+        gr->gr     = mk_graph(nullptr, gpbc->idef, 0, natoms, FALSE, FALSE);
     }
 
     return gr->gr;
@@ -140,14 +140,14 @@ void gmx_rmpbc_done(gmx_rmpbc_t gpbc)
 {
     int i;
 
-    if (NULL != gpbc)
+    if (nullptr != gpbc)
     {
         for (i = 0; i < gpbc->ngraph; i++)
         {
             done_graph(gpbc->graph[i].gr);
             sfree(gpbc->graph[i].gr);
         }
-        if (gpbc->graph != NULL)
+        if (gpbc->graph != nullptr)
         {
             sfree(gpbc->graph);
         }
@@ -157,7 +157,7 @@ void gmx_rmpbc_done(gmx_rmpbc_t gpbc)
 
 static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, const matrix box)
 {
-    if (NULL != gpbc && gpbc->ePBC >= 0)
+    if (nullptr != gpbc && gpbc->ePBC >= 0)
     {
         return gpbc->ePBC;
     }
@@ -174,7 +174,7 @@ void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[])
 
     ePBC = gmx_rmpbc_ePBC(gpbc, box);
     gr   = gmx_rmpbc_get_graph(gpbc, ePBC, natoms);
-    if (gr != NULL)
+    if (gr != nullptr)
     {
         mk_mshift(stdout, gr, ePBC, box, x);
         shift_self(gr, box, x);
@@ -189,7 +189,7 @@ void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[], rv
 
     ePBC = gmx_rmpbc_ePBC(gpbc, box);
     gr   = gmx_rmpbc_get_graph(gpbc, ePBC, natoms);
-    if (gr != NULL)
+    if (gr != nullptr)
     {
         mk_mshift(stdout, gr, ePBC, box, x);
         shift_x(gr, box, x, x_s);
@@ -212,7 +212,7 @@ void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, t_trxframe *fr)
     {
         ePBC = gmx_rmpbc_ePBC(gpbc, fr->box);
         gr   = gmx_rmpbc_get_graph(gpbc, ePBC, fr->natoms);
-        if (gr != NULL)
+        if (gr != nullptr)
         {
             mk_mshift(stdout, gr, ePBC, fr->box, fr->x);
             shift_self(gr, fr->box, fr->x);
index de42a26d775028330fd97d0f0f7a120433a7ef88..d430f8a609ab02040c1c8a182c333b5738fc083f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1327,7 +1327,7 @@ static void do_constraint(struct pull_t *pull, t_pbc *pbc,
 
         pcrd->f_scal = dr_tot[c]/((pull->group[pcrd->params.group[0]].invtm + pull->group[pcrd->params.group[1]].invtm)*dt*dt);
 
-        if (vir != NULL && pcrd->params.eGeom != epullgDIRPBC && bMaster)
+        if (vir != nullptr && pcrd->params.eGeom != epullgDIRPBC && bMaster)
         {
             double f_invr;
 
@@ -1365,7 +1365,7 @@ static void add_virial_coord_dr(tensor vir, const dvec dr, const dvec f)
 /* Adds the pull contribution to the virial */
 static void add_virial_coord(tensor vir, const pull_coord_work_t *pcrd)
 {
-    if (vir != NULL && pcrd->params.eGeom != epullgDIRPBC)
+    if (vir != nullptr && pcrd->params.eGeom != epullgDIRPBC)
     {
         /* Add the pull contribution for each distance vector to the virial. */
         add_virial_coord_dr(vir, pcrd->dr01, pcrd->f01);
@@ -1564,8 +1564,8 @@ void register_external_pull_potential(struct pull_t *pull,
                                       int            coord_index,
                                       const char    *provider)
 {
-    GMX_RELEASE_ASSERT(pull != NULL, "register_external_pull_potential called before init_pull");
-    GMX_RELEASE_ASSERT(provider != NULL, "register_external_pull_potential called with NULL as provider name");
+    GMX_RELEASE_ASSERT(pull != nullptr, "register_external_pull_potential called before init_pull");
+    GMX_RELEASE_ASSERT(provider != nullptr, "register_external_pull_potential called with NULL as provider name");
 
     if (coord_index < 0 || coord_index > pull->ncoord - 1)
     {
@@ -1581,7 +1581,7 @@ void register_external_pull_potential(struct pull_t *pull,
                   provider, coord_index + 1, epull_names[pcrd->params.eType], epull_names[epullEXTERNAL]);
     }
 
-    GMX_RELEASE_ASSERT(pcrd->params.externalPotentialProvider != NULL, "The external potential provider string for a pull coordinate is NULL");
+    GMX_RELEASE_ASSERT(pcrd->params.externalPotentialProvider != nullptr, "The external potential provider string for a pull coordinate is NULL");
 
     if (gmx_strcasecmp(provider, pcrd->params.externalPotentialProvider) != 0)
     {
@@ -1702,7 +1702,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
     {
         real dVdl = 0;
 
-        pull_calc_coms(cr, pull, md, pbc, t, x, NULL);
+        pull_calc_coms(cr, pull, md, pbc, t, x, nullptr);
 
         for (int c = 0; c < pull->ncoord; c++)
         {
@@ -1714,7 +1714,7 @@ real pull_potential(struct pull_t *pull, t_mdatoms *md, t_pbc *pbc,
             }
 
             do_pull_pot_coord(pull, c, pbc, t, lambda,
-                              &V, MASTER(cr) ? vir : NULL, &dVdl);
+                              &V, MASTER(cr) ? vir : nullptr, &dVdl);
 
             /* Distribute the force over the atoms in the pulled groups */
             apply_forces_coord(pull, c, md, f);
@@ -1771,13 +1771,13 @@ static void make_local_pull_group(gmx_ga2la_t *ga2la,
             {
                 pg->nalloc_loc = over_alloc_dd(pg->nat_loc+1);
                 srenew(pg->ind_loc, pg->nalloc_loc);
-                if (pg->epgrppbc == epgrppbcCOS || pg->params.weight != NULL)
+                if (pg->epgrppbc == epgrppbcCOS || pg->params.weight != nullptr)
                 {
                     srenew(pg->weight_loc, pg->nalloc_loc);
                 }
             }
             pg->ind_loc[pg->nat_loc] = ii;
-            if (pg->params.weight != NULL)
+            if (pg->params.weight != nullptr)
             {
                 pg->weight_loc[pg->nat_loc] = pg->params.weight[i];
             }
@@ -1804,13 +1804,13 @@ void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md
     }
     else
     {
-        ga2la = NULL;
+        ga2la = nullptr;
     }
 
     /* We always make the master node participate, such that it can do i/o
      * and to simplify MC type extensions people might have.
      */
-    bMustParticipate = (comm->bParticipateAll || dd == NULL || DDMASTER(dd));
+    bMustParticipate = (comm->bParticipateAll || dd == nullptr || DDMASTER(dd));
 
     for (g = 0; g < pull->ngroup; g++)
     {
@@ -1852,7 +1852,7 @@ void dd_make_local_pull_groups(t_commrec *cr, struct pull_t *pull, t_mdatoms *md
             (comm->bParticipate &&
              comm->must_count >= comm->setup_count - history_count);
 
-        if (debug && dd != NULL)
+        if (debug && dd != nullptr)
         {
             fprintf(debug, "Our DD rank (%3d) pull #atoms>0 or master: %d, will be part %d\n",
                     dd->rank, bMustParticipate, bWillParticipate);
@@ -1933,8 +1933,8 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
     {
         pg->nat_loc    = 0;
         pg->nalloc_loc = 0;
-        pg->ind_loc    = NULL;
-        pg->weight_loc = NULL;
+        pg->ind_loc    = nullptr;
+        pg->weight_loc = nullptr;
     }
     else
     {
@@ -2007,7 +2007,7 @@ static void init_pull_group_index(FILE *fplog, t_commrec *cr,
             }
             else
             {
-                if (groups->grpnr[egcTC] == NULL)
+                if (groups->grpnr[egcTC] == nullptr)
                 {
                     mbd = ir->delta_t/ir->opts.tau_t[0];
                 }
@@ -2099,8 +2099,8 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
     /* Copy the pull parameters */
     pull->params       = *pull_params;
     /* Avoid pointer copies */
-    pull->params.group = NULL;
-    pull->params.coord = NULL;
+    pull->params.group = nullptr;
+    pull->params.coord = nullptr;
 
     pull->ncoord       = pull_params->ncoord;
     pull->ngroup       = pull_params->ngroup;
@@ -2389,7 +2389,7 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
                     }
                     else
                     {
-                        if (pgrp->params.weight != NULL)
+                        if (pgrp->params.weight != nullptr)
                         {
                             gmx_fatal(FARGS, "Pull groups can not have relative weights and cosine weighting at same time");
                         }
@@ -2446,9 +2446,9 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
 
 #if GMX_MPI
     /* Use a sub-communicator when we have more than 32 ranks */
-    comm->bParticipateAll = (cr == NULL || !DOMAINDECOMP(cr) ||
+    comm->bParticipateAll = (cr == nullptr || !DOMAINDECOMP(cr) ||
                              cr->dd->nnodes <= 32 ||
-                             getenv("GMX_PULL_PARTICIPATE_ALL") != NULL);
+                             getenv("GMX_PULL_PARTICIPATE_ALL") != nullptr);
     /* This sub-commicator is not used with comm->bParticipateAll,
      * so we can always initialize it to NULL.
      */
@@ -2462,21 +2462,21 @@ init_pull(FILE *fplog, const pull_params_t *pull_params, const t_inputrec *ir,
     comm->setup_count     = 0;
     comm->must_count      = 0;
 
-    if (!comm->bParticipateAll && fplog != NULL)
+    if (!comm->bParticipateAll && fplog != nullptr)
     {
         fprintf(fplog, "Will use a sub-communicator for pull communication\n");
     }
 
-    comm->rbuf     = NULL;
-    comm->dbuf     = NULL;
-    comm->dbuf_cyl = NULL;
+    comm->rbuf     = nullptr;
+    comm->dbuf     = nullptr;
+    comm->dbuf_cyl = nullptr;
 
     /* We still need to initialize the PBC reference coordinates */
     pull->bSetPBCatoms = TRUE;
 
     /* Only do I/O when we are doing dynamics and if we are the MASTER */
-    pull->out_x = NULL;
-    pull->out_f = NULL;
+    pull->out_x = nullptr;
+    pull->out_f = nullptr;
     if (bOutFile)
     {
         /* Check for px and pf filename collision, if we are writing
index 7ebe0db0fb3b65bd75ec10f57873171b35739eb7..8d8b685739ee56a5ac975d225b3b2b68c7a08f02 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -266,7 +266,7 @@ static gmx_bool HavePotFitGroups(t_rot *rot)
 static double** allocate_square_matrix(int dim)
 {
     int      i;
-    double** mat = NULL;
+    double** mat = nullptr;
 
 
     snew(mat, dim);
@@ -665,7 +665,7 @@ static void get_slab_centers(
     } /* END of loop over slabs */
 
     /* Output on the master */
-    if ( (NULL != out_slabs) && bOutStep)
+    if ( (nullptr != out_slabs) && bOutStep)
     {
         fprintf(out_slabs, "%12.3e%6d", time, g);
         for (j = erg->slab_first; j <= erg->slab_last; j++)
@@ -861,7 +861,7 @@ static FILE *open_rot_out(const char *fn, t_rot *rot, const gmx_output_env_t *oe
     char            buf[50], buf2[75];
     gmx_enfrotgrp_t erg;       /* Pointer to enforced rotation group data */
     gmx_bool        bFlex;
-    char           *LegendStr = NULL;
+    char           *LegendStr = nullptr;
 
 
     if (rot->enfrot->Flags & MD_APPENDFILES)
@@ -1188,7 +1188,7 @@ static void align_with_z(
     int     i, j, k;
     rvec    zet         = {0.0, 0.0, 1.0};
     rvec    rot_axis    = {0.0, 0.0, 0.0};
-    rvec   *rotated_str = NULL;
+    rvec   *rotated_str = nullptr;
     real    ooanorm;
     real    angle;
     matrix  rotmat;
@@ -1287,8 +1287,8 @@ static real opt_angle_analytic(
         rvec  axis)
 {
     int      i, j, k;
-    rvec    *ref_s_1 = NULL;
-    rvec    *act_s_1 = NULL;
+    rvec    *ref_s_1 = nullptr;
+    rvec    *act_s_1 = nullptr;
     rvec     shift;
     double **Rmat, **RtR, **eigvec;
     double   eigval[3];
@@ -1331,7 +1331,7 @@ static real opt_angle_analytic(
     }
 
     /* Weight positions with sqrt(weight) */
-    if (NULL != weight)
+    if (nullptr != weight)
     {
         weigh_coords(ref_s_1, weight, natoms);
         weigh_coords(act_s_1, weight, natoms);
@@ -1454,7 +1454,7 @@ static real opt_angle_analytic(
 static real flex_fit_angle(t_rotgrp *rotg)
 {
     int             i;
-    rvec           *fitcoords = NULL;
+    rvec           *fitcoords = nullptr;
     rvec            center;     /* Center of positions passed to the fit routine */
     real            fitangle;   /* Angle of the rotation group derived by fitting */
     rvec            coord;
@@ -3283,7 +3283,7 @@ static void allocate_slabs(
     /* Remember how many we allocated */
     erg->nslabs_alloc = nslabs;
 
-    if ( (NULL != fplog) && bVerbose)
+    if ( (nullptr != fplog) && bVerbose)
     {
         fprintf(fplog, "%s allocating memory to store data for %d slabs (rotation group %d).\n",
                 RotStr, nslabs, g);
@@ -3445,7 +3445,7 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
     }
     else
     {
-        erg->PotAngleFit = NULL;
+        erg->PotAngleFit = nullptr;
     }
 
     /* xc_ref_ind needs to be set to identity in the serial case */
@@ -3662,10 +3662,10 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     t_rot          *rot;
     t_rotgrp       *rotg;
     int             g;
-    int             nat_max = 0;  /* Size of biggest rotation group */
-    gmx_enfrot_t    er;           /* Pointer to the enforced rotation buffer variables */
-    gmx_enfrotgrp_t erg;          /* Pointer to enforced rotation group data */
-    rvec           *x_pbc = NULL; /* Space for the pbc-correct atom positions */
+    int             nat_max = 0;     /* Size of biggest rotation group */
+    gmx_enfrot_t    er;              /* Pointer to the enforced rotation buffer variables */
+    gmx_enfrotgrp_t erg;             /* Pointer to enforced rotation group data */
+    rvec           *x_pbc = nullptr; /* Space for the pbc-correct atom positions */
 
 
     if (MASTER(cr) && bVerbose)
@@ -3696,7 +3696,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     /* Output every step for reruns */
     if (er->Flags & MD_RERUN)
     {
-        if (NULL != fplog)
+        if (nullptr != fplog)
         {
             fprintf(fplog, "%s rerun - will write rotation output every available step.\n", RotStr);
         }
@@ -3704,7 +3704,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
         rot->nstsout = 1;
     }
 
-    er->out_slabs = NULL;
+    er->out_slabs = nullptr;
     if (MASTER(cr) && HaveFlexibleGroups(rot) )
     {
         er->out_slabs = open_slab_out(opt2fn("-rs", nfile, fnm), rot);
@@ -3716,7 +3716,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
          * When ir->bContinuation=TRUE this has already been done, but ok. */
         snew(x_pbc, mtop->natoms);
         copy_rvecn(x, x_pbc, 0, mtop->natoms);
-        do_pbc_first_mtop(NULL, ir->ePBC, box, mtop, x_pbc);
+        do_pbc_first_mtop(nullptr, ir->ePBC, box, mtop, x_pbc);
         /* All molecules will be whole now, but not necessarily in the home box.
          * Additionally, if a rotation group consists of more than one molecule
          * (e.g. two strands of DNA), each one of them can end up in a different
@@ -3727,7 +3727,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     {
         rotg = &rot->grp[g];
 
-        if (NULL != fplog)
+        if (nullptr != fplog)
         {
             fprintf(fplog, "%s group %d type '%s'\n", RotStr, g, erotg_names[rotg->eType]);
         }
@@ -3744,7 +3744,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
             {
                 erg->nat_loc    = 0;
                 erg->nalloc_loc = 0;
-                erg->ind_loc    = NULL;
+                erg->ind_loc    = nullptr;
             }
             else
             {
@@ -3773,14 +3773,14 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     else
     {
         er->mpi_bufsize = 0;
-        er->mpi_inbuf   = NULL;
-        er->mpi_outbuf  = NULL;
+        er->mpi_inbuf   = nullptr;
+        er->mpi_outbuf  = nullptr;
     }
 
     /* Only do I/O on the MASTER */
-    er->out_angles  = NULL;
-    er->out_rot     = NULL;
-    er->out_torque  = NULL;
+    er->out_angles  = nullptr;
+    er->out_rot     = nullptr;
+    er->out_torque  = nullptr;
     if (MASTER(cr))
     {
         er->out_rot = open_rot_out(opt2fn("-ro", nfile, fnm), rot, oenv);
@@ -3896,11 +3896,11 @@ extern void do_rotation(
     t_rotgrp       *rotg;
     gmx_bool        outstep_slab, outstep_rot;
     gmx_bool        bColl;
-    gmx_enfrot_t    er;         /* Pointer to the enforced rotation buffer variables */
-    gmx_enfrotgrp_t erg;        /* Pointer to enforced rotation group data           */
+    gmx_enfrot_t    er;            /* Pointer to the enforced rotation buffer variables */
+    gmx_enfrotgrp_t erg;           /* Pointer to enforced rotation group data           */
     rvec            transvec;
-    t_gmx_potfit   *fit = NULL; /* For fit type 'potential' determine the fit
-                                   angle via the potential minimum            */
+    t_gmx_potfit   *fit = nullptr; /* For fit type 'potential' determine the fit
+                                      angle via the potential minimum            */
 
     /* Enforced rotation cycle counting: */
     gmx_cycles_t cycles_comp;   /* Cycles for the enf. rotation computation
index 661b5a4d8841ad8d0686869171717abb9640b7ac..0c62ff647fede330a2c2457742972a1557395f49 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -65,7 +65,7 @@ static void pull_reduce_real(t_commrec   *cr,
                              int          n,
                              real        *data)
 {
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         if (comm->bParticipateAll)
         {
@@ -105,7 +105,7 @@ static void pull_reduce_double(t_commrec   *cr,
                                int          n,
                                double      *data)
 {
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         if (comm->bParticipateAll)
         {
@@ -146,7 +146,7 @@ static void pull_set_pbcatom(t_commrec *cr, pull_group_work_t *pgrp,
 {
     int a;
 
-    if (cr != NULL && DOMAINDECOMP(cr))
+    if (cr != nullptr && DOMAINDECOMP(cr))
     {
         if (ga2la_get_home(cr->dd->ga2la, pgrp->params.pbcatom, &a))
         {
@@ -202,11 +202,11 @@ static void make_cyl_refgrps(t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
     rvec            g_x, dx, dir;
     double          inv_cyl_r2;
     pull_comm_t    *comm;
-    gmx_ga2la_t    *ga2la = NULL;
+    gmx_ga2la_t    *ga2la = nullptr;
 
     comm = &pull->comm;
 
-    if (comm->dbuf_cyl == NULL)
+    if (comm->dbuf_cyl == nullptr)
     {
         snew(comm->dbuf_cyl, pull->ncoord*stride);
     }
@@ -346,7 +346,7 @@ static void make_cyl_refgrps(t_commrec *cr, struct pull_t *pull, t_mdatoms *md,
         comm->dbuf_cyl[c*stride+8] = radf_fac1[ZZ];
     }
 
-    if (cr != NULL && PAR(cr))
+    if (cr != nullptr && PAR(cr))
     {
         /* Sum the contributions over the ranks */
         pull_reduce_double(cr, comm, pull->ncoord*stride, comm->dbuf_cyl);
@@ -439,7 +439,7 @@ static void sum_com_part(const pull_group_work_t *pgrp,
     {
         int  ii = pgrp->ind_loc[i];
         real wm;
-        if (pgrp->weight_loc == NULL)
+        if (pgrp->weight_loc == nullptr)
         {
             wm      = mass[ii];
             sum_wm += wm;
@@ -530,7 +530,7 @@ static void sum_com_part_cosweight(const pull_group_work_t *pgrp,
         sum_csm += static_cast<double>(cw*sw*m);
         sum_ssm += static_cast<double>(sw*sw*m);
 
-        if (xp != NULL)
+        if (xp != nullptr)
         {
             real cw  = std::cos(xp[ii][cosdim]*twopi_box);
             real sw  = std::sin(xp[ii][cosdim]*twopi_box);
@@ -559,11 +559,11 @@ void pull_calc_coms(t_commrec *cr,
 
     comm = &pull->comm;
 
-    if (comm->rbuf == NULL)
+    if (comm->rbuf == nullptr)
     {
         snew(comm->rbuf, pull->ngroup);
     }
-    if (comm->dbuf == NULL)
+    if (comm->dbuf == nullptr)
     {
         snew(comm->dbuf, 3*pull->ngroup);
     }
@@ -572,7 +572,7 @@ void pull_calc_coms(t_commrec *cr,
     {
         pull_set_pbcatoms(cr, pull, x, comm->rbuf);
 
-        if (cr != NULL && DOMAINDECOMP(cr))
+        if (cr != nullptr && DOMAINDECOMP(cr))
         {
             /* We can keep these PBC reference coordinates fixed for nstlist
              * steps, since atoms won't jump over PBC.
@@ -672,7 +672,7 @@ void pull_calc_coms(t_commrec *cr,
                     }
                 }
 
-                if (pgrp->weight_loc == NULL)
+                if (pgrp->weight_loc == nullptr)
                 {
                     sum_com->sum_wwm = sum_com->sum_wm;
                 }
index a35ac378a01d52dfc82ff246087b6ac29bf9b53e..0d7833bcbbe827edd1763a11585615186e7babec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -466,7 +466,7 @@ void SelectionTreeElement::freeCompilerData()
         }
         sfree(cdata);
     }
-    cdata = NULL;
+    cdata = nullptr;
 }
 
 } // namespace gmx
@@ -628,7 +628,7 @@ init_pos_keyword_defaults(SelectionTreeElement *root,
      * reference positions use the whole residue/molecule. */
     if (root->type == SEL_EXPRESSION)
     {
-        bool bSelection = (sel != NULL);
+        bool bSelection = (sel != nullptr);
         int  flags      = bSelection ? POS_COMPLMAX : POS_COMPLWHOLE;
         if (bSelection)
         {
@@ -652,7 +652,7 @@ init_pos_keyword_defaults(SelectionTreeElement *root,
     if (root->type != SEL_ROOT && root->type != SEL_MODIFIER
         && root->type != SEL_SUBEXPRREF && root->type != SEL_SUBEXPR)
     {
-        sel = NULL;
+        sel = nullptr;
     }
     /* Recurse into children */
     SelectionTreeElementPointer child = root->child;
@@ -1247,7 +1247,7 @@ init_item_evaloutput(const SelectionTreeElementPointer &sel)
     {
         sel->evaluate        = &_gmx_sel_evaluate_subexpr_staticeval;
         sel->cdata->evaluate = sel->evaluate;
-        sel->child->mempool  = NULL;
+        sel->child->mempool  = nullptr;
         sel->flags          &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
         if (sel->v.type == GROUP_VALUE || sel->v.type == POS_VALUE)
         {
@@ -1620,7 +1620,7 @@ initialize_evalgrps(gmx_ana_selcollection_t *sc)
         if (root->child->type != SEL_SUBEXPR
             || (root->child->v.type != GROUP_VALUE && !(root->flags & SEL_ATOMVAL)))
         {
-            gmx_ana_index_set(&root->u.cgrp, -1, 0, 0);
+            gmx_ana_index_set(&root->u.cgrp, -1, nullptr, 0);
         }
         else if (root->child->cdata->flags & SEL_CDATA_FULLEVAL)
         {
@@ -1746,8 +1746,8 @@ make_static(const SelectionTreeElementPointer &sel)
     sel->freeExpressionData();
     /* Make the item static */
     sel->type            = SEL_CONST;
-    sel->evaluate        = NULL;
-    sel->cdata->evaluate = NULL;
+    sel->evaluate        = nullptr;
+    sel->cdata->evaluate = nullptr;
     /* Set the group value.
      * freeExpressionData() frees the cgrp group, so we can just override it.
      * */
@@ -1885,7 +1885,7 @@ init_method(const SelectionTreeElementPointer &sel, const gmx_mtop_t *top, int i
                 sel->flags |= SEL_ALLOCDATA;
                 for (i = 0; i < isize; ++i)
                 {
-                    if (sel->v.u.s[i] == NULL)
+                    if (sel->v.u.s[i] == nullptr)
                     {
                         snew(sel->v.u.s[i], 2);
                     }
@@ -1932,7 +1932,7 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
         child.reset(new SelectionTreeElement(SEL_CONST, SelectionLocation::createEmpty()));
         child->flags      = SEL_FLAGSSET | SEL_SINGLEVAL | SEL_ALLOCVAL | SEL_ALLOCDATA;
         _gmx_selelem_set_vtype(child, GROUP_VALUE);
-        child->evaluate   = NULL;
+        child->evaluate   = nullptr;
         _gmx_selvalue_reserve(&child->v, 1);
         gmx_ana_index_copy(child->v.u.g, sel->v.u.g, true);
         init_item_compilerdata(child);
@@ -1954,12 +1954,12 @@ evaluate_boolean_static_part(gmx_sel_evaluate_t                *data,
      * If we reach here with a NOT expression, the NOT expression
      * is also static, and will be made a constant later, so don't waste
      * time copying the group. */
-    child->evaluate = NULL;
+    child->evaluate = nullptr;
     if (sel->u.boolt == BOOL_NOT
         || ((sel->cdata->flags & SEL_CDATA_STATICEVAL)
             && sel->u.boolt == BOOL_OR))
     {
-        child->cdata->evaluate = NULL;
+        child->cdata->evaluate = nullptr;
     }
     else
     {
@@ -2381,10 +2381,10 @@ init_root_item(const SelectionTreeElementPointer &root,
             || ((root->child->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
                 && !(root->child->cdata->flags & SEL_CDATA_FULLEVAL))))
     {
-        root->evaluate = NULL;
+        root->evaluate = nullptr;
         if (root->cdata)
         {
-            root->cdata->evaluate = NULL;
+            root->cdata->evaluate = nullptr;
         }
     }
 
@@ -2396,7 +2396,7 @@ init_root_item(const SelectionTreeElementPointer &root,
         if ((expr->flags & SEL_VARNUMVAL)
             || ((expr->flags & SEL_SINGLEVAL) && expr->v.type != GROUP_VALUE))
         {
-            gmx_ana_index_set(&root->u.cgrp, -1, NULL, 0);
+            gmx_ana_index_set(&root->u.cgrp, -1, nullptr, 0);
         }
         else if (expr->cdata->gmax->isize == gall->isize)
         {
@@ -2410,7 +2410,7 @@ init_root_item(const SelectionTreeElementPointer &root,
         /* For selections, store the maximum group for
          * gmx_ana_selcollection_evaluate_fin() as the value of the root
          * element (unused otherwise). */
-        if (expr->type != SEL_SUBEXPR && expr->v.u.p->m.mapb.a != NULL)
+        if (expr->type != SEL_SUBEXPR && expr->v.u.p->m.mapb.a != nullptr)
         {
             SelectionTreeElementPointer child = expr;
 
@@ -2539,7 +2539,7 @@ postprocess_item_subexpressions(const SelectionTreeElementPointer &sel)
         sel->cdata->evaluate = sel->evaluate;
 
         sel->child->freeValues();
-        sel->child->mempool = NULL;
+        sel->child->mempool = nullptr;
         _gmx_selvalue_setstore(&sel->child->v, sel->v.u.ptr);
         sel->child->flags &= ~(SEL_ALLOCVAL | SEL_ALLOCDATA);
     }
@@ -2579,8 +2579,8 @@ postprocess_item_subexpressions(const SelectionTreeElementPointer &sel)
         && (sel->cdata->flags & SEL_CDATA_SIMPLESUBEXPR)
         && (sel->cdata->flags & SEL_CDATA_STATICMULTIEVALSUBEXPR))
     {
-        sel->evaluate        = NULL;
-        sel->cdata->evaluate = NULL;
+        sel->evaluate        = nullptr;
+        sel->cdata->evaluate = nullptr;
     }
 }
 
@@ -2721,7 +2721,7 @@ SelectionCompiler::compile(SelectionCollection *coll)
 
     sc->mempool = _gmx_sel_mempool_create();
     _gmx_sel_evaluate_init(&evaldata, sc->mempool, &sc->gall,
-                           sc->top, NULL, NULL);
+                           sc->top, nullptr, nullptr);
 
     /* Clear the symbol table because it is not possible to parse anything
      * after compilation, and variable references in the symbol table can
@@ -2818,7 +2818,7 @@ SelectionCompiler::compile(SelectionCollection *coll)
             mark_subexpr_dynamic(item->child, true);
         }
         set_evaluation_function(item, &analyze_static);
-        item->evaluate(&evaldata, item, NULL);
+        item->evaluate(&evaldata, item, nullptr);
         item = item->next;
     }
 
index 70e5fd1ddd7cc3d9b1b89ee09f34fe6f7d499b3c..05a5d3853758ecd80cb6d804cf0d58098e7b2e7a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -152,13 +152,13 @@ class MempoolGroupReserver
          * \param    mp  Memory pool from which to reserve memory.
          */
         explicit MempoolGroupReserver(gmx_sel_mempool_t *mp)
-            : mp_(mp), g_(NULL)
+            : mp_(mp), g_(nullptr)
         {
         }
         //! Frees any memory allocated using this reserver.
         ~MempoolGroupReserver()
         {
-            if (g_ != NULL)
+            if (g_ != nullptr)
             {
                 _gmx_sel_mempool_free_group(mp_, g_);
             }
@@ -175,7 +175,7 @@ class MempoolGroupReserver
          */
         void reserve(gmx_ana_index_t *g, int count)
         {
-            GMX_RELEASE_ASSERT(g_ == NULL, "Can only reserve one element with one instance");
+            GMX_RELEASE_ASSERT(g_ == nullptr, "Can only reserve one element with one instance");
             _gmx_sel_mempool_alloc_group(mp_, g, count);
             g_ = g;
         }
@@ -198,7 +198,7 @@ class SelelemTemporaryValueAssigner
     public:
         //! Constructs an assigner without an initial assignment.
         SelelemTemporaryValueAssigner()
-            : old_ptr_(NULL), old_nalloc_(0)
+            : old_ptr_(nullptr), old_nalloc_(0)
         {
         }
         /*! \brief
@@ -445,7 +445,7 @@ SelectionEvaluator::evaluate(SelectionCollection *coll,
     {
         /* Clear the evaluation group of subexpressions */
         if (sel->child && sel->child->type == SEL_SUBEXPR
-            && sel->child->evaluate != NULL)
+            && sel->child->evaluate != nullptr)
         {
             sel->child->u.cgrp.isize = 0;
             /* Not strictly necessary, because the value will be overwritten
@@ -461,7 +461,7 @@ SelectionEvaluator::evaluate(SelectionCollection *coll,
         }
         if (sel->evaluate)
         {
-            sel->evaluate(&data, sel, NULL);
+            sel->evaluate(&data, sel, nullptr);
         }
         sel = sel->next;
     }
@@ -530,7 +530,7 @@ _gmx_sel_evaluate_root(gmx_sel_evaluate_t                     *data,
     }
 
     sel->child->evaluate(data, sel->child,
-                         sel->u.cgrp.isize < 0 ? NULL : &sel->u.cgrp);
+                         sel->u.cgrp.isize < 0 ? nullptr : &sel->u.cgrp);
 }
 
 void
@@ -796,7 +796,7 @@ _gmx_sel_evaluate_subexprref(gmx_sel_evaluate_t                     *data,
 {
     int        i, j;
 
-    if (g != NULL && sel->child->evaluate != NULL)
+    if (g != nullptr && sel->child->evaluate != nullptr)
     {
         sel->child->evaluate(data, sel->child, g);
     }
@@ -931,7 +931,7 @@ _gmx_sel_evaluate_method_params(gmx_sel_evaluate_t                     *data,
             else
             {
                 child->flags |= SEL_EVALFRAME;
-                child->evaluate(data, child, NULL);
+                child->evaluate(data, child, nullptr);
             }
         }
         child = child->next;
@@ -1023,7 +1023,7 @@ _gmx_sel_evaluate_modifier(gmx_sel_evaluate_t                     *data,
     {
         GMX_THROW(gmx::NotImplementedError("Non-position valued modifiers not implemented"));
     }
-    sel->u.expr.method->pupdate(context, NULL, &sel->v, sel->u.expr.mdata);
+    sel->u.expr.method->pupdate(context, nullptr, &sel->v, sel->u.expr.mdata);
 }
 
 
index 210d52d97bceb0f5afa9379c2836e8fa75a09c12..d264b47bb67c89b5e0deced261d6cb7eb7bd9630 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,7 +71,7 @@
 struct gmx_ana_indexgrps_t
 {
     //! Initializes an empty set of groups.
-    explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(NULL)
+    explicit gmx_ana_indexgrps_t(int nr) : nr(nr), g(nullptr)
     {
         names.reserve(nr);
         snew(g, nr);
@@ -110,8 +110,8 @@ void
 gmx_ana_indexgrps_init(gmx_ana_indexgrps_t **g, gmx_mtop_t *top,
                        const char *fnm)
 {
-    t_blocka *block = NULL;
-    char    **names = NULL;
+    t_blocka *block = nullptr;
+    char    **names = nullptr;
 
     if (fnm)
     {
@@ -201,7 +201,7 @@ gmx_ana_indexgrps_get_grp(gmx_ana_indexgrps_t *g, int n)
 {
     if (n < 0 || n >= g->nr)
     {
-        return NULL;
+        return nullptr;
     }
     return &g->g[n];
 }
@@ -224,7 +224,7 @@ gmx_ana_indexgrps_extract(gmx_ana_index_t *dest, std::string *destName,
         return false;
     }
 
-    if (destName != NULL)
+    if (destName != nullptr)
     {
         *destName = src->names[n];
     }
@@ -324,7 +324,7 @@ void
 gmx_ana_index_clear(gmx_ana_index_t *g)
 {
     g->isize        = 0;
-    g->index        = NULL;
+    g->index        = nullptr;
     g->nalloc_index = 0;
 }
 
@@ -859,14 +859,14 @@ gmx_ana_index_make_block(t_blocka *t, const gmx_mtop_t *top, gmx_ana_index_t *g,
         t->index[0]     = 0;
         t->index[1]     = 0;
         t->nra          = 0;
-        t->a            = NULL;
+        t->a            = nullptr;
         t->nalloc_a     = 0;
         return;
     }
 
     // TODO: Check callers and either check these there as well, or turn these
     // into exceptions.
-    GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+    GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
                        "Topology must be provided for residue or molecule blocks");
     GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
                        "Molecule information must be present for molecule blocks");
@@ -1168,19 +1168,19 @@ void
 gmx_ana_indexmap_clear(gmx_ana_indexmap_t *m)
 {
     m->type              = INDEX_UNKNOWN;
-    m->refid             = NULL;
-    m->mapid             = NULL;
+    m->refid             = nullptr;
+    m->mapid             = nullptr;
     m->mapb.nr           = 0;
-    m->mapb.index        = NULL;
+    m->mapb.index        = nullptr;
     m->mapb.nalloc_index = 0;
     m->mapb.nra          = 0;
-    m->mapb.a            = NULL;
+    m->mapb.a            = nullptr;
     m->mapb.nalloc_a     = 0;
-    m->orgid             = NULL;
+    m->orgid             = nullptr;
     m->b.nr              = 0;
-    m->b.index           = NULL;
+    m->b.index           = nullptr;
     m->b.nra             = 0;
-    m->b.a               = NULL;
+    m->b.a               = nullptr;
     m->b.nalloc_index    = 0;
     m->b.nalloc_a        = 0;
     m->bStatic           = true;
@@ -1255,7 +1255,7 @@ gmx_ana_indexmap_init_orgid_group(gmx_ana_indexmap_t *m, const gmx_mtop_t *top,
     GMX_RELEASE_ASSERT(m->bStatic,
                        "Changing original IDs is not supported after starting "
                        "to use the mapping");
-    GMX_RELEASE_ASSERT(top != NULL || (type != INDEX_RES && type != INDEX_MOL),
+    GMX_RELEASE_ASSERT(top != nullptr || (type != INDEX_RES && type != INDEX_MOL),
                        "Topology must be provided for residue or molecule blocks");
     GMX_RELEASE_ASSERT(!(type == INDEX_MOL && top->mols.nr == 0),
                        "Molecule information must be present for molecule blocks");
index 675932440febc6ce87158d6791ae37dd609570c9..20134991fbabc69235c14757557ebd8b9f1e9a8d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -100,10 +100,10 @@ _gmx_sel_mempool_create()
     snew(mp, 1);
     mp->currsize          = 0;
     mp->freesize          = 0;
-    mp->buffer            = NULL;
-    mp->freeptr           = NULL;
+    mp->buffer            = nullptr;
+    mp->freeptr           = nullptr;
     mp->nblocks           = 0;
-    mp->blockstack        = NULL;
+    mp->blockstack        = nullptr;
     mp->blockstack_nalloc = 0;
     mp->maxsize           = 0;
     return mp;
@@ -129,7 +129,7 @@ _gmx_sel_mempool_destroy(gmx_sel_mempool_t *mp)
 void *
 _gmx_sel_mempool_alloc(gmx_sel_mempool_t *mp, size_t size)
 {
-    void   *ptr = NULL;
+    void   *ptr = nullptr;
     size_t  size_walign;
 
     size_walign = ((size + ALIGN_STEP - 1) / ALIGN_STEP) * ALIGN_STEP;
@@ -175,7 +175,7 @@ _gmx_sel_mempool_free(gmx_sel_mempool_t *mp, void *ptr)
 {
     int size;
 
-    if (ptr == NULL)
+    if (ptr == nullptr)
     {
         return;
     }
@@ -226,5 +226,5 @@ void
 _gmx_sel_mempool_free_group(gmx_sel_mempool_t *mp, gmx_ana_index_t *g)
 {
     _gmx_sel_mempool_free(mp, g->index);
-    g->index = NULL;
+    g->index = nullptr;
 }
index ac0b921e44b9ae4b6cf1480903fb7bc188f7d39f..9dcfa19d203ead8719ea373d4f2671200fe2a35c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -323,11 +323,11 @@ class AnalysisNeighborhoodPairSearchImpl
             : search_(search)
         {
             testPosCount_     = 0;
-            testPositions_    = NULL;
-            testExclusionIds_ = NULL;
-            testIndices_      = NULL;
+            testPositions_    = nullptr;
+            testExclusionIds_ = nullptr;
+            testIndices_      = nullptr;
             nexcl_            = 0;
-            excl_             = NULL;
+            excl_             = nullptr;
             clear_rvec(xtest_);
             clear_rvec(testcell_);
             clear_ivec(currCell_);
@@ -408,9 +408,9 @@ AnalysisNeighborhoodSearchImpl::AnalysisNeighborhoodSearchImpl(real cutoff)
     }
     bXY_             = false;
     nref_            = 0;
-    xref_            = NULL;
-    refExclusionIds_ = NULL;
-    refIndices_      = NULL;
+    xref_            = nullptr;
+    refExclusionIds_ = nullptr;
+    refIndices_      = nullptr;
     std::memset(&pbc_, 0, sizeof(pbc_));
 
     bGrid_          = false;
@@ -884,7 +884,7 @@ void AnalysisNeighborhoodSearchImpl::init(
     GMX_RELEASE_ASSERT(positions.index_ == -1,
                        "Individual indexed positions not supported as reference");
     bXY_ = bXY;
-    if (bXY_ && pbc != NULL && pbc->ePBC != epbcNONE)
+    if (bXY_ && pbc != nullptr && pbc->ePBC != epbcNONE)
     {
         if (pbc->ePBC != epbcXY && pbc->ePBC != epbcXYZ)
         {
@@ -905,7 +905,7 @@ void AnalysisNeighborhoodSearchImpl::init(
         clear_rvec(box[ZZ]);
         set_pbc(&pbc_, epbcXY, box);
     }
-    else if (pbc != NULL)
+    else if (pbc != nullptr)
     {
         pbc_ = *pbc;
     }
@@ -932,13 +932,13 @@ void AnalysisNeighborhoodSearchImpl::init(
 
         for (int i = 0; i < nref_; ++i)
         {
-            const int ii = (refIndices_ != NULL) ? refIndices_[i] : i;
+            const int ii = (refIndices_ != nullptr) ? refIndices_[i] : i;
             rvec      refcell;
             mapPointToGridCell(positions.x_[ii], refcell, xrefAlloc_[i]);
             addToGridCell(refcell, i);
         }
     }
-    else if (refIndices_ != NULL)
+    else if (refIndices_ != nullptr)
     {
         xrefAlloc_.resize(nref_);
         xref_ = as_rvec_array(xrefAlloc_.data());
@@ -952,12 +952,12 @@ void AnalysisNeighborhoodSearchImpl::init(
         xref_ = positions.x_;
     }
     excls_           = excls;
-    refExclusionIds_ = NULL;
-    if (excls != NULL)
+    refExclusionIds_ = nullptr;
+    if (excls != nullptr)
     {
         // TODO: Check that the IDs are ascending, or remove the limitation.
         refExclusionIds_ = positions.exclusionIds_;
-        GMX_RELEASE_ASSERT(refExclusionIds_ != NULL,
+        GMX_RELEASE_ASSERT(refExclusionIds_ != nullptr,
                            "Exclusion IDs must be set for reference positions "
                            "when exclusions are enabled");
     }
@@ -973,7 +973,7 @@ void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
     if (testIndex_ >= 0 && testIndex_ < testPosCount_)
     {
         const int index =
-            (testIndices_ != NULL ? testIndices_[testIndex] : testIndex);
+            (testIndices_ != nullptr ? testIndices_[testIndex] : testIndex);
         if (search_.bGrid_)
         {
             search_.mapPointToGridCell(testPositions_[index], testcell_, xtest_);
@@ -985,7 +985,7 @@ void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
         {
             copy_rvec(testPositions_[index], xtest_);
         }
-        if (search_.excls_ != NULL)
+        if (search_.excls_ != nullptr)
         {
             const int exclIndex  = testExclusionIds_[index];
             if (exclIndex < search_.excls_->nr)
@@ -997,7 +997,7 @@ void AnalysisNeighborhoodPairSearchImpl::reset(int testIndex)
             else
             {
                 nexcl_ = 0;
-                excl_  = NULL;
+                excl_  = nullptr;
             }
         }
     }
@@ -1022,7 +1022,7 @@ bool AnalysisNeighborhoodPairSearchImpl::isExcluded(int j)
     if (exclind_ < nexcl_)
     {
         const int index =
-            (search_.refIndices_ != NULL ? search_.refIndices_[j] : j);
+            (search_.refIndices_ != nullptr ? search_.refIndices_[j] : j);
         const int refId = search_.refExclusionIds_[index];
         while (exclind_ < nexcl_ && excl_[exclind_] < refId)
         {
@@ -1044,7 +1044,7 @@ void AnalysisNeighborhoodPairSearchImpl::startSearch(
     testPositions_    = positions.x_;
     testExclusionIds_ = positions.exclusionIds_;
     testIndices_      = positions.indices_;
-    GMX_RELEASE_ASSERT(search_.excls_ == NULL || testExclusionIds_ != NULL,
+    GMX_RELEASE_ASSERT(search_.excls_ == nullptr || testExclusionIds_ != nullptr,
                        "Exclusion IDs must be set when exclusions are enabled");
     if (positions.index_ < 0)
     {
@@ -1238,7 +1238,7 @@ class AnalysisNeighborhood::Impl
         typedef std::vector<SearchImplPointer> SearchList;
 
         Impl()
-            : cutoff_(0), excls_(NULL), mode_(eSearchMode_Automatic), bXY_(false)
+            : cutoff_(0), excls_(nullptr), mode_(eSearchMode_Automatic), bXY_(false)
         {
         }
         ~Impl()
index cbd3fdc268bd14fb0a6c6fbce909ddf8fa5597f5..8a4c3a29db93b796e170195efd0974eb1c5e9995 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -109,14 +109,14 @@ class AnalysisNeighborhoodPositions
          * to methods that accept positions.
          */
         AnalysisNeighborhoodPositions(const rvec &x)
-            : count_(1), index_(-1), x_(&x), exclusionIds_(NULL), indices_(NULL)
+            : count_(1), index_(-1), x_(&x), exclusionIds_(nullptr), indices_(nullptr)
         {
         }
         /*! \brief
          * Initializes positions from an array of position vectors.
          */
         AnalysisNeighborhoodPositions(const rvec x[], int count)
-            : count_(count), index_(-1), x_(x), exclusionIds_(NULL), indices_(NULL)
+            : count_(count), index_(-1), x_(x), exclusionIds_(nullptr), indices_(nullptr)
         {
         }
         /*! \brief
@@ -124,7 +124,7 @@ class AnalysisNeighborhoodPositions
          */
         AnalysisNeighborhoodPositions(const std::vector<RVec> &x)
             : count_(x.size()), index_(-1), x_(as_rvec_array(x.data())),
-              exclusionIds_(NULL), indices_(NULL)
+              exclusionIds_(nullptr), indices_(nullptr)
         {
         }
 
index b2a8ff61f2be9b706ab5433ac04a7d842d1ae8f4..4e69009cbe1d752031c44e2231af8f14ebe7385b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -78,18 +78,18 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
 
     if (nparam == 0)
     {
-        return NULL;
+        return nullptr;
     }
     /* Find the first non-null parameter */
     i = 0;
-    while (i < nparam && param[i].name == NULL)
+    while (i < nparam && param[i].name == nullptr)
     {
         ++i;
     }
     /* Process the special case of a NULL parameter */
-    if (name == NULL)
+    if (name == nullptr)
     {
-        return (i == 0) ? NULL : &param[i-1];
+        return (i == 0) ? nullptr : &param[i-1];
     }
     for (; i < nparam; ++i)
     {
@@ -105,7 +105,7 @@ gmx_ana_selparam_find(const char *name, int nparam, gmx_ana_selparam_t *param)
             return &param[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 /*! \brief
@@ -133,7 +133,7 @@ convert_value(SelectionParserValue *value, e_selvalue_t type,
             try
             {
                 SelectionTreeElementPointer expr =
-                    _gmx_sel_init_position(value->expr, NULL, scanner);
+                    _gmx_sel_init_position(value->expr, nullptr, scanner);
                 *value = SelectionParserValue::createExpr(expr);
             }
             catch (UserInputError &ex)
@@ -309,8 +309,8 @@ parse_values_range(const SelectionParserValueList &values,
     param->flags &= ~SPAR_DYNAMIC;
     GMX_RELEASE_ASSERT(param->val.type == INT_VALUE || param->val.type == REAL_VALUE,
                        "Invalid range parameter type");
-    int                *idata = NULL;
-    real               *rdata = NULL;
+    int                *idata = nullptr;
+    real               *rdata = nullptr;
     sfree_guard         dataGuard;
     if (param->val.type == INT_VALUE)
     {
@@ -451,7 +451,7 @@ parse_values_range(const SelectionParserValueList &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -499,7 +499,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
     if (param->val.type == POS_VALUE)
     {
         gmx_ana_pos_reserve(param->val.u.p, valueCount, 0);
-        gmx_ana_indexmap_init(&param->val.u.p->m, NULL, NULL, INDEX_UNKNOWN);
+        gmx_ana_indexmap_init(&param->val.u.p->m, nullptr, nullptr, INDEX_UNKNOWN);
         gmx_ana_pos_set_nr(param->val.u.p, valueCount);
     }
     else
@@ -586,7 +586,7 @@ parse_values_varnum(const SelectionParserValueList    &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -685,7 +685,7 @@ parse_values_varnum_expr(const SelectionParserValueList    &values,
         {
             *param->nvalptr = param->val.nr;
         }
-        param->nvalptr = NULL;
+        param->nvalptr = nullptr;
         return;
     }
 
@@ -795,7 +795,7 @@ parse_values_std(const SelectionParserValueList &values,
             {
                 *param->nvalptr = 1;
             }
-            param->nvalptr = NULL;
+            param->nvalptr = nullptr;
             if (param->val.type == INT_VALUE || param->val.type == REAL_VALUE
                 || param->val.type == STR_VALUE)
             {
@@ -914,7 +914,7 @@ parse_values_std(const SelectionParserValueList &values,
     {
         *param->nvalptr = param->val.nr;
     }
-    param->nvalptr = NULL;
+    param->nvalptr = nullptr;
 }
 
 /*! \brief
@@ -998,7 +998,7 @@ parse_values_enum(const SelectionParserValueList &values,
     const std::string &svalue = value.stringValue();
     int                i      = 1;
     int                match  = 0;
-    while (param->val.u.s[i] != NULL)
+    while (param->val.u.s[i] != nullptr)
     {
         if (startsWith(param->val.u.s[i], svalue))
         {
@@ -1088,19 +1088,19 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         if (params[i].val.type != POS_VALUE
             && (params[i].flags & (SPAR_VARNUM | SPAR_ATOMVAL)))
         {
-            GMX_RELEASE_ASSERT(params[i].val.u.ptr == NULL,
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr == nullptr,
                                "value pointer is not NULL "
                                "although it should be for SPAR_VARNUM "
                                "and SPAR_ATOMVAL parameters");
             GMX_RELEASE_ASSERT(!((params[i].flags & SPAR_VARNUM)
                                  && (params[i].flags & SPAR_DYNAMIC))
-                               || params[i].nvalptr != NULL,
+                               || params[i].nvalptr != nullptr,
                                "nvalptr is NULL but both "
                                "SPAR_VARNUM and SPAR_DYNAMIC are specified");
         }
         else
         {
-            GMX_RELEASE_ASSERT(params[i].val.u.ptr != NULL,
+            GMX_RELEASE_ASSERT(params[i].val.u.ptr != nullptr,
                                "value pointer is NULL");
         }
     }
@@ -1112,19 +1112,19 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         try
         {
             // Always assigned afterwards, but cppcheck does not see that.
-            gmx_ana_selparam_t *oparam = NULL;
+            gmx_ana_selparam_t *oparam = nullptr;
             /* Find the parameter and make some checks */
             if (!pparam->name().empty())
             {
                 nullParamIndex = -1;
                 oparam
                     = gmx_ana_selparam_find(pparam->name().c_str(), nparam, params);
-                GMX_RELEASE_ASSERT(oparam != NULL, "Inconsistent selection parameter");
+                GMX_RELEASE_ASSERT(oparam != nullptr, "Inconsistent selection parameter");
             }
             else if (nullParamIndex >= 0)
             {
                 oparam = &params[nullParamIndex];
-                if (oparam->name != NULL)
+                if (oparam->name != nullptr)
                 {
                     std::string text(_gmx_sel_lexer_get_text(scanner, pparam->location()));
                     std::string message
@@ -1210,7 +1210,7 @@ _gmx_sel_parse_params(const gmx::SelectionParserParameterList &pparams,
         if (!(params[i].flags & SPAR_OPTIONAL) && !(params[i].flags & SPAR_SET))
         {
             std::string message;
-            if (params[i].name == NULL)
+            if (params[i].name == nullptr)
             {
                 message = formatString("'%s' should be followed by a value/expression",
                                        root->name().c_str());
index f351d787636060512b5c19cdeba6c51f5edd2da3..ee2fc570295eaf4f74e7bbd255f1e7b6d5f93cc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -167,7 +167,7 @@ yyerror(YYLTYPE *location, yyscan_t scanner, char const *s)
 template <typename ValueType> static
 ValueType get(ValueType *src)
 {
-    GMX_RELEASE_ASSERT(src != NULL, "Semantic value pointers should be non-NULL");
+    GMX_RELEASE_ASSERT(src != nullptr, "Semantic value pointers should be non-NULL");
     const std::unique_ptr<ValueType> srcGuard(src);
     return ValueType(std::move(*src));
 }
index 4ca2010fe7d4380206c8bd237843e6a8fcc62b0b..2db9ae10357534a85ee32776ff65e88824d4a23f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -282,10 +282,10 @@ _gmx_selparser_handle_exception(yyscan_t scanner, std::exception *ex)
         bool                   canContinue = false;
         gmx::GromacsException *gromacsException
             = dynamic_cast<gmx::GromacsException *>(ex);
-        if (gromacsException != NULL)
+        if (gromacsException != nullptr)
         {
             gromacsException->prependContext(formatCurrentErrorContext(scanner));
-            canContinue = (dynamic_cast<gmx::UserInputError *>(ex) != NULL);
+            canContinue = (dynamic_cast<gmx::UserInputError *>(ex) != nullptr);
         }
         _gmx_sel_lexer_set_exception(scanner, std::current_exception());
         return canContinue;
@@ -312,7 +312,7 @@ _gmx_selparser_handle_error(yyscan_t scanner)
         ex.prependContext(context);
         gmx::TextWriter *statusWriter
             = _gmx_sel_lexer_get_status_writer(scanner);
-        if (statusWriter != NULL)
+        if (statusWriter != nullptr)
         {
             gmx::formatExceptionMessageToWriter(statusWriter, ex);
             return true;
@@ -357,7 +357,7 @@ SelectionParserParameter::SelectionParserParameter(
         const char                      *name,
         SelectionParserValueListPointer  values,
         const SelectionLocation         &location)
-    : name_(name != NULL ? name : ""), location_(location),
+    : name_(name != nullptr ? name : ""), location_(location),
       values_(values ? std::move(values)
               : SelectionParserValueListPointer(new SelectionParserValueList))
 {
@@ -515,19 +515,19 @@ _gmx_selelem_init_method_params(const gmx::SelectionTreeElementPointer &sel,
     for (i = 0; i < nparams; ++i)
     {
         param[i].flags &= ~SPAR_SET;
-        _gmx_selvalue_setstore(&param[i].val, NULL);
+        _gmx_selvalue_setstore(&param[i].val, nullptr);
         if (param[i].flags & SPAR_VARNUM)
         {
             param[i].val.nr = -1;
         }
         /* Duplicate the enum value array if it is given statically */
-        if ((param[i].flags & SPAR_ENUMVAL) && orgparam[i].val.u.ptr != NULL)
+        if ((param[i].flags & SPAR_ENUMVAL) && orgparam[i].val.u.ptr != nullptr)
         {
             int n;
 
             /* Count the values */
             n = 1;
-            while (orgparam[i].val.u.s[n] != NULL)
+            while (orgparam[i].val.u.s[n] != nullptr)
             {
                 ++n;
             }
@@ -536,7 +536,7 @@ _gmx_selelem_init_method_params(const gmx::SelectionTreeElementPointer &sel,
                    (n+1)*sizeof(param[i].val.u.s[0]));
         }
     }
-    mdata = NULL;
+    mdata = nullptr;
     if (sel->u.expr.method->init_data)
     {
         mdata = sel->u.expr.method->init_data(nparams, param);
@@ -731,9 +731,9 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
         }
         SelectionParserParameterList params;
         params.push_back(
-                SelectionParserParameter::createFromExpression(NULL, child));
+                SelectionParserParameter::createFromExpression(nullptr, child));
         params.push_back(
-                SelectionParserParameter::create(NULL, std::move(args), location));
+                SelectionParserParameter::create(nullptr, std::move(args), location));
         _gmx_sel_parse_params(params, root->u.expr.method->nparams,
                               root->u.expr.method->param, root, scanner);
     }
@@ -877,7 +877,7 @@ _gmx_sel_init_modifier(gmx_ana_selmethod_t                      *method,
     else
     {
         params->push_front(
-                SelectionParserParameter::createFromExpression(NULL, sel));
+                SelectionParserParameter::createFromExpression(nullptr, sel));
         root = modifier;
     }
     /* Process the parameters */
@@ -907,7 +907,7 @@ _gmx_sel_init_position(const gmx::SelectionTreeElementPointer &expr,
     _gmx_selelem_set_kwpos_type(root.get(), type);
     /* Create the parameters for the parameter parser. */
     SelectionParserParameterList params;
-    params.push_back(SelectionParserParameter::createFromExpression(NULL, expr));
+    params.push_back(SelectionParserParameter::createFromExpression(nullptr, expr));
     /* Parse the parameters. */
     _gmx_sel_parse_params(params, root->u.expr.method->nparams,
                           root->u.expr.method->param, root, scanner);
@@ -979,7 +979,7 @@ _gmx_sel_init_group_by_id(int id, yyscan_t scanner)
                     SEL_GROUPREF, _gmx_sel_lexer_get_current_location(scanner)));
     _gmx_selelem_set_vtype(sel, GROUP_VALUE);
     sel->setName(gmx::formatString("group %d", id));
-    sel->u.gref.name = NULL;
+    sel->u.gref.name = nullptr;
     sel->u.gref.id   = id;
 
     if (_gmx_sel_lexer_has_groups_set(scanner))
@@ -1064,7 +1064,7 @@ _gmx_sel_init_selection(const char                             *name,
 
     /* Print out some information if the parser is interactive */
     gmx::TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         const std::string message
             = gmx::formatString("Selection '%s' parsed",
@@ -1134,7 +1134,7 @@ _gmx_sel_assign_variable(const char                             *name,
     sc->varstrs[sc->nvars] = gmx_strdup(pselstr);
     ++sc->nvars;
     gmx::TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         const std::string message
             = gmx::formatString("Variable '%s' parsed", pselstr);
index 68ad13a2ace85fc7857a83d74067b26d77f4034f..6617cd7859a32ab08f38536eb3f2d4ac2f9c3c53 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -244,7 +244,7 @@ const char * const gmx::PositionCalculationCollection::typeEnumValues[] = {
     "part_mol_com",  "part_mol_cog",
     "dyn_res_com",   "dyn_res_cog",
     "dyn_mol_com",   "dyn_mol_cog",
-    NULL,
+    nullptr,
 };
 
 /*! \brief
@@ -371,7 +371,7 @@ PositionCalculationCollection::requiredTopologyInfoForType(const char *post,
  */
 
 PositionCalculationCollection::Impl::Impl()
-    : top_(NULL), first_(NULL), last_(NULL), bInit_(false)
+    : top_(nullptr), first_(nullptr), last_(nullptr), bInit_(false)
 {
 }
 
@@ -379,7 +379,7 @@ PositionCalculationCollection::Impl::~Impl()
 {
     // Loop backwards, because there can be internal references in that are
     // correctly handled by this direction.
-    while (last_ != NULL)
+    while (last_ != nullptr)
     {
         GMX_ASSERT(last_->refcount == 1,
                    "Dangling references to position calculations");
@@ -392,11 +392,11 @@ PositionCalculationCollection::Impl::insertCalculation(gmx_ana_poscalc_t *pc,
                                                        gmx_ana_poscalc_t *before)
 {
     GMX_RELEASE_ASSERT(pc->coll == this, "Inconsistent collections");
-    if (before == NULL)
+    if (before == nullptr)
     {
-        pc->next = NULL;
+        pc->next = nullptr;
         pc->prev = last_;
-        if (last_ != NULL)
+        if (last_ != nullptr)
         {
             last_->next = pc;
         }
@@ -412,7 +412,7 @@ PositionCalculationCollection::Impl::insertCalculation(gmx_ana_poscalc_t *pc,
         }
         before->prev = pc;
     }
-    if (pc->prev == NULL)
+    if (pc->prev == nullptr)
     {
         first_ = pc;
     }
@@ -422,7 +422,7 @@ void
 PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
 {
     GMX_RELEASE_ASSERT(pc->coll == this, "Inconsistent collections");
-    if (pc->prev != NULL)
+    if (pc->prev != nullptr)
     {
         pc->prev->next = pc->next;
     }
@@ -430,7 +430,7 @@ PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
     {
         first_ = pc->next;
     }
-    if (pc->next != NULL)
+    if (pc->next != nullptr)
     {
         pc->next->prev = pc->prev;
     }
@@ -438,7 +438,7 @@ PositionCalculationCollection::Impl::removeCalculation(gmx_ana_poscalc_t *pc)
     {
         last_ = pc->prev;
     }
-    pc->prev = pc->next = NULL;
+    pc->prev = pc->next = nullptr;
 }
 
 gmx_ana_poscalc_t *
@@ -452,7 +452,7 @@ PositionCalculationCollection::Impl::createCalculation(e_poscalc_t type, int fla
     gmx_ana_poscalc_set_flags(pc, flags);
     pc->refcount = 1;
     pc->coll     = this;
-    insertCalculation(pc, NULL);
+    insertCalculation(pc, nullptr);
     return pc;
 }
 
@@ -1224,7 +1224,7 @@ gmx_ana_poscalc_update(gmx_ana_poscalc_t *pc, gmx_ana_pos_t *p,
     }
     if (pc->sbase)
     {
-        gmx_ana_poscalc_update(pc->sbase, NULL, NULL, fr, pbc);
+        gmx_ana_poscalc_update(pc->sbase, nullptr, nullptr, fr, pbc);
     }
     if (!p)
     {
index 1315d94aaea8450357fb3bf72a78707990e0b814..0e0499c98d0b79d0a7e4f8e41ffd7b8a202527e7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,9 +52,9 @@
 
 gmx_ana_pos_t::gmx_ana_pos_t()
 {
-    x = NULL;
-    v = NULL;
-    f = NULL;
+    x = nullptr;
+    v = nullptr;
+    f = nullptr;
     gmx_ana_indexmap_clear(&m);
     nalloc_x = 0;
 }
@@ -183,7 +183,7 @@ gmx_ana_pos_init_const(gmx_ana_pos_t *pos, const rvec x)
     copy_rvec(x, pos->x[0]);
     clear_rvec(pos->v[0]);
     clear_rvec(pos->f[0]);
-    gmx_ana_indexmap_init(&pos->m, NULL, NULL, INDEX_UNKNOWN);
+    gmx_ana_indexmap_init(&pos->m, nullptr, nullptr, INDEX_UNKNOWN);
 }
 
 /*!
index da23df0453793912170321553d18f15f6a85221a..5ff51acdf41dbeab4e08c7455c37571f71646553 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -89,7 +89,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
 {
     if (bBoolNo)
     {
-        GMX_RELEASE_ASSERT(param->name != NULL,
+        GMX_RELEASE_ASSERT(param->name != nullptr,
                            "bBoolNo should only be set for a parameters with a name");
         snew(yylval->str, strlen(param->name) + 3);
         yylval->str[0] = 'n';
@@ -98,7 +98,7 @@ init_param_token(YYSTYPE *yylval, gmx_ana_selparam_t *param, bool bBoolNo)
     }
     else
     {
-        yylval->str = param->name ? gmx_strdup(param->name) : NULL;
+        yylval->str = param->name ? gmx_strdup(param->name) : nullptr;
     }
     return PARAM;
 }
@@ -117,7 +117,7 @@ init_method_token(YYSTYPE *yylval, YYLTYPE *yylloc,
     if (!bPosMod && method->type != POS_VALUE)
     {
         state->nextMethodSymbol = symbol;
-        _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
+        _gmx_sel_lexer_add_token(yylloc, nullptr, 0, state);
         return EMPTY_POSMOD;
     }
     _gmx_sel_lexer_add_token(yylloc, symbol->name().c_str(), -1, state);
@@ -144,14 +144,14 @@ init_method_token(YYSTYPE *yylval, YYLTYPE *yylloc,
         {
             /* Remove all methods from the stack */
             state->msp = -1;
-            if (method->param[1].name == NULL)
+            if (method->param[1].name == nullptr)
             {
                 state->nextparam = &method->param[1];
             }
         }
         else
         {
-            if (method->param[0].name == NULL)
+            if (method->param[0].name == nullptr)
             {
                 state->nextparam = &method->param[0];
             }
@@ -193,10 +193,10 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, YYLTYPE *yylloc,
         if (state->neom > 0)
         {
             --state->neom;
-            _gmx_sel_lexer_add_token(yylloc, NULL, 0, state);
+            _gmx_sel_lexer_add_token(yylloc, nullptr, 0, state);
             return END_OF_METHOD;
         }
-        state->nextparam = NULL;
+        state->nextparam = nullptr;
         state->bBoolNo   = false;
         _gmx_sel_lexer_add_token(yylloc, param->name, -1, state);
         return init_param_token(yylval, param, bBoolNo);
@@ -208,7 +208,7 @@ _gmx_sel_lexer_process_pending(YYSTYPE *yylval, YYLTYPE *yylloc,
     if (state->nextMethodSymbol)
     {
         const gmx::SelectionParserSymbol *symbol = state->nextMethodSymbol;
-        state->nextMethodSymbol = NULL;
+        state->nextMethodSymbol = nullptr;
         return init_method_token(yylval, yylloc, symbol, true, state);
     }
     return 0;
@@ -222,7 +222,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, YYLTYPE *yylloc,
     /* Check if the identifier matches with a parameter name */
     if (state->msp >= 0)
     {
-        gmx_ana_selparam_t *param   = NULL;
+        gmx_ana_selparam_t *param   = nullptr;
         bool                bBoolNo = false;
         int                 sp      = state->msp;
         while (!param && sp >= 0)
@@ -231,7 +231,7 @@ _gmx_sel_lexer_process_identifier(YYSTYPE *yylval, YYLTYPE *yylloc,
             for (i = 0; i < state->mstack[sp]->nparams; ++i)
             {
                 /* Skip NULL parameters and too long parameters */
-                if (state->mstack[sp]->param[i].name == NULL
+                if (state->mstack[sp]->param[i].name == nullptr
                     || strlen(state->mstack[sp]->param[i].name) > yyleng)
                 {
                     continue;
@@ -400,8 +400,8 @@ _gmx_sel_init_lexer(yyscan_t *scannerp, struct gmx_ana_selcollection_t *sc,
     state->mstack_alloc     = 20;
     state->msp              = -1;
     state->neom             = 0;
-    state->nextparam        = NULL;
-    state->nextMethodSymbol = NULL;
+    state->nextparam        = nullptr;
+    state->nextMethodSymbol = nullptr;
     state->prev_pos_kw      = 0;
     state->bBoolNo          = false;
     state->bMatchOf         = false;
index d1ec9e623c3059ad19ff8c885768acf611d43f0e..3032cf58aea60edcb8567b5c68e483e088f6078b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -209,7 +209,7 @@ SelectionData::initializeMassesAndCharges(const gmx_mtop_t *top)
                "Should not be called more than once");
     posMass_.reserve(posCount());
     posCharge_.reserve(posCount());
-    if (top == NULL)
+    if (top == nullptr)
     {
         posMass_.resize(posCount(), 1.0);
         posCharge_.resize(posCount(), 0.0);
@@ -224,7 +224,7 @@ SelectionData::initializeMassesAndCharges(const gmx_mtop_t *top)
 void
 SelectionData::refreshMassesAndCharges(const gmx_mtop_t *top)
 {
-    if (top != NULL && isDynamic() && !hasFlag(efSelection_DynamicMask))
+    if (top != nullptr && isDynamic() && !hasFlag(efSelection_DynamicMask))
     {
         computeMassesAndCharges(top, rawPositions_, &posMass_, &posCharge_);
     }
index 1b9df4157d7181f2b581dccd17a5b9972d6a7e1e..3ff3dadeff0cd1eac98c20475ae44c6feff2c162 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -294,7 +294,7 @@ class Selection
          * assigned results in undefined behavior.
          * isValid() returns `false` for the selection until it is initialized.
          */
-        Selection() : sel_(NULL) {}
+        Selection() : sel_(nullptr) {}
         /*! \brief
          * Creates a new selection object.
          *
@@ -305,7 +305,7 @@ class Selection
         explicit Selection(internal::SelectionData *sel) : sel_(sel) {}
 
         //! Returns whether the selection object is initialized.
-        bool isValid() const { return sel_ != NULL; }
+        bool isValid() const { return sel_ != nullptr; }
 
         //! Returns whether two selection objects wrap the same selection.
         bool operator==(const Selection &other) const
@@ -352,7 +352,7 @@ class Selection
             return constArrayRefFromArray(data().rawPositions_.x, posCount());
         }
         //! Returns whether velocities are available for this selection.
-        bool hasVelocities() const { return data().rawPositions_.v != NULL; }
+        bool hasVelocities() const { return data().rawPositions_.v != nullptr; }
         /*! \brief
          * Returns velocities for this selection as a continuous array.
          *
@@ -364,7 +364,7 @@ class Selection
             return constArrayRefFromArray(data().rawPositions_.v, posCount());
         }
         //! Returns whether forces are available for this selection.
-        bool hasForces() const { return sel_->rawPositions_.f != NULL; }
+        bool hasForces() const { return sel_->rawPositions_.f != nullptr; }
         /*! \brief
          * Returns forces for this selection as a continuous array.
          *
@@ -691,7 +691,7 @@ class SelectionPosition
         ConstArrayRef<int> atomIndices() const
         {
             const int *atoms = sel_->rawPositions_.m.mapb.a;
-            if (atoms == NULL)
+            if (atoms == nullptr)
             {
                 return ConstArrayRef<int>();
             }
index ccb1e98dd3962445decc4480ca7c8fd6870b35e4..7b9b17073d9a99caad2e6f42c57d1343842f72d0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,13 +84,13 @@ namespace gmx
  */
 
 SelectionCollection::Impl::Impl()
-    : debugLevel_(0), bExternalGroupsSet_(false), grps_(NULL)
+    : debugLevel_(0), bExternalGroupsSet_(false), grps_(nullptr)
 {
     sc_.nvars     = 0;
-    sc_.varstrs   = NULL;
-    sc_.top       = NULL;
+    sc_.varstrs   = nullptr;
+    sc_.top       = nullptr;
     gmx_ana_index_clear(&sc_.gall);
-    sc_.mempool   = NULL;
+    sc_.mempool   = nullptr;
     sc_.symtab.reset(new SelectionParserSymbolTable);
     gmx_ana_index_clear(&requiredAtoms_);
     gmx_ana_selmethod_register_defaults(sc_.symtab.get());
@@ -141,7 +141,7 @@ namespace
 bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
                 std::string *line)
 {
-    if (statusWriter != NULL)
+    if (statusWriter != nullptr)
     {
         statusWriter->writeString("> ");
     }
@@ -152,7 +152,7 @@ bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
     while (endsWith(*line, "\\\n"))
     {
         line->resize(line->length() - 2);
-        if (statusWriter != NULL)
+        if (statusWriter != nullptr)
         {
             statusWriter->writeString("... ");
         }
@@ -166,7 +166,7 @@ bool promptLine(TextInputStream *inputStream, TextWriter *statusWriter,
     {
         line->resize(line->length() - 1);
     }
-    else if (statusWriter != NULL)
+    else if (statusWriter != nullptr)
     {
         statusWriter->writeLine();
     }
@@ -223,7 +223,7 @@ void printCurrentStatus(TextWriter *writer, gmx_ana_selcollection_t *sc,
                         gmx_ana_indexgrps_t *grps, size_t firstSelection,
                         int maxCount, const std::string &context, bool bFirst)
 {
-    if (grps != NULL)
+    if (grps != nullptr)
     {
         writer->writeLine("Available static index groups:");
         gmx_ana_indexgrps_print(writer, grps, 0);
@@ -284,7 +284,7 @@ void printCurrentStatus(TextWriter *writer, gmx_ana_selcollection_t *sc,
 void printHelp(TextWriter *writer, gmx_ana_selcollection_t *sc,
                const std::string &line)
 {
-    if (sc->rootHelp.get() == NULL)
+    if (sc->rootHelp.get() == nullptr)
     {
         sc->rootHelp = createSelectionHelpTopic();
     }
@@ -341,7 +341,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
         if (bInteractive)
         {
             TextWriter *statusWriter = _gmx_sel_lexer_get_status_writer(scanner);
-            if (statusWriter != NULL)
+            if (statusWriter != nullptr)
             {
                 printCurrentStatus(statusWriter, sc, grps, oldCount, maxnr, context, true);
             }
@@ -349,7 +349,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
             int         status;
             while (promptLine(inputStream, statusWriter, &line))
             {
-                if (statusWriter != NULL)
+                if (statusWriter != nullptr)
                 {
                     line = stripString(line);
                     if (line.empty())
@@ -376,7 +376,7 @@ SelectionList runParser(yyscan_t scanner, TextInputStream *inputStream,
             }
             {
                 YYLTYPE location;
-                status = _gmx_sel_yypush_parse(parserState.get(), 0, NULL,
+                status = _gmx_sel_yypush_parse(parserState.get(), 0, nullptr,
                                                &location, scanner);
             }
             // TODO: Remove added selections from the collection if parsing failed?
@@ -454,7 +454,7 @@ void checkExternalGroups(const SelectionTreeElementPointer &root,
 void checkTopologyProperties(const gmx_mtop_t                  *top,
                              const SelectionTopologyProperties &props)
 {
-    if (top == NULL)
+    if (top == nullptr)
     {
         if (props.hasAny())
         {
@@ -583,7 +583,7 @@ SelectionCollection::initOptions(IOptionsContainer   *options,
 void
 SelectionCollection::setReferencePosType(const char *type)
 {
-    GMX_RELEASE_ASSERT(type != NULL, "Cannot assign NULL position type");
+    GMX_RELEASE_ASSERT(type != nullptr, "Cannot assign NULL position type");
     // Check that the type is valid, throw if it is not.
     e_poscalc_t  dummytype;
     int          dummyflags;
@@ -595,7 +595,7 @@ SelectionCollection::setReferencePosType(const char *type)
 void
 SelectionCollection::setOutputPosType(const char *type)
 {
-    GMX_RELEASE_ASSERT(type != NULL, "Cannot assign NULL position type");
+    GMX_RELEASE_ASSERT(type != nullptr, "Cannot assign NULL position type");
     // Check that the type is valid, throw if it is not.
     e_poscalc_t  dummytype;
     int          dummyflags;
@@ -614,7 +614,7 @@ SelectionCollection::setDebugLevel(int debugLevel)
 void
 SelectionCollection::setTopology(gmx_mtop_t *top, int natoms)
 {
-    GMX_RELEASE_ASSERT(natoms > 0 || top != NULL,
+    GMX_RELEASE_ASSERT(natoms > 0 || top != nullptr,
                        "The number of atoms must be given if there is no topology");
     checkTopologyProperties(top, requiredTopologyProperties());
     // Get the number of atoms from the topology if it is not given.
@@ -647,7 +647,7 @@ SelectionCollection::setTopology(gmx_mtop_t *top, int natoms)
 void
 SelectionCollection::setIndexGroups(gmx_ana_indexgrps_t *grps)
 {
-    GMX_RELEASE_ASSERT(grps == NULL || !impl_->bExternalGroupsSet_,
+    GMX_RELEASE_ASSERT(grps == nullptr || !impl_->bExternalGroupsSet_,
                        "Can only set external groups once or clear them afterwards");
     impl_->grps_               = grps;
     impl_->bExternalGroupsSet_ = true;
@@ -712,7 +712,7 @@ SelectionCollection::parseFromStdin(int count, bool bInteractive,
                                     const std::string &context)
 {
     return parseInteractive(count, &StandardInputStream::instance(),
-                            bInteractive ? &TextOutputFile::standardError() : NULL,
+                            bInteractive ? &TextOutputFile::standardError() : nullptr,
                             context);
 }
 
@@ -723,7 +723,7 @@ namespace
 std::unique_ptr<TextWriter> initStatusWriter(TextOutputStream *statusStream)
 {
     std::unique_ptr<TextWriter> statusWriter;
-    if (statusStream != NULL)
+    if (statusStream != nullptr)
     {
         statusWriter.reset(new TextWriter(statusStream));
         statusWriter->wrapperSettings().setLineLength(78);
@@ -758,11 +758,11 @@ SelectionCollection::parseFromFile(const std::string &filename)
         yyscan_t      scanner;
         TextInputFile file(filename);
         // TODO: Exception-safe way of using the lexer.
-        _gmx_sel_init_lexer(&scanner, &impl_->sc_, NULL, -1,
+        _gmx_sel_init_lexer(&scanner, &impl_->sc_, nullptr, -1,
                             impl_->bExternalGroupsSet_,
                             impl_->grps_);
         _gmx_sel_set_lex_input_file(scanner, file.handle());
-        return runParser(scanner, NULL, false, -1, std::string());
+        return runParser(scanner, nullptr, false, -1, std::string());
     }
     catch (GromacsException &ex)
     {
@@ -779,11 +779,11 @@ SelectionCollection::parseFromString(const std::string &str)
 {
     yyscan_t scanner;
 
-    _gmx_sel_init_lexer(&scanner, &impl_->sc_, NULL, -1,
+    _gmx_sel_init_lexer(&scanner, &impl_->sc_, nullptr, -1,
                         impl_->bExternalGroupsSet_,
                         impl_->grps_);
     _gmx_sel_set_lex_input_str(scanner, str.c_str());
-    return runParser(scanner, NULL, false, -1, std::string());
+    return runParser(scanner, nullptr, false, -1, std::string());
 }
 
 
@@ -793,7 +793,7 @@ SelectionCollection::compile()
     checkTopologyProperties(impl_->sc_.top, requiredTopologyProperties());
     if (!impl_->bExternalGroupsSet_)
     {
-        setIndexGroups(NULL);
+        setIndexGroups(nullptr);
     }
     if (impl_->debugLevel_ >= 1)
     {
index 1343907baa3ef72cddf657079e1afd689b9df968..b9ccda569b58326bbe9e62b8ae018a99a0a8c9b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ SelectionOptionStorage::SelectionOptionStorage(const SelectionOption  &settings,
       info_(this), manager_(*manager), defaultText_(settings.defaultText_),
       selectionFlags_(settings.selectionFlags_)
 {
-    GMX_RELEASE_ASSERT(manager != NULL,
+    GMX_RELEASE_ASSERT(manager != nullptr,
                        "SelectionOptionManager must be added before SelectionOption");
     GMX_RELEASE_ASSERT(!hasFlag(efOption_MultipleTimes),
                        "allowMultiple() is not supported for selection options");
@@ -278,7 +278,7 @@ SelectionFileOptionStorage::SelectionFileOptionStorage(
                             | efOption_DontCheckMinimumCount),
       info_(this), manager_(*manager), bValueParsed_(false)
 {
-    GMX_RELEASE_ASSERT(manager != NULL,
+    GMX_RELEASE_ASSERT(manager != nullptr,
                        "SelectionOptionManager must be added before SelectionFileOption");
 }
 
index 8de8667f1becac9c9976ed8a7a6b6288cd051be6..f1886386468099ce6ad0800b78f285a2af4b8840 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -80,12 +80,12 @@ class SelectionOptionBehavior::Impl
         Impl(SelectionCollection *selections,
              ITopologyProvider   *topologyProvider)
             : selections_(*selections), topologyProvider_(*topologyProvider),
-              manager_(selections), grps_(NULL)
+              manager_(selections), grps_(nullptr)
         {
         }
         ~Impl()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
                 gmx_ana_indexgrps_free(grps_);
             }
@@ -109,27 +109,27 @@ class SelectionOptionBehavior::Impl
                                  "  %s\n(with -n), but it was not used by any selection.\n",
                                  ndxfile_.c_str());
                 }
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 return;
             }
             if (ndxfile_.empty())
             {
                 gmx_mtop_t *top = topologyProvider_.getTopology(false);
-                gmx_ana_indexgrps_init(&grps_, top, NULL);
+                gmx_ana_indexgrps_init(&grps_, top, nullptr);
             }
             else
             {
-                gmx_ana_indexgrps_init(&grps_, NULL, ndxfile_.c_str());
+                gmx_ana_indexgrps_init(&grps_, nullptr, ndxfile_.c_str());
             }
             selections_.setIndexGroups(grps_);
         }
         void doneIndexGroups()
         {
-            if (grps_ != NULL)
+            if (grps_ != nullptr)
             {
-                selections_.setIndexGroups(NULL);
+                selections_.setIndexGroups(nullptr);
                 gmx_ana_indexgrps_free(grps_);
-                grps_ = NULL;
+                grps_ = nullptr;
             }
         }
 
@@ -138,7 +138,7 @@ class SelectionOptionBehavior::Impl
             const bool  topRequired = selections_.requiredTopologyProperties().needsTopology;
             gmx_mtop_t *top         = topologyProvider_.getTopology(topRequired);
             int         natoms      = -1;
-            if (top == NULL)
+            if (top == nullptr)
             {
                 natoms = topologyProvider_.getAtomCount();
             }
index 2c81620370e427ae2ddb8fdd780b32dcd51b70a4..43553d4bc9653e09aae8eb22c17f0844b8e8883e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,7 +69,7 @@
 const char *
 _gmx_selelem_type_str(const gmx::SelectionTreeElement &sel)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (sel.type)
     {
         case SEL_CONST:      p = "CONST";    break;
@@ -97,7 +97,7 @@ _gmx_selelem_type_str(const gmx::SelectionTreeElement &sel)
 const char *
 _gmx_sel_value_type_str(const gmx_ana_selvalue_t *val)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (val->type)
     {
         case NO_VALUE:       p = "NONE";  break;
@@ -116,7 +116,7 @@ _gmx_sel_value_type_str(const gmx_ana_selvalue_t *val)
 const char *
 _gmx_selelem_boolean_type_str(const gmx::SelectionTreeElement &sel)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (sel.u.boolt)
     {
         case BOOL_NOT:  p = "NOT"; break;
@@ -151,9 +151,9 @@ SelectionTreeElement::SelectionTreeElement(e_selelem_t              type,
     }
     _gmx_selvalue_clear(&this->v);
     std::memset(&this->u, 0, sizeof(this->u));
-    this->evaluate   = NULL;
-    this->mempool    = NULL;
-    this->cdata      = NULL;
+    this->evaluate   = nullptr;
+    this->mempool    = nullptr;
+    this->cdata      = nullptr;
 }
 
 SelectionTreeElement::~SelectionTreeElement()
@@ -200,7 +200,7 @@ void SelectionTreeElement::freeValues()
         }
     }
     _gmx_selvalue_free(&v);
-    if (type == SEL_SUBEXPRREF && u.param != NULL)
+    if (type == SEL_SUBEXPRREF && u.param != nullptr)
     {
         // TODO: This is now called from two different locations.
         // It is likely that one of them is unnecessary, but that requires
@@ -215,22 +215,22 @@ SelectionTreeElement::freeExpressionData()
     if (type == SEL_EXPRESSION || type == SEL_MODIFIER)
     {
         _gmx_selelem_free_method(u.expr.method, u.expr.mdata);
-        u.expr.mdata  = NULL;
-        u.expr.method = NULL;
+        u.expr.mdata  = nullptr;
+        u.expr.method = nullptr;
         /* Free position data */
         delete u.expr.pos;
-        u.expr.pos = NULL;
+        u.expr.pos = nullptr;
         /* Free position calculation data */
         if (u.expr.pc)
         {
             gmx_ana_poscalc_free(u.expr.pc);
-            u.expr.pc = NULL;
+            u.expr.pc = nullptr;
         }
     }
     if (type == SEL_ARITHMETIC)
     {
         sfree(u.arith.opstr);
-        u.arith.opstr = NULL;
+        u.arith.opstr = nullptr;
     }
     if (type == SEL_SUBEXPR || type == SEL_ROOT
         || (type == SEL_CONST && v.type == GROUP_VALUE))
@@ -281,7 +281,7 @@ void SelectionTreeElement::mempoolRelease()
         case INT_VALUE:
         case REAL_VALUE:
             _gmx_sel_mempool_free(mempool, v.u.ptr);
-            _gmx_selvalue_setstore(&v, NULL);
+            _gmx_selvalue_setstore(&v, nullptr);
             break;
 
         case GROUP_VALUE:
@@ -425,7 +425,7 @@ void SelectionTreeElement::resolveIndexGroupReference(
 {
     GMX_RELEASE_ASSERT(type == SEL_GROUPREF,
                        "Should only be called for index group reference elements");
-    if (grps == NULL)
+    if (grps == nullptr)
     {
         std::string message = formatString(
                     "Cannot match '%s', because index groups are not available.",
@@ -435,7 +435,7 @@ void SelectionTreeElement::resolveIndexGroupReference(
 
     gmx_ana_index_t foundGroup;
     std::string     foundName;
-    if (u.gref.name != NULL)
+    if (u.gref.name != nullptr)
     {
         if (!gmx_ana_indexgrps_find(&foundGroup, &foundName, grps, u.gref.name))
         {
@@ -518,7 +518,7 @@ _gmx_selelem_set_vtype(const gmx::SelectionTreeElementPointer &sel,
 void
 _gmx_selelem_free_param(gmx_ana_selparam_t *param)
 {
-    if (param->val.u.ptr != NULL)
+    if (param->val.u.ptr != nullptr)
     {
         if (param->val.type == GROUP_VALUE)
         {
@@ -534,7 +534,7 @@ _gmx_selelem_free_param(gmx_ana_selparam_t *param)
 void
 _gmx_selelem_free_method(gmx_ana_selmethod_t *method, void *mdata)
 {
-    sel_freefunc free_func = NULL;
+    sel_freefunc free_func = nullptr;
 
     /* Save the pointer to the free function. */
     if (method && method->free)
@@ -670,7 +670,7 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
     if ((sel.type == SEL_CONST && sel.v.type == GROUP_VALUE) || sel.type == SEL_ROOT)
     {
         const gmx_ana_index_t *g = sel.v.u.g;
-        if (!g || g->isize == 0 || sel.evaluate != NULL)
+        if (!g || g->isize == 0 || sel.evaluate != nullptr)
         {
             g = &sel.u.cgrp;
         }
@@ -703,10 +703,10 @@ _gmx_selelem_print_tree(FILE *fp, const gmx::SelectionTreeElement &sel,
             fprintf(fp, "\n");
         }
     }
-    else if (sel.type == SEL_SUBEXPRREF && sel.u.param != NULL)
+    else if (sel.type == SEL_SUBEXPRREF && sel.u.param != nullptr)
     {
         fprintf(fp, "%*c param", level*2+1, ' ');
-        if (sel.u.param->name != NULL)
+        if (sel.u.param->name != nullptr)
         {
             fprintf(fp, " \"%s\"", sel.u.param->name);
         }
index d6b63ed6b5cf84b93cc3826321142d1efbe8c7b2..f2f218744cee82ad9455b0fb3b6001b7f411c6cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -341,7 +341,7 @@ class SelectionTreeElement
          * \param[in] name  Name to set (can be NULL).
          * \throws    std::bad_alloc if out of memory.
          */
-        void setName(const char *name) { name_ = (name != NULL ? name : ""); }
+        void setName(const char *name) { name_ = (name != nullptr ? name : ""); }
         //! \copydoc setName(const char *)
         void setName(const std::string &name) { name_ = name; }
         /*! \brief
index 14220e28c291cb9f7315516628a9656b6ce78397..d807f042f4c7048eeed5d86b1b55b157eda3b07b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -647,7 +647,7 @@ KeywordsHelpTopic::KeywordsHelpTopic()
         const std::string         &symname = symbol->name();
         const gmx_ana_selmethod_t *method  = symbol->methodValue();
         methods_.push_back(std::make_pair(std::string(symname), method));
-        if (method->help.nlhelp > 0 && method->help.help != NULL)
+        if (method->help.nlhelp > 0 && method->help.help != nullptr)
         {
             addSubTopic(HelpTopicPointer(
                                 new KeywordDetailsHelpTopic(symname, *method)));
@@ -675,7 +675,7 @@ void KeywordsHelpTopic::writeHelp(const HelpWriterContext &context) const
 
     writeKeywordListStart(context, "Additional keywords that directly select atoms:");
     printKeywordList(context, GROUP_VALUE, false);
-    writeKeywordListEnd(context, NULL);
+    writeKeywordListEnd(context, nullptr);
 
     writeKeywordListStart(context, "Keywords that directly evaluate to positions:");
     printKeywordList(context, POS_VALUE, false);
@@ -684,7 +684,7 @@ void KeywordsHelpTopic::writeHelp(const HelpWriterContext &context) const
     writeKeywordListStart(context, "Additional keywords:");
     printKeywordList(context, POS_VALUE, true);
     printKeywordList(context, NO_VALUE, true);
-    writeKeywordListEnd(context, NULL);
+    writeKeywordListEnd(context, nullptr);
 
     writeKeywordSubTopics(context);
 }
@@ -732,11 +732,11 @@ void KeywordsHelpTopic::printKeywordList(const HelpWriterContext &context,
             = (method.flags & SMETH_MODIFIER) != 0;
         if (method.type == type && bModifiers == bIsModifier)
         {
-            const bool bHasHelp = (method.help.nlhelp > 0 && method.help.help != NULL);
+            const bool bHasHelp = (method.help.nlhelp > 0 && method.help.help != nullptr);
             const bool bPrintHelpMark
                 = bHasHelp && context.outputFormat() == eHelpOutputFormat_Console;
             file.writeString(formatString("   %c ", bPrintHelpMark ? '+' : ' '));
-            if (method.help.syntax != NULL)
+            if (method.help.syntax != nullptr)
             {
                 file.writeLine(method.help.syntax);
             }
@@ -765,14 +765,14 @@ void KeywordsHelpTopic::writeKeywordSubTopics(const HelpWriterContext &context)
     {
         const gmx_ana_selmethod_t &method = *iter->second;
         const bool                 bHasHelp
-            = (method.help.nlhelp > 0 && method.help.help != NULL);
+            = (method.help.nlhelp > 0 && method.help.help != nullptr);
         if (!bHasHelp || usedSymbols.count(iter->first) > 0)
         {
             continue;
         }
 
         std::string                title;
-        if (method.help.helpTitle != NULL)
+        if (method.help.helpTitle != nullptr)
         {
             title = method.help.helpTitle;
             title.append(" - ");
@@ -790,7 +790,7 @@ void KeywordsHelpTopic::writeKeywordSubTopics(const HelpWriterContext &context)
         }
 
         const IHelpTopic         *subTopic = findSubTopic(iter->first.c_str());
-        GMX_RELEASE_ASSERT(subTopic != NULL, "Keyword subtopic no longer exists");
+        GMX_RELEASE_ASSERT(subTopic != nullptr, "Keyword subtopic no longer exists");
         HelpWriterContext         subContext(context);
         subContext.enterSubSection(title);
         subTopic->writeHelp(subContext);
index e494b8b298e5bdbd47ebf1d1bc64cdc061644b12..3df5be8d726b04d212928d34e332f311b166f294 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -127,49 +127,49 @@ typedef struct {
 
 /** Array of selection methods defined in the library. */
 static const t_register_method smtable_def[] = {
-    {NULL,         &sm_cog},
-    {NULL,         &sm_com},
+    {nullptr,         &sm_cog},
+    {nullptr,         &sm_com},
 
-    {NULL,         &sm_all},
-    {NULL,         &sm_none},
-    {NULL,         &sm_atomnr},
-    {NULL,         &sm_resnr},
+    {nullptr,         &sm_all},
+    {nullptr,         &sm_none},
+    {nullptr,         &sm_atomnr},
+    {nullptr,         &sm_resnr},
     {"resid",      &sm_resnr},
-    {NULL,         &sm_resindex},
+    {nullptr,         &sm_resindex},
     {"residue",    &sm_resindex},
-    {NULL,         &sm_molindex},
+    {nullptr,         &sm_molindex},
     {"mol",        &sm_molindex},
     {"molecule",   &sm_molindex},
-    {NULL,         &sm_atomname},
+    {nullptr,         &sm_atomname},
     {"name",       &sm_atomname},
-    {NULL,         &sm_pdbatomname},
+    {nullptr,         &sm_pdbatomname},
     {"pdbname",    &sm_pdbatomname},
-    {NULL,         &sm_atomtype},
+    {nullptr,         &sm_atomtype},
     {"type",       &sm_atomtype},
-    {NULL,         &sm_resname},
-    {NULL,         &sm_insertcode},
-    {NULL,         &sm_chain},
-    {NULL,         &sm_mass},
-    {NULL,         &sm_charge},
-    {NULL,         &sm_altloc},
-    {NULL,         &sm_occupancy},
-    {NULL,         &sm_betafactor},
+    {nullptr,         &sm_resname},
+    {nullptr,         &sm_insertcode},
+    {nullptr,         &sm_chain},
+    {nullptr,         &sm_mass},
+    {nullptr,         &sm_charge},
+    {nullptr,         &sm_altloc},
+    {nullptr,         &sm_occupancy},
+    {nullptr,         &sm_betafactor},
     {"beta",       &sm_betafactor},
-    {NULL,         &sm_x},
-    {NULL,         &sm_y},
-    {NULL,         &sm_z},
+    {nullptr,         &sm_x},
+    {nullptr,         &sm_y},
+    {nullptr,         &sm_z},
 
-    {NULL,         &sm_distance},
+    {nullptr,         &sm_distance},
     {"dist",       &sm_distance},
-    {NULL,         &sm_mindistance},
+    {nullptr,         &sm_mindistance},
     {"mindist",    &sm_mindistance},
-    {NULL,         &sm_within},
-    {NULL,         &sm_insolidangle},
-    {NULL,         &sm_same},
+    {nullptr,         &sm_within},
+    {nullptr,         &sm_insolidangle},
+    {nullptr,         &sm_same},
 
-    {NULL,         &sm_merge},
-    {NULL,         &sm_plus},
-    {NULL,         &sm_permute},
+    {nullptr,         &sm_merge},
+    {nullptr,         &sm_plus},
+    {nullptr,         &sm_permute},
 };
 
 /*! \brief
@@ -248,7 +248,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
     for (i = 0; i < nparams; ++i)
     {
         /* Check that there is at most one NULL name, in the beginning */
-        if (param[i].name == NULL && i > 0)
+        if (param[i].name == nullptr && i > 0)
         {
             report_error(fp, name, "error: NULL parameter should be the first one");
             bOk = false;
@@ -257,7 +257,7 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
         /* Check for duplicates */
         for (j = 0; j < i; ++j)
         {
-            if (param[j].name == NULL)
+            if (param[j].name == nullptr)
             {
                 continue;
             }
@@ -356,16 +356,16 @@ check_params(FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[]
             }
         }
         /* Check that the value pointer is NULL */
-        if (param[i].nvalptr != NULL)
+        if (param[i].nvalptr != nullptr)
         {
             report_param_error(fp, name, param[i].name, "warning: nvalptr is set");
         }
-        if (param[i].val.u.ptr != NULL && !(param[i].flags & SPAR_ENUMVAL))
+        if (param[i].val.u.ptr != nullptr && !(param[i].flags & SPAR_ENUMVAL))
         {
             report_param_error(fp, name, param[i].name, "warning: value pointer is set");
         }
         /* Check that the name contains only valid characters */
-        if (param[i].name == NULL)
+        if (param[i].name == nullptr)
         {
             continue;
         }
@@ -461,7 +461,7 @@ check_callbacks(FILE *fp, gmx_ana_selmethod_t *method)
         if (method->pupdate && !(method->flags & SMETH_DYNAMIC))
         {
             report_error(fp, method->name, "warning: pupdate not used because the method is static");
-            method->pupdate = NULL;
+            method->pupdate = nullptr;
         }
     }
     /* Check that there is an evaluation function */
@@ -687,7 +687,7 @@ gmx_ana_selmethod_register_defaults(gmx::SelectionParserSymbolTable *symtab)
     {
         gmx_ana_selmethod_t *method = smtable_def[i].method;
 
-        if (smtable_def[i].name == NULL)
+        if (smtable_def[i].name == nullptr)
         {
             rc = gmx_ana_selmethod_register(symtab, method->name, method);
         }
index 80e1cfea57b57615367f5e93d218ee69c2ed5594..9bd049969f93d35225d9b0041eb5fe2fa03b9dc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,7 @@ void
 _gmx_selvalue_clear(gmx_ana_selvalue_t *val)
 {
     val->nr     = 0;
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
@@ -71,7 +71,7 @@ _gmx_selvalue_free(gmx_ana_selvalue_t *val)
         }
     }
     // TODO: It causes a memory leak somewhere if val->nr is assigned zero here...
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
@@ -95,11 +95,11 @@ _gmx_selvalue_reserve(gmx_ana_selvalue_t *val, int n)
                 srenew(val->u.s, n);
                 for (i = val->nalloc; i < n; ++i)
                 {
-                    val->u.s[i] = NULL;
+                    val->u.s[i] = nullptr;
                 }
                 break;
             case POS_VALUE:
-                GMX_RELEASE_ASSERT(val->u.ptr == NULL,
+                GMX_RELEASE_ASSERT(val->u.ptr == nullptr,
                                    "Reallocation of position values not supported");
                 val->u.p = new gmx_ana_pos_t[n];
                 break;
@@ -121,7 +121,7 @@ _gmx_selvalue_getstore_and_release(gmx_ana_selvalue_t *val, void **ptr, int *nal
 {
     *ptr        = val->u.ptr;
     *nalloc     = val->nalloc;
-    val->u.ptr  = NULL;
+    val->u.ptr  = nullptr;
     val->nalloc = 0;
 }
 
index c92a940e02864adbbee4f656764a041271c5cd05..03762e4929274055152b6666e7165467879b60cc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -142,14 +142,14 @@ evaluate_compare(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for comparison expression evaluation. */
 static gmx_ana_selparam_t smparams_compare[] = {
-    {"int1",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"int1",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real1", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real1", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"op",    {STR_VALUE,   1, {NULL}}, NULL, 0},
-    {"int2",  {INT_VALUE,  -1, {NULL}}, NULL,
+    {"op",    {STR_VALUE,   1, {nullptr}}, nullptr, 0},
+    {"int2",  {INT_VALUE,  -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"real2", {REAL_VALUE, -1, {NULL}}, NULL,
+    {"real2", {REAL_VALUE, -1, {nullptr}}, nullptr,
      SPAR_OPTIONAL | SPAR_DYNAMIC | SPAR_ATOMVAL},
 };
 
@@ -158,14 +158,14 @@ gmx_ana_selmethod_t sm_compare = {
     "cmp", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_compare), smparams_compare,
     &init_data_compare,
-    NULL,
+    nullptr,
     &init_compare,
-    NULL,
+    nullptr,
     &free_data_compare,
-    NULL,
+    nullptr,
     &evaluate_compare,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /*! \brief
@@ -206,7 +206,7 @@ comparison_type(char *str)
 static const char *
 comparison_type_str(e_comparison_t cmpt)
 {
-    const char *p = NULL;
+    const char *p = nullptr;
     switch (cmpt)
     {
         case CMP_INVALID: p = "INVALID"; break;
@@ -330,8 +330,8 @@ init_comparison_value(t_compare_value *val, gmx_ana_selparam_t param[2])
     else
     {
         n           = 0;
-        val->i      = NULL;
-        val->r      = NULL;
+        val->i      = nullptr;
+        val->r      = nullptr;
     }
     return n;
 }
@@ -458,9 +458,9 @@ init_compare(const gmx_mtop_t * /* top */, int /* npar */, gmx_ana_selparam_t *p
             /* Reverse the sides to place the integer on the right */
             int    flags;
             d->left.r      = d->right.r;
-            d->right.r     = NULL;
+            d->right.r     = nullptr;
             d->right.i     = d->left.i;
-            d->left.i      = NULL;
+            d->left.i      = nullptr;
             flags          = d->left.flags;
             d->left.flags  = d->right.flags;
             d->right.flags = flags;
index 738657c92f051fd9cf11fa8da9407d0d0bae0c12..5cf559d6ae52ff817dad671a07eacde44836d2f5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -135,20 +135,20 @@ evaluate_within(const gmx::SelMethodEvalContext & /*context*/,
 
 /** Parameters for the \p distance selection method. */
 static gmx_ana_selparam_t smparams_distance[] = {
-    {"cutoff", {REAL_VALUE, 1, {NULL}}, NULL, SPAR_OPTIONAL},
-    {"from",   {POS_VALUE,  1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {"cutoff", {REAL_VALUE, 1, {nullptr}}, nullptr, SPAR_OPTIONAL},
+    {"from",   {POS_VALUE,  1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 /** Parameters for the \p mindistance selection method. */
 static gmx_ana_selparam_t smparams_mindistance[] = {
-    {"cutoff", {REAL_VALUE, 1, {NULL}}, NULL, SPAR_OPTIONAL},
-    {"from",   {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"cutoff", {REAL_VALUE, 1, {nullptr}}, nullptr, SPAR_OPTIONAL},
+    {"from",   {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Parameters for the \p within selection method. */
 static gmx_ana_selparam_t smparams_within[] = {
-    {NULL, {REAL_VALUE,  1, {NULL}}, NULL, 0},
-    {"of", {POS_VALUE,  -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {REAL_VALUE,  1, {nullptr}}, nullptr, 0},
+    {"of", {POS_VALUE,  -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 //! Help title for distance selection methods.
@@ -179,12 +179,12 @@ gmx_ana_selmethod_t sm_distance = {
     "distance", REAL_VALUE, SMETH_DYNAMIC,
     asize(smparams_distance), smparams_distance,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_distance,
     {"distance from POS [cutoff REAL]",
      helptitle_distance, asize(help_distance), help_distance},
@@ -195,12 +195,12 @@ gmx_ana_selmethod_t sm_mindistance = {
     "mindistance", REAL_VALUE, SMETH_DYNAMIC,
     asize(smparams_mindistance), smparams_mindistance,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_distance,
     {"mindistance from POS_EXPR [cutoff REAL]",
      helptitle_distance, asize(help_distance), help_distance},
@@ -211,12 +211,12 @@ gmx_ana_selmethod_t sm_within = {
     "within", GROUP_VALUE, SMETH_DYNAMIC,
     asize(smparams_within), smparams_within,
     &init_data_common,
-    NULL,
+    nullptr,
     &init_common,
-    NULL,
+    nullptr,
     &free_data_common,
     &init_frame_common,
-    NULL,
+    nullptr,
     &evaluate_within,
     {"within REAL of POS_EXPR",
      helptitle_distance, asize(help_distance), help_distance},
index 3bb50305f3a62af73f19a26e016e86966a50e9cc..d9c23c5dab305f9559eb2fda8e7a8aefcd998e3e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -327,9 +327,9 @@ is_surface_covered(t_methoddata_insolidangle *surf, rvec x);
 
 /** Parameters for the \p insolidangle selection method. */
 static gmx_ana_selparam_t smparams_insolidangle[] = {
-    {"center", {POS_VALUE,   1, {NULL}}, NULL, SPAR_DYNAMIC},
-    {"span",   {POS_VALUE,  -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {"cutoff", {REAL_VALUE,  1, {NULL}}, NULL, SPAR_OPTIONAL},
+    {"center", {POS_VALUE,   1, {nullptr}}, nullptr, SPAR_DYNAMIC},
+    {"span",   {POS_VALUE,  -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"cutoff", {REAL_VALUE,  1, {nullptr}}, nullptr, SPAR_OPTIONAL},
 };
 
 /** Help text for the \p insolidangle selection method. */
@@ -356,12 +356,12 @@ gmx_ana_selmethod_t sm_insolidangle = {
     "insolidangle", GROUP_VALUE, SMETH_DYNAMIC,
     asize(smparams_insolidangle), smparams_insolidangle,
     &init_data_insolidangle,
-    NULL,
+    nullptr,
     &init_insolidangle,
-    NULL,
+    nullptr,
     &free_data_insolidangle,
     &init_frame_insolidangle,
-    NULL,
+    nullptr,
     &evaluate_insolidangle,
     {"insolidangle center POS span POS_EXPR [cutoff REAL]",
      "Selecting atoms in a solid angle",
@@ -387,13 +387,13 @@ init_data_insolidangle(int /* npar */, gmx_ana_selparam_t *param)
     // cppcheck-suppress uninitdata
     data->tbinsize      = 0.0;
     // cppcheck-suppress uninitdata
-    data->tbin          = NULL;
+    data->tbin          = nullptr;
     // cppcheck-suppress uninitdata
     data->maxbins       = 0;
     // cppcheck-suppress uninitdata
     data->nbins         = 0;
     // cppcheck-suppress uninitdata
-    data->bin           = NULL;
+    data->bin           = nullptr;
 
     param[0].val.u.p = &data->center;
     param[1].val.u.p = &data->span;
@@ -746,7 +746,7 @@ free_surface_points(t_methoddata_insolidangle *surf)
             sfree(surf->bin[i].x);
         }
         surf->bin[i].n_alloc = 0;
-        surf->bin[i].x       = NULL;
+        surf->bin[i].x       = nullptr;
     }
 }
 
index e675249a4c1dc5cd4415a0f5f51049a85df72a69..3e020fb4bc7440b2f07caa5a29aeabfed47e57ef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -274,20 +274,20 @@ struct t_methoddata_kwstr
 
 /** Parameters for integer keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_int[] = {
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL},
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_RANGES | SPAR_VARNUM},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_RANGES | SPAR_VARNUM},
 };
 
 /** Parameters for real keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_real[] = {
-    {NULL, {REAL_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL | SPAR_DYNAMIC},
-    {NULL, {REAL_VALUE, -1, {NULL}}, NULL, SPAR_RANGES | SPAR_VARNUM},
+    {nullptr, {REAL_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL | SPAR_DYNAMIC},
+    {nullptr, {REAL_VALUE, -1, {nullptr}}, nullptr, SPAR_RANGES | SPAR_VARNUM},
 };
 
 /** Parameters for string keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_str[] = {
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_ATOMVAL},
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_VARNUM},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_ATOMVAL},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_VARNUM},
 };
 
 /** Selection method data for integer keyword evaluation. */
@@ -295,14 +295,14 @@ gmx_ana_selmethod_t sm_keyword_int = {
     "kw_int", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_int), smparams_keyword_int,
     &init_data_kwint,
-    NULL,
+    nullptr,
     &init_kwint,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_keyword_int,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for real keyword evaluation. */
@@ -310,14 +310,14 @@ gmx_ana_selmethod_t sm_keyword_real = {
     "kw_real", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_real), smparams_keyword_real,
     &init_data_kwreal,
-    NULL,
+    nullptr,
     &init_kwreal,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_keyword_real,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for string keyword evaluation. */
@@ -325,14 +325,14 @@ gmx_ana_selmethod_t sm_keyword_str = {
     "kw_str", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_keyword_str), smparams_keyword_str,
     &init_data_kwstr,
-    NULL,
+    nullptr,
     &init_kwstr,
-    NULL,
+    nullptr,
     &free_data_kwstr,
-    NULL,
+    nullptr,
     &evaluate_keyword_str,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /*! \brief
@@ -419,11 +419,11 @@ struct t_methoddata_kweval
 
 /** Parameters for keyword evaluation in an arbitrary group. */
 static gmx_ana_selparam_t smparams_kweval_group[] = {
-    {NULL,   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 /** Parameters for keyword evaluation from positions. */
 static gmx_ana_selparam_t smparams_kweval_pos[] = {
-    {NULL,   {POS_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {POS_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 
@@ -678,7 +678,7 @@ init_kweval(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* param
 {
     t_methoddata_kweval *d = static_cast<t_methoddata_kweval *>(data);
 
-    d->kwmethod->init(top, 0, NULL, d->kwmdata);
+    d->kwmethod->init(top, 0, nullptr, d->kwmdata);
 }
 
 static void
@@ -771,14 +771,14 @@ init_evaluator_group(gmx_ana_selmethod_t                     *method,
     sel->u.expr.method->name         = data->kwmethod->name;
     sel->u.expr.method->type         = data->kwmethod->type;
     sel->u.expr.method->flags        = data->kwmethod->flags | SMETH_VARNUMVAL;
-    sel->u.expr.method->init_data    = NULL;
-    sel->u.expr.method->set_poscoll  = NULL;
-    sel->u.expr.method->init         = method->init ? &init_kweval : NULL;
+    sel->u.expr.method->init_data    = nullptr;
+    sel->u.expr.method->set_poscoll  = nullptr;
+    sel->u.expr.method->init         = method->init ? &init_kweval : nullptr;
     sel->u.expr.method->outinit      = &init_output_kweval;
     sel->u.expr.method->free         = &free_data_kweval;
-    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
+    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : nullptr;
     sel->u.expr.method->update       = &evaluate_kweval;
-    sel->u.expr.method->pupdate      = NULL;
+    sel->u.expr.method->pupdate      = nullptr;
     sel->u.expr.method->nparams      = asize(smparams_kweval_group);
     sel->u.expr.method->param        = smparams_kweval_group;
     _gmx_selelem_init_method_params(sel, scanner);
@@ -808,7 +808,7 @@ init_evaluator_pos(gmx_ana_selmethod_t                     *method,
                    void                                    *scanner)
 {
     if ((method->flags & (SMETH_SINGLEVAL | SMETH_VARNUMVAL))
-        || method->outinit || method->pupdate == NULL)
+        || method->outinit || method->pupdate == nullptr)
     {
         std::string message
             = gmx::formatString("Keyword '%s' cannot be evaluated in this context",
@@ -828,14 +828,14 @@ init_evaluator_pos(gmx_ana_selmethod_t                     *method,
     sel->u.expr.method->name         = data->kwmethod->name;
     sel->u.expr.method->type         = data->kwmethod->type;
     sel->u.expr.method->flags        = data->kwmethod->flags | SMETH_SINGLEVAL;
-    sel->u.expr.method->init_data    = NULL;
-    sel->u.expr.method->set_poscoll  = NULL;
-    sel->u.expr.method->init         = method->init ? &init_kweval : NULL;
-    sel->u.expr.method->outinit      = NULL;
+    sel->u.expr.method->init_data    = nullptr;
+    sel->u.expr.method->set_poscoll  = nullptr;
+    sel->u.expr.method->init         = method->init ? &init_kweval : nullptr;
+    sel->u.expr.method->outinit      = nullptr;
     sel->u.expr.method->free         = &free_data_kweval;
-    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : NULL;
+    sel->u.expr.method->init_frame   = method->init_frame ? &init_frame_kweval : nullptr;
     sel->u.expr.method->update       = &evaluate_kweval_pos;
-    sel->u.expr.method->pupdate      = NULL;
+    sel->u.expr.method->pupdate      = nullptr;
     sel->u.expr.method->nparams      = asize(smparams_kweval_pos);
     sel->u.expr.method->param        = smparams_kweval_pos;
     _gmx_selelem_init_method_params(sel, scanner);
@@ -855,7 +855,7 @@ _gmx_sel_init_keyword_evaluator(gmx_ana_selmethod_t                    *method,
 {
     gmx::SelectionParserParameterList    params;
     params.push_back(
-            gmx::SelectionParserParameter::createFromExpression(NULL, child));
+            gmx::SelectionParserParameter::createFromExpression(nullptr, child));
     if (child->v.type == GROUP_VALUE)
     {
         return init_evaluator_group(method, params, scanner);
index 309de2f09ffcf280818b0a2c7897a4f300005ddd..db4505375281cbafeec7ec1b7fcf6c47801edcff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -111,9 +111,9 @@ evaluate_plus(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for the merging selection modifiers. */
 static gmx_ana_selparam_t smparams_merge[] = {
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {"stride",   {INT_VALUE,  1, {NULL}}, NULL, SPAR_OPTIONAL},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {"stride",   {INT_VALUE,  1, {nullptr}}, nullptr, SPAR_OPTIONAL},
 };
 
 //! Help title for the merging selection modifiers.
@@ -149,12 +149,12 @@ gmx_ana_selmethod_t sm_merge = {
     "merge", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_merge), smparams_merge,
     &init_data_merge,
-    NULL,
+    nullptr,
     &init_merge,
     &init_output_merge,
     &free_data_merge,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_merge,
     {"merge POSEXPR", helptitle_merge, asize(help_merge), help_merge},
 };
@@ -164,12 +164,12 @@ gmx_ana_selmethod_t sm_plus = {
     "plus", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_merge)-1, smparams_merge,
     &init_data_merge,
-    NULL,
+    nullptr,
     &init_merge,
     &init_output_plus,
     &free_data_merge,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_plus,
     {"plus POSEXPR", helptitle_merge, asize(help_merge), help_merge},
 };
@@ -240,7 +240,7 @@ init_output_common(const gmx_mtop_t *top, gmx_ana_selvalue_t *out, void *data)
     }
     gmx_ana_pos_reserve_for_append(out->u.p, d->p1.count() + d->p2.count(),
                                    d->p1.m.b.nra + d->p2.m.b.nra,
-                                   d->p1.v != NULL, d->p1.f != NULL);
+                                   d->p1.v != nullptr, d->p1.f != nullptr);
     gmx_ana_pos_empty_init(out->u.p);
 }
 
index b55c4048bafaa1189cc0cc13fdc6f748d58ef5da..9328c7b96f22e55699232466280b811e71aa97e6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -117,8 +117,8 @@ evaluate_permute(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for the \p permute selection modifier. */
 static gmx_ana_selparam_t smparams_permute[] = {
-    {NULL,       {POS_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
-    {NULL,       {INT_VALUE, -1, {NULL}}, NULL, SPAR_VARNUM},
+    {nullptr,       {POS_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr,       {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_VARNUM},
 };
 
 /** Help text for the \p permute selection modifier. */
@@ -145,12 +145,12 @@ gmx_ana_selmethod_t sm_permute = {
     "permute", POS_VALUE, SMETH_MODIFIER,
     asize(smparams_permute), smparams_permute,
     &init_data_permute,
-    NULL,
+    nullptr,
     &init_permute,
     &init_output_permute,
     &free_data_permute,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
     &evaluate_permute,
     {"POSEXPR permute P1 ... PN",
      "Permuting selections", asize(help_permute), help_permute},
@@ -161,8 +161,8 @@ init_data_permute(int /* npar */, gmx_ana_selparam_t *param)
 {
     t_methoddata_permute *data = new t_methoddata_permute();
     data->n          = 0;
-    data->perm       = NULL;
-    data->rperm      = NULL;
+    data->perm       = nullptr;
+    data->rperm      = nullptr;
     param[0].val.u.p = &data->p;
     return data;
 }
@@ -208,7 +208,7 @@ init_output_permute(const gmx_mtop_t * /* top */, gmx_ana_selvalue_t *out, void
 
     out->u.p->m.type = d->p.m.type;
     gmx_ana_pos_reserve_for_append(out->u.p, d->p.count(), d->p.m.b.nra,
-                                   d->p.v != NULL, d->p.f != NULL);
+                                   d->p.v != nullptr, d->p.f != nullptr);
     gmx_ana_pos_empty_init(out->u.p);
     for (i = 0; i < d->p.count(); i += d->n)
     {
index 1b22204c83d95118042b7ee54a36271a94818bd1..d1b1f457b16b41058ab67121eb2c0279f7d35dba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -133,13 +133,13 @@ evaluate_pos(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for position keyword evaluation. */
 static gmx_ana_selparam_t smparams_keyword_pos[] = {
-    {NULL,   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
+    {nullptr,   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
 };
 
 /** Parameters for the \p cog and \p com selection methods. */
 static gmx_ana_selparam_t smparams_com[] = {
-    {"of",   {GROUP_VALUE, 1, {NULL}}, NULL, SPAR_DYNAMIC},
-    {"pbc",  {NO_VALUE,    0, {NULL}}, NULL, 0},
+    {"of",   {GROUP_VALUE, 1, {nullptr}}, nullptr, SPAR_DYNAMIC},
+    {"pbc",  {NO_VALUE,    0, {nullptr}}, nullptr, 0},
 };
 
 /** Selection method data for position keyword evaluation. */
@@ -151,10 +151,10 @@ gmx_ana_selmethod_t sm_keyword_pos = {
     &init_kwpos,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 /** Selection method data for the \p cog method. */
@@ -166,10 +166,10 @@ gmx_ana_selmethod_t sm_cog = {
     &init_cog,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {"cog of ATOM_EXPR [pbc]", NULL, 0, NULL},
+    nullptr,
+    {"cog of ATOM_EXPR [pbc]", nullptr, 0, nullptr},
 };
 
 /** Selection method data for the \p com method. */
@@ -181,10 +181,10 @@ gmx_ana_selmethod_t sm_com = {
     &init_com,
     &init_output_pos,
     &free_data_pos,
-    NULL,
+    nullptr,
     &evaluate_pos,
-    NULL,
-    {"com of ATOM_EXPR [pbc]", NULL, 0, NULL},
+    nullptr,
+    {"com of ATOM_EXPR [pbc]", nullptr, 0, nullptr},
 };
 
 /*!
@@ -209,9 +209,9 @@ init_data_pos(int npar, gmx_ana_selparam_t *param)
     {
         param[1].val.u.b = &data->bPBC;
     }
-    data->pc       = NULL;
+    data->pc       = nullptr;
     data->bPBC     = false;
-    data->type     = NULL;
+    data->type     = nullptr;
     data->flags    = -1;
     return data;
 }
@@ -236,7 +236,7 @@ _gmx_selelem_is_default_kwpos(const gmx::SelectionTreeElement &sel)
     }
 
     t_methoddata_pos *d = static_cast<t_methoddata_pos *>(sel.u.expr.mdata);
-    return d->type == NULL;
+    return d->type == nullptr;
 }
 
 /*! \brief
index f475efd72d09eaed9626e4c4f840808d8d6e73c3..9f8e2c8d724b53aebf43bb218690d55157ddd018 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -156,14 +156,14 @@ evaluate_same_str(const gmx::SelMethodEvalContext &context,
 
 /** Parameters for the \p same selection method. */
 static gmx_ana_selparam_t smparams_same_int[] = {
-    {NULL, {INT_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"as", {INT_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_ATOMVAL},
+    {"as", {INT_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Parameters for the \p same selection method. */
 static gmx_ana_selparam_t smparams_same_str[] = {
-    {NULL, {STR_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_ATOMVAL},
-    {"as", {STR_VALUE, -1, {NULL}}, NULL, SPAR_DYNAMIC | SPAR_VARNUM},
+    {nullptr, {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_ATOMVAL},
+    {"as", {STR_VALUE, -1, {nullptr}}, nullptr, SPAR_DYNAMIC | SPAR_VARNUM},
 };
 
 /** Help text for the \p same selection method. */
@@ -183,13 +183,13 @@ gmx_ana_selmethod_t sm_same = {
     "same", GROUP_VALUE, 0,
     asize(smparams_same_int), smparams_same_int,
     &init_data_same,
-    NULL,
+    nullptr,
     &init_same,
-    NULL,
+    nullptr,
     &free_data_same,
     &init_frame_same_int,
     &evaluate_same_int,
-    NULL,
+    nullptr,
     {"same KEYWORD as ATOM_EXPR",
      "Extending selections", asize(help_same), help_same},
 };
@@ -205,14 +205,14 @@ static gmx_ana_selmethod_t sm_same_str = {
     "same", GROUP_VALUE, SMETH_SINGLEVAL,
     asize(smparams_same_str), smparams_same_str,
     &init_data_same,
-    NULL,
+    nullptr,
     &init_same,
-    NULL,
+    nullptr,
     &free_data_same,
     &init_frame_same_str,
     &evaluate_same_str,
-    NULL,
-    {NULL, NULL, 0, NULL},
+    nullptr,
+    {nullptr, nullptr, 0, nullptr},
 };
 
 static void *
@@ -221,7 +221,7 @@ init_data_same(int /* npar */, gmx_ana_selparam_t *param)
     t_methoddata_same *data;
 
     snew(data, 1);
-    data->as_s_sorted = NULL;
+    data->as_s_sorted = nullptr;
     param[1].nvalptr  = &data->nas;
     return data;
 }
@@ -519,7 +519,7 @@ evaluate_same_str(const gmx::SelMethodEvalContext & /*context*/,
         ptr = bsearch(&d->val.s[j], d->as_s_sorted, d->nas,
                       sizeof(d->as_s_sorted[0]), &cmp_str);
         /* Check whether the value was found in the as list. */
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             /* If not, skip all atoms with the same value. */
             const char *tmpval = d->val.s[j];
index 60910d1cbe43b604284636459c9c68f22b22d41b..259e395fe6e795544babd6662f642b2174b16de9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -230,284 +230,284 @@ static const char *const help_resindex[] = {
 /** Selection method data for \p all selection keyword. */
 gmx_ana_selmethod_t sm_all = {
     "all", GROUP_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_all,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p none selection keyword. */
 gmx_ana_selmethod_t sm_none = {
     "none", GROUP_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_none,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p atomnr selection keyword. */
 gmx_ana_selmethod_t sm_atomnr = {
     "atomnr", INT_VALUE, 0,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomnr,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p resnr selection keyword. */
 gmx_ana_selmethod_t sm_resnr = {
     "resnr", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resnr,
-    NULL,
-    {NULL, helptitle_resindex, asize(help_resindex), help_resindex}
+    nullptr,
+    {nullptr, helptitle_resindex, asize(help_resindex), help_resindex}
 };
 
 /** Selection method data for \p resindex selection keyword. */
 gmx_ana_selmethod_t sm_resindex = {
     "resindex", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resindex,
-    NULL,
-    {NULL, helptitle_resindex, asize(help_resindex), help_resindex}
+    nullptr,
+    {nullptr, helptitle_resindex, asize(help_resindex), help_resindex}
 };
 
 /** Selection method data for \p molindex selection keyword. */
 gmx_ana_selmethod_t sm_molindex = {
     "molindex", INT_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_molecules,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_molindex,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p atomname selection keyword. */
 gmx_ana_selmethod_t sm_atomname = {
     "atomname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomname,
-    NULL,
-    {NULL, helptitle_atomname, asize(help_atomname), help_atomname}
+    nullptr,
+    {nullptr, helptitle_atomname, asize(help_atomname), help_atomname}
 };
 
 /** Selection method data for \p pdbatomname selection keyword. */
 gmx_ana_selmethod_t sm_pdbatomname = {
     "pdbatomname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_pdbatomname,
-    NULL,
-    {NULL, helptitle_atomname, asize(help_atomname), help_atomname}
+    nullptr,
+    {nullptr, helptitle_atomname, asize(help_atomname), help_atomname}
 };
 
 /** Selection method data for \p atomtype selection keyword. */
 gmx_ana_selmethod_t sm_atomtype = {
     "atomtype", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_atomtype,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_atomtype,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p resname selection keyword. */
 gmx_ana_selmethod_t sm_resname = {
     "resname", STR_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_resname,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_insertcode = {
     "insertcode", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_insertcode,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_chain = {
     "chain", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_chain,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p mass selection keyword. */
 gmx_ana_selmethod_t sm_mass = {
     "mass", REAL_VALUE, SMETH_REQMASS,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_mass,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p charge selection keyword. */
 gmx_ana_selmethod_t sm_charge = {
     "charge", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_charge,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_charge,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p chain selection keyword. */
 gmx_ana_selmethod_t sm_altloc = {
     "altloc", STR_VALUE, SMETH_REQTOP | SMETH_CHARVAL,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_altloc,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p occupancy selection keyword. */
 gmx_ana_selmethod_t sm_occupancy = {
     "occupancy", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_occupancy,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p betafactor selection keyword. */
 gmx_ana_selmethod_t sm_betafactor = {
     "betafactor", REAL_VALUE, SMETH_REQTOP,
-    0, NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
     &check_pdbinfo,
-    NULL,
-    NULL,
-    NULL,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_betafactor,
-    NULL,
+    nullptr,
 };
 
 /** Selection method data for \p x selection keyword. */
 gmx_ana_selmethod_t sm_x = {
     "x", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_x,
 };
 
 /** Selection method data for \p y selection keyword. */
 gmx_ana_selmethod_t sm_y = {
     "y", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_y,
 };
 
 /** Selection method data for \p z selection keyword. */
 gmx_ana_selmethod_t sm_z = {
     "z", REAL_VALUE, SMETH_DYNAMIC,
-    0, NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
+    0, nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
     &evaluate_z,
 };
 
@@ -601,7 +601,7 @@ check_molecules(const gmx_mtop_t *top, int /* npar */, gmx_ana_selparam_t * /* p
 {
     bool bOk;
 
-    bOk = (top != NULL && top->mols.nr > 0);
+    bOk = (top != nullptr && top->mols.nr > 0);
     if (!bOk)
     {
         GMX_THROW(gmx::InconsistentInputError("Molecule information not available in topology"));
index 34f63ae9b1cf791283c3a014055ebfb1f24701bc..1cbc5df4794de7171d0f4f8f3452782735c5ecdc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -81,7 +81,7 @@ class SelectionParserSymbol::Impl
          * \a var_ members as appropriate.
          */
         Impl(SymbolType type, const char *name)
-            : name_(name), type_(type), meth_(NULL)
+            : name_(name), type_(type), meth_(nullptr)
         {
         }
 
@@ -204,7 +204,7 @@ SelectionParserSymbolTable::Impl::addPositionSymbols()
 {
     const char *const *postypes
         = gmx::PositionCalculationCollection::typeEnumValues;
-    for (int i = 0; postypes[i] != NULL; ++i)
+    for (int i = 0; postypes[i] != nullptr; ++i)
     {
         SymbolPointer sym(new SelectionParserSymbol(
                                   new SelectionParserSymbol::Impl(
@@ -320,13 +320,13 @@ SelectionParserSymbolTable::findSymbol(const std::string &name) const
     Impl::SymbolMap::const_iterator sym = impl_->symbols_.lower_bound(name);
     if (sym == impl_->symbols_.end())
     {
-        return NULL;
+        return nullptr;
     }
     if (sym->second->name() == name)
     {
         return sym->second.get();
     }
-    return NULL;
+    return nullptr;
 }
 
 SelectionParserSymbolIterator
index 70bb817208ea4a62f32df42baec8319f16338b29..a2d43aca86fab128376db9368716cfbe05d4184b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -103,10 +103,10 @@ class IndexBlockTest : public ::testing::Test
 IndexBlockTest::IndexBlockTest()
 {
     blocka_.nr           = 0;
-    blocka_.index        = NULL;
+    blocka_.index        = nullptr;
     blocka_.nalloc_index = 0;
     blocka_.nra          = 0;
-    blocka_.a            = NULL;
+    blocka_.a            = nullptr;
     blocka_.nalloc_a     = 0;
     gmx_ana_index_clear(&g_);
 }
@@ -131,7 +131,7 @@ void IndexBlockTest::checkBlocka()
     for (int i = 0; i < blocka_.nr; ++i)
     {
         gmx::test::TestReferenceChecker blockCompound(
-                compound.checkCompound("Block", NULL));
+                compound.checkCompound("Block", nullptr));
         blockCompound.checkSequence(&blocka_.a[blocka_.index[i]],
                                     &blocka_.a[blocka_.index[i+1]],
                                     "Atoms");
@@ -144,10 +144,10 @@ void IndexBlockTest::checkBlocka()
 
 TEST_F(IndexBlockTest, CreatesUnknownBlock)
 {
-    gmx_ana_index_make_block(&blocka_, NULL, NULL, INDEX_UNKNOWN, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, nullptr, INDEX_UNKNOWN, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, NULL, INDEX_UNKNOWN, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, nullptr, INDEX_UNKNOWN, false);
     checkBlocka();
 }
 
@@ -155,10 +155,10 @@ TEST_F(IndexBlockTest, CreatesAtomBlock)
 {
     const int group[] = { 0, 1, 3, 4, 6 };
     setGroup(group);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ATOM, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ATOM, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ATOM, true);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ATOM, true);
     checkBlocka();
 }
 
@@ -210,10 +210,10 @@ TEST_F(IndexBlockTest, CreatesSingleBlock)
 {
     const int group[] = { 0, 1, 3, 4, 6 };
     setGroup(group);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ALL, false);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ALL, false);
     checkBlocka();
     done_blocka(&blocka_);
-    gmx_ana_index_make_block(&blocka_, NULL, &g_, INDEX_ALL, true);
+    gmx_ana_index_make_block(&blocka_, nullptr, &g_, INDEX_ALL, true);
     checkBlocka();
 }
 
@@ -284,9 +284,9 @@ TEST_F(IndexBlockTest, ChecksGroupForCompleteElementsTrivial)
 {
     const int group[] = { 0, 1, 2 };
     setGroup(group);
-    EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_ATOM, NULL));
-    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_ALL, NULL));
-    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_UNKNOWN, NULL));
+    EXPECT_TRUE(gmx_ana_index_has_complete_elems(&g_, INDEX_ATOM, nullptr));
+    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_ALL, nullptr));
+    EXPECT_FALSE(gmx_ana_index_has_complete_elems(&g_, INDEX_UNKNOWN, nullptr));
 }
 
 TEST_F(IndexBlockTest, ChecksGroupForCompleteResiduesPositive)
@@ -426,7 +426,7 @@ void IndexMapTest::testUpdate(int atomCount, const int atoms[], bool bMaskOnly,
     g.isize = atomCount;
     g.index = const_cast<int *>(atoms);
     gmx_ana_indexmap_update(&map_, &g, bMaskOnly);
-    if (name == NULL)
+    if (name == nullptr)
     {
         name = "Updated";
     }
@@ -464,7 +464,7 @@ void IndexMapTest::checkMapping(int atomCount, const int atoms[],
     for (int i = 0; i < map_.mapb.nr; ++i)
     {
         gmx::test::TestReferenceChecker blockCompound(
-                compound.checkCompound("Block", NULL));
+                compound.checkCompound("Block", nullptr));
         blockCompound.checkSequence(&atoms[map_.mapb.index[i]],
                                     &atoms[map_.mapb.index[i+1]],
                                     "Atoms");
@@ -540,7 +540,7 @@ TEST_F(IndexMapTest, MapsSingleBlock)
     const int maxGroup[]  = { 0, 1, 2, 3 };
     const int evalGroup[] = { 0, 2 };
     testInit(maxGroup, INDEX_ALL);
-    testUpdate(evalGroup, false, NULL);
+    testUpdate(evalGroup, false, nullptr);
 }
 
 TEST_F(IndexMapTest, MapsResidueBlocks)
@@ -552,7 +552,7 @@ TEST_F(IndexMapTest, MapsResidueBlocks)
     topManager_.initAtoms(18);
     topManager_.initUniformResidues(3);
     testInit(maxGroup, INDEX_RES);
-    testUpdate(evalGroup, false, NULL);
+    testUpdate(evalGroup, false, nullptr);
 }
 
 TEST_F(IndexMapTest, MapsResidueBlocksWithMask)
@@ -564,7 +564,7 @@ TEST_F(IndexMapTest, MapsResidueBlocksWithMask)
     topManager_.initAtoms(18);
     topManager_.initUniformResidues(3);
     testInit(maxGroup, INDEX_RES);
-    testUpdate(evalGroup, true, NULL);
+    testUpdate(evalGroup, true, nullptr);
 }
 
 TEST_F(IndexMapTest, HandlesMultipleRequests)
index 240f282ead94cd6920d8c7cdea50ae3e6ce4894b..af445d88c35ed74fae099a3a039c36fe1ae9e216 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -274,7 +274,7 @@ void NeighborhoodSearchTestData::computeReferencesInternal(t_pbc *pbc, bool bXY)
         for (int j = 0; j < refPosCount_; ++j)
         {
             rvec dx;
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
                 pbc_dx(pbc, i->x, refPos_[j], dx);
             }
@@ -372,9 +372,9 @@ ExclusionsHelper::ExclusionsHelper(int refPosCount, int testPosCount)
                      exclusionIds_.begin());
 
     excls_.nr           = 0;
-    excls_.index        = NULL;
+    excls_.index        = nullptr;
     excls_.nra          = 0;
-    excls_.a            = NULL;
+    excls_.a            = nullptr;
     excls_.nalloc_index = 0;
     excls_.nalloc_a     = 0;
 }
@@ -518,7 +518,7 @@ void NeighborhoodSearchTest::testPairSearch(
         gmx::AnalysisNeighborhoodSearch  *search,
         const NeighborhoodSearchTestData &data)
 {
-    testPairSearchFull(search, data, data.testPositions(), NULL,
+    testPairSearchFull(search, data, data.testPositions(), nullptr,
                        gmx::EmptyArrayRef(), gmx::EmptyArrayRef());
 }
 
@@ -532,7 +532,7 @@ void NeighborhoodSearchTest::testPairSearchIndexed(
     gmx::AnalysisNeighborhoodSearch search =
         nb->initSearch(&data.pbc_,
                        data.refPositions().indexed(refIndices));
-    testPairSearchFull(&search, data, data.testPositions(), NULL,
+    testPairSearchFull(&search, data, data.testPositions(), nullptr,
                        refIndices, testIndices);
 }
 
@@ -591,7 +591,7 @@ void NeighborhoodSearchTest::testPairSearchFull(
             }
             remainingTestPositions.erase(testIndex);
             refPairs = data.testPositions_[testIndex].refPairs;
-            if (excls != NULL)
+            if (excls != nullptr)
             {
                 ExclusionsHelper::markExcludedPairs(&refPairs, testIndex, excls);
             }
@@ -742,7 +742,7 @@ class TrivialNoPBCTestData
         {
             data_.generateRandomRefPositions(10);
             data_.generateRandomTestPositions(5);
-            data_.computeReferences(NULL);
+            data_.computeReferences(nullptr);
         }
 
     private:
@@ -875,7 +875,7 @@ class RandomBoxNoPBCData
             data_.generateRandomRefPositions(1000);
             data_.generateRandomTestPositions(100);
             set_pbc(&data_.pbc_, epbcNONE, data_.box_);
-            data_.computeReferences(NULL);
+            data_.computeReferences(nullptr);
         }
 
     private:
@@ -1059,7 +1059,7 @@ TEST_F(NeighborhoodSearchTest, HandlesNullPBC)
 
     nb_.setCutoff(data.cutoff_);
     gmx::AnalysisNeighborhoodSearch search =
-        nb_.initSearch(NULL, data.refPositions());
+        nb_.initSearch(nullptr, data.refPositions());
     ASSERT_EQ(gmx::AnalysisNeighborhood::eSearchMode_Simple, search.mode());
 
     testIsWithin(&search, data);
index 4b28450eea924596a469e5ab55da3fc359b70f67..00e22a5acc6615202b1c9fd11e2d0dae5cf87099 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -209,7 +209,7 @@ PositionCalculationTest::initPositions(gmx_ana_poscalc_t *pc, const char *name)
 void PositionCalculationTest::checkInitialized()
 {
     gmx::test::TestReferenceChecker  compound(
-            checker_.checkCompound("InitializedPositions", NULL));
+            checker_.checkCompound("InitializedPositions", nullptr));
     PositionTestList::const_iterator pi;
     for (pi = posList_.begin(); pi != posList_.end(); ++pi)
     {
@@ -224,7 +224,7 @@ void PositionCalculationTest::updateAndCheck(
     gmx_ana_index_t g;
     g.isize = atoms.size();
     g.index = const_cast<int *>(atoms.data());
-    gmx_ana_poscalc_update(pc, p, &g, topManager_.frame(), NULL);
+    gmx_ana_poscalc_update(pc, p, &g, topManager_.frame(), nullptr);
     checkPositions(checker, name, p, true);
 }
 
@@ -248,7 +248,7 @@ void PositionCalculationTest::testSingleStatic(
             != gmx::PositionCalculationCollection::RequiredTopologyInfo::None;
     EXPECT_EQ(bExpectTop, requiresTopology);
     setMaximumGroup(pc, atoms);
-    gmx_ana_pos_t *p = initPositions(pc, NULL);
+    gmx_ana_pos_t *p = initPositions(pc, nullptr);
     checkInitialized();
     {
         generateCoordinates();
@@ -260,7 +260,7 @@ void PositionCalculationTest::testSingleStatic(
         pcc_.initFrame(frame);
         gmx::test::TestReferenceChecker frameCompound(
                 checker_.checkCompound("EvaluatedPositions", "Frame0"));
-        updateAndCheck(pc, p, atoms, &frameCompound, NULL);
+        updateAndCheck(pc, p, atoms, &frameCompound, nullptr);
     }
 }
 
@@ -276,7 +276,7 @@ void PositionCalculationTest::testSingleDynamic(
             != gmx::PositionCalculationCollection::RequiredTopologyInfo::None;
     EXPECT_EQ(bExpectTop, requiresTopology);
     setMaximumGroup(pc, initAtoms);
-    gmx_ana_pos_t *p = initPositions(pc, NULL);
+    gmx_ana_pos_t *p = initPositions(pc, nullptr);
     checkInitialized();
     {
         generateCoordinates();
@@ -288,7 +288,7 @@ void PositionCalculationTest::testSingleDynamic(
         pcc_.initFrame(topManager_.frame());
         gmx::test::TestReferenceChecker frameCompound(
                 checker_.checkCompound("EvaluatedPositions", "Frame0"));
-        updateAndCheck(pc, p, evalAtoms, &frameCompound, NULL);
+        updateAndCheck(pc, p, evalAtoms, &frameCompound, nullptr);
     }
 }
 
@@ -334,7 +334,7 @@ void PositionCalculationTest::checkPositions(
     for (int i = 0; i < p->count(); ++i)
     {
         gmx::test::TestReferenceChecker posCompound(
-                compound.checkCompound("Position", NULL));
+                compound.checkCompound("Position", nullptr));
         posCompound.checkSequence(&p->m.mapb.a[p->m.mapb.index[i]],
                                   &p->m.mapb.a[p->m.mapb.index[i+1]],
                                   "Atoms");
@@ -343,11 +343,11 @@ void PositionCalculationTest::checkPositions(
         {
             posCompound.checkVector(p->x[i], "Coordinates");
         }
-        if (bCoordinates && p->v != NULL)
+        if (bCoordinates && p->v != nullptr)
         {
             posCompound.checkVector(p->v[i], "Velocity");
         }
-        if (bCoordinates && p->f != NULL)
+        if (bCoordinates && p->f != nullptr)
         {
             posCompound.checkVector(p->f[i], "Force");
         }
index c8c3a75c4a63151845f1ba538f8bc78e86e75bad..356f2e7beb626e9ef88fd54fb3212670b6449d79 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,7 +82,7 @@ class SelectionCollectionTest : public ::testing::Test
 
         void setAtomCount(int natoms)
         {
-            ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, natoms));
+            ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, natoms));
         }
         void loadTopology(const char *filename);
         void setTopology();
@@ -107,7 +107,7 @@ GMX_TEST_OPTIONS(SelectionCollectionTestOptions, options)
 #endif
 
 SelectionCollectionTest::SelectionCollectionTest()
-    : grps_(NULL)
+    : grps_(nullptr)
 {
     topManager_.requestFrame();
     sc_.setDebugLevel(s_debugLevel);
@@ -117,7 +117,7 @@ SelectionCollectionTest::SelectionCollectionTest()
 
 SelectionCollectionTest::~SelectionCollectionTest()
 {
-    if (grps_ != NULL)
+    if (grps_ != nullptr)
     {
         gmx_ana_indexgrps_free(grps_);
     }
@@ -139,11 +139,11 @@ SelectionCollectionTest::setTopology()
 void
 SelectionCollectionTest::loadIndexGroups(const char *filename)
 {
-    GMX_RELEASE_ASSERT(grps_ == NULL,
+    GMX_RELEASE_ASSERT(grps_ == nullptr,
                        "External groups can only be loaded once");
     std::string fullpath =
         gmx::test::TestFileManager::getInputFilePath(filename);
-    gmx_ana_indexgrps_init(&grps_, NULL, fullpath.c_str());
+    gmx_ana_indexgrps_init(&grps_, nullptr, fullpath.c_str());
     sc_.setIndexGroups(grps_);
 }
 
@@ -175,7 +175,7 @@ void SelectionCollectionInteractiveTest::runTest(
     // TODO: Check something about the returned selections as well.
     ASSERT_NO_THROW_GMX(sc_.parseInteractive(
                                 count, &helper_.inputStream(),
-                                bInteractive ? &helper_.outputStream() : NULL,
+                                bInteractive ? &helper_.outputStream() : nullptr,
                                 "for test context"));
     helper_.checkSession();
 }
@@ -253,7 +253,7 @@ SelectionCollectionDataTest::checkSelection(
                 checker->checkSequenceCompound("Positions", sel.posCount()));
         for (int i = 0; i < sel.posCount(); ++i)
         {
-            TestReferenceChecker          poscompound(compound.checkCompound("Position", NULL));
+            TestReferenceChecker          poscompound(compound.checkCompound("Position", nullptr));
             const gmx::SelectionPosition &p = sel.position(i);
             if (flags.test(efTestPositionAtoms))
             {
@@ -365,7 +365,7 @@ SelectionCollectionDataTest::runEvaluate()
     using gmx::test::TestReferenceChecker;
 
     ++framenr_;
-    ASSERT_NO_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL));
+    ASSERT_NO_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr));
     std::string          frame = gmx::formatString("Frame%d", framenr_);
     TestReferenceChecker compound(
             checker_.checkCompound("EvaluatedSelections", frame.c_str()));
@@ -534,7 +534,7 @@ TEST_F(SelectionCollectionTest, HandlesMissingMethodParamValue3)
 
 TEST_F(SelectionCollectionTest, HandlesUnknownGroupReferenceParser1)
 {
-    ASSERT_NO_THROW_GMX(sc_.setIndexGroups(NULL));
+    ASSERT_NO_THROW_GMX(sc_.setIndexGroups(nullptr));
     EXPECT_THROW_GMX(sc_.parseFromString("group \"foo\""), gmx::InconsistentInputError);
     EXPECT_THROW_GMX(sc_.parseFromString("4"), gmx::InconsistentInputError);
 }
@@ -550,7 +550,7 @@ TEST_F(SelectionCollectionTest, HandlesUnknownGroupReferenceDelayed1)
 {
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"foo\""));
     ASSERT_NO_FATAL_FAILURE(setAtomCount(10));
-    EXPECT_THROW_GMX(sc_.setIndexGroups(NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.setIndexGroups(nullptr), gmx::InconsistentInputError);
     EXPECT_THROW_GMX(sc_.compile(), gmx::APIError);
 }
 
@@ -586,7 +586,7 @@ TEST_F(SelectionCollectionTest, HandlesUnsortedGroupReferenceDelayed)
 
 TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroup)
 {
-    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, 5));
     ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
     EXPECT_THROW_GMX(sc_.parseFromString("group \"GrpB\""), gmx::InconsistentInputError);
 }
@@ -595,12 +595,12 @@ TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed)
 {
     ASSERT_NO_THROW_GMX(loadIndexGroups("simple.ndx"));
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
-    EXPECT_THROW_GMX(sc_.setTopology(NULL, 5), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.setTopology(nullptr, 5), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesOutOfRangeAtomIndexInGroupDelayed2)
 {
-    ASSERT_NO_THROW_GMX(sc_.setTopology(NULL, 5));
+    ASSERT_NO_THROW_GMX(sc_.setTopology(nullptr, 5));
     ASSERT_NO_THROW_GMX(sc_.parseFromString("group \"GrpB\""));
     EXPECT_THROW_GMX(loadIndexGroups("simple.ndx"), gmx::InconsistentInputError);
 }
@@ -645,7 +645,7 @@ TEST_F(SelectionCollectionTest, RecoversFromInvalidPermutation3)
     ASSERT_NO_THROW_GMX(sc_.parseFromString("x < 1.5 permute 3 2 1"));
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets)
@@ -654,7 +654,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.frame()->natoms = 8;
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets2)
@@ -664,7 +664,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets2)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.initFrameIndices(index);
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets3)
@@ -675,7 +675,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets3)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.initFrameIndices(index);
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets4)
@@ -684,7 +684,7 @@ TEST_F(SelectionCollectionTest, HandlesFramesWithTooSmallAtomSubsets4)
     ASSERT_NO_FATAL_FAILURE(loadTopology("simple.gro"));
     ASSERT_NO_THROW_GMX(sc_.compile());
     topManager_.frame()->natoms = 10;
-    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), NULL), gmx::InconsistentInputError);
+    EXPECT_THROW_GMX(sc_.evaluate(topManager_.frame(), nullptr), gmx::InconsistentInputError);
 }
 
 // TODO: Tests for more evaluation errors
index d6d6e7053fc6b5ba966b7f0daabdbc0907e34896..f230af5a696dfd5992fd8335cc565fdff193537a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -263,7 +263,7 @@ TEST_F(SelectionOptionTest, HandlesDefaultSelectionText)
 
     ASSERT_TRUE(sel.isValid());
 
-    EXPECT_NO_THROW_GMX(sc_.setTopology(NULL, 10));
+    EXPECT_NO_THROW_GMX(sc_.setTopology(nullptr, 10));
     EXPECT_NO_THROW_GMX(sc_.compile());
 
     EXPECT_STREQ("all", sel.selectionText());
index 4de0421cbc02f393b1a0a6c2ac622e1daf9b7e06..975ce6e331a1d4463157d2ab8caa9a63f0e2c175 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -96,9 +96,9 @@ TopologyManager::~TopologyManager()
 
 void TopologyManager::requestFrame()
 {
-    GMX_RELEASE_ASSERT(mtop_ == NULL,
+    GMX_RELEASE_ASSERT(mtop_ == nullptr,
                        "Frame must be requested before initializing topology");
-    if (frame_ == NULL)
+    if (frame_ == nullptr)
     {
         snew(frame_, 1);
     }
@@ -106,7 +106,7 @@ void TopologyManager::requestFrame()
 
 void TopologyManager::requestVelocities()
 {
-    GMX_RELEASE_ASSERT(frame_ != NULL,
+    GMX_RELEASE_ASSERT(frame_ != nullptr,
                        "Velocities requested before requesting a frame");
     frame_->bV = TRUE;
     if (frame_->natoms > 0)
@@ -117,7 +117,7 @@ void TopologyManager::requestVelocities()
 
 void TopologyManager::requestForces()
 {
-    GMX_RELEASE_ASSERT(frame_ != NULL,
+    GMX_RELEASE_ASSERT(frame_ != nullptr,
                        "Forces requested before requesting a frame");
     frame_->bF = TRUE;
     if (frame_->natoms > 0)
@@ -130,17 +130,17 @@ void TopologyManager::loadTopology(const char *filename)
 {
     bool    fullTopology;
     int     ePBC;
-    rvec   *xtop = NULL;
+    rvec   *xtop = nullptr;
     matrix  box;
 
     GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
     snew(mtop_, 1);
     readConfAndTopology(
             gmx::test::TestFileManager::getInputFilePath(filename).c_str(),
-            &fullTopology, mtop_, &ePBC, frame_ != NULL ? &xtop : NULL,
-            NULL, box);
+            &fullTopology, mtop_, &ePBC, frame_ != nullptr ? &xtop : nullptr,
+            nullptr, box);
 
-    if (frame_ != NULL)
+    if (frame_ != nullptr)
     {
         frame_->natoms = mtop_->natoms;
         frame_->bX     = TRUE;
@@ -155,7 +155,7 @@ void TopologyManager::loadTopology(const char *filename)
 
 void TopologyManager::initAtoms(int count)
 {
-    GMX_RELEASE_ASSERT(mtop_ == NULL, "Topology initialized more than once");
+    GMX_RELEASE_ASSERT(mtop_ == nullptr, "Topology initialized more than once");
     snew(mtop_, 1);
     mtop_->nmoltype = 1;
     snew(mtop_->moltype, 1);
@@ -175,7 +175,7 @@ void TopologyManager::initAtoms(int count)
         atoms.atom[i].m = (i % 3 == 0 ? 2.0 : 1.0);
     }
     atoms.haveMass = TRUE;
-    if (frame_ != NULL)
+    if (frame_ != nullptr)
     {
         frame_->natoms = count;
         frame_->bX     = TRUE;
@@ -215,7 +215,7 @@ void TopologyManager::initAtomTypes(const ConstArrayRef<const char *> &types)
 
 void TopologyManager::initUniformResidues(int residueSize)
 {
-    GMX_RELEASE_ASSERT(mtop_ != NULL, "Topology not initialized");
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
     t_atoms &atoms        = this->atoms();
     int      residueIndex = -1;
     for (int i = 0; i < atoms.nr; ++i)
@@ -230,7 +230,7 @@ void TopologyManager::initUniformResidues(int residueSize)
 
 void TopologyManager::initUniformMolecules(int moleculeSize)
 {
-    GMX_RELEASE_ASSERT(mtop_ != NULL, "Topology not initialized");
+    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");
     int index = 0;
     mtop_->mols.nalloc_index = (mtop_->natoms + moleculeSize - 1) / moleculeSize + 1;
     srenew(mtop_->mols.index, mtop_->mols.nalloc_index);
index 44214e9b92ca056c57e56718f2de90f6e40d2703..2e9fbc1b8020201664bded23612d1d6cd63ab62f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,19 +143,19 @@ int gmx_stats_get_point(gmx_stats_t gstats, real *x, real *y,
         outlier = (r > rmsd*level);
         if (outlier)
         {
-            if (NULL != x)
+            if (nullptr != x)
             {
                 *x  = stats->x[stats->np_c];
             }
-            if (NULL != y)
+            if (nullptr != y)
             {
                 *y  = stats->y[stats->np_c];
             }
-            if (NULL != dx)
+            if (nullptr != dx)
             {
                 *dx = stats->dx[stats->np_c];
             }
-            if (NULL != dy)
+            if (nullptr != dy)
             {
                 *dy = stats->dy[stats->np_c];
             }
@@ -180,8 +180,8 @@ int gmx_stats_add_points(gmx_stats_t gstats, int n, real *x, real *y,
     {
         int ok;
         if ((ok = gmx_stats_add_point(gstats, x[i], y[i],
-                                      (NULL != dx) ? dx[i] : 0,
-                                      (NULL != dy) ? dy[i] : 0)) != estatsOK)
+                                      (nullptr != dx) ? dx[i] : 0,
+                                      (nullptr != dy) ? dy[i] : 0)) != estatsOK)
         {
             return ok;
         }
@@ -329,27 +329,27 @@ int gmx_stats_get_ab(gmx_stats_t gstats, int weight,
     {
         return ok;
     }
-    if (NULL != a)
+    if (nullptr != a)
     {
         *a    = stats->a;
     }
-    if (NULL != b)
+    if (nullptr != b)
     {
         *b    = stats->b;
     }
-    if (NULL != da)
+    if (nullptr != da)
     {
         *da   = stats->sigma_a;
     }
-    if (NULL != db)
+    if (nullptr != db)
     {
         *db   = stats->sigma_b;
     }
-    if (NULL != chi2)
+    if (nullptr != chi2)
     {
         *chi2 = stats->chi2;
     }
-    if (NULL != Rfit)
+    if (nullptr != Rfit)
     {
         *Rfit = stats->Rfit;
     }
@@ -367,19 +367,19 @@ int gmx_stats_get_a(gmx_stats_t gstats, int weight, real *a, real *da,
     {
         return ok;
     }
-    if (NULL != a)
+    if (nullptr != a)
     {
         *a    = stats->aa;
     }
-    if (NULL != da)
+    if (nullptr != da)
     {
         *da   = stats->sigma_aa;
     }
-    if (NULL != chi2)
+    if (nullptr != chi2)
     {
         *chi2 = stats->chi2aa;
     }
-    if (NULL != Rfit)
+    if (nullptr != Rfit)
     {
         *Rfit = stats->Rfitaa;
     }
@@ -412,15 +412,15 @@ int gmx_stats_get_ase(gmx_stats_t gstats, real *aver, real *sigma, real *error)
         return ok;
     }
 
-    if (NULL != aver)
+    if (nullptr != aver)
     {
         *aver  = stats->aver;
     }
-    if (NULL != sigma)
+    if (nullptr != sigma)
     {
         *sigma = stats->sigma_aver;
     }
-    if (NULL != error)
+    if (nullptr != error)
     {
         *error = stats->error;
     }
@@ -674,7 +674,7 @@ int lsq_y_ax(int n, real x[], real y[], real *a)
     int         ok;
     real        da, chi2, Rfit;
 
-    gmx_stats_add_points(lsq, n, x, y, 0, 0);
+    gmx_stats_add_points(lsq, n, x, y, nullptr, nullptr);
     ok = gmx_stats_get_a(lsq, elsqWEIGHT_NONE, a, &da, &chi2, &Rfit);
     gmx_stats_free(lsq);
 
@@ -691,11 +691,11 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
     {
         double pt;
 
-        if (xd != NULL)
+        if (xd != nullptr)
         {
             pt = xd[i];
         }
-        else if (xr != NULL)
+        else if (xr != nullptr)
         {
             pt = xr[i];
         }
@@ -710,7 +710,7 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
             return ok;
         }
     }
-    ok = gmx_stats_get_ab(lsq, elsqWEIGHT_NONE, a, b, NULL, NULL, chi2, r);
+    ok = gmx_stats_get_ab(lsq, elsqWEIGHT_NONE, a, b, nullptr, nullptr, chi2, r);
     gmx_stats_free(lsq);
 
     return ok;
@@ -718,13 +718,13 @@ static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
 
 int lsq_y_ax_b(int n, real x[], real y[], real *a, real *b, real *r, real *chi2)
 {
-    return low_lsq_y_ax_b(n, x, NULL, y, a, b, r, chi2);
+    return low_lsq_y_ax_b(n, x, nullptr, y, a, b, r, chi2);
 }
 
 int lsq_y_ax_b_xdouble(int n, double x[], real y[], real *a, real *b,
                        real *r, real *chi2)
 {
-    return low_lsq_y_ax_b(n, NULL, x, y, a, b, r, chi2);
+    return low_lsq_y_ax_b(n, nullptr, x, y, a, b, r, chi2);
 }
 
 int lsq_y_ax_b_error(int n, real x[], real y[], real dy[],
index e1a035e957759d921da03316e027ff5e2a4fd74a..2b8c903f1ac1d9df42f38c14aa31882c5b48dd9a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,8 +73,8 @@
 static const char *SwS      = {"SWAP:"};                                           /**< For output that comes from the swap module */
 static const char *SwSEmpty = {"     "};                                           /**< Placeholder for multi-line output */
 static const char* CompStr[eCompNR] = {"A", "B" };                                 /**< Compartment name */
-static const char *SwapStr[eSwapTypesNR+1] = { "", "X-", "Y-", "Z-", NULL};        /**< Name for the swap types. */
-static const char *DimStr[DIM+1] = { "X", "Y", "Z", NULL};                         /**< Name for the swap dimension. */
+static const char *SwapStr[eSwapTypesNR+1] = { "", "X-", "Y-", "Z-", nullptr};     /**< Name for the swap types. */
+static const char *DimStr[DIM+1] = { "X", "Y", "Z", nullptr};                      /**< Name for the swap dimension. */
 
 /** Keep track of through which channel the ions have passed */
 enum eChannelHistory {
@@ -312,7 +312,7 @@ static void get_molecule_center(
         rvec_add(reference, dx, correctPBCimage);
 
         /* Take weight into account */
-        if (NULL == weights)
+        if (nullptr == weights)
         {
             wi = 1.0;
         }
@@ -701,7 +701,7 @@ static void sortMoleculesIntoCompartments(
                 add_to_list(iAtom, &g->comp[comp], dist);
 
                 /* Master also checks for ion groups through which channel each ion has passed */
-                if (MASTER(cr) && (g->comp_now != NULL) && !bIsSolvent)
+                if (MASTER(cr) && (g->comp_now != nullptr) && !bIsSolvent)
                 {
                     int globalAtomNr = g->ind[iAtom] + 1; /* PDB index starts at 1 ... */
                     detect_flux_per_channel(g, globalAtomNr, comp, g->xc[iAtom],
@@ -737,7 +737,7 @@ static void sortMoleculesIntoCompartments(
         }
     }
 
-    if (bIsSolvent && NULL != fpout)
+    if (bIsSolvent && nullptr != fpout)
     {
         fprintf(fpout, "# Solv. molecules in comp.%s: %d   comp.%s: %d\n",
                 CompStr[eCompA], g->comp[eCompA].nMol,
@@ -924,10 +924,10 @@ static void bc_initial_concentrations(
 /*! \brief Ensure that each atom belongs to at most one of the swap groups. */
 static void check_swap_groups(t_swap *s, int nat, gmx_bool bVerbose)
 {
-    int  *nGroup    = NULL; /* This array counts for each atom in the MD system to
-                               how many swap groups it belongs (should be 0 or 1!) */
+    int  *nGroup    = nullptr; /* This array counts for each atom in the MD system to
+                                  how many swap groups it belongs (should be 0 or 1!) */
     int   ind       = -1;
-    int   nMultiple = 0;    /* Number of atoms belonging to multiple groups */
+    int   nMultiple = 0;       /* Number of atoms belonging to multiple groups */
 
 
     if (bVerbose)
@@ -984,7 +984,7 @@ static int get_group_apm_check(
     /* Determine the number of solvent atoms per solvent molecule from the
      * first solvent atom: */
     int molb = 0;
-    mtopGetMolblockIndex(mtop, ind[0], &molb, NULL, NULL);
+    mtopGetMolblockIndex(mtop, ind[0], &molb, nullptr, nullptr);
     int apm = mtop->molblock[molb].natoms_mol;
 
     if (bVerbose)
@@ -996,7 +996,7 @@ static int get_group_apm_check(
     /* Check whether this is also true for all other solvent atoms */
     for (int i = 1; i < nat; i++)
     {
-        mtopGetMolblockIndex(mtop, ind[i], &molb, NULL, NULL);
+        mtopGetMolblockIndex(mtop, ind[i], &molb, nullptr, nullptr);
         if (apm != mtop->molblock[molb].natoms_mol)
         {
             gmx_fatal(FARGS, "Not all molecules of swap group %d consist of %d atoms.",
@@ -1046,9 +1046,9 @@ static void print_ionlist_legend(t_inputrec             *ir,
     }
 
     // Center of split groups
-    snprintf(buf, STRLEN, "%scenter of %s of split group 0", SwapStr[ir->eSwapCoords], (NULL != s->group[eGrpSplit0].m) ? "mass" : "geometry");
+    snprintf(buf, STRLEN, "%scenter of %s of split group 0", SwapStr[ir->eSwapCoords], (nullptr != s->group[eGrpSplit0].m) ? "mass" : "geometry");
     legend[count++] = gmx_strdup(buf);
-    snprintf(buf, STRLEN, "%scenter of %s of split group 1", SwapStr[ir->eSwapCoords], (NULL != s->group[eGrpSplit1].m) ? "mass" : "geometry");
+    snprintf(buf, STRLEN, "%scenter of %s of split group 1", SwapStr[ir->eSwapCoords], (nullptr != s->group[eGrpSplit1].m) ? "mass" : "geometry");
     legend[count++] = gmx_strdup(buf);
 
     // Ion flux for each channel and ion type
@@ -1105,9 +1105,9 @@ static void detect_flux_per_channel_init(
         /* All these flux detection routines run on the master only */
         if (!MASTER(cr))
         {
-            g->comp_now      = NULL;
-            g->comp_from     = NULL;
-            g->channel_label = NULL;
+            g->comp_now      = nullptr;
+            g->comp_from     = nullptr;
+            g->channel_label = nullptr;
 
             return;
         }
@@ -1204,13 +1204,13 @@ static void outputStartStructureIfWanted(gmx_mtop_t *mtop, rvec *x, int ePBC, ma
 {
     char *env = getenv("GMX_COMPELDUMP");
 
-    if (env != NULL)
+    if (env != nullptr)
     {
         fprintf(stderr, "\n%s Found env.var. GMX_COMPELDUMP, will output CompEL starting structure made whole.\n"
                 "%s In case of multimeric channels, please check whether they have the correct PBC representation.\n",
                 SwS, SwSEmpty);
 
-        write_sto_conf_mtop("CompELAssumedWholeConfiguration.pdb", *mtop->name, mtop, x, NULL, ePBC, box);
+        write_sto_conf_mtop("CompELAssumedWholeConfiguration.pdb", *mtop->name, mtop, x, nullptr, ePBC, box);
     }
 }
 
@@ -1233,7 +1233,7 @@ static void init_swapstate(
         matrix            box,
         int               ePBC)
 {
-    rvec      *x_pbc  = NULL; /* positions of the whole MD system with molecules made whole */
+    rvec      *x_pbc  = nullptr; /* positions of the whole MD system with molecules made whole */
     t_swapgrp *g;
     t_swap    *s;
 
@@ -1277,7 +1277,7 @@ static void init_swapstate(
         copy_rvecn(x, x_pbc, 0, mtop->natoms);
 
         /* This can only make individual molecules whole, not multimers */
-        do_pbc_mtop(NULL, ePBC, box, mtop, x_pbc);
+        do_pbc_mtop(nullptr, ePBC, box, mtop, x_pbc);
 
         /* Output the starting structure? */
         outputStartStructureIfWanted(mtop, x_pbc, ePBC, box);
@@ -1394,8 +1394,8 @@ void convertOldToNewGroupFormat(
      */
     int  nAnions    = 0;
     int  nCations   = 0;
-    int *indAnions  = NULL;
-    int *indCations = NULL;
+    int *indAnions  = nullptr;
+    int *indCations = nullptr;
     snew(indAnions, g->nat);
     snew(indCations, g->nat);
 
@@ -1556,7 +1556,7 @@ void init_swapcoords(
         }
     }
 
-    if (*swapstatePtr == NULL)
+    if (*swapstatePtr == nullptr)
     {
         snew(*swapstatePtr, 1);
     }
@@ -1709,7 +1709,7 @@ void init_swapcoords(
     }
     else
     {
-        s->fpout = NULL;
+        s->fpout = nullptr;
     }
 
     /* Prepare for parallel or serial run */
@@ -1720,7 +1720,7 @@ void init_swapcoords(
             g             = &(s->group[ig]);
             g->nat_loc    = 0;
             g->nalloc_loc = 0;
-            g->ind_loc    = NULL;
+            g->ind_loc    = nullptr;
         }
     }
     else
@@ -2030,8 +2030,8 @@ gmx_bool do_swapcoords(
     for (ig = eSwapFixedGrpNR; ig < s->ngrp; ig++)
     {
         g = &(s->group[ig]);
-        communicate_group_positions(cr, g->xc, NULL, NULL, FALSE,
-                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, NULL, NULL);
+        communicate_group_positions(cr, g->xc, nullptr, nullptr, FALSE,
+                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, nullptr, nullptr);
 
         /* Determine how many ions of this type each compartment contains */
         sortMoleculesIntoCompartments(g, cr, sc, box, step, s->fpout, bRerun, FALSE);
@@ -2057,8 +2057,8 @@ gmx_bool do_swapcoords(
         /* Since we here know that we have to perform ion/water position exchanges,
          * we now assemble the solvent positions */
         g = &(s->group[eGrpSolvent]);
-        communicate_group_positions(cr, g->xc, NULL, NULL, FALSE,
-                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, NULL, NULL);
+        communicate_group_positions(cr, g->xc, nullptr, nullptr, FALSE,
+                                    x, g->nat, g->nat_loc, g->ind_loc, g->c_ind_loc, nullptr, nullptr);
 
         /* Determine how many molecules of solvent each compartment contains */
         sortMoleculesIntoCompartments(g, cr, sc, box, step, s->fpout, bRerun, TRUE);
@@ -2144,7 +2144,7 @@ gmx_bool do_swapcoords(
             }
         }
 
-        if (s->fpout != NULL)
+        if (s->fpout != nullptr)
         {
             print_ionlist(s, t, "  # after swap");
         }
index 2b52c178a32c6f43df8d33d4a246ef9fd0900c7e..6fb0ad04de0f27c1b79585679bf46619b500c721 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -211,7 +211,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
             vi = v_inrange - dc*(i - i_inrange)*dx;
         }
 
-        if (table_v != NULL)
+        if (table_v != nullptr)
         {
             table_v[i] = vi;
         }
@@ -281,7 +281,7 @@ void table_spline3_fill_ewald_lr(real                                 *table_f,
     /* Currently the last value only contains half the force: double it */
     table_f[0] *= 2;
 
-    if (table_v != NULL && table_fdv0 != NULL)
+    if (table_v != nullptr && table_fdv0 != nullptr)
     {
         /* Copy to FDV0 table too. Allocation occurs in forcerec.c,
          * init_ewald_f_table().
@@ -609,7 +609,7 @@ static void read_tables(FILE *fp, const char *fn,
 {
     char    *libfn;
     char     buf[STRLEN];
-    double **yy = NULL, start, end, dx0, dx1, ssd, vm, vp, f, numf;
+    double **yy = nullptr, start, end, dx0, dx1, ssd, vm, vp, f, numf;
     int      k, i, nx, nx0 = 0, ny, nny, ns;
     gmx_bool bAllZero, bZeroV, bZeroF;
     double   tabscale;
@@ -1573,9 +1573,9 @@ t_forcetable *makeDispersionCorrectionTable(FILE *fp,
                                             t_forcerec *fr, real rtab,
                                             const char *tabfn)
 {
-    t_forcetable *dispersionCorrectionTable = NULL;
+    t_forcetable *dispersionCorrectionTable = nullptr;
 
-    if (tabfn == NULL)
+    if (tabfn == nullptr)
     {
         if (debug)
         {
index bd776b8b2274c449b5a8cd6b19e4308c9c387e7b..46757699746271b829c049a49ab2027b0cb399f5 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2006 David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -105,8 +105,8 @@ gmx_cycles_calibrate(double sampletime)
      *
      * We call gettimeofday an extra time at the start to avoid cache misses.
      */
-    gettimeofday(&t1, NULL);
-    gettimeofday(&t1, NULL);
+    gettimeofday(&t1, nullptr);
+    gettimeofday(&t1, nullptr);
     c1 = gmx_cycles_read();
 
     do
@@ -120,7 +120,7 @@ gmx_cycles_calibrate(double sampletime)
             d = d/(1.0+static_cast<double>(i));
         }
         /* Read the time again */
-        gettimeofday(&t2, NULL);
+        gettimeofday(&t2, nullptr);
         c2       = gmx_cycles_read();
         timediff = static_cast<double>(t2.tv_sec-t1.tv_sec)+(t2.tv_usec-t1.tv_usec)*1e-6;
     }
index 7b9ab440a2dfc5b3be1a631a298d571ea900782d..57fe28bfb336ec6c8aa43b4ca05c6be7492463af 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -138,20 +138,20 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
 
     if (!wallcycle_have_counter())
     {
-        return NULL;
+        return nullptr;
     }
 
     snew(wc, 1);
 
     wc->haveInvalidCount    = FALSE;
     wc->wc_barrier          = FALSE;
-    wc->wcc_all             = NULL;
+    wc->wcc_all             = nullptr;
     wc->wc_depth            = 0;
     wc->ewc_prev            = -1;
     wc->reset_counters      = resetstep;
 
 #if GMX_MPI
-    if (PAR(cr) && getenv("GMX_CYCLE_BARRIER") != NULL)
+    if (PAR(cr) && getenv("GMX_CYCLE_BARRIER") != nullptr)
     {
         if (fplog)
         {
@@ -163,7 +163,7 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
 #endif
 
     snew(wc->wcc, ewcNR);
-    if (getenv("GMX_CYCLE_ALL") != NULL)
+    if (getenv("GMX_CYCLE_ALL") != nullptr)
     {
         if (fplog)
         {
@@ -186,20 +186,20 @@ gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused
 
 void wallcycle_destroy(gmx_wallcycle_t wc)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
 
-    if (wc->wcc != NULL)
+    if (wc->wcc != nullptr)
     {
         sfree(wc->wcc);
     }
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         sfree(wc->wcc_all);
     }
-    if (wc->wcsc != NULL)
+    if (wc->wcsc != nullptr)
     {
         sfree(wc->wcsc);
     }
@@ -255,7 +255,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 {
     gmx_cycles_t cycle;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -273,7 +273,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 
     cycle              = gmx_cycles_read();
     wc->wcc[ewc].start = cycle;
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         wc->wc_depth++;
         if (ewc == ewcRUN)
@@ -289,7 +289,7 @@ void wallcycle_start(gmx_wallcycle_t wc, int ewc)
 
 void wallcycle_start_nocount(gmx_wallcycle_t wc, int ewc)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -302,7 +302,7 @@ double wallcycle_stop(gmx_wallcycle_t wc, int ewc)
 {
     gmx_cycles_t cycle, last;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return 0;
     }
@@ -364,7 +364,7 @@ void wallcycle_reset_all(gmx_wallcycle_t wc)
 {
     int i;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -423,7 +423,7 @@ static void subtract_cycles(wallcc_t *wcc, int ewc_main, int ewc_sub)
 
 void wallcycle_scale_by_num_threads(gmx_wallcycle_t wc, bool isPmeRank, int nthreads_pp, int nthreads_pme)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -487,7 +487,7 @@ WallcycleCounts wallcycle_sum(t_commrec *cr, gmx_wallcycle_t wc)
     int             i;
     int             nsum;
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         /* Default construction of std::array of non-class T can leave
            the values indeterminate, just like a C array, and icc
@@ -569,7 +569,7 @@ WallcycleCounts wallcycle_sum(t_commrec *cr, gmx_wallcycle_t wc)
         MPI_Allreduce(cycles, cycles_sum.data(), nsum, MPI_DOUBLE, MPI_SUM,
                       cr->mpi_comm_mysim);
 
-        if (wc->wcc_all != NULL)
+        if (wc->wcc_all != nullptr)
         {
             double *buf_all, *cyc_all;
 
@@ -721,7 +721,7 @@ void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int np
     char        buf[STRLEN];
     const char *hline = "-----------------------------------------------------------------------------";
 
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -809,7 +809,7 @@ void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int np
             tot_for_pp += cyc_sum[i];
         }
     }
-    if (wc->wcc_all != NULL)
+    if (wc->wcc_all != nullptr)
     {
         for (i = 0; i < ewcNR; i++)
         {
@@ -1015,7 +1015,7 @@ void wallcycle_print(FILE *fplog, const gmx::MDLogger &mdlog, int nnodes, int np
 
 extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return -1;
     }
@@ -1025,7 +1025,7 @@ extern gmx_int64_t wcycle_get_reset_counters(gmx_wallcycle_t wc)
 
 extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_counters)
 {
-    if (wc == NULL)
+    if (wc == nullptr)
     {
         return;
     }
@@ -1035,7 +1035,7 @@ extern void wcycle_set_reset_counters(gmx_wallcycle_t wc, gmx_int64_t reset_coun
 
 void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wc->wcsc[ewcs].start = gmx_cycles_read();
     }
@@ -1043,7 +1043,7 @@ void wallcycle_sub_start(gmx_wallcycle_t wc, int ewcs)
 
 void wallcycle_sub_start_nocount(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wallcycle_sub_start(wc, ewcs);
         wc->wcsc[ewcs].n--;
@@ -1052,7 +1052,7 @@ void wallcycle_sub_start_nocount(gmx_wallcycle_t wc, int ewcs)
 
 void wallcycle_sub_stop(gmx_wallcycle_t wc, int ewcs)
 {
-    if (useCycleSubcounters && wc != NULL)
+    if (useCycleSubcounters && wc != nullptr)
     {
         wc->wcsc[ewcs].c += gmx_cycles_read() - wc->wcsc[ewcs].start;
         wc->wcsc[ewcs].n++;
index d2fbd6998484feb45cb4c4d1e4616696946abd12..68a79f23421dcc9e7b906828acd27982fb8865ca 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -134,7 +134,7 @@ static void comp_tpx(const char *fn1, const char *fn2,
              * but it might be useful to keep t_topology comparison as an option.
              */
             top[0] = gmx_mtop_t_to_t_topology(&mtop[0], true);
-            cmp_top(stdout, &top[0], NULL, ftol, abstol);
+            cmp_top(stdout, &top[0], nullptr, ftol, abstol);
         }
     }
 }
@@ -386,7 +386,7 @@ void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real
     gmx_bool         bShowTimestep = TRUE, newline = FALSE;
     t_trxstatus     *status;
     gmx_mtop_t       mtop;
-    gmx_localtop_t  *top = NULL;
+    gmx_localtop_t  *top = nullptr;
     t_state          state;
     t_inputrec      *ir;
 
@@ -751,7 +751,7 @@ void chk_enx(const char *fn)
 {
     int            nre, fnr;
     ener_file_t    in;
-    gmx_enxnm_t   *enm = NULL;
+    gmx_enxnm_t   *enm = nullptr;
     t_enxframe    *fr;
     gmx_bool       bShowTStep;
     gmx_bool       timeSet;
@@ -840,18 +840,18 @@ int gmx_check(int argc, char *argv[])
         "consisting of a rough outline for a methods section for a paper."
     };
     t_filenm          fnm[] = {
-        { efTRX, "-f",  NULL, ffOPTRD },
-        { efTRX, "-f2",  NULL, ffOPTRD },
+        { efTRX, "-f",  nullptr, ffOPTRD },
+        { efTRX, "-f2",  nullptr, ffOPTRD },
         { efTPR, "-s1", "top1", ffOPTRD },
         { efTPR, "-s2", "top2", ffOPTRD },
-        { efTPS, "-c",  NULL, ffOPTRD },
-        { efEDR, "-e",  NULL, ffOPTRD },
+        { efTPS, "-c",  nullptr, ffOPTRD },
+        { efEDR, "-e",  nullptr, ffOPTRD },
         { efEDR, "-e2", "ener2", ffOPTRD },
-        { efNDX, "-n",  NULL, ffOPTRD },
-        { efTEX, "-m",  NULL, ffOPTWR }
+        { efNDX, "-n",  nullptr, ffOPTRD },
+        { efTEX, "-m",  nullptr, ffOPTWR }
     };
 #define NFILE asize(fnm)
-    const char       *fn1 = NULL, *fn2 = NULL, *tex = NULL;
+    const char       *fn1 = nullptr, *fn2 = nullptr, *tex = nullptr;
 
     gmx_output_env_t *oenv;
     static real       vdw_fac  = 0.8;
@@ -861,7 +861,7 @@ int gmx_check(int argc, char *argv[])
     static real       ftol     = 0.001;
     static real       abstol   = 0.001;
     static gmx_bool   bCompAB  = FALSE;
-    static char      *lastener = NULL;
+    static char      *lastener = nullptr;
     static t_pargs    pa[]     = {
         { "-vdwfac", FALSE, etREAL, {&vdw_fac},
           "Fraction of sum of VdW radii used as warning cutoff" },
@@ -882,7 +882,7 @@ int gmx_check(int argc, char *argv[])
     };
 
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -909,11 +909,11 @@ int gmx_check(int argc, char *argv[])
     {
         if (bCompAB)
         {
-            if (fn1 == NULL)
+            if (fn1 == nullptr)
             {
                 gmx_fatal(FARGS, "With -ab you need to set the -s1 option");
             }
-            fn2 = NULL;
+            fn2 = nullptr;
         }
         comp_tpx(fn1, fn2, bRMSD, ftol, abstol);
     }
index a81324d405fae49edf5aae7b3034320c05147c27..a2764f506b62f5649b8c7447e7898a0bae9928cc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -354,12 +354,12 @@ int gmx_convert_tpr(int argc, char *argv[])
     t_state           state;
     int               gnx;
     char             *grpname;
-    int              *index = NULL;
+    int              *index = nullptr;
     char              buf[200], buf2[200];
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTPR, NULL,  NULL,    ffREAD  },
-        { efNDX, NULL,  NULL,    ffOPTRD },
+        { efTPR, nullptr,  nullptr,    ffREAD  },
+        { efNDX, nullptr,  nullptr,    ffOPTRD },
         { efTPR, "-o",  "tprout", ffWRITE }
     };
 #define NFILE asize(fnm)
@@ -381,7 +381,7 @@ int gmx_convert_tpr(int argc, char *argv[])
 
     /* Parse the command line */
     if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
index 0c421ffd83c54e8b9b06d743c96c7c0b6ab633cc..0979763b0ac0ab483638cafa102476bd10afc2ca 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -94,12 +94,12 @@ static void list_tpx(const char *fn,
     read_tpx_state(fn,
                    ir,
                    &state,
-                   tpx.bTop ? &mtop : NULL);
+                   tpx.bTop ? &mtop : nullptr);
 
     if (mdpfn && tpx.bIr)
     {
         gp = gmx_fio_fopen(mdpfn, "w");
-        pr_inputrec(gp, 0, NULL, ir, TRUE);
+        pr_inputrec(gp, 0, nullptr, ir, TRUE);
         gmx_fio_fclose(gp);
     }
 
@@ -127,18 +127,18 @@ static void list_tpx(const char *fn,
                 pr_top(stdout, indent, "topology", &(top), bShowNumbers, bShowParameters);
             }
 
-            pr_rvecs(stdout, indent, "box", tpx.bBox ? state.box : NULL, DIM);
-            pr_rvecs(stdout, indent, "box_rel", tpx.bBox ? state.box_rel : NULL, DIM);
-            pr_rvecs(stdout, indent, "boxv", tpx.bBox ? state.boxv : NULL, DIM);
-            pr_rvecs(stdout, indent, "pres_prev", tpx.bBox ? state.pres_prev : NULL, DIM);
-            pr_rvecs(stdout, indent, "svir_prev", tpx.bBox ? state.svir_prev : NULL, DIM);
-            pr_rvecs(stdout, indent, "fvir_prev", tpx.bBox ? state.fvir_prev : NULL, DIM);
+            pr_rvecs(stdout, indent, "box", tpx.bBox ? state.box : nullptr, DIM);
+            pr_rvecs(stdout, indent, "box_rel", tpx.bBox ? state.box_rel : nullptr, DIM);
+            pr_rvecs(stdout, indent, "boxv", tpx.bBox ? state.boxv : nullptr, DIM);
+            pr_rvecs(stdout, indent, "pres_prev", tpx.bBox ? state.pres_prev : nullptr, DIM);
+            pr_rvecs(stdout, indent, "svir_prev", tpx.bBox ? state.svir_prev : nullptr, DIM);
+            pr_rvecs(stdout, indent, "fvir_prev", tpx.bBox ? state.fvir_prev : nullptr, DIM);
             /* leave nosehoover_xi in for now to match the tpr version */
             pr_doubles(stdout, indent, "nosehoover_xi", state.nosehoover_xi.data(), state.ngtc);
             /*pr_doubles(stdout,indent,"nosehoover_vxi",state.nosehoover_vxi,state.ngtc);*/
             /*pr_doubles(stdout,indent,"therm_integral",state.therm_integral,state.ngtc);*/
-            pr_rvecs(stdout, indent, "x", tpx.bX ? as_rvec_array(state.x.data()) : NULL, state.natoms);
-            pr_rvecs(stdout, indent, "v", tpx.bV ? as_rvec_array(state.v.data()) : NULL, state.natoms);
+            pr_rvecs(stdout, indent, "x", tpx.bX ? as_rvec_array(state.x.data()) : nullptr, state.natoms);
+            pr_rvecs(stdout, indent, "v", tpx.bV ? as_rvec_array(state.v.data()) : nullptr, state.natoms);
         }
 
         groups = &mtop.groups;
@@ -179,7 +179,7 @@ static void list_top(const char *fn)
 #define BUFLEN 256
     char      buf[BUFLEN];
     gmx_cpp_t handle;
-    char     *cppopts[] = { NULL };
+    char     *cppopts[] = { nullptr };
 
     status = cpp_open_file(fn, &handle, cppopts);
     if (status != 0)
@@ -229,10 +229,10 @@ static void list_trr(const char *fn)
         snew(v, trrheader.natoms);
         snew(f, trrheader.natoms);
         if (gmx_trr_read_frame_data(fpread, &trrheader,
-                                    trrheader.box_size ? box : NULL,
-                                    trrheader.x_size   ? x : NULL,
-                                    trrheader.v_size   ? v : NULL,
-                                    trrheader.f_size   ? f : NULL))
+                                    trrheader.box_size ? box : nullptr,
+                                    trrheader.x_size   ? x : nullptr,
+                                    trrheader.v_size   ? v : nullptr,
+                                    trrheader.f_size   ? f : nullptr))
         {
             sprintf(buf, "%s frame %d", fn, nframe);
             indent = 0;
@@ -350,16 +350,16 @@ static void list_tng(const char gmx_unused *fn)
 #ifdef GMX_USE_TNG
     tng_trajectory_t     tng;
     gmx_int64_t          nframe = 0;
-    gmx_int64_t          i, *block_ids = NULL, step, ndatablocks;
+    gmx_int64_t          i, *block_ids = nullptr, step, ndatablocks;
     gmx_bool             bOK;
-    real                *values = NULL;
+    real                *values = nullptr;
 
     gmx_tng_open(fn, 'r', &tng);
     gmx_print_tng_molecule_system(tng, stdout);
 
     bOK    = gmx_get_tng_data_block_types_of_next_frame(tng, -1,
                                                         0,
-                                                        NULL,
+                                                        nullptr,
                                                         &step, &ndatablocks,
                                                         &block_ids);
     do
@@ -392,7 +392,7 @@ static void list_tng(const char gmx_unused *fn)
     }
     while (gmx_get_tng_data_block_types_of_next_frame(tng, step,
                                                       0,
-                                                      NULL,
+                                                      nullptr,
                                                       &step,
                                                       &ndatablocks,
                                                       &block_ids));
@@ -429,7 +429,7 @@ void list_ene(const char *fn)
 {
     ener_file_t    in;
     gmx_bool       bCont;
-    gmx_enxnm_t   *enm = NULL;
+    gmx_enxnm_t   *enm = nullptr;
     t_enxframe    *fr;
     int            i, j, nre, b;
     char           buf[22];
@@ -557,12 +557,12 @@ void list_ene(const char *fn)
 static void list_mtx(const char *fn)
 {
     int                  nrow, ncol, i, j, k;
-    real                *full   = NULL, value;
-    gmx_sparsematrix_t * sparse = NULL;
+    real                *full   = nullptr, value;
+    gmx_sparsematrix_t * sparse = nullptr;
 
     gmx_mtxio_read(fn, &nrow, &ncol, &full, &sparse);
 
-    if (full == NULL)
+    if (full == nullptr)
     {
         snew(full, nrow*ncol);
         for (i = 0; i < nrow*ncol; i++)
@@ -613,13 +613,13 @@ int gmx_dump(int argc, char *argv[])
         "Position restraint output from -sys -s is broken"
     };
     t_filenm    fnm[] = {
-        { efTPR, "-s", NULL, ffOPTRD },
-        { efTRX, "-f", NULL, ffOPTRD },
-        { efEDR, "-e", NULL, ffOPTRD },
-        { efCPT, NULL, NULL, ffOPTRD },
-        { efTOP, "-p", NULL, ffOPTRD },
+        { efTPR, "-s", nullptr, ffOPTRD },
+        { efTRX, "-f", nullptr, ffOPTRD },
+        { efEDR, "-e", nullptr, ffOPTRD },
+        { efCPT, nullptr, nullptr, ffOPTRD },
+        { efTOP, "-p", nullptr, ffOPTRD },
         { efMTX, "-mtx", "hessian", ffOPTRD },
-        { efMDP, "-om", NULL, ffOPTWR }
+        { efMDP, "-om", nullptr, ffOPTWR }
     };
 #define NFILE asize(fnm)
 
index 0fda312f0d82f6b8e27810ca688fdf3296276c16..693d7d8bb5776cd00f445236c52789762d98a7b1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -178,8 +178,8 @@ static void add_prop(aprop_t *ap, gmx_residuetype_t *restype,
             srenew(ap->bAvail, ap->maxprop);
             for (i = ap->nprop; (i < ap->maxprop); i++)
             {
-                ap->atomnm[i] = NULL;
-                ap->resnm[i]  = NULL;
+                ap->atomnm[i] = nullptr;
+                ap->resnm[i]  = nullptr;
                 ap->value[i]  = 0;
                 ap->bAvail[i] = FALSE;
             }
@@ -317,7 +317,7 @@ void gmx_atomprop_destroy(gmx_atomprop_t aps)
     gmx_atomprop *ap = (gmx_atomprop*) aps;
     int           p;
 
-    if (aps == NULL)
+    if (aps == nullptr)
     {
         printf("\nWARNING: gmx_atomprop_destroy called with a NULL pointer\n\n");
         return;
@@ -335,7 +335,7 @@ void gmx_atomprop_destroy(gmx_atomprop_t aps)
 
 static void vdw_warning(FILE *fp)
 {
-    if (NULL != fp)
+    if (nullptr != fp)
     {
         fprintf(fp, "NOTE: From version 5.0 %s uses the Van der Waals radii\n",
                 gmx::getProgramContext().displayName());
@@ -414,7 +414,7 @@ char *gmx_atomprop_element(gmx_atomprop_t aps, int atomnumber)
             return ap->prop[epropElement].atomnm[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 int gmx_atomprop_atomnumber(gmx_atomprop_t aps, const char *elem)
index c23339aed64440fb43537cae01254b2aa5664c5e..72b504596a6d25bfc85b6d14213ddc14817d03c2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/utility/txtdump.h"
 
 const char *ptype_str[eptNR+1] = {
-    "Atom", "Nucleus", "Shell", "Bond", "VSite", NULL
+    "Atom", "Nucleus", "Shell", "Bond", "VSite", nullptr
 };
 
 void init_atom(t_atoms *at)
 {
     at->nr          = 0;
     at->nres        = 0;
-    at->atom        = NULL;
-    at->resinfo     = NULL;
-    at->atomname    = NULL;
-    at->atomtype    = NULL;
-    at->atomtypeB   = NULL;
-    at->pdbinfo     = NULL;
+    at->atom        = nullptr;
+    at->resinfo     = nullptr;
+    at->atomname    = nullptr;
+    at->atomtype    = nullptr;
+    at->atomtypeB   = nullptr;
+    at->pdbinfo     = nullptr;
     at->haveMass    = FALSE;
     at->haveCharge  = FALSE;
     at->haveType    = FALSE;
@@ -74,11 +74,11 @@ void init_atom(t_atoms *at)
 void init_atomtypes(t_atomtypes *at)
 {
     at->nr         = 0;
-    at->radius     = NULL;
-    at->vol        = NULL;
-    at->atomnumber = NULL;
-    at->gb_radius  = NULL;
-    at->S_hct      = NULL;
+    at->radius     = nullptr;
+    at->vol        = nullptr;
+    at->atomnumber = nullptr;
+    at->gb_radius  = nullptr;
+    at->S_hct      = nullptr;
 }
 
 void done_atom(t_atoms *at)
@@ -111,33 +111,33 @@ void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra)
     {
         srenew(atoms->atomname, atoms->nr+natom_extra);
         srenew(atoms->atom, atoms->nr+natom_extra);
-        if (NULL != atoms->pdbinfo)
+        if (nullptr != atoms->pdbinfo)
         {
             srenew(atoms->pdbinfo, atoms->nr+natom_extra);
         }
-        if (NULL != atoms->atomtype)
+        if (nullptr != atoms->atomtype)
         {
             srenew(atoms->atomtype, atoms->nr+natom_extra);
         }
-        if (NULL != atoms->atomtypeB)
+        if (nullptr != atoms->atomtypeB)
         {
             srenew(atoms->atomtypeB, atoms->nr+natom_extra);
         }
         for (i = atoms->nr; (i < atoms->nr+natom_extra); i++)
         {
-            atoms->atomname[i] = NULL;
+            atoms->atomname[i] = nullptr;
             memset(&atoms->atom[i], 0, sizeof(atoms->atom[i]));
-            if (NULL != atoms->pdbinfo)
+            if (nullptr != atoms->pdbinfo)
             {
                 std::memset(&atoms->pdbinfo[i], 0, sizeof(atoms->pdbinfo[i]));
             }
-            if (NULL != atoms->atomtype)
+            if (nullptr != atoms->atomtype)
             {
-                atoms->atomtype[i] = NULL;
+                atoms->atomtype[i] = nullptr;
             }
-            if (NULL != atoms->atomtypeB)
+            if (nullptr != atoms->atomtypeB)
             {
-                atoms->atomtypeB[i] = NULL;
+                atoms->atomtypeB[i] = nullptr;
             }
         }
         atoms->nr += natom_extra;
@@ -158,8 +158,8 @@ void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo)
     atoms->nr   = natoms;
     atoms->nres = 0;
     snew(atoms->atomname, natoms);
-    atoms->atomtype  = NULL;
-    atoms->atomtypeB = NULL;
+    atoms->atomtype  = nullptr;
+    atoms->atomtypeB = nullptr;
     snew(atoms->resinfo, natoms);
     snew(atoms->atom, natoms);
     atoms->haveMass    = FALSE;
@@ -173,7 +173,7 @@ void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo)
     }
     else
     {
-        atoms->pdbinfo = NULL;
+        atoms->pdbinfo = nullptr;
     }
 }
 
@@ -195,36 +195,36 @@ t_atoms *copy_t_atoms(const t_atoms *src)
     int      i;
 
     snew(dst, 1);
-    init_t_atoms(dst, src->nr, (NULL != src->pdbinfo));
+    init_t_atoms(dst, src->nr, (nullptr != src->pdbinfo));
     dst->nr = src->nr;
-    if (NULL != src->atomname)
+    if (nullptr != src->atomname)
     {
         snew(dst->atomname, src->nr);
     }
-    if (NULL != src->atomtype)
+    if (nullptr != src->atomtype)
     {
         snew(dst->atomtype, src->nr);
     }
-    if (NULL != src->atomtypeB)
+    if (nullptr != src->atomtypeB)
     {
         snew(dst->atomtypeB, src->nr);
     }
     for (i = 0; (i < src->nr); i++)
     {
         dst->atom[i] = src->atom[i];
-        if (NULL != src->pdbinfo)
+        if (nullptr != src->pdbinfo)
         {
             dst->pdbinfo[i] = src->pdbinfo[i];
         }
-        if (NULL != src->atomname)
+        if (nullptr != src->atomname)
         {
             dst->atomname[i]  = src->atomname[i];
         }
-        if (NULL != src->atomtype)
+        if (nullptr != src->atomtype)
         {
             dst->atomtype[i] = src->atomtype[i];
         }
-        if (NULL != src->atomtypeB)
+        if (nullptr != src->atomtypeB)
         {
             dst->atomtypeB[i] = src->atomtypeB[i];
         }
@@ -245,7 +245,7 @@ void t_atoms_set_resinfo(t_atoms *atoms, int atom_ind, t_symtab *symtab,
 
     ri           = &atoms->resinfo[atoms->atom[atom_ind].resind];
     ri->name     = put_symtab(symtab, resname);
-    ri->rtp      = NULL;
+    ri->rtp      = nullptr;
     ri->nr       = resnr;
     ri->ic       = ic;
     ri->chainnum = chainnum;
@@ -380,7 +380,7 @@ void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real a
     {
         for (i = 0; (i < a1->nr); i++)
         {
-            cmp_atom(fp, i, &(a1->atom[i]), NULL, ftol, abstol);
+            cmp_atom(fp, i, &(a1->atom[i]), nullptr, ftol, abstol);
         }
     }
 }
index 4d7f7711889d7a0bea54c45df11d0f5cee0cd302..281c6666c13646cc13176f9006c59c08c0a103ac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,7 +74,7 @@ AtomsBuilder::~AtomsBuilder()
 
 char **AtomsBuilder::symtabString(char **source)
 {
-    if (symtab_ != NULL)
+    if (symtab_ != nullptr)
     {
         return put_symtab(symtab_, *source);
     }
@@ -268,7 +268,7 @@ void AtomsRemover::removeMarkedElements(std::vector<real> *container) const
 void AtomsRemover::removeMarkedAtoms(t_atoms *atoms) const
 {
     const int    originalAtomCount = atoms->nr;
-    AtomsBuilder builder(atoms, NULL);
+    AtomsBuilder builder(atoms, nullptr);
     if (atoms->nr > 0)
     {
         builder.setNextResidueNumber(atoms->resinfo[0].nr);
index 0d09f5e4de2ea5cca833d158c4cd0ef4bc78523e..73c7e47cbbaabb17dec2e52f7ad45eb71081474c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,7 +61,7 @@ void init_blocka(t_blocka *block)
     snew(block->index, block->nalloc_index);
     block->index[0]     = 0;
     block->nalloc_a     = 0;
-    block->a            = NULL;
+    block->a            = nullptr;
 }
 
 t_blocka *new_blocka(void)
@@ -87,8 +87,8 @@ void done_blocka(t_blocka *block)
     block->nra   = 0;
     sfree(block->index);
     sfree(block->a);
-    block->index        = NULL;
-    block->a            = NULL;
+    block->index        = nullptr;
+    block->a            = nullptr;
     block->nalloc_index = 0;
     block->nalloc_a     = 0;
 }
index ace7395591bca39e5118ae29a4b5d8fc76f791ba..4d148ce2cb13a68e6727cdae1e0474fbf2b4e811 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -229,8 +229,8 @@ typedef struct {
 static void analyse_other(const char ** restype, const t_atoms *atoms,
                           t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
-    restp_t *restp = NULL;
-    char   **attp  = NULL;
+    restp_t *restp = nullptr;
+    char   **attp  = nullptr;
     char    *rname, *aname;
     int     *aid, *aaid;
     int      i, j, k, l, resind, naid, naaid, natp, nrestp = 0;
@@ -331,7 +331,7 @@ static void analyse_other(const char ** restype, const t_atoms *atoms,
                         }
                     }
                     sfree(attp);
-                    attp = NULL;
+                    attp = nullptr;
                 }
             }
             sfree(aid);
@@ -388,7 +388,7 @@ static void analyse_prot(const char ** restype, const t_atoms *atoms,
     };
 
     static const t_gmx_help_make_index_group constructing_data[] =
-    {{ NULL,   0, "Protein",      TRUE,  -1, -1},
+    {{ nullptr,   0, "Protein",      TRUE,  -1, -1},
      { pnoh,   asize(pnoh),   "Protein-H",    TRUE,  0,  -1},
      { calpha, asize(calpha), "C-alpha",      FALSE, -1, -1},
      { bb,     asize(bb),     "Backbone",     FALSE, -1, -1},
@@ -569,7 +569,7 @@ static void analyse_prot(const char ** restype, const t_atoms *atoms,
 
 void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
-    gmx_residuetype_t*rt = NULL;
+    gmx_residuetype_t*rt = nullptr;
     char             *resnm;
     int              *aid;
     const char    **  restype;
@@ -600,7 +600,7 @@ void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_
 
     snew(restype, atoms->nres);
     ntypes     = 0;
-    p_typename = NULL;
+    p_typename = nullptr;
     if (atoms->nres > 0)
     {
         int i = 0;
@@ -765,10 +765,10 @@ t_blocka *init_index(const char *gfile, char ***grpname)
     in = gmx_ffopen(gfile, "r");
     snew(b, 1);
     b->nr      = 0;
-    b->index   = NULL;
+    b->index   = nullptr;
     b->nra     = 0;
-    b->a       = NULL;
-    *grpname   = NULL;
+    b->a       = nullptr;
+    *grpname   = nullptr;
     maxentries = 0;
     while (get_a_line(in, line, STRLEN))
     {
@@ -800,7 +800,7 @@ t_blocka *init_index(const char *gfile, char ***grpname)
                     srenew(b->a, maxentries);
                 }
                 assert(b->a != NULL); // for clang analyzer
-                b->a[i] = strtol(str, NULL, 10)-1;
+                b->a[i] = strtol(str, nullptr, 10)-1;
                 b->index[b->nr]++;
                 (b->nra)++;
                 pt = strstr(pt, str)+strlen(str);
@@ -888,7 +888,7 @@ int find_group(const char *s, int ngrps, char **grpname)
             strcpy(string, grpname[i]);
             upstring(string);
             minstring(string);
-            if (strstr(string, key) != NULL)
+            if (strstr(string, key) != nullptr)
             {
                 if (aa != -1)
                 {
@@ -1020,12 +1020,12 @@ void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], int *index[], char *grpnames[])
 {
     char    ***gnames;
-    t_blocka  *grps = NULL;
+    t_blocka  *grps = nullptr;
     int       *grpnr;
 
     snew(grpnr, ngrps);
     snew(gnames, 1);
-    if (fnm != NULL)
+    if (fnm != nullptr)
     {
         grps = init_index(fnm, gnames);
     }
index 6a8b69fe4752d2d8b171fc9741f8cbfcacd0a2f4..1d892ab1790233ef33f4b2b51e3940ff84ea3ebb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -129,7 +129,7 @@ mtopGetAtomParameters(const gmx_mtop_t  *mtop,
 {
     int atomIndexInMolecule;
     mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
-                         NULL, &atomIndexInMolecule);
+                         nullptr, &atomIndexInMolecule);
     const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
     return moltype.atoms.atom[atomIndexInMolecule];
 }
@@ -236,7 +236,7 @@ mtopGetResidueInfo(const gmx_mtop_t  *mtop,
 {
     int atomIndexInMolecule;
     mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
-                         NULL, &atomIndexInMolecule);
+                         nullptr, &atomIndexInMolecule);
     const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
     const int            resind  = moltype.atoms.atom[atomIndexInMolecule].resind;
     return moltype.atoms.resinfo[resind];
@@ -261,7 +261,7 @@ mtopGetAtomPdbInfo(const gmx_mtop_t  *mtop,
 {
     int atomIndexInMolecule;
     mtopGetMolblockIndex(mtop, globalAtomIndex, moleculeBlock,
-                         NULL, &atomIndexInMolecule);
+                         nullptr, &atomIndexInMolecule);
     const gmx_moltype_t &moltype = mtop->moltype[mtop->molblock[*moleculeBlock].type];
     GMX_ASSERT(moltype.atoms.havePdbInfo, "PDB information not present when requested");
     return moltype.atoms.pdbinfo[atomIndexInMolecule];
index 9df64226446f4badaefae13c6194e74177c3f06d..52b1305bd3cac1a54e502ab82eaf42ac9f228edc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -121,7 +121,7 @@ void gmx_mtop_finalize(gmx_mtop_t *mtop)
     }
 
     env = getenv("GMX_MAXRESRENUM");
-    if (env != NULL)
+    if (env != nullptr)
     {
         sscanf(env, "%d", &mtop->maxres_renum);
     }
@@ -251,7 +251,7 @@ static void gmx_mtop_atomloop_all_destroy(gmx_mtop_atomloop_all_t aloop)
 gmx_bool gmx_mtop_atomloop_all_next(gmx_mtop_atomloop_all_t aloop,
                                     int *at_global, const t_atom **atom)
 {
-    if (aloop == NULL)
+    if (aloop == nullptr)
     {
         gmx_incons("gmx_mtop_atomloop_all_next called without calling gmx_mtop_atomloop_all_init");
     }
@@ -340,7 +340,7 @@ static void gmx_mtop_atomloop_block_destroy(gmx_mtop_atomloop_block_t aloop)
 gmx_bool gmx_mtop_atomloop_block_next(gmx_mtop_atomloop_block_t aloop,
                                       const t_atom **atom, int *nmol)
 {
-    if (aloop == NULL)
+    if (aloop == nullptr)
     {
         gmx_incons("gmx_mtop_atomloop_all_next called without calling gmx_mtop_atomloop_all_init");
     }
@@ -392,7 +392,7 @@ static void gmx_mtop_ilistloop_destroy(gmx_mtop_ilistloop_t iloop)
 gmx_bool gmx_mtop_ilistloop_next(gmx_mtop_ilistloop_t iloop,
                                  t_ilist **ilist_mol, int *nmol)
 {
-    if (iloop == NULL)
+    if (iloop == nullptr)
     {
         gmx_incons("gmx_mtop_ilistloop_next called without calling gmx_mtop_ilistloop_init");
     }
@@ -451,7 +451,7 @@ gmx_bool gmx_mtop_ilistloop_all_next(gmx_mtop_ilistloop_all_t iloop,
                                      t_ilist **ilist_mol, int *atnr_offset)
 {
 
-    if (iloop == NULL)
+    if (iloop == nullptr)
     {
         gmx_incons("gmx_mtop_ilistloop_all_next called without calling gmx_mtop_ilistloop_all_init");
     }
@@ -857,9 +857,9 @@ static void gen_local_top(const gmx_mtop_t *mtop,
     idef->atnr                    = ffp->atnr;
     idef->functype                = ffp->functype;
     idef->iparams                 = ffp->iparams;
-    idef->iparams_posres          = NULL;
+    idef->iparams_posres          = nullptr;
     idef->iparams_posres_nalloc   = 0;
-    idef->iparams_fbposres        = NULL;
+    idef->iparams_fbposres        = nullptr;
     idef->iparams_fbposres_nalloc = 0;
     idef->fudgeQQ                 = ffp->fudgeQQ;
     idef->cmap_grid               = ffp->cmap_grid;
@@ -871,7 +871,7 @@ static void gen_local_top(const gmx_mtop_t *mtop,
     {
         idef->il[ftype].nr     = 0;
         idef->il[ftype].nalloc = 0;
-        idef->il[ftype].iatoms = NULL;
+        idef->il[ftype].iatoms = nullptr;
     }
 
     natoms = 0;
index 50485b318f8c0c1365945114c4019d39802fbdb9..b7d189f4cceff51fddec45a41ca7ae9a840e64ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,8 +66,8 @@ gmx_residuetype_init(gmx_residuetype_t **prt)
     *prt = rt;
 
     rt->n        = 0;
-    rt->resname  = NULL;
-    rt->restype  = NULL;
+    rt->resname  = nullptr;
+    rt->restype  = nullptr;
 
     db = libopen("residuetypes.dat");
 
@@ -158,7 +158,7 @@ gmx_residuetype_get_alltypes(gmx_residuetype_t   *rt,
                              int *                ntypes)
 {
     int          n           = 0;
-    const char **my_typename = NULL;
+    const char **my_typename = nullptr;
 
     if (rt->n > 0)
     {
@@ -280,6 +280,6 @@ gmx_residuetype_get_name(gmx_residuetype_t *rt, int index)
     }
     else
     {
-        return NULL;
+        return nullptr;
     }
 }
index 5d3c5c30c5bb3f9517a765c9707de93ff946c870..55d3a59d47e343ae1dc4eaaaa996efeb496ded2a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -100,7 +100,7 @@ int lookup_symtab(t_symtab *symtab, char **name)
 
     base   = 0;
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         const int index = name-symbuf->buf;
         if ( ( index >= 0 ) && ( index < symbuf->bufsize ) )
@@ -122,7 +122,7 @@ char **get_symtab_handle(t_symtab *symtab, int name)
     t_symbuf *symbuf;
 
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         if (name < symbuf->bufsize)
         {
@@ -135,7 +135,7 @@ char **get_symtab_handle(t_symtab *symtab, int name)
         }
     }
     gmx_fatal(FARGS, "symtab get_symtab_handle %d not found", name);
-    return NULL;
+    return nullptr;
 }
 
 static t_symbuf *new_symbuf(void)
@@ -145,7 +145,7 @@ static t_symbuf *new_symbuf(void)
     snew(symbuf, 1);
     symbuf->bufsize = TABLESIZE;
     snew(symbuf->buf, symbuf->bufsize);
-    symbuf->next = NULL;
+    symbuf->next = nullptr;
 
     return symbuf;
 }
@@ -156,7 +156,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
     t_symbuf    *symbuf;
     gmx_bool     bCont;
 
-    if (symtab->symbuf == NULL)
+    if (symtab->symbuf == nullptr)
     {
         symtab->symbuf = new_symbuf();
     }
@@ -166,7 +166,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
     {
         for (i = 0; (i < symbuf->bufsize); i++)
         {
-            if (symbuf->buf[i] == NULL)
+            if (symbuf->buf[i] == nullptr)
             {
                 symtab->nr++;
                 symbuf->buf[i] = gmx_strdup(name);
@@ -177,7 +177,7 @@ static char **enter_buf(t_symtab *symtab, char *name)
                 return &(symbuf->buf[i]);
             }
         }
-        if (symbuf->next != NULL)
+        if (symbuf->next != nullptr)
         {
             symbuf = symbuf->next;
             bCont  = TRUE;
@@ -207,7 +207,7 @@ char **put_symtab(t_symtab *symtab, const char *name)
 void open_symtab(t_symtab *symtab)
 {
     symtab->nr     = 0;
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
 }
 
 void close_symtab(t_symtab gmx_unused *symtab)
@@ -221,7 +221,7 @@ void done_symtab(t_symtab *symtab)
 
     close_symtab(symtab);
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         for (i = 0; (i < symbuf->bufsize) && (i < symtab->nr); i++)
         {
@@ -233,7 +233,7 @@ void done_symtab(t_symtab *symtab)
         symbuf  = symbuf->next;
         sfree(freeptr);
     }
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
     if (symtab->nr != 0)
     {
         gmx_incons("Freeing symbol table (symtab) structure");
@@ -246,14 +246,14 @@ void free_symtab(t_symtab *symtab)
 
     close_symtab(symtab);
     symbuf = symtab->symbuf;
-    while (symbuf != NULL)
+    while (symbuf != nullptr)
     {
         symtab->nr -= std::min(symbuf->bufsize, symtab->nr);
         freeptr     = symbuf;
         symbuf      = symbuf->next;
         sfree(freeptr);
     }
-    symtab->symbuf = NULL;
+    symtab->symbuf = nullptr;
     if (symtab->nr != 0)
     {
         gmx_incons("Freeing symbol table (symtab) structure");
@@ -271,7 +271,7 @@ void pr_symtab(FILE *fp, int indent, const char *title, t_symtab *symtab)
         i      = 0;
         nr     = symtab->nr;
         symbuf = symtab->symbuf;
-        while (symbuf != NULL)
+        while (symbuf != nullptr)
         {
             for (j = 0; (j < symbuf->bufsize) && (j < nr); j++)
             {
index f113900e1364fc4a16b534b5de5581b7234588ec..29e04753394062963d6a8e707435dca993070684 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 const char *gtypes[egcNR+1] = {
     "T-Coupling", "Energy Mon.", "Acceleration", "Freeze",
-    "User1", "User2", "VCM", "Compressed X", "Or. Res. Fit", "QMMM", NULL
+    "User1", "User2", "VCM", "Compressed X", "Or. Res. Fit", "QMMM", nullptr
 };
 
 static void init_groups(gmx_groups_t *groups)
 {
     groups->ngrpname = 0;
-    groups->grpname  = NULL;
+    groups->grpname  = nullptr;
     for (int g = 0; g < egcNR; g++)
     {
-        groups->grps[g].nm_ind = NULL;
+        groups->grps[g].nm_ind = nullptr;
         groups->ngrpnr[g]      = 0;
-        groups->grpnr[g]       = NULL;
+        groups->grpnr[g]       = nullptr;
     }
 
 }
 
 void init_mtop(gmx_mtop_t *mtop)
 {
-    mtop->name         = NULL;
+    mtop->name         = nullptr;
     mtop->nmoltype     = 0;
-    mtop->moltype      = NULL;
+    mtop->moltype      = nullptr;
     mtop->nmolblock    = 0;
-    mtop->molblock     = NULL;
+    mtop->molblock     = nullptr;
     mtop->maxres_renum = 0;
     mtop->maxresnr     = -1;
     init_groups(&mtop->groups);
@@ -86,7 +86,7 @@ void init_mtop(gmx_mtop_t *mtop)
 
 void init_top(t_topology *top)
 {
-    top->name = NULL;
+    top->name = nullptr;
     init_atom(&(top->atoms));
     init_atomtypes(&(top->atomtypes));
     init_block(&top->cgs);
@@ -129,15 +129,15 @@ void done_gmx_groups_t(gmx_groups_t *g)
 
     for (i = 0; (i < egcNR); i++)
     {
-        if (NULL != g->grps[i].nm_ind)
+        if (nullptr != g->grps[i].nm_ind)
         {
             sfree(g->grps[i].nm_ind);
-            g->grps[i].nm_ind = NULL;
+            g->grps[i].nm_ind = nullptr;
         }
-        if (NULL != g->grpnr[i])
+        if (nullptr != g->grpnr[i])
         {
             sfree(g->grpnr[i]);
-            g->grpnr[i] = NULL;
+            g->grpnr[i] = nullptr;
         }
     }
     /* The contents of this array is in symtab, don't free it here */
@@ -173,7 +173,7 @@ void done_top(t_topology *top)
     for (int f = 0; f < F_NRE; ++f)
     {
         sfree(top->idef.il[f].iatoms);
-        top->idef.il[f].iatoms = NULL;
+        top->idef.il[f].iatoms = nullptr;
         top->idef.il[f].nalloc = 0;
     }
 
@@ -197,7 +197,7 @@ void done_top_mtop(t_topology *top, gmx_mtop_t *mtop)
             for (int f = 0; f < F_NRE; ++f)
             {
                 sfree(top->idef.il[f].iatoms);
-                top->idef.il[f].iatoms = NULL;
+                top->idef.il[f].iatoms = nullptr;
                 top->idef.il[f].nalloc = 0;
             }
             done_atom(&top->atoms);
@@ -583,8 +583,8 @@ void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, re
     }
     else
     {
-        cmp_idef(fp, &(t1->idef), NULL, ftol, abstol);
-        cmp_atoms(fp, &(t1->atoms), NULL, ftol, abstol);
+        cmp_idef(fp, &(t1->idef), nullptr, ftol, abstol);
+        cmp_atoms(fp, &(t1->atoms), nullptr, ftol, abstol);
     }
 }
 
@@ -612,7 +612,7 @@ void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
         }
         cmp_int(fp, "ngrpnr", i, g0->ngrpnr[i], g1->ngrpnr[i]);
         if (g0->ngrpnr[i] == g1->ngrpnr[i] && natoms0 == natoms1 &&
-            (g0->grpnr[i] != NULL || g1->grpnr[i] != NULL))
+            (g0->grpnr[i] != nullptr || g1->grpnr[i] != nullptr))
         {
             for (j = 0; j < natoms0; j++)
             {
index de8e9850a072b1697f3b4625bfb38b508ff08872..4c3a7e80cec9364a9d8e906361d3596a9b6a377f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -209,13 +209,13 @@ void gmx_sort_ilist_fe(t_idef *idef, const real *qA, const real *qB)
     t_iatom   *iabuf;
     int        iabuf_nalloc;
 
-    if (qB == NULL)
+    if (qB == nullptr)
     {
         qB = qA;
     }
 
     iabuf_nalloc = 0;
-    iabuf        = NULL;
+    iabuf        = nullptr;
 
     iparams = idef->iparams;
 
index 11b2fc2b14b3be6d2d58671a4dfb5a88848c6156..716368b9747e13f57e55187e20df19ed16789fc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -345,7 +345,7 @@ AbstractAnalysisData &TrajectoryAnalysisModule::datasetFromName(const char *name
 void TrajectoryAnalysisModule::registerBasicDataset(AbstractAnalysisData *data,
                                                     const char           *name)
 {
-    GMX_RELEASE_ASSERT(data != NULL, "Attempting to register NULL data");
+    GMX_RELEASE_ASSERT(data != nullptr, "Attempting to register NULL data");
     // TODO: Strong exception safety should be possible to implement.
     GMX_RELEASE_ASSERT(impl_->datasets_.find(name) == impl_->datasets_.end(),
                        "Duplicate data set name registered");
index 98759771d41fb60d9ed2de8bfb1c3be285b85287..4b1e935be6f6dac724448977dccd0a14cac54f14 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -186,7 +186,7 @@ TrajectoryAnalysisSettings::setHelpText(const ConstArrayRef<const char *> &help)
  */
 
 TopologyInformation::TopologyInformation()
-    : mtop_(NULL), top_(NULL), bTop_(false), xtop_(NULL), ePBC_(-1)
+    : mtop_(nullptr), top_(nullptr), bTop_(false), xtop_(nullptr), ePBC_(-1)
 {
     clear_mat(boxtop_);
 }
@@ -223,7 +223,7 @@ TopologyInformation::getTopologyConf(rvec **x, matrix box) const
     {
         if (!xtop_)
         {
-            *x = NULL;
+            *x = nullptr;
             GMX_THROW(APIError("Topology coordinates requested without setting efUseTopX"));
         }
         *x = xtop_;
index 0873d8a5a696ed5992f2e2d4c1222904716c6aeb..f886d0b87954f32ea2bc28133637a5d9a6fc7a34 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -254,7 +254,7 @@ class TopologyInformation
 {
     public:
         //! Returns true if a topology file was loaded.
-        bool hasTopology() const { return mtop_ != NULL; }
+        bool hasTopology() const { return mtop_ != nullptr; }
         //! Returns true if a full topology file was loaded.
         bool hasFullTopology() const { return bTop_; }
         //! Returns the loaded topology, or NULL if not loaded.
index 71992a21f2878372a804138a500a4787716e9ade..77c348ce583c6d252e08040822e4474fee1da6ec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,7 +128,7 @@ int RunnerModule::run()
     module_->initAfterFirstFrame(settings_, common_.frame());
 
     t_pbc  pbc;
-    t_pbc *ppbc = settings_.hasPBC() ? &pbc : NULL;
+    t_pbc *ppbc = settings_.hasPBC() ? &pbc : nullptr;
 
     int    nframes = 0;
     AnalysisDataParallelOptions         dataOptions;
@@ -138,7 +138,7 @@ int RunnerModule::run()
     {
         common_.initFrame();
         t_trxframe &frame = common_.frame();
-        if (ppbc != NULL)
+        if (ppbc != nullptr)
         {
             set_pbc(ppbc, topology.ePBC(), frame.box);
         }
@@ -151,7 +151,7 @@ int RunnerModule::run()
     }
     while (common_.readNextFrame());
     module_->finishFrames(pdata.get());
-    if (pdata.get() != NULL)
+    if (pdata.get() != nullptr)
     {
         pdata->finish();
     }
@@ -191,7 +191,7 @@ TrajectoryAnalysisCommandLineRunner::runAsMain(
     {
         return createModule(factory());
     };
-    return ICommandLineOptionsModule::runAsMain(argc, argv, NULL, NULL, runnerFactory);
+    return ICommandLineOptionsModule::runAsMain(argc, argv, nullptr, nullptr, runnerFactory);
 }
 
 // static
index 4304efd0a7732a587d9ebb3dde3a018c8e4af659..058e5329c617a98ce8ada6459f5399acf6b43ee6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -314,7 +314,7 @@ class Angle : public TrajectoryAnalysisModule
 };
 
 Angle::Angle()
-    : sel1info_(NULL), sel2info_(NULL),
+    : sel1info_(nullptr), sel2info_(nullptr),
       g1type_(Group1Type_Angle), g2type_(Group2Type_None),
       binWidth_(1.0), natoms1_(0), natoms2_(0)
 {
index a3988d03e3d7ef80536adc371bec1c0cc2b1e55b..c766073734ed8481b65175c85e04ef7be3b46467 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -334,7 +334,7 @@ Distance::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
             const SelectionPosition &p1 = sel[g].position(i);
             const SelectionPosition &p2 = sel[g].position(i+1);
             rvec                     dx;
-            if (pbc != NULL)
+            if (pbc != nullptr)
             {
                 pbc_dx(pbc, p2.x(), p1.x(), dx);
             }
index f639d3f6435eac114a23ae69049c92dfd7abdcd8..faa8078eec9cb512973abe6eee208bf1727646ad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -317,7 +317,7 @@ FreeVolume::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
     const Selection                     &sel  = pdata->parallelSelection(sel_);
     gmx::UniformRealDistribution<real>   dist;
 
-    GMX_RELEASE_ASSERT(NULL != pbc, "You have no periodic boundary conditions");
+    GMX_RELEASE_ASSERT(nullptr != pbc, "You have no periodic boundary conditions");
 
     // Analysis framework magic
     dh.startFrame(frnr, fr.time);
index eaff4344dca92e02044d0f818afe0495189364e4..de7116cac63dec5fc9d68f1b1bb04e520748843c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2006, The GROMACS development team.
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -217,7 +217,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
         srenew(atoms->resinfo, r0+1);
         atoms->atom[i0].resind = r0;
         t_atoms_set_resinfo(atoms, i0, symtab, resnm, r0+1, ' ', 0, ' ');
-        if (atoms->pdbinfo != NULL)
+        if (atoms->pdbinfo != nullptr)
         {
             srenew(atoms->pdbinfo, atoms->nr+ndots);
         }
@@ -234,7 +234,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
             xnew[ii0][XX]              = dots[k++];
             xnew[ii0][YY]              = dots[k++];
             xnew[ii0][ZZ]              = dots[k++];
-            if (atoms->pdbinfo != NULL)
+            if (atoms->pdbinfo != nullptr)
             {
                 atoms->pdbinfo[ii0].type   = epdbATOM;
                 atoms->pdbinfo[ii0].atomnr = ii0;
@@ -244,7 +244,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
         }
         atoms->nr   = i0+ndots;
         atoms->nres = r0+1;
-        write_sto_conf(fn, title, atoms, xnew, NULL, ePBC, const_cast<rvec *>(box));
+        write_sto_conf(fn, title, atoms, xnew, nullptr, ePBC, const_cast<rvec *>(box));
         atoms->nres = r0;
         atoms->nr   = i0;
     }
@@ -268,7 +268,7 @@ void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *at
             aaa.pdbinfo[ii0].occup  = 0.0;
         }
         aaa.nr = ndots;
-        write_sto_conf(fn, title, &aaa, xnew, NULL, ePBC, const_cast<rvec *>(box));
+        write_sto_conf(fn, title, &aaa, xnew, nullptr, ePBC, const_cast<rvec *>(box));
         do_conect(fn, ndots, xnew);
         done_atom(&aaa);
     }
@@ -394,7 +394,7 @@ class Sasa : public TrajectoryAnalysisModule
 };
 
 Sasa::Sasa()
-    : solsize_(0.14), ndots_(24), dgsDefault_(0), bIncludeSolute_(true), top_(NULL)
+    : solsize_(0.14), ndots_(24), dgsDefault_(0), bIncludeSolute_(true), top_(nullptr)
 {
     //minarea_ = 0.5;
     registerAnalysisDataset(&area_, "area");
@@ -924,7 +924,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
     // surfacedots contains nsurfacedots entries, and contains the actual
     // points.
     real  totarea, totvolume;
-    real *area = NULL, *surfacedots = NULL;
+    real *area = nullptr, *surfacedots = nullptr;
     int   nsurfacedots;
     calculator_.calculate(surfaceSel.coordinates().data(), pbc,
                           frameData.index_.size(), frameData.index_.data(), flag,
@@ -932,7 +932,7 @@ Sasa::analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
                           &surfacedots, &nsurfacedots);
     // Unpack the atomwise areas into the frameData.atomAreas_ array for easier
     // indexing in the case of dynamic surfaceSel.
-    if (area != NULL)
+    if (area != nullptr)
     {
         if (surfaceSel.isDynamic())
         {
index f84fc44e49659c67d8ebeac477173f12379e8a2b..3137b8ddac0219c91dbc26491456fe1b84ed5ebf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -137,7 +137,7 @@ class IndexFileWriterModule : public AnalysisDataModuleSerial
  */
 
 IndexFileWriterModule::IndexFileWriterModule()
-    : fp_(NULL), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
+    : fp_(nullptr), currentGroup_(-1), currentSize_(0), bAnyWritten_(false)
 {
 }
 
@@ -150,10 +150,10 @@ IndexFileWriterModule::~IndexFileWriterModule()
 
 void IndexFileWriterModule::closeFile()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         gmx_fio_fclose(fp_);
-        fp_ = NULL;
+        fp_ = nullptr;
     }
 }
 
@@ -197,7 +197,7 @@ void IndexFileWriterModule::frameStarted(const AnalysisDataFrameHeader & /*heade
 void
 IndexFileWriterModule::pointsAdded(const AnalysisDataPointSetRef &points)
 {
-    if (fp_ == NULL)
+    if (fp_ == nullptr)
     {
         return;
     }
@@ -245,7 +245,7 @@ void IndexFileWriterModule::frameFinished(const AnalysisDataFrameHeader & /*head
 
 void IndexFileWriterModule::dataFinished()
 {
-    if (fp_ != NULL)
+    if (fp_ != nullptr)
     {
         std::fprintf(fp_, "\n");
     }
@@ -322,7 +322,7 @@ class Select : public TrajectoryAnalysisModule
 Select::Select()
     : bTotNorm_(false), bFracNorm_(false), bResInd_(false),
       bCumulativeLifetimes_(true), resNumberType_(ResidueNumbering_ByNumber),
-      pdbAtoms_(PdbAtomsSelection_All), top_(NULL),
+      pdbAtoms_(PdbAtomsSelection_All), top_(nullptr),
       occupancyModule_(new AnalysisDataAverageModule()),
       lifetimeModule_(new AnalysisDataLifetimeModule())
 {
@@ -723,7 +723,7 @@ Select::writeOutput()
             case PdbAtomsSelection_All:
             {
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe(status, &fr, NULL);
+                write_trxframe(status, &fr, nullptr);
                 close_trx(status);
                 break;
             }
@@ -739,7 +739,7 @@ Select::writeOutput()
                                                  atomIndicesSet.end());
                 t_trxstatus      *status = open_trx(fnPDB_.c_str(), "w");
                 write_trxframe_indexed(status, &fr, allAtomIndices.size(),
-                                       allAtomIndices.data(), NULL);
+                                       allAtomIndices.data(), nullptr);
                 close_trx(status);
                 break;
             }
@@ -754,7 +754,7 @@ Select::writeOutput()
                     }
                 }
                 t_trxstatus *status = open_trx(fnPDB_.c_str(), "w");
-                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), NULL);
+                write_trxframe_indexed(status, &fr, indices.size(), indices.data(), nullptr);
                 close_trx(status);
                 break;
             }
index 00aa76f12f5a800dd5b0358cb719314bb7d206b6..a3801082683f686731cadd8dcdf34aa491461aa8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -574,7 +574,7 @@ nsc_dclm_pbc(const rvec *coords, const ConstArrayRef<real> &radius, int nat,
         return;
     }
     real        area = 0.0, vol = 0.0;
-    real       *dots = NULL, *atom_area = NULL;
+    real       *dots = nullptr, *atom_area = nullptr;
     int         lfnr = 0, maxdots = 0;
     if (mode & FLAG_VOLUME)
     {
@@ -806,7 +806,7 @@ void SurfaceAreaCalculator::calculate(
 {
     flags |= impl_->flags_;
     *area  = 0;
-    if (volume == NULL)
+    if (volume == nullptr)
     {
         flags &= ~FLAG_VOLUME;
     }
@@ -814,23 +814,23 @@ void SurfaceAreaCalculator::calculate(
     {
         *volume = 0;
     }
-    if (at_area == NULL)
+    if (at_area == nullptr)
     {
         flags &= ~FLAG_ATOM_AREA;
     }
     else
     {
-        *at_area = NULL;
+        *at_area = nullptr;
     }
-    if (lidots == NULL)
+    if (lidots == nullptr)
     {
         flags &= ~FLAG_DOTS;
     }
     else
     {
-        *lidots = NULL;
+        *lidots = nullptr;
     }
-    if (n_dots == NULL)
+    if (n_dots == nullptr)
     {
         flags &= ~FLAG_DOTS;
     }
index e146c5e2d6d2f0292c88e8ad194b771dad783b92..38c74f1f96a40ef8ce813612047957f6e23b971f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -140,7 +140,7 @@ TrajectoryAnalysisRunnerCommon::Impl::Impl(TrajectoryAnalysisSettings *settings)
     : settings_(*settings),
       startTime_(0.0), endTime_(0.0), deltaTime_(0.0),
       bStartTimeSet_(false), bEndTimeSet_(false), bDeltaTimeSet_(false),
-      bTrajOpen_(false), fr(NULL), gpbc_(NULL), status_(NULL), oenv_(NULL)
+      bTrajOpen_(false), fr(nullptr), gpbc_(nullptr), status_(nullptr), oenv_(nullptr)
 {
 }
 
@@ -182,7 +182,7 @@ TrajectoryAnalysisRunnerCommon::Impl::initTopology(bool required)
     {
         snew(topInfo_.mtop_, 1);
         readConfAndTopology(topfile_.c_str(), &topInfo_.bTop_, topInfo_.mtop_,
-                            &topInfo_.ePBC_, &topInfo_.xtop_, NULL,
+                            &topInfo_.ePBC_, &topInfo_.xtop_, nullptr,
                             topInfo_.boxtop_);
         // TODO: Only load this here if the tool actually needs it; selections
         // take care of themselves.
@@ -199,7 +199,7 @@ TrajectoryAnalysisRunnerCommon::Impl::initTopology(bool required)
             && !settings_.hasFlag(TrajectoryAnalysisSettings::efUseTopX))
         {
             sfree(topInfo_.xtop_);
-            topInfo_.xtop_ = NULL;
+            topInfo_.xtop_ = nullptr;
         }
     }
 }
@@ -208,7 +208,7 @@ void
 TrajectoryAnalysisRunnerCommon::Impl::initFirstFrame()
 {
     // Return if we have already initialized the trajectory.
-    if (fr != NULL)
+    if (fr != nullptr)
     {
         return;
     }
@@ -302,10 +302,10 @@ TrajectoryAnalysisRunnerCommon::Impl::finishTrajectory()
         close_trx(status_);
         bTrajOpen_ = false;
     }
-    if (gpbc_ != NULL)
+    if (gpbc_ != nullptr)
     {
         gmx_rmpbc_done(gpbc_);
-        gpbc_ = NULL;
+        gpbc_ = nullptr;
     }
 }
 
@@ -464,7 +464,7 @@ TrajectoryAnalysisRunnerCommon::readNextFrame()
 void
 TrajectoryAnalysisRunnerCommon::initFrame()
 {
-    if (impl_->gpbc_ != NULL)
+    if (impl_->gpbc_ != nullptr)
     {
         gmx_rmpbc_trxfr(impl_->gpbc_, impl_->fr);
     }
@@ -488,7 +488,7 @@ TrajectoryAnalysisRunnerCommon::topologyInformation() const
 t_trxframe &
 TrajectoryAnalysisRunnerCommon::frame() const
 {
-    GMX_RELEASE_ASSERT(impl_->fr != NULL, "Frame not available when accessed");
+    GMX_RELEASE_ASSERT(impl_->fr != nullptr, "Frame not available when accessed");
     return *impl_->fr;
 }
 
index eccd685fe708c40fe7c46670bb4984bcef983ff9..d80e1b74caf44cd9e50a033b5570eff0bd6dc979 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -109,7 +109,7 @@ AbstractTrajectoryAnalysisModuleTestFixture::Impl::module()
 void
 AbstractTrajectoryAnalysisModuleTestFixture::Impl::ensureModuleCreated()
 {
-    if (module_.get() == NULL)
+    if (module_.get() == nullptr)
     {
         module_ = parent_.createModule();
         const std::vector<std::string>          &datasetNames(module_->datasetNames());
index f7607f6264913e1a20bf65873fb26fd2de0a8d9a..cdc64442bc29ef31fbb814a2239df83cf4adfc04 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,7 +71,7 @@ class SurfaceAreaTest : public ::testing::Test
     public:
         SurfaceAreaTest()
             : rng_(12345), area_(0.0), volume_(0.0),
-              atomArea_(NULL), dotCount_(0), dots_(NULL)
+              atomArea_(nullptr), dotCount_(0), dots_(nullptr)
         {
             clear_mat(box_);
         }
@@ -142,10 +142,10 @@ class SurfaceAreaTest : public ::testing::Test
         {
             volume_   = 0.0;
             sfree(atomArea_);
-            atomArea_ = NULL;
+            atomArea_ = nullptr;
             dotCount_ = 0;
             sfree(dots_);
-            dots_     = NULL;
+            dots_     = nullptr;
             t_pbc       pbc;
             if (bPBC)
             {
@@ -156,7 +156,7 @@ class SurfaceAreaTest : public ::testing::Test
                         gmx::SurfaceAreaCalculator calculator;
                         calculator.setDotCount(ndots);
                         calculator.setRadii(radius_);
-                        calculator.calculate(as_rvec_array(x_.data()), bPBC ? &pbc : NULL,
+                        calculator.calculate(as_rvec_array(x_.data()), bPBC ? &pbc : nullptr,
                                              index_.size(), index_.data(), flags,
                                              &area_, &volume_, &atomArea_,
                                              &dots_, &dotCount_);
@@ -176,11 +176,11 @@ class SurfaceAreaTest : public ::testing::Test
             {
                 compound.checkReal(volume_, "Volume");
             }
-            if (atomArea_ != NULL)
+            if (atomArea_ != nullptr)
             {
                 compound.checkSequenceArray(index_.size(), atomArea_, "AtomArea");
             }
-            if (dots_ != NULL)
+            if (dots_ != nullptr)
             {
                 if (checkDotCoordinates)
                 {
index 56d1b2e6743ee763978cebe0068de20abbd4018b..a86df70fb159ecc25f93b6242d90cb04853d4588 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -180,7 +180,7 @@ class AlignedAllocator
          *  \throws std::bad_alloc if the allocation fails.
          */
         pointer
-        allocate(std::size_t n, typename std::allocator<void>::const_pointer gmx_unused hint = 0)
+        allocate(std::size_t n, typename std::allocator<void>::const_pointer gmx_unused hint = nullptr)
         {
             void *p = internal::alignedMalloc(n*sizeof(T));
 
index 0538fb8f57fc8d222adaf2fd2bdc893bc9e4f1e9..2084f75102e2d7c36cd643c6d73500eda28247ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -167,7 +167,7 @@ class ArrayRef
         fromVector(typename std::vector<value_type>::iterator begin,
                    typename std::vector<value_type>::iterator end)
         {
-            value_type *p_begin = (begin != end) ? &*begin : NULL;
+            value_type *p_begin = (begin != end) ? &*begin : nullptr;
             value_type *p_end   = p_begin + (end-begin);
             return ArrayRef<value_type>(p_begin, p_end);
         }
@@ -183,7 +183,7 @@ class ArrayRef
          * used to initialize any ArrayRef, without specifying the template
          * type.  It is not explicit to enable that usage.
          */
-        ArrayRef(const EmptyArrayRef &) : begin_(NULL), end_(NULL) {}
+        ArrayRef(const EmptyArrayRef &) : begin_(nullptr), end_(nullptr) {}
         /*! \brief
          * Constructs a reference to a particular range.
          *
@@ -212,8 +212,8 @@ class ArrayRef
          * std::vector<T> to a method that takes ArrayRef.
          */
         ArrayRef(std::vector<T> &v)
-            : begin_((!v.empty()) ? &v[0] : NULL),
-              end_((!v.empty()) ? &v[0] + v.size() : NULL)
+            : begin_((!v.empty()) ? &v[0] : nullptr),
+              end_((!v.empty()) ? &v[0] + v.size() : nullptr)
         {
         }
         /*! \brief
@@ -408,7 +408,7 @@ class ConstArrayRef
         fromVector(typename std::vector<value_type>::const_iterator begin,
                    typename std::vector<value_type>::const_iterator end)
         {
-            const value_type *p_begin = (begin != end) ? &*begin : NULL;
+            const value_type *p_begin = (begin != end) ? &*begin : nullptr;
             const value_type *p_end   = p_begin + (end-begin);
             return ConstArrayRef<value_type>(p_begin, p_end);
         }
@@ -416,7 +416,7 @@ class ConstArrayRef
         /*! \brief
          * Constructs an empty reference.
          */
-        ConstArrayRef() : begin_(NULL), end_(NULL) {}
+        ConstArrayRef() : begin_(nullptr), end_(nullptr) {}
         /*! \brief
          * Constructs an empty reference.
          *
@@ -424,7 +424,7 @@ class ConstArrayRef
          * used to initialize any Const ArrayRef, without specifying the
          * template type.  It is not explicit to enable that usage.
          */
-        ConstArrayRef(const EmptyArrayRef &) : begin_(NULL), end_(NULL) {}
+        ConstArrayRef(const EmptyArrayRef &) : begin_(nullptr), end_(nullptr) {}
         /*! \brief
          * Constructs a const reference from a non-const reference.
          */
@@ -457,8 +457,8 @@ class ConstArrayRef
          * std::vector<T> to a method that takes ConstArrayRef.
          */
         ConstArrayRef(const std::vector<T> &v)
-            : begin_((!v.empty()) ? &v[0] : NULL),
-              end_((!v.empty()) ? &v[0] + v.size() : NULL)
+            : begin_((!v.empty()) ? &v[0] : nullptr),
+              end_((!v.empty()) ? &v[0] + v.size() : nullptr)
         {
         }
         /*! \brief
index 61986b561be890b76068a1bbf147dbc3f14668a8..b53ced9680a83a944b570f04dede43dd25c51c0c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -65,7 +65,7 @@ bool beCool(void)
      * a mutex for locking the variable...
      */
 #if GMX_COOL_QUOTES
-    return (getenv("GMX_NO_QUOTES") == NULL);
+    return (getenv("GMX_NO_QUOTES") == nullptr);
 #else
     /*be uncool*/
     return false;
index c9b906d0739edcc19f3dfeebe2fa87fe4aa8051a..d28c4820a09483c8e8083c90248c58f43b6e6acf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,11 +79,11 @@ int continuing(char *s)
 char *fgets2(char *line, int n, FILE *stream)
 {
     char *c;
-    if (fgets(line, n, stream) == NULL)
+    if (fgets(line, n, stream) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
-    if ((c = strchr(line, '\n')) != NULL)
+    if ((c = strchr(line, '\n')) != nullptr)
     {
         *c = '\0';
     }
@@ -98,7 +98,7 @@ char *fgets2(char *line, int n, FILE *stream)
             gmx_fatal(FARGS, "An input file contains a line longer than %d characters, while the buffer passed to fgets2 has size %d. The line starts with: '%20.20s'", n, n, line);
         }
     }
-    if ((c = strchr(line, '\r')) != NULL)
+    if ((c = strchr(line, '\r')) != nullptr)
     {
         *c = '\0';
     }
@@ -116,7 +116,7 @@ void strip_comment (char *line)
     }
 
     /* search for a comment mark and replace it by a zero */
-    if ((c = strchr(line, COMMENTSIGN)) != NULL)
+    if ((c = strchr(line, COMMENTSIGN)) != nullptr)
     {
         (*c) = 0;
     }
@@ -136,7 +136,7 @@ void ltrim (char *str)
 {
     int   i, c;
 
-    if (NULL == str)
+    if (nullptr == str)
     {
         return;
     }
@@ -160,7 +160,7 @@ void rtrim (char *str)
 {
     int nul;
 
-    if (NULL == str)
+    if (nullptr == str)
     {
         return;
     }
@@ -440,7 +440,7 @@ char *wrap_lines(const char *buf, int line_width, int indent, gmx_bool bIndentFi
      * the current line (where it also won't fit, but looks better)
      */
 
-    b2    = NULL;
+    b2    = nullptr;
     b2len = strlen(buf)+1+indent;
     snew(b2, b2len);
     i0 = i2 = 0;
@@ -544,14 +544,14 @@ char *gmx_step_str(gmx_int64_t i, char *buf)
 void parse_digits_from_string(const char *digitstring, int *ndigits, int **digitlist)
 {
     /* TODO use std::string, once gmx_gpu_opt_t is ready for it */
-    if (NULL == digitstring)
+    if (nullptr == digitstring)
     {
         *ndigits   = 0;
-        *digitlist = NULL;
+        *digitlist = nullptr;
         return;
     }
 
-    if (strstr(digitstring, ",") != NULL)
+    if (strstr(digitstring, ",") != nullptr)
     {
         parse_digits_from_csv_string(digitstring, ndigits, digitlist);
     }
@@ -565,10 +565,10 @@ void parse_digits_from_plain_string(const char *digitstring, int *ndigits, int *
 {
     int i;
 
-    if (NULL == digitstring)
+    if (nullptr == digitstring)
     {
         *ndigits   = 0;
-        *digitlist = NULL;
+        *digitlist = nullptr;
         return;
     }
 
@@ -589,10 +589,10 @@ void parse_digits_from_plain_string(const char *digitstring, int *ndigits, int *
 
 void parse_digits_from_csv_string(const char *digitstring, int *ndigits, int **digitlist)
 {
-    if (NULL == digitstring)
+    if (nullptr == digitstring)
     {
         *ndigits   = 0;
-        *digitlist = NULL;
+        *digitlist = nullptr;
         return;
     }
 
@@ -606,7 +606,7 @@ void parse_digits_from_csv_string(const char *digitstring, int *ndigits, int **d
             gmx_fatal(FARGS, "Invalid token in digit-only string: \"%s\"\n",
                       token.c_str());
         }
-        int number = static_cast<int>(str_to_int64_t(token.c_str(), NULL));
+        int number = static_cast<int>(str_to_int64_t(token.c_str(), nullptr));
         digits.push_back(number);
     }
 
index 598997ed33a020298abae4df8aba2853daa137a1..96eec7f501686a56727ab572b79d65c5fe02df2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,7 @@ class DataFileFinder::Impl
     public:
         static std::string getDefaultPath();
 
-        Impl() : envName_(NULL), bEnvIsSet_(false) {}
+        Impl() : envName_(nullptr), bEnvIsSet_(false) {}
 
         const char               *envName_;
         bool                      bEnvIsSet_;
@@ -125,7 +125,7 @@ FILE *DataFileFinder::openFile(const DataFileOptions &options) const
     std::string filename = findFile(options);
     if (filename.empty())
     {
-        return NULL;
+        return nullptr;
     }
 #if 0
     if (debug)
@@ -201,7 +201,7 @@ std::string DataFileFinder::findFile(const DataFileOptions &options) const
             message.append(defaultPath);
             message.append(" (default)");
         }
-        if (!bEnvIsSet && envName != NULL)
+        if (!bEnvIsSet && envName != nullptr)
         {
             message.append(
                     formatString("\nYou can set additional directories to search "
index 8ec23c6d890e0fb50cfa8364ca2f813fed8255a4..230f456be8bcdb8049633f3fc6587923cc9e9d8e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -163,7 +163,7 @@ class DirectoryEnumerator::Impl
         {
             errno       = 0;
             DIR *handle = opendir(dirname);
-            if (handle == NULL)
+            if (handle == nullptr)
             {
                 if (bThrow)
                 {
@@ -173,7 +173,7 @@ class DirectoryEnumerator::Impl
                                      dirname);
                     GMX_THROW_WITH_ERRNO(FileIOError(message), "opendir", code);
                 }
-                return NULL;
+                return nullptr;
             }
             return new Impl(handle);
         }
@@ -187,7 +187,7 @@ class DirectoryEnumerator::Impl
         {
             errno = 0;
             dirent *p = readdir(dirent_handle);
-            if (p == NULL)
+            if (p == nullptr)
             {
                 if (errno == 0)
                 {
@@ -266,7 +266,7 @@ DirectoryEnumerator::enumerateFilesWithExtension(
 DirectoryEnumerator::DirectoryEnumerator(const char *dirname, bool bThrow)
     : impl_(nullptr)
 {
-    GMX_RELEASE_ASSERT(dirname != NULL && dirname[0] != '\0',
+    GMX_RELEASE_ASSERT(dirname != nullptr && dirname[0] != '\0',
                        "Attempted to open empty/null directory path");
     impl_.reset(Impl::init(dirname, bThrow));
 }
index 2c8b21fb2b56191361b6bc62a4360a1a166a3059..1fc9d8b9cb2325d67af52979462090bd0faf3123 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,12 +76,12 @@ void printFatalErrorHeader(FILE *fp, const char *title,
 
     std::fprintf(fp, "\n-------------------------------------------------------\n");
     std::fprintf(fp, "Program:     %s, version %s\n", programName, gmx_version());
-    if (file != NULL)
+    if (file != nullptr)
     {
         std::fprintf(fp, "Source file: %s (line %d)\n",
                      Path::stripSourcePrefix(file), line);
     }
-    if (func != NULL)
+    if (func != nullptr)
     {
         std::fprintf(fp, "Function:    %s\n", func);
     }
index ed4a3fe1473adb77c9381739f1f0781fb6d0f70b..a90da61fbf7da22edfd0c40fed635c3a47c07470 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -191,7 +191,7 @@ GromacsException::GromacsException(const ExceptionInitializer &details)
 const char *GromacsException::what() const noexcept
 {
     const ErrorMessage *msg = getInfo<ExceptionInfoMessage>();
-    if (msg == NULL)
+    if (msg == nullptr)
     {
         return "No reason provided";
     }
@@ -205,7 +205,7 @@ const char *GromacsException::what() const noexcept
 void GromacsException::prependContext(const std::string &context)
 {
     const ErrorMessage *msg = getInfo<ExceptionInfoMessage>();
-    GMX_RELEASE_ASSERT(msg != NULL, "Message should always be set");
+    GMX_RELEASE_ASSERT(msg != nullptr, "Message should always be set");
     setInfo(ExceptionInfoMessage(msg->prependContext(context)));
 }
 
@@ -339,7 +339,7 @@ class MessageWriterFileNoThrow : public IMessageWriter
         {
             std::fprintf(fp_, "%*sReason: %s\n", indent, "",
                          std::strerror(errorNumber));
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 std::fprintf(fp_, "%*s(call to %s() returned error code %d)\n",
                              indent, "", funcName, errorNumber);
@@ -371,7 +371,7 @@ class MessageWriterTextWriter : public IMessageWriter
         {
             writer_->wrapperSettings().setIndent(indent);
             writer_->writeLine(formatString("Reason: %s", std::strerror(errorNumber)));
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 writer_->writeLine(
                         formatString("(call to %s() returned error code %d)",
@@ -411,7 +411,7 @@ class MessageWriterString : public IMessageWriter
         {
             writeLine(formatString("Reason: %s", std::strerror(errorNumber)).c_str(),
                       indent);
-            if (funcName != NULL)
+            if (funcName != nullptr)
             {
                 writeLine(formatString("(call to %s() returned error code %d)",
                                        funcName, errorNumber).c_str(),
@@ -439,7 +439,7 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
                                     const std::exception &ex, int indent)
 {
     const GromacsException *gmxEx = dynamic_cast<const GromacsException *>(&ex);
-    if (gmxEx != NULL)
+    if (gmxEx != nullptr)
     {
         // TODO: Add an option to print location information for the tests
 
@@ -453,15 +453,15 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
         bool                bAnythingWritten = false;
         // TODO: Remove duplicate context if present in multiple nested exceptions.
         const ErrorMessage *msg = gmxEx->getInfo<ExceptionInfoMessage>();
-        if (msg != NULL)
+        if (msg != nullptr)
         {
-            while (msg != NULL && msg->isContext())
+            while (msg != nullptr && msg->isContext())
             {
                 writer->writeLine(msg->text().c_str(), indent*2);
                 ++indent;
                 msg = &msg->child();
             }
-            if (msg != NULL && !msg->text().empty())
+            if (msg != nullptr && !msg->text().empty())
             {
                 writer->writeLine(msg->text().c_str(), indent*2);
                 bAnythingWritten = true;
@@ -474,19 +474,19 @@ void formatExceptionMessageInternal(IMessageWriter *writer,
         }
 
         const int *errorNumber = gmxEx->getInfo<ExceptionInfoErrno>();
-        if (errorNumber != NULL && *errorNumber != 0)
+        if (errorNumber != nullptr && *errorNumber != 0)
         {
             const char * const *funcName
                 = gmxEx->getInfo<ExceptionInfoApiFunction>();
             writer->writeErrNoInfo(*errorNumber,
-                                   funcName != NULL ? *funcName : NULL,
+                                   funcName != nullptr ? *funcName : nullptr,
                                    (indent+1)*2);
             bAnythingWritten = true;
         }
 
         const internal::NestedExceptionList *nested
             = gmxEx->getInfo<ExceptionInfoNestedExceptions>();
-        if (nested != NULL)
+        if (nested != nullptr)
         {
             internal::NestedExceptionList::const_iterator ni;
             for (ni = nested->begin(); ni != nested->end(); ++ni)
@@ -519,24 +519,24 @@ void printFatalErrorMessage(FILE *fp, const std::exception &ex)
     bool                    bPrintType = false;
     const GromacsException *gmxEx      = dynamic_cast<const GromacsException *>(&ex);
     // TODO: Treat more of the standard exceptions
-    if (gmxEx != NULL)
+    if (gmxEx != nullptr)
     {
         title = getErrorCodeString(gmxEx->errorCode());
     }
-    else if (dynamic_cast<const tMPI::system_error *>(&ex) != NULL)
+    else if (dynamic_cast<const tMPI::system_error *>(&ex) != nullptr)
     {
         title = "System error in thread synchronization";
     }
-    else if (dynamic_cast<const std::bad_alloc *>(&ex) != NULL)
+    else if (dynamic_cast<const std::bad_alloc *>(&ex) != nullptr)
     {
         title = "Memory allocation failed";
     }
-    else if (dynamic_cast<const std::logic_error *>(&ex) != NULL)
+    else if (dynamic_cast<const std::logic_error *>(&ex) != nullptr)
     {
         title      = "Standard library logic error (bug)";
         bPrintType = true;
     }
-    else if (dynamic_cast<const std::runtime_error *>(&ex) != NULL)
+    else if (dynamic_cast<const std::runtime_error *>(&ex) != nullptr)
     {
         title      = "Standard library runtime error (possible bug)";
         bPrintType = true;
index 1b16b1bea5027863e8f1e8f2ca76eff2537d2c9e..a47dd740a4d14a6f89ee5dcfa8e76fdae78e0d76 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 static bool                bDebug         = false;
 static tMPI_Thread_mutex_t where_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
 
-FILE                      *debug          = NULL;
+FILE                      *debug          = nullptr;
 gmx_bool                   gmx_debug_at   = FALSE;
 
-static FILE               *log_file       = NULL;
+static FILE               *log_file       = nullptr;
 static tMPI_Thread_mutex_t error_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
 
 void gmx_init_debug(const int dbglevel, const char *dbgfile)
@@ -105,9 +105,9 @@ void _where(const char *file, int line)
         if (bFirst) /* we repeat the check in the locked section because things
                        might have changed */
         {
-            if ((temp = getenv("GMX_PRINT_DEBUG_LINES")) != NULL)
+            if ((temp = getenv("GMX_PRINT_DEBUG_LINES")) != nullptr)
             {
-                nskip = strtol(temp, NULL, 10);
+                nskip = strtol(temp, nullptr, 10);
             }
             bFirst = FALSE;
         }
@@ -143,11 +143,11 @@ static void default_error_handler(const char *title, const char *msg,
 {
     if (log_file)
     {
-        gmx::internal::printFatalErrorHeader(log_file, title, NULL, file, line);
+        gmx::internal::printFatalErrorHeader(log_file, title, nullptr, file, line);
         gmx::internal::printFatalErrorMessageLine(log_file, msg, 0);
         gmx::internal::printFatalErrorFooter(log_file);
     }
-    gmx::internal::printFatalErrorHeader(stderr, title, NULL, file, line);
+    gmx::internal::printFatalErrorHeader(stderr, title, nullptr, file, line);
     gmx::internal::printFatalErrorMessageLine(stderr, msg, 0);
     gmx::internal::printFatalErrorFooter(stderr);
 }
@@ -180,7 +180,7 @@ static const char *gmx_strerror(const char *key)
         { "range",  "Range checking error" }
     };
 
-    if (key == NULL)
+    if (key == nullptr)
     {
         return "NULL error type (should not occur)";
     }
@@ -196,7 +196,7 @@ static const char *gmx_strerror(const char *key)
 
 static void call_error_handler(const char *key, const char *file, int line, const char *msg)
 {
-    if (msg == NULL)
+    if (msg == nullptr)
     {
         msg = "Empty gmx_fatal message (bug).";
     }
@@ -289,7 +289,7 @@ void _range_check(int n, int n_min, int n_max, const char *warn_str,
 
     if ((n < n_min) || (n >= n_max))
     {
-        if (warn_str != NULL)
+        if (warn_str != nullptr)
         {
             strcpy(buf, warn_str);
             strcat(buf, "\n");
index 5f245858a5662fd6a0bace6138f10771179ad668..b24f687b27a50b7546a37973ca6806ef1e7d72c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ bool readLineImpl(FILE *fp, std::string *line)
     std::string  result;
     char         buf[bufsize];
     buf[0] = '\0';
-    while (std::fgets(buf, bufsize, fp) != NULL)
+    while (std::fgets(buf, bufsize, fp) != nullptr)
     {
         const size_t length = std::strlen(buf);
         result.append(buf, length);
@@ -105,10 +105,10 @@ class FileStreamImpl
         {
         }
         FileStreamImpl(const char *filename, const char *mode)
-            : fp_(NULL), bClose_(true)
+            : fp_(nullptr), bClose_(true)
         {
             fp_ = std::fopen(filename, mode);
-            if (fp_ == NULL)
+            if (fp_ == nullptr)
             {
                 GMX_THROW_WITH_ERRNO(
                         FileIOError(formatString("Could not open file '%s'", filename)),
@@ -117,7 +117,7 @@ class FileStreamImpl
         }
         ~FileStreamImpl()
         {
-            if (fp_ != NULL && bClose_)
+            if (fp_ != nullptr && bClose_)
             {
                 if (std::fclose(fp_) != 0)
                 {
@@ -128,19 +128,19 @@ class FileStreamImpl
 
         FILE *handle()
         {
-            GMX_RELEASE_ASSERT(fp_ != NULL,
+            GMX_RELEASE_ASSERT(fp_ != nullptr,
                                "Attempted to access a file object that is not open");
             return fp_;
         }
 
         void close()
         {
-            GMX_RELEASE_ASSERT(fp_ != NULL,
+            GMX_RELEASE_ASSERT(fp_ != nullptr,
                                "Attempted to close a file object that is not open");
             GMX_RELEASE_ASSERT(bClose_,
                                "Attempted to close a file object that should not be");
             const bool bOk = (std::fclose(fp_) == 0);
-            fp_ = NULL;
+            fp_ = nullptr;
             if (!bOk)
             {
                 GMX_THROW_WITH_ERRNO(
@@ -192,7 +192,7 @@ StandardInputStream &StandardInputStream::instance()
 FILE *TextInputFile::openRawHandle(const char *filename)
 {
     FILE *fp = fopen(filename, "r");
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         GMX_THROW_WITH_ERRNO(
                 FileIOError(formatString("Could not open file '%s'", filename)),
index 0b5fe92cfed5f0069e297426d027504229075e0d..e64440789ff750fdd930fae8b0e867b1c04ab2a8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,7 +79,7 @@ typedef struct t_pstack {
     struct t_pstack *prev;
 } t_pstack;
 
-static t_pstack    *pstack           = NULL;
+static t_pstack    *pstack           = nullptr;
 static bool         bUnbuffered      = false;
 static int          s_maxBackupCount = 0;
 
@@ -99,7 +99,7 @@ const DataFileFinder  g_defaultLibFileFinder;
 
 const DataFileFinder &getLibraryFileFinder()
 {
-    if (g_libFileFinder != NULL)
+    if (g_libFileFinder != nullptr)
     {
         return *g_libFileFinder;
     }
@@ -123,10 +123,10 @@ void gmx_set_max_backup_count(int count)
     if (count < 0)
     {
         const char *env = getenv("GMX_MAXBACKUP");
-        if (env != NULL)
+        if (env != nullptr)
         {
             // TODO: Check that the value is converted properly.
-            count = strtol(env, NULL, 10);
+            count = strtol(env, nullptr, 10);
             if (count < 0)
             {
                 count = 0;
@@ -194,16 +194,16 @@ int gmx_ffclose(FILE *fp)
     tMPI_Thread_mutex_lock(&pstack_mutex);
 
     ps = pstack;
-    if (ps == NULL)
+    if (ps == nullptr)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             ret = fclose(fp);
         }
     }
     else if (ps->fp == fp)
     {
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             ret = pclose(fp);
         }
@@ -212,13 +212,13 @@ int gmx_ffclose(FILE *fp)
     }
     else
     {
-        while ((ps->prev != NULL) && (ps->prev->fp != fp))
+        while ((ps->prev != nullptr) && (ps->prev->fp != fp))
         {
             ps = ps->prev;
         }
-        if ((ps->prev != NULL) && ps->prev->fp == fp)
+        if ((ps->prev != nullptr) && ps->prev->fp == fp)
         {
-            if (ps->prev->fp != NULL)
+            if (ps->prev->fp != nullptr)
             {
                 ret = pclose(ps->prev->fp);
             }
@@ -228,7 +228,7 @@ int gmx_ffclose(FILE *fp)
         }
         else
         {
-            if (fp != NULL)
+            if (fp != nullptr)
             {
                 ret = fclose(fp);
             }
@@ -246,7 +246,7 @@ void frewind(FILE *fp)
     tMPI_Thread_mutex_lock(&pstack_mutex);
 
     t_pstack *ps = pstack;
-    while (ps != NULL)
+    while (ps != nullptr)
     {
         if (ps->fp == fp)
         {
@@ -317,7 +317,7 @@ static FILE *uncompress(const char *fn, const char *mode)
 
     sprintf(buf, "uncompress -c < %s", fn);
     fprintf(stderr, "Going to execute '%s'\n", buf);
-    if ((fp = popen(buf, mode)) == NULL)
+    if ((fp = popen(buf, mode)) == nullptr)
     {
         gmx_open(fn);
     }
@@ -333,7 +333,7 @@ static FILE *gunzip(const char *fn, const char *mode)
 
     sprintf(buf, "gunzip -c < %s", fn);
     fprintf(stderr, "Going to execute '%s'\n", buf);
-    if ((fp = popen(buf, mode)) == NULL)
+    if ((fp = popen(buf, mode)) == nullptr)
     {
         gmx_open(fn);
     }
@@ -346,12 +346,12 @@ gmx_bool gmx_fexist(const char *fname)
 {
     FILE *test;
 
-    if (fname == NULL)
+    if (fname == nullptr)
     {
         return FALSE;
     }
     test = fopen(fname, "r");
-    if (test == NULL)
+    if (test == nullptr)
     {
         /*Windows doesn't allow fopen of directory - so we need to check this seperately */
         #if GMX_NATIVE_WINDOWS
@@ -445,14 +445,14 @@ FILE *gmx_ffopen(const char *file, const char *mode)
 #ifdef SKIP_FFOPS
     return fopen(file, mode);
 #else
-    FILE    *ff = NULL;
-    char     buf[256], *bufsize = 0, *ptr;
+    FILE    *ff = nullptr;
+    char     buf[256], *bufsize = nullptr, *ptr;
     gmx_bool bRead;
     int      bs;
 
-    if (file == NULL)
+    if (file == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     if (mode[0] == 'w')
@@ -465,7 +465,7 @@ FILE *gmx_ffopen(const char *file, const char *mode)
     strcpy(buf, file);
     if (!bRead || gmx_fexist(buf))
     {
-        if ((ff = fopen(buf, mode)) == NULL)
+        if ((ff = fopen(buf, mode)) == nullptr)
         {
             gmx_file(buf);
         }
@@ -473,7 +473,7 @@ FILE *gmx_ffopen(const char *file, const char *mode)
         /* Check whether we should be using buffering (default) or not
          * (for debugging)
          */
-        if (bUnbuffered || ((bufsize = getenv("GMX_LOG_BUFFER")) != NULL))
+        if (bUnbuffered || ((bufsize = getenv("GMX_LOG_BUFFER")) != nullptr))
         {
             /* Check whether to use completely unbuffered */
             if (bUnbuffered)
@@ -482,11 +482,11 @@ FILE *gmx_ffopen(const char *file, const char *mode)
             }
             else
             {
-                bs = strtol(bufsize, NULL, 10);
+                bs = strtol(bufsize, nullptr, 10);
             }
             if (bs <= 0)
             {
-                setbuf(ff, NULL);
+                setbuf(ff, nullptr);
             }
             else
             {
@@ -539,7 +539,7 @@ char *low_gmxlibfn(const char *file, gmx_bool bAddCWD, gmx_bool bFatal)
         }
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    return NULL;
+    return nullptr;
 }
 
 FILE *low_libopen(const char *file, gmx_bool bFatal)
@@ -554,7 +554,7 @@ FILE *low_libopen(const char *file, gmx_bool bFatal)
         return fp;
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
-    return NULL;
+    return nullptr;
 }
 
 char *gmxlibfn(const char *file)
@@ -610,7 +610,7 @@ void gmx_tmpnam(char *buf)
 FILE *gmx_fopen_temporary(char *buf)
 {
     int   i, len;
-    FILE *fpout = NULL;
+    FILE *fpout = nullptr;
 
     if ((len = strlen(buf)) < 7)
     {
@@ -642,7 +642,7 @@ FILE *gmx_fopen_temporary(char *buf)
         gmx_fatal(FARGS, "Error creating temporary file %s: %s", buf,
                   strerror(errno));
     }
-    if ((fpout = fdopen(fd, "w")) == NULL)
+    if ((fpout = fdopen(fd, "w")) == nullptr)
     {
         gmx_fatal(FARGS, "Cannot open temporary file %s", buf);
     }
@@ -674,8 +674,8 @@ int gmx_file_copy(const char *oldname, const char *newname, gmx_bool copy_if_emp
 {
 /* the full copy buffer size: */
 #define FILECOPY_BUFSIZE (1<<16)
-    FILE *in  = NULL;
-    FILE *out = NULL;
+    FILE *in  = nullptr;
+    FILE *out = nullptr;
     char *buf;
 
     snew(buf, FILECOPY_BUFSIZE);
@@ -819,7 +819,7 @@ void gmx_getcwd(char *buffer, size_t size)
 #else
     char *pdum = getcwd(buffer, size);
 #endif
-    if (pdum == NULL)
+    if (pdum == nullptr)
     {
         gmx_fatal(FARGS, "Cannot get working directory. Reason: %s",
                   strerror(errno));
index 1b3ceccc129a4a15b7fa76e8b7360ba9d2d0aaeb..6dc2d2adafce571544729f6e35d4aa390e9a14f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -98,7 +98,7 @@ gmx_bool gmx_omp_check_thread_affinity(char **message)
 {
     bool shouldSetAffinity = true;
 
-    *message = NULL;
+    *message = nullptr;
 #if GMX_OPENMP
     /* We assume that the affinity setting is available on all platforms
      * gcc supports. Even if this is not the case (e.g. Mac OS) the user
@@ -112,7 +112,7 @@ gmx_bool gmx_omp_check_thread_affinity(char **message)
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     const char *const gomp_env            = getenv("GOMP_CPU_AFFINITY");
-    const bool        bGompCpuAffinitySet = (gomp_env != NULL);
+    const bool        bGompCpuAffinitySet = (gomp_env != nullptr);
 
     /* turn off internal pinning if GOMP_CPU_AFFINITY is set & non-empty */
     if (bGompCpuAffinitySet && *gomp_env != '\0')
index 87ccafa9b1be695a07bbb8310d7a8fbe8ff9bab2..a15a71b6db7cf0dadd4942c4f933a40195ebc334 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -88,7 +88,7 @@ class Regex::Impl
 
         bool match(const char *value) const
         {
-            int rc = regexec(&regex_, value, 0, NULL, 0);
+            int rc = regexec(&regex_, value, 0, nullptr, 0);
             if (rc != 0 && rc != REG_NOMATCH)
             {
                 // TODO: Handle errors.
index 2d1a595e6818a727b6ab6b4bd2718aea60acd311..8f4c8c8ee3b77121edbfb6efb66eac4739748c05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,7 +46,7 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn)
 
     i = static_cast<int>(step);
 
-    if (warn != NULL && (static_cast<gmx_int64_t>(i) != step))
+    if (warn != nullptr && (static_cast<gmx_int64_t>(i) != step))
     {
         fprintf(stderr, "\nWARNING during %s:\n", warn);
         fprintf(stderr, "int64 value ");
index f9f4f6d2759e69b5e95ae6f4ce575600dec1f7b5..4f52ec6045c181a8b9cf188b45d3e9c67a77b656 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -124,7 +124,7 @@ class LogWriteHelper
          * Note that the return value is unintuitively `false` when the target
          * is active, to allow implementing ::GMX_LOG like it is now.
          */
-        operator bool() const { return target_ == NULL; }
+        operator bool() const { return target_ == nullptr; }
 
         /*! \brief
          * Writes the entry from the given writer to the log target.
@@ -159,7 +159,7 @@ class LogLevelHelper
 
         // Both of the below should be explicit, once that works in CUDA.
         //! Returns whether the output for this log level goes anywhere.
-        operator bool() const { return target_ != NULL; }
+        operator bool() const { return target_ != nullptr; }
 
         //! Creates a helper for ::GMX_LOG.
         operator LogWriteHelper() const { return LogWriteHelper(target_); }
index c71f4fdb0313d04937e29971ff687f6284ff122a..1bf323f4c28f9349055f4477e520e6cbe54c33b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -418,7 +418,7 @@ std::vector<std::string> Path::getExecutablePaths()
     result.push_back("");
 #endif
     const char *path = std::getenv("PATH");
-    if (path != NULL)
+    if (path != nullptr)
     {
         splitPathEnvironment(path, &result);
     }
@@ -481,12 +481,12 @@ void File::throwOnNotFound(const NotFoundInfo &info)
 // static
 bool File::exists(const char *filename, NotFoundHandler onNotFound)
 {
-    if (filename == NULL)
+    if (filename == nullptr)
     {
         return false;
     }
     FILE *test = std::fopen(filename, "r");
-    if (test == NULL)
+    if (test == nullptr)
     {
         const bool   wasError = (errno != ENOENT && errno != ENOTDIR);
         NotFoundInfo info(filename, "The file could not be opened.",
@@ -512,7 +512,7 @@ bool File::exists(const char *filename, NotFoundHandler onNotFound)
         if (!S_ISREG(st_buf.st_mode))
         {
             NotFoundInfo info(filename, "The file is not a regular file.",
-                              NULL, true, 0);
+                              nullptr, true, 0);
             onNotFound(info);
             return false;
         }
index 8e6040fd54e15680cfb380fad2621ac470f971c1..98c12342e135470f4ce40de75b2207efee547128 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -384,7 +384,7 @@ void please_cite(FILE *fp, const char *key)
     char *title;
 #define LINE_WIDTH 79
 
-    if (fp == NULL)
+    if (fp == nullptr)
     {
         return;
     }
index 4de54036ab0948f8babc697f4be49ebe67a9e5ac..7ec9df222f87731e1f60a13ee3dbd6da77ad5589 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -88,7 +88,7 @@ const DefaultProgramContext    g_defaultContext;
 
 const IProgramContext &getProgramContext()
 {
-    if (g_programContext != NULL)
+    if (g_programContext != nullptr)
     {
         return *g_programContext;
     }
index 6a63bf225f43857a984686b22a2954ead4c47384..40fc08ae62cb9183df33ca39cff63854d73147b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -138,7 +138,7 @@ gmx_qsort(void *           base,
 
     cbase = (char *)base;
 
-    swaptype = (size_t)(cbase - (char *)0) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
+    swaptype = (size_t)(cbase - (char *)nullptr) % sizeof(int) || size % sizeof(int) ? 2 : size == sizeof(int) ? 0 : 1;
 
     if (nmemb < 7)
     {
index 2410b22149f63d373f263cdd6b3c71aa23e68bbd..699681faa63f16586b46e7ed31da4554f043cbba 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -120,14 +120,14 @@ void *save_malloc(const char *name, const char *file, int line, size_t size)
 {
     void *p;
 
-    p = NULL;
+    p = nullptr;
     if (size == 0)
     {
-        p = NULL;
+        p = nullptr;
     }
     else
     {
-        if ((p = malloc(size)) == NULL)
+        if ((p = malloc(size)) == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to malloc %" GMX_PRId64 " bytes for %s\n"
@@ -147,10 +147,10 @@ void *save_calloc(const char *name, const char *file, int line,
 {
     void *p;
 
-    p = NULL;
+    p = nullptr;
     if ((nelem == 0) || (elsize == 0))
     {
-        p = NULL;
+        p = nullptr;
     }
     else
     {
@@ -176,7 +176,7 @@ void *save_calloc(const char *name, const char *file, int line,
         }
         memset(p, 0, (size_t) (nelem * elsize));
 #else
-        if ((p = calloc((size_t)nelem, (size_t)elsize)) == NULL)
+        if ((p = calloc((size_t)nelem, (size_t)elsize)) == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to calloc %" GMX_PRId64
@@ -198,7 +198,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
     void  *p;
     size_t size = nelem*elsize;
 
-    p = NULL;
+    p = nullptr;
     if (size == 0)
     {
         save_free(name, file, line, ptr);
@@ -213,7 +213,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
                    size/1048576.0, name, file, line, rank);
         }
 #endif
-        if (ptr == NULL)
+        if (ptr == nullptr)
         {
             p = malloc((size_t)size);
         }
@@ -221,7 +221,7 @@ void *save_realloc(const char *name, const char *file, int line, void *ptr,
         {
             p = realloc(ptr, (size_t)size);
         }
-        if (p == NULL)
+        if (p == nullptr)
         {
             gmx_fatal(errno, __FILE__, __LINE__,
                       "Not enough memory. Failed to realloc %" GMX_PRId64 " bytes for %s, %s=%x\n"
@@ -240,7 +240,7 @@ void save_free(const char gmx_unused *name, const char gmx_unused *file, int gmx
 #ifdef DEBUG
     log_action(0, name, file, line, 0, 0, ptr);
 #endif
-    if (ptr != NULL)
+    if (ptr != nullptr)
     {
         free(ptr);
     }
@@ -300,7 +300,7 @@ void *save_calloc_aligned(const char *name, const char *file, int line,
                           size_t nelem, size_t elsize, size_t alignment)
 {
     void *aligned = save_malloc_aligned(name, file, line, nelem, elsize, alignment);
-    if (aligned != NULL)
+    if (aligned != nullptr)
     {
         memset(aligned, 0, (size_t)(nelem * elsize));
     }
index 0985d3c5bbbb4b353c117abcc2c342173b68dc52..5ea2fa3c1d5226fc1983e6b1e29757159dae5ac1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -97,13 +97,13 @@ gmx_bool get_header(char line[], char *header)
 
     std::strcpy(temp, line);
     dum = std::strchr(temp, '[');
-    if (dum == NULL)
+    if (dum == nullptr)
     {
         return FALSE;
     }
     dum[0] = ' ';
     dum    = std::strchr(temp, ']');
-    if (dum == NULL)
+    if (dum == nullptr)
     {
         gmx_fatal(FARGS, "header is not terminated on line:\n'%s'\n", line);
         return FALSE;
@@ -141,7 +141,7 @@ static int fget_lines(FILE *in, const char *db, char ***strings)
     char  *pret;
 
     pret = fgets(buf, STRLEN, in);
-    if (pret == NULL  || sscanf(buf, "%d", &nstr) != 1)
+    if (pret == nullptr  || sscanf(buf, "%d", &nstr) != 1)
     {
         gmx_warning("File is empty");
         gmx_ffclose(in);
index 1a1b1c1e224e4ef6e64da0e16aac0e13693e32dd..9b9cc1a2a12b5b4c2894939802ae0c6c0791ab5d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -105,7 +105,7 @@ bool endsWith(const char *str, const char *suffix)
 
 std::string stripSuffixIfPresent(const std::string &str, const char *suffix)
 {
-    if (suffix != NULL)
+    if (suffix != nullptr)
     {
         size_t suffixLength = std::strlen(suffix);
         if (suffixLength > 0 && endsWith(str, suffix))
@@ -247,7 +247,7 @@ std::string
 replaceInternal(const std::string &input, const char *from, const char *to,
                 bool bWholeWords)
 {
-    GMX_RELEASE_ASSERT(from != NULL && to != NULL,
+    GMX_RELEASE_ASSERT(from != nullptr && to != nullptr,
                        "Replacement strings must not be NULL");
     size_t      matchLength = std::strlen(from);
     std::string result;
@@ -352,7 +352,7 @@ TextLineWrapper::findNextLine(const char *input, size_t lineStart) const
     {
         const char *nextBreakPtr = std::strpbrk(input + lineEnd, " \n");
         size_t      nextBreak
-            = (nextBreakPtr != NULL ? nextBreakPtr - input : inputLength);
+            = (nextBreakPtr != nullptr ? nextBreakPtr - input : inputLength);
         if (nextBreak > lastAllowedBreakPoint && lineEnd > lineStart)
         {
             break;
index 592d517c7332731c16eff2e046b5d2252fbe1bb9..56beb1cc924b943ff9df132dd132b294fb1d2590 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -62,7 +62,7 @@ namespace gmx
  */
 static inline bool isNullOrEmpty(const char *str)
 {
-    return str == NULL || str[0] == '\0';
+    return str == nullptr || str[0] == '\0';
 }
 
 /*! \brief
index 374b3c04a47495afd43357179808cbbb8a216c2b..88a26d8696dc0c3a5ffc5b83486ccfd4178071cf 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -156,7 +156,7 @@ gmx_ctime_r(const time_t *clock, char *buf, size_t len)
 
 void gmx_format_current_time(char *buf, size_t len)
 {
-    time_t clock = time(NULL);
+    time_t clock = time(nullptr);
     gmx_ctime_r(&clock, buf, len);
 }
 
index 08a844d53bca90124447e143d1aa9edddb8e1ecb..e3c5d87ed0e5aa511d83a245c336ecb149192cf9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,7 +84,7 @@ TEST(StringUtilityTest, StartsWith)
 TEST(StringUtilityTest, EndsWith)
 {
     EXPECT_TRUE(gmx::endsWith("foobar", "bar"));
-    EXPECT_TRUE(gmx::endsWith("foobar", NULL));
+    EXPECT_TRUE(gmx::endsWith("foobar", nullptr));
     EXPECT_TRUE(gmx::endsWith("foobar", ""));
     EXPECT_TRUE(gmx::endsWith("", ""));
     EXPECT_FALSE(gmx::endsWith("", "foobar"));
@@ -96,7 +96,7 @@ TEST(StringUtilityTest, EndsWith)
 TEST(StringUtilityTest, StripSuffixIfPresent)
 {
     EXPECT_EQ("foo", gmx::stripSuffixIfPresent("foobar", "bar"));
-    EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", NULL));
+    EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", nullptr));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", ""));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", "bbar"));
     EXPECT_EQ("foobar", gmx::stripSuffixIfPresent("foobar", "barr"));
index bcb2b10d797e08044f43405166457eead0748bbe..a978b7ad200841ba200054be5e48ff1710d3abbc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,7 +66,7 @@ int available(FILE *fp, const void *p, int indent, const char *title)
         }
         fprintf(fp, "%s: not available\n", title);
     }
-    return (p != NULL);
+    return (p != nullptr);
 }
 
 int pr_title(FILE *fp, int indent, const char *title)
@@ -129,7 +129,7 @@ void pr_reals_of_dim(FILE *fp, int indent, const char *title, const real *vec, i
     const char *flong  = "%15.8e";
     const char *format;
 
-    if (getenv("GMX_PRINT_LONGFORMAT") != NULL)
+    if (getenv("GMX_PRINT_LONGFORMAT") != nullptr)
     {
         format = flong;
     }
index 10a6f64c342d2a66b6357c371aede70f1c737840..c39c2c4ae99548ad3e7373078e103d69d754d1d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -84,7 +84,7 @@ class ObsoleteToolModule : public gmx::ICommandLineModule
         }
         virtual const char *shortDescription() const
         {
-            return NULL;
+            return nullptr;
         }
 
         virtual void init(gmx::CommandLineModuleSettings * /*settings*/)
index 29d96431d32446f64a1deeac5eb3fa53e33502dc..63583b9055b0aef4351e2a0230e40ff8777eb5f3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -230,7 +230,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                   unsigned long Flags,
                   gmx_walltime_accounting_t walltime_accounting)
 {
-    gmx_mdoutf_t    outf = NULL;
+    gmx_mdoutf_t    outf = nullptr;
     gmx_int64_t     step, step_rel;
     double          elapsed_time;
     double          t, t0, lam0[efptNR];
@@ -250,15 +250,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     t_vcm            *vcm;
     matrix            parrinellorahmanMu, M;
     t_trxframe        rerun_fr;
-    gmx_repl_ex_t     repl_ex = NULL;
+    gmx_repl_ex_t     repl_ex = nullptr;
     int               nchkpt  = 1;
     gmx_localtop_t   *top;
-    t_mdebin         *mdebin   = NULL;
+    t_mdebin         *mdebin   = nullptr;
     gmx_enerdata_t   *enerd;
     PaddedRVecVector  f {};
     gmx_global_stat_t gstat;
-    gmx_update_t     *upd   = NULL;
-    t_graph          *graph = NULL;
+    gmx_update_t     *upd   = nullptr;
+    t_graph          *graph = nullptr;
     gmx_groups_t     *groups;
     gmx_ekindata_t   *ekind;
     gmx_shellfc_t    *shellfc;
@@ -266,7 +266,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     gmx_bool          bResetCountersHalfMaxH = FALSE;
     gmx_bool          bTemp, bPres, bTrotter;
     real              dvdl_constr;
-    rvec             *cbuf        = NULL;
+    rvec             *cbuf        = nullptr;
     int               cbuf_nalloc = 0;
     matrix            lastbox;
     int               lamnew  = 0;
@@ -282,7 +282,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
 
 
     /* PME load balancing data for GPU kernels */
-    pme_load_balancing_t *pme_loadbal      = NULL;
+    pme_load_balancing_t *pme_loadbal      = nullptr;
     gmx_bool              bPMETune         = FALSE;
     gmx_bool              bPMETunePrinting = FALSE;
 
@@ -444,7 +444,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                             state_global, top_global, ir,
                             state, &f, mdatoms, top, fr,
                             vsite, constr,
-                            nrnb, NULL, FALSE);
+                            nrnb, nullptr, FALSE);
         shouldCheckNumberOfBondedInteractions = true;
         update_realloc(upd, state->natoms);
     }
@@ -537,7 +537,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         if (vsite)
         {
             /* Construct the virtual sites for the initial configuration */
-            construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t, NULL,
+            construct_vsites(vsite, as_rvec_array(state->x.data()), ir->delta_t, nullptr,
                              top->idef.iparams, top->idef.il,
                              fr->ePBC, fr->bMolPBC, cr, state->box);
         }
@@ -577,7 +577,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
 
     bSumEkinhOld = FALSE;
     compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                    NULL, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
+                    nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                     constr, &nullSignaller, state->box,
                     &totalNumberOfBondedInteractions, &bSumEkinhOld, cglo_flags
                     | (shouldCheckNumberOfBondedInteractions ? CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS : 0));
@@ -593,9 +593,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
            perhaps loses some logic?*/
 
         compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                        NULL, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
+                        nullptr, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                         constr, &nullSignaller, state->box,
-                        NULL, &bSumEkinhOld,
+                        nullptr, &bSumEkinhOld,
                         cglo_flags &~(CGLO_STOPCM | CGLO_PRESSURE));
     }
 
@@ -795,7 +795,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         {
             /* PME grid + cut-off optimization with GPUs or PME nodes */
             pme_loadbal_do(pme_loadbal, cr,
-                           (bVerbose && MASTER(cr)) ? stderr : NULL,
+                           (bVerbose && MASTER(cr)) ? stderr : nullptr,
                            fplog, mdlog,
                            ir, fr, state,
                            wcycle,
@@ -999,7 +999,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
              * the full step kinetic energy and possibly for T-coupling.*/
             /* This may not be quite working correctly yet . . . . */
             compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                            wcycle, enerd, NULL, NULL, NULL, NULL, mu_tot,
+                            wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
                             constr, &nullSignaller, state->box,
                             &totalNumberOfBondedInteractions, &bSumEkinhOld,
                             CGLO_GSTAT | CGLO_TEMPERATURE | CGLO_CHECK_NUMBER_OF_BONDED_INTERACTIONS);
@@ -1095,7 +1095,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         if (EI_VV(ir->eI) && !startingFromCheckpoint && !bRerunMD)
         /*  ############### START FIRST UPDATE HALF-STEP FOR VV METHODS############### */
         {
-            rvec *vbuf = NULL;
+            rvec *vbuf = nullptr;
 
             wallcycle_start(wcycle, ewcUPDATE);
             if (ir->eI == eiVV && bInitStep)
@@ -1122,7 +1122,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             if (!bRerunMD || rerun_fr.bV || bForceUpdate)         /* Why is rerun_fr.bV here?  Unclear. */
             {
                 wallcycle_stop(wcycle, ewcUPDATE);
-                update_constraints(fplog, step, NULL, ir, mdatoms,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, &f,
                                    &top->idef, shake_vir,
                                    cr, nrnb, wcycle, upd, constr,
@@ -1193,7 +1193,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                     if (inputrecNvtTrotter(ir) && ir->eI == eiVV)
                     {
                         /* update temperature and kinetic energy now that step is over - this is the v(t+dt) point */
-                        enerd->term[F_TEMP] = sum_ekin(&(ir->opts), ekind, NULL, (ir->eI == eiVV), FALSE);
+                        enerd->term[F_TEMP] = sum_ekin(&(ir->opts), ekind, nullptr, (ir->eI == eiVV), FALSE);
                         enerd->term[F_EKIN] = trace(ekind->ekin);
                     }
                 }
@@ -1204,9 +1204,9 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                      * the full step kinetic energy and possibly for T-coupling.*/
                     /* This may not be quite working correctly yet . . . . */
                     compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
-                                    wcycle, enerd, NULL, NULL, NULL, NULL, mu_tot,
+                                    wcycle, enerd, nullptr, nullptr, nullptr, nullptr, mu_tot,
                                     constr, &nullSignaller, state->box,
-                                    NULL, &bSumEkinhOld,
+                                    nullptr, &bSumEkinhOld,
                                     CGLO_GSTAT | CGLO_TEMPERATURE);
                     wallcycle_start(wcycle, ewcUPDATE);
                 }
@@ -1356,7 +1356,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             /* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
             if (constr && bIfRandomize)
             {
-                update_constraints(fplog, step, NULL, ir, mdatoms,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, &f,
                                    &top->idef, tmp_vir,
                                    cr, nrnb, wcycle, upd, constr,
@@ -1434,7 +1434,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
                                 wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
                                 constr, &nullSignaller, lastbox,
-                                NULL, &bSumEkinhOld,
+                                nullptr, &bSumEkinhOld,
                                 (bGStat ? CGLO_GSTAT : 0) | CGLO_TEMPERATURE
                                 );
                 wallcycle_start(wcycle, ewcUPDATE);
@@ -1451,10 +1451,10 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                  * to numerical errors, or are they important
                  * physically? I'm thinking they are just errors, but not completely sure.
                  * For now, will call without actually constraining, constr=NULL*/
-                update_constraints(fplog, step, NULL, ir, mdatoms,
+                update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, &f,
                                    &top->idef, tmp_vir,
-                                   cr, nrnb, wcycle, upd, NULL,
+                                   cr, nrnb, wcycle, upd, nullptr,
                                    FALSE, bCalcVir);
             }
             if (EI_VV(ir->eI))
@@ -1486,10 +1486,10 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             unshift_self(graph, state->box, as_rvec_array(state->x.data()));
         }
 
-        if (vsite != NULL)
+        if (vsite != nullptr)
         {
             wallcycle_start(wcycle, ewcVSITECONSTR);
-            if (graph != NULL)
+            if (graph != nullptr)
             {
                 shift_self(graph, state->box, as_rvec_array(state->x.data()));
             }
@@ -1497,7 +1497,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                              top->idef.iparams, top->idef.il,
                              fr->ePBC, fr->bMolPBC, cr, state->box);
 
-            if (graph != NULL)
+            if (graph != nullptr)
             {
                 unshift_self(graph, state->box, as_rvec_array(state->x.data()));
             }
@@ -1600,7 +1600,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             if (fplog && do_log && bDoExpanded)
             {
                 /* only needed if doing expanded ensemble */
-                PrintFreeEnergyInfoToFile(fplog, ir->fepvals, ir->expandedvals, ir->bSimTemp ? ir->simtempvals : NULL,
+                PrintFreeEnergyInfoToFile(fplog, ir->fepvals, ir->expandedvals, ir->bSimTemp ? ir->simtempvals : nullptr,
                                           state_global->dfhist, state->fep_state, ir->nstlog, step);
             }
             if (bCalcEner)
@@ -1619,7 +1619,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             gmx_bool do_dr  = do_per_step(step, ir->nstdisreout);
             gmx_bool do_or  = do_per_step(step, ir->nstorireout);
 
-            print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : NULL,
+            print_ebin(mdoutf_get_fp_ene(outf), do_ene, do_dr, do_or, do_log ? fplog : nullptr,
                        step, t,
                        eprNORMAL, mdebin, fcd, groups, &(ir->opts));
 
@@ -1712,7 +1712,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
 
         /* #######  END SET VARIABLES FOR NEXT ITERATION ###### */
 
-        if ( (membed != NULL) && (!bLastStep) )
+        if ( (membed != nullptr) && (!bLastStep) )
         {
             rescale_membed(step_rel, membed, as_rvec_array(state_global->x.data()));
         }
@@ -1767,7 +1767,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                           "mdrun -resetstep.", step);
             }
             reset_all_counters(fplog, mdlog, cr, step, &step_rel, ir, wcycle, nrnb, walltime_accounting,
-                               use_GPU(fr->nbv) ? fr->nbv : NULL);
+                               use_GPU(fr->nbv) ? fr->nbv : nullptr);
             wcycle_set_reset_counters(wcycle, -1);
             if (!(cr->duty & DUTY_PME))
             {
index 1804ab4b3663d8865a739d2142702c938418cc54..2855d79eca430c0b9728ca6075be18ee7d623581 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -229,11 +229,11 @@ int gmx_mdrun(int argc, char *argv[])
     };
     t_commrec    *cr;
     t_filenm      fnm[] = {
-        { efTPR, NULL,      NULL,       ffREAD },
-        { efTRN, "-o",      NULL,       ffWRITE },
-        { efCOMPRESSED, "-x", NULL,     ffOPTWR },
-        { efCPT, "-cpi",    NULL,       ffOPTRD | ffALLOW_MISSING },
-        { efCPT, "-cpo",    NULL,       ffOPTWR },
+        { efTPR, nullptr,      nullptr,       ffREAD },
+        { efTRN, "-o",      nullptr,       ffWRITE },
+        { efCOMPRESSED, "-x", nullptr,     ffOPTWR },
+        { efCPT, "-cpi",    nullptr,       ffOPTRD | ffALLOW_MISSING },
+        { efCPT, "-cpo",    nullptr,       ffOPTWR },
         { efSTO, "-c",      "confout",  ffWRITE },
         { efEDR, "-e",      "ener",     ffWRITE },
         { efLOG, "-g",      "md",       ffWRITE },
@@ -256,7 +256,7 @@ int gmx_mdrun(int argc, char *argv[])
         { efLOG, "-rs",     "rotslabs", ffOPTWR },
         { efLOG, "-rt",     "rottorque", ffOPTWR },
         { efMTX, "-mtx",    "nm",       ffOPTWR },
-        { efRND, "-multidir", NULL,      ffOPTRDMULT},
+        { efRND, "-multidir", nullptr,      ffOPTRDMULT},
         { efDAT, "-membed", "membed",   ffOPTRD },
         { efTOP, "-mp",     "membed",   ffOPTRD },
         { efNDX, "-mn",     "membed",   ffOPTRD },
@@ -291,20 +291,20 @@ int gmx_mdrun(int argc, char *argv[])
 
     rvec              realddxyz                   = {0, 0, 0};
     const char       *ddrank_opt[ddrankorderNR+1] =
-    { NULL, "interleave", "pp_pme", "cartesian", NULL };
+    { nullptr, "interleave", "pp_pme", "cartesian", nullptr };
     const char       *dddlb_opt[] =
-    { NULL, "auto", "no", "yes", NULL };
+    { nullptr, "auto", "no", "yes", nullptr };
     const char       *thread_aff_opt[threadaffNR+1] =
-    { NULL, "auto", "on", "off", NULL };
+    { nullptr, "auto", "on", "off", nullptr };
     const char       *nbpu_opt[] =
-    { NULL, "auto", "cpu", "gpu", "gpu_cpu", NULL };
+    { nullptr, "auto", "cpu", "gpu", "gpu_cpu", nullptr };
     real              rdd                   = 0.0, rconstr = 0.0, dlb_scale = 0.8, pforce = -1;
-    char             *ddcsx                 = NULL, *ddcsy = NULL, *ddcsz = NULL;
+    char             *ddcsx                 = nullptr, *ddcsy = nullptr, *ddcsz = nullptr;
     real              cpt_period            = 15.0, max_hours = -1;
     gmx_bool          bTryToAppendFiles     = TRUE;
     gmx_bool          bKeepAndNumCPT        = FALSE;
     gmx_bool          bResetCountersHalfWay = FALSE;
-    gmx_output_env_t *oenv                  = NULL;
+    gmx_output_env_t *oenv                  = nullptr;
 
     /* Non transparent initialization of a complex gmx_hw_opt_t struct.
      * But unfortunately we are not allowed to call a function here,
@@ -312,7 +312,7 @@ int gmx_mdrun(int argc, char *argv[])
      */
     gmx_hw_opt_t    hw_opt = {
         0, 0, 0, 0, threadaffSEL, 0, 0,
-        { NULL, FALSE, 0, NULL }
+        { nullptr, FALSE, 0, nullptr }
     };
 
     t_pargs         pa[] = {
@@ -421,7 +421,7 @@ int gmx_mdrun(int argc, char *argv[])
     gmx_bool        bDoAppendFiles, bStartFromCpt;
     FILE           *fplog;
     int             rc;
-    char          **multidir = NULL;
+    char          **multidir = nullptr;
 
     cr = init_commrec();
 
@@ -448,7 +448,7 @@ int gmx_mdrun(int argc, char *argv[])
      */
 
     if (!parse_common_args(&argc, argv, PCA_Flags, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, NULL, &oenv))
+                           asize(desc), desc, 0, nullptr, &oenv))
     {
         sfree(cr);
         return 0;
@@ -535,7 +535,7 @@ int gmx_mdrun(int argc, char *argv[])
     }
     else
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
 
     ddxyz[XX] = (int)(realddxyz[XX] + 0.5);
index 38f7388c74aa8215e4975b773a80dad75fdbd4fd..0869b8e590eadd1aa265620ffa3cf8963d523267 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -726,7 +726,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
 
     for (i = 0; i < egcNR; i++)
     {
-        if (groups->grpnr[i] != NULL)
+        if (groups->grpnr[i] != nullptr)
         {
             groups->ngrpnr[i] = state->natoms;
             snew(new_egrp[i], state->natoms);
@@ -750,7 +750,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
         {
             for (j = 0; j < egcNR; j++)
             {
-                if (groups->grpnr[j] != NULL)
+                if (groups->grpnr[j] != nullptr)
                 {
                     new_egrp[j][i-rm] = groups->grpnr[j][i];
                 }
@@ -790,7 +790,7 @@ static void rm_group(gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state
 
     for (i = 0; i < egcNR; i++)
     {
-        if (groups->grpnr[i] != NULL)
+        if (groups->grpnr[i] != nullptr)
         {
             sfree(groups->grpnr[i]);
             groups->grpnr[i] = new_egrp[i];
@@ -908,7 +908,7 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
         if (buf[0] != ';')
         {
             strcpy(buf2, buf);
-            if ((temp = strchr(buf2, '\n')) != NULL)
+            if ((temp = strchr(buf2, '\n')) != nullptr)
             {
                 temp[0] = '\0';
             }
@@ -916,7 +916,7 @@ static void top_update(const char *topfile, rm_t *rm_p, gmx_mtop_t *mtop)
             if (buf2[0] == '[')
             {
                 buf2[0] = ' ';
-                if ((temp = strchr(buf2, '\n')) != NULL)
+                if ((temp = strchr(buf2, '\n')) != nullptr)
                 {
                     temp[0] = '\0';
                 }
@@ -1013,7 +1013,7 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
     int                       i, rm_bonded_at, fr_id, fr_i = 0, tmp_id, warn = 0;
     int                       ng, j, max_lip_rm, ins_grp_id, ntype, lip_rm;
     real                      prot_area;
-    rvec                     *r_ins = NULL;
+    rvec                     *r_ins = nullptr;
     t_block                  *ins_at, *rest_at;
     pos_ins_t                *pos_ins;
     mem_t                    *mem_p;
@@ -1022,8 +1022,8 @@ gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop
     gmx_bool                  bExcl = FALSE;
     t_atoms                   atoms;
     t_pbc                    *pbc;
-    char                    **piecename = NULL;
-    gmx_membed_t             *membed    = NULL;
+    char                    **piecename = nullptr;
+    gmx_membed_t             *membed    = nullptr;
 
     /* input variables */
     const char *membed_input;
index 83c1e43a23c5d774b827cc6f9ec397514c9f0b8d..1021f43966be5930bc9dc95a9362f57b5dc4cee4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -162,7 +162,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
 
     fprintf(fplog, "\nInitializing Replica Exchange\n");
 
-    if (ms == NULL || ms->nsim == 1)
+    if (ms == nullptr || ms->nsim == 1)
     {
         gmx_fatal(FARGS, "Nothing to exchange with only one replica, maybe you forgot to set the -multi option of mdrun?");
     }
@@ -620,7 +620,7 @@ static void print_ind(FILE *fplog, const char *leg, int n, int *ind, gmx_bool *b
     fprintf(fplog, "Repl %2s %2d", leg, ind[0]);
     for (i = 1; i < n; i++)
     {
-        fprintf(fplog, " %c %2d", (bEx != 0 && bEx[i]) ? 'x' : ' ', ind[i]);
+        fprintf(fplog, " %c %2d", (bEx != nullptr && bEx[i]) ? 'x' : ' ', ind[i]);
     }
     fprintf(fplog, "\n");
 }
@@ -1311,11 +1311,11 @@ void print_replica_exchange_statistics(FILE *fplog, struct gmx_repl_ex *re)
                 re->prob[i] =  re->prob_sum[i]/re->nattempt[i%2];
             }
         }
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_prob(fplog, "", re->nrepl, re->prob);
 
         fprintf(fplog, "Repl  number of exchanges:\n");
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_count(fplog, "", re->nrepl, re->nexchange);
 
         fprintf(fplog, "Repl  average number of exchanges:\n");
@@ -1330,7 +1330,7 @@ void print_replica_exchange_statistics(FILE *fplog, struct gmx_repl_ex *re)
                 re->prob[i] =  ((real)re->nexchange[i])/re->nattempt[i%2];
             }
         }
-        print_ind(fplog, "", re->nrepl, re->ind, NULL);
+        print_ind(fplog, "", re->nrepl, re->ind, nullptr);
         print_prob(fplog, "", re->nrepl, re->prob);
 
         fprintf(fplog, "\n");
index 5e51e7e106f491bfeb05d82f918b1eac1926a98e..d5518a725ca44738460d745de6ec47b3bd8dcb66 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -615,7 +615,7 @@ void check_resource_division_efficiency(const gmx_hw_info_t *hwinfo,
             gmx_bool bEnvSet;
             char     buf2[256];
 
-            bEnvSet = (getenv("OMP_NUM_THREADS") != NULL);
+            bEnvSet = (getenv("OMP_NUM_THREADS") != nullptr);
 
             if (bNtOmpOptionSet || bEnvSet)
             {
@@ -670,7 +670,7 @@ static void print_hw_opt(FILE *fp, const gmx_hw_opt_t *hw_opt)
             hw_opt->nthreads_tmpi,
             hw_opt->nthreads_omp,
             hw_opt->nthreads_omp_pme,
-            hw_opt->gpu_opt.gpu_id != NULL ? hw_opt->gpu_opt.gpu_id : "");
+            hw_opt->gpu_opt.gpu_id != nullptr ? hw_opt->gpu_opt.gpu_id : "");
 }
 
 /* Checks we can do when we don't (yet) know the cut-off scheme */
index 38aa03d1477dfe76710f2963321b7342d4944e7f..39b979632a090be96f7d7eca0e10c736caf20d4b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -187,7 +187,7 @@ static void mdrunner_start_fn(void *arg)
                                                 copy pointed-to items, of course,
                                                 but those are all const. */
         t_commrec *cr;                       /* we need a local version of this */
-        FILE      *fplog = NULL;
+        FILE      *fplog = nullptr;
         t_filenm  *fnm;
 
         fnm = dup_tfn(mc.nfile, mc.fnm);
@@ -289,7 +289,7 @@ static t_commrec *mdrunner_start_threads(gmx_hw_opt_t *hw_opt,
                        mdrunner_start_fn, (void*)(mda) );
     if (ret != TMPI_SUCCESS)
     {
-        return NULL;
+        return nullptr;
     }
 
     crn = reinitialize_commrec_for_this_thread(cr);
@@ -364,7 +364,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
             return;
         }
 
-        if (fp != NULL && bGPU && ir->nstlist < nstlist_try[0])
+        if (fp != nullptr && bGPU && ir->nstlist < nstlist_try[0])
         {
             fprintf(fp, nstl_gpu, ir->nstlist);
         }
@@ -386,7 +386,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
         {
             fprintf(stderr, "%s\n", nve_err);
         }
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "%s\n", nve_err);
         }
@@ -405,7 +405,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
         {
             fprintf(stderr, "%s\n", vbd_err);
         }
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "%s\n", vbd_err);
         }
@@ -447,7 +447,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
      */
     nstlist_prev = ir->nstlist;
     ir->nstlist  = nbnxnReferenceNstlist;
-    calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL,
+    calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, nullptr,
                             &rlistWithReferenceNstlist);
     ir->nstlist  = nstlist_prev;
 
@@ -472,7 +472,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
         }
 
         /* Set the pair-list buffer size in ir */
-        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL, &rlist_new);
+        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, nullptr, &rlist_new);
 
         /* Does rlist fit in the box? */
         bBox = (gmx::square(rlist_new) < max_cutoff2(ir->ePBC, box));
@@ -523,7 +523,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
     if (!bBox || !bDD)
     {
         gmx_warning(!bBox ? box_err : dd_err);
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "\n%s\n", bBox ? box_err : dd_err);
         }
@@ -538,7 +538,7 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
         {
             fprintf(stderr, "%s\n\n", buf);
         }
-        if (fp != NULL)
+        if (fp != nullptr)
         {
             fprintf(fp, "%s\n\n", buf);
         }
@@ -571,11 +571,11 @@ static void prepare_verlet_scheme(FILE                           *fplog,
          */
         verletbuf_get_list_setup(TRUE, bUseGPU, &ls);
 
-        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, NULL, &rlist_new);
+        calc_verlet_buffer_size(mtop, det(box), ir, -1, &ls, nullptr, &rlist_new);
 
         if (rlist_new != ir->rlist)
         {
-            if (fplog != NULL)
+            if (fplog != nullptr)
             {
                 fprintf(fplog, "\nChanging rlist from %g to %g for non-bonded %dx%d atom kernels\n\n",
                         ir->rlist, rlist_new,
@@ -681,7 +681,7 @@ static integrator_t *my_integrator(unsigned int ei)
 static gmx::LoggerOwner buildLogger(FILE *fplog, const t_commrec *cr)
 {
     gmx::LoggerBuilder builder;
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         builder.addTargetFile(gmx::MDLogger::LogLevel::Info, fplog);
     }
@@ -712,24 +712,24 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
     gmx_ddbox_t               ddbox = {0};
     int                       npme_major, npme_minor;
     t_nrnb                   *nrnb;
-    gmx_mtop_t               *mtop          = NULL;
-    t_mdatoms                *mdatoms       = NULL;
-    t_forcerec               *fr            = NULL;
-    t_fcdata                 *fcd           = NULL;
+    gmx_mtop_t               *mtop          = nullptr;
+    t_mdatoms                *mdatoms       = nullptr;
+    t_forcerec               *fr            = nullptr;
+    t_fcdata                 *fcd           = nullptr;
     real                      ewaldcoeff_q  = 0;
     real                      ewaldcoeff_lj = 0;
-    struct gmx_pme_t        **pmedata       = NULL;
-    gmx_vsite_t              *vsite         = NULL;
+    struct gmx_pme_t        **pmedata       = nullptr;
+    gmx_vsite_t              *vsite         = nullptr;
     gmx_constr_t              constr;
     int                       nChargePerturbed = -1, nTypePerturbed = 0, status;
     gmx_wallcycle_t           wcycle;
-    gmx_walltime_accounting_t walltime_accounting = NULL;
+    gmx_walltime_accounting_t walltime_accounting = nullptr;
     int                       rc;
     gmx_int64_t               reset_counters;
-    gmx_edsam_t               ed           = NULL;
+    gmx_edsam_t               ed           = nullptr;
     int                       nthreads_pme = 1;
-    gmx_membed_t *            membed       = NULL;
-    gmx_hw_info_t            *hwinfo       = NULL;
+    gmx_membed_t *            membed       = nullptr;
+    gmx_hw_info_t            *hwinfo       = nullptr;
     /* The master rank decides early on bUseGPU and broadcasts this later */
     gmx_bool                  bUseGPU            = FALSE;
 
@@ -741,7 +741,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
     if (Flags & MD_APPENDFILES)
     {
-        fplog = NULL;
+        fplog = nullptr;
     }
 
     bool doMembed = opt2bSet("-membed", nfile, fnm);
@@ -760,7 +760,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
     gmx_print_detected_hardware(fplog, cr, mdlog, hwinfo);
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         /* Print references after all software/hardware printing */
         please_cite(fplog, "Abraham2015");
@@ -784,7 +784,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         {
             /* Here the master rank decides if all ranks will use GPUs */
             bUseGPU = (hwinfo->gpu_info.n_dev_compatible > 0 ||
-                       getenv("GMX_EMULATE_GPU") != NULL);
+                       getenv("GMX_EMULATE_GPU") != nullptr);
 
             /* TODO add GPU kernels for this and replace this check by:
              * (bUseGPU && (ir->vdwtype == evdwPME &&
@@ -877,7 +877,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
                                         Flags);
             /* the main thread continues here with a new cr. We don't deallocate
                the old cr because other threads may still be reading it. */
-            if (cr == NULL)
+            if (cr == nullptr)
             {
                 gmx_comm("Failed to spawn threads");
             }
@@ -897,7 +897,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         gmx_bcast_sim(sizeof(bUseGPU), &bUseGPU, cr);
     }
 
-    if (fplog != NULL)
+    if (fplog != nullptr)
     {
         pr_inputrec(fplog, 0, "Input Parameters", inputrec, FALSE);
         fprintf(fplog, "\n");
@@ -1253,7 +1253,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         }
         else
         {
-            pmedata = NULL;
+            pmedata = nullptr;
         }
     }
     else
@@ -1262,7 +1262,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
         /* We don't need the state */
         stateInstance.reset();
-        state         = NULL;
+        state         = nullptr;
 
         ewaldcoeff_q  = calc_ewaldcoeff_q(inputrec->rcoulomb, inputrec->ewald_rtol);
         ewaldcoeff_lj = calc_ewaldcoeff_lj(inputrec->rvdw, inputrec->ewald_rtol_lj);
@@ -1412,18 +1412,18 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
      */
     finish_run(fplog, mdlog, cr,
                inputrec, nrnb, wcycle, walltime_accounting,
-               fr ? fr->nbv : NULL,
+               fr ? fr->nbv : nullptr,
                EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
 
     // Free PME data
     if (pmedata)
     {
         gmx_pme_destroy(pmedata);
-        pmedata = NULL;
+        pmedata = nullptr;
     }
 
     /* Free GPU memory and context */
-    free_gpu_resources(fr, cr, &hwinfo->gpu_info, fr ? fr->gpu_opt : NULL);
+    free_gpu_resources(fr, cr, &hwinfo->gpu_info, fr ? fr->gpu_opt : nullptr);
 
     if (doMembed)
     {
index 08dc54edfc14fcd58f64890fc18cecde0d878894..13104d405caa4dd970275610d6d5ea214d8c5c48 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -182,11 +182,11 @@ static t_fitem *NewFItem(void)
 
     snew(fitem, 1);
     fitem->nname = 0;
-    fitem->name  = NULL;
-    fitem->set   = NULL;
-    fitem->get   = NULL;
-    fitem->def   = NULL;
-    fitem->help  = NULL;
+    fitem->name  = nullptr;
+    fitem->set   = nullptr;
+    fitem->get   = nullptr;
+    fitem->def   = nullptr;
+    fitem->help  = nullptr;
 
     return fitem;
 }
@@ -211,9 +211,9 @@ static t_fgroup *NewFGroup(void)
     t_fgroup *fgroup;
 
     snew(fgroup, 1);
-    fgroup->name   = NULL;
+    fgroup->name   = nullptr;
     fgroup->nfitem = 0;
-    fgroup->fitem  = NULL;
+    fgroup->fitem  = nullptr;
 
     return fgroup;
 }
@@ -246,9 +246,9 @@ static t_fgrid *NewFGrid(void)
     fgrid->w        = 0;
     fgrid->h        = 0;
     fgrid->nfgroup  = 0;
-    fgrid->fgroup   = NULL;
+    fgrid->fgroup   = nullptr;
     fgrid->nfsimple = 0;
-    fgrid->fsimple  = NULL;
+    fgrid->fsimple  = nullptr;
 
     return fgrid;
 }
index 177e787982b15b3ec4b50e44cc80085d48b4f9e5..3bcfd9bcd030e6ea6652c059fa37f8b3b0ad87d4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -57,7 +57,7 @@ t_filter *init_filter(t_atoms *atoms, const char *fn, int natom_trx)
     int       g, i;
 
     snew(f, 1);
-    if (fn != NULL)
+    if (fn != nullptr)
     {
         f->grps = init_index(fn, &f->grpnames);
     }
index 1e2bbdde598184b162a0fa057ec2bab7aa03d9c2..bb397e2af699eefc549285a184e78ba7d8a0307b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -105,12 +105,12 @@ static bool LogoCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
     };
 #define COFFS 70
     static t_mess   Mess[] = {
-        { "GROMACS",                         0,       20, NULL },
-        { NULL,                             16,        9, NULL },
-        { "Copyright (c) 1991-2013",        COFFS+ 2,  9, NULL },
-        { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11,  9, NULL },
-        { "& Groningen University ",        COFFS+20,  9, NULL },
-        { "click to dismiss",               COFFS+31,  8, NULL }
+        { "GROMACS",                         0,       20, nullptr },
+        { nullptr,                             16,        9, nullptr },
+        { "Copyright (c) 1991-2013",        COFFS+ 2,  9, nullptr },
+        { "D.v.d.Spoel, E.Lindahl, B.Hess", COFFS+11,  9, nullptr },
+        { "& Groningen University ",        COFFS+20,  9, nullptr },
+        { "click to dismiss",               COFFS+31,  8, nullptr }
     };
 #define NMESS asize(Mess)
     int             i;
@@ -201,7 +201,7 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
     logo->bQuitOnClick = bQuitOnClick;
     InitWin(&logo->wd, 0, 0, 360, 270, 1, "GROMACS");
     bg = LIGHTGREY;
-    if ((newcol = std::getenv("GMX_LOGO_COLOR")) != NULL)
+    if ((newcol = std::getenv("GMX_LOGO_COLOR")) != nullptr)
     {
         GetNamedColor(x11, newcol, &bg);
     }
@@ -209,9 +209,9 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
                                         logo->wd.x, logo->wd.y,
                                         logo->wd.width, logo->wd.height,
                                         logo->wd.bwidth, WHITE, bg);
-    for (i = 0, logo->bigfont = NULL; (i < NBF); i++)
+    for (i = 0, logo->bigfont = nullptr; (i < NBF); i++)
     {
-        if ((logo->bigfont = XLoadQueryFont(x11->disp, bfname[i])) != NULL)
+        if ((logo->bigfont = XLoadQueryFont(x11->disp, bfname[i])) != nullptr)
         {
             break;
         }
@@ -224,9 +224,9 @@ t_logo *init_logo(t_x11 *x11, Window parent, bool bQuitOnClick)
 #ifdef DEBUG
     std::fprintf(stderr, "Big Logofont: %s\n", bfname[i]);
 #endif
-    for (i = 0, logo->smallfont = NULL; (i < NSF); i++)
+    for (i = 0, logo->smallfont = nullptr; (i < NSF); i++)
     {
-        if ((logo->smallfont = XLoadQueryFont(x11->disp, sfname[i])) != NULL)
+        if ((logo->smallfont = XLoadQueryFont(x11->disp, sfname[i])) != nullptr)
         {
             break;
         }
index 5a99f93191d5995074754f122fe049c90e9e6cbf..f30af45af66f16644da60993de997a88a15e2926 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -229,7 +229,7 @@ void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
     snew(man->szLab, sh.natoms);
     snew(man->bHydro, sh.natoms);
     snew(bB, sh.natoms);
-    read_tpx_top(status, NULL, man->box, &man->natom, NULL, NULL, &man->top);
+    read_tpx_top(status, nullptr, man->box, &man->natom, nullptr, nullptr, &man->top);
     man->gpbc = gmx_rmpbc_init(&man->top.idef, -1, man->natom);
 
     man->natom =
@@ -644,7 +644,7 @@ t_manager *init_man(t_x11 *x11, Window Parent,
     t_manager *man;
 
     snew(man, 1);
-    man->status = NULL;
+    man->status = nullptr;
     man->bPlus  = true;
     man->bSort  = true;
     man->oenv   = oenv;
@@ -661,7 +661,7 @@ t_manager *init_man(t_x11 *x11, Window Parent,
     man->molw = init_mw(x11, man->wd.self, 0, 0, 1, 1, WHITE, BLUE, ePBC, box);
 
     /* Title Window */
-    InitWin(&(man->title), 0, 0, 1, 1, 0, NULL);
+    InitWin(&(man->title), 0, 0, 1, 1, 0, nullptr);
     man->title.self = XCreateSimpleWindow(x11->disp, man->molw->wd.self,
                                           man->title.x, man->title.y,
                                           man->title.width, man->title.height,
index f31009eca27bdb3de2d4d759a26bfdc642d3fcee..d27b367184080a6da7c28dd2465c3e6f6dab2cf7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,7 +74,7 @@ int search_ac(const char *type)
 
     best  = 0;
     besti = 0;
-    if (NULL != type)
+    if (nullptr != type)
     {
         for (i = 0; (i < NAC); i++)
         {
index f06896d2c94a0b00d99bee01ff2ac61c8cb45d84..fb19996a83b5192468d0d15ae2c23b721d02dd70 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -442,7 +442,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
         { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 4 },
         { 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 }
     };
-    static int *edge = NULL;
+    static int *edge = nullptr;
     int         i, j, k, i0, i1;
     rvec        corner[NCUCEDGE], box_center;
     vec4        x4;
@@ -452,7 +452,7 @@ static void draw_box(t_x11 *x11, Window w, t_3dview *view, matrix box,
     if (boxtype == esbTrunc)
     {
         calc_compact_unitcell_vertices(view->ecenter, box, corner);
-        if (edge == NULL)
+        if (edge == nullptr)
         {
             edge = compact_unitcell_edges();
         }
index cc8a4dc63870f39fedbede99e47ceba3763222f3..584d5c63c0722afbc3477b6eac9ab00058f43d88 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -190,7 +190,7 @@ t_menu *init_menu(t_x11 *x11, Window Parent, unsigned long fg, unsigned long bg,
             kid->m      = &(ent[l]);
             kid->Parent = Parent;
             w           = &(kid->wd);
-            InitWin(w, j*mlen, k*mht, mlen-2, mht-2, 1, NULL);
+            InitWin(w, j*mlen, k*mht, mlen-2, mht-2, 1, nullptr);
             w->self = XCreateSimpleWindow(x11->disp, m->wd.self,
                                           w->x, w->y, w->width, w->height,
                                           w->bwidth, bg, bg);
index f72e7aa64ccaf7099a186e32a9413554987605fd..4bf597347582c455eb68c612b2064c0ba6d9f2eb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -134,7 +134,7 @@ static bool HandleClient(t_x11 *x11, int ID, t_gmx *gmx)
         case IDDOEXPORT:
             write_sto_conf(gmx->confout, *gmx->man->top.name,
                            &(gmx->man->top.atoms),
-                           gmx->man->x, NULL, gmx->man->molw->ePBC, gmx->man->box);
+                           gmx->man->x, nullptr, gmx->man->molw->ePBC, gmx->man->box);
             break;
         case IDQUIT:
             show_mb(gmx, emQuit);
@@ -311,7 +311,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     snew(gmx->wd, 1);
 
     ePBC = read_tpx_top(ftp2fn(efTPR, nfile, fnm),
-                        NULL, box, &natom, NULL, NULL, &top);
+                        nullptr, box, &natom, nullptr, nullptr, &top);
 
     read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_DONT_SKIP);
     close_trx(status);
@@ -333,7 +333,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     hints.min_width  = 2*EWIDTH+40;
     hints.min_height = EHEIGHT+LDHEIGHT+LEGHEIGHT+40;
     XSetStandardProperties(x11->disp, gmx->wd->self, gmx->wd->text, program,
-                           pm, NULL, 0, &hints);
+                           pm, nullptr, 0, &hints);
 
     x11->RegisterCallback(x11, gmx->wd->self, x11->root, MainCallBack, gmx);
     x11->SetInputMask(x11, gmx->wd->self,
@@ -396,21 +396,21 @@ int gmx_view(int argc, char *argv[])
 
     gmx_output_env_t *oenv;
     t_filenm          fnm[] = {
-        { efTRX, "-f", NULL, ffREAD },
-        { efTPR, NULL, NULL, ffREAD },
-        { efNDX, NULL, NULL, ffOPTRD }
+        { efTRX, "-f", nullptr, ffREAD },
+        { efTPR, nullptr, nullptr, ffREAD },
+        { efNDX, nullptr, nullptr, ffOPTRD }
     };
 #define NFILE asize(fnm)
 
     if (parse_common_args(&argc, argv, PCA_CAN_TIME, NFILE, fnm,
-                          0, NULL, asize(desc), desc, asize(bugs), bugs, &oenv))
+                          0, nullptr, asize(desc), desc, asize(bugs), bugs, &oenv))
     {
 #if !GMX_X11
         std::fprintf(stderr, "Compiled without X-Windows - can not run viewer.\n");
 #else
         t_x11 *x11;
 
-        if ((x11 = GetX11(&argc, argv)) == NULL)
+        if ((x11 = GetX11(&argc, argv)) == nullptr)
         {
             std::fprintf(stderr, "Can't connect to X Server.\n"
                          "Check your DISPLAY environment variable\n");
index 478bb5c9853fb2e7ad4d3b8effb490a5067e5049..fcfc76d27505d6c4f54676d917418dec3c7f81d5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -80,16 +80,16 @@ static XFontStruct *GetFont(FILE *err, Display *disp, char *name)
 
     if (name)
     {
-        bFont = ((font = XLQF(err, disp, name)) != NULL);
+        bFont = ((font = XLQF(err, disp, name)) != nullptr);
     }
     else
     {
-        font = NULL;
+        font = nullptr;
     }
 
     for (i = 0; (!bFont && (i < MAXNAMES)); i++)
     {
-        bFont = ((font = XLQF(err, disp, fontnames[i])) != NULL);
+        bFont = ((font = XLQF(err, disp, fontnames[i])) != nullptr);
     }
 
     if (!bFont)
@@ -97,7 +97,7 @@ static XFontStruct *GetFont(FILE *err, Display *disp, char *name)
         fontlist = XListFonts(disp, "?", 1, &count);
         if (count != 0)
         {
-            bFont = ((font = XLQF(err, disp, fontlist[0])) != NULL);
+            bFont = ((font = XLQF(err, disp, fontlist[0])) != nullptr);
         }
     }
     if (!bFont)
@@ -171,7 +171,7 @@ static void MainLoop(t_x11 *x11)
                         /* Filter out expose events with non-zero count field */
                         if (event.xexpose.count != 0)
                         {
-                            curs = NULL;
+                            curs = nullptr;
                         }
                         break;
                     case ConfigureNotify:
@@ -202,7 +202,7 @@ static void RegisterCallback(t_x11 *x11, Window w, Window Parent,
     item->cb     = cb;
     item->mask   = 0;
     item->data   = data;
-    item->next   = NULL;
+    item->next   = nullptr;
 
     if (x11->wlist)
     {
@@ -317,7 +317,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     char          **ARGV;
     char           *display;
     char           *fontname;
-    char           *title, *FG = NULL, *BG = NULL;
+    char           *title, *FG = nullptr, *BG = nullptr;
     bool            bVerbose = false;
     int             i;
 
@@ -380,7 +380,7 @@ t_x11 *GetX11(int *argc, char *argv[])
         argv[i] = ARGV[i];
     }
     *argc      = ARGC;
-    argv[ARGC] = NULL;
+    argv[ARGC] = nullptr;
 
     snew(x11, 1);
     x11->dispname = display;
@@ -389,27 +389,27 @@ t_x11 *GetX11(int *argc, char *argv[])
         x11->console = stderr;
     }
     else
-    if ((x11->console = std::fopen("/dev/null", "w")) == NULL)
+    if ((x11->console = std::fopen("/dev/null", "w")) == nullptr)
     {
         x11->console = stderr;
     }
 
-    if ((x11->disp = XOpenDisplay(display)) == NULL)
+    if ((x11->disp = XOpenDisplay(display)) == nullptr)
     {
         if (bVerbose)
         {
             std::fprintf(x11->console, "Display %s invalid\n", display);
         }
-        return NULL;
+        return nullptr;
     }
 
-    if ((x11->font = GetFont(x11->console, x11->disp, fontname)) == NULL)
+    if ((x11->font = GetFont(x11->console, x11->disp, fontname)) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
-    if ((x11->gc = GetGC(x11->disp, x11->font)) == NULL)
+    if ((x11->gc = GetGC(x11->disp, x11->font)) == nullptr)
     {
-        return NULL;
+        return nullptr;
     }
 
     x11->root   = DefaultRootWindow(x11->disp);
@@ -486,7 +486,7 @@ t_x11 *GetX11(int *argc, char *argv[])
     }
     x11->title = gmx_strdup(title);
     sfree(title);
-    x11->wlist              = NULL;
+    x11->wlist              = nullptr;
     x11->GetNamedColor      = &GetNamedColor;
     x11->MainLoop           = &MainLoop;
     x11->RegisterCallback   = &RegisterCallback;
index e52f9cb0e35f647207b0ba7b1b4ffcb0460e3e61..230623820727904de9d1595033797b821f1c454b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -65,7 +65,7 @@ t_dlgitem *FindItem(t_dlg *dlg, t_id id)
             return dlg->dlgitem[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 t_dlgitem *FindWin(t_dlg *dlg, Window win)
@@ -79,7 +79,7 @@ t_dlgitem *FindWin(t_dlg *dlg, Window win)
             return dlg->dlgitem[i];
         }
     }
-    return NULL;
+    return nullptr;
 }
 
 /*****************************
@@ -91,7 +91,7 @@ bool QueryDlgItemSize(t_dlg *dlg, t_id id, int *w, int *h)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         *w = dlgitem->win.width;
         *h = dlgitem->win.height;
@@ -104,7 +104,7 @@ bool QueryDlgItemPos(t_dlg *dlg, t_id id, int *x0, int *y0)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         *x0 = dlgitem->win.x;
         *y0 = dlgitem->win.y;
@@ -117,7 +117,7 @@ int QueryDlgItemX(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.x;
     }
@@ -128,7 +128,7 @@ int QueryDlgItemY(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.y;
     }
@@ -139,7 +139,7 @@ int QueryDlgItemW(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.width;
     }
@@ -150,7 +150,7 @@ int QueryDlgItemH(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         return dlgitem->win.height;
     }
@@ -164,7 +164,7 @@ bool SetDlgItemSize(t_dlg *dlg, t_id id, int w, int h)
     int        old_w, old_h;
 #endif
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
 #ifdef DEBUG
         old_w = dlgitem->win.width;
@@ -213,7 +213,7 @@ bool SetDlgItemPos(t_dlg *dlg, t_id id, int x0, int y0)
     t_dlgitem *dlgitem;
     int        old_x, old_y;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         old_x          = dlgitem->win.x;
         old_y          = dlgitem->win.y;
@@ -259,7 +259,7 @@ bool IsCBChecked(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgCB)
         {
@@ -291,7 +291,7 @@ int EditTextLen(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgET)
         {
@@ -306,7 +306,7 @@ char *EditText(t_dlg *dlg, t_id id)
 {
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         if (dlgitem->type == edlgET)
         {
@@ -314,7 +314,7 @@ char *EditText(t_dlg *dlg, t_id id)
         }
     }
 
-    return NULL;
+    return nullptr;
 }
 
 /*****************************
@@ -369,7 +369,7 @@ void NoHelp(t_dlg *dlg)
         "No help for this item"
     };
     MessageBox(dlg->x11, dlg->wDad, "No Help", 2, lines,
-               MB_OK | MB_ICONSTOP | MB_APPLMODAL, NULL, NULL);
+               MB_OK | MB_ICONSTOP | MB_APPLMODAL, nullptr, nullptr);
 }
 
 void HelpDlg(t_dlg *dlg)
@@ -380,7 +380,7 @@ void HelpDlg(t_dlg *dlg)
         "First press the OK button."
     };
     MessageBox(dlg->x11, dlg->win.self, "Help Dialogbox",
-               3, lines, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, NULL, NULL);
+               3, lines, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, nullptr, nullptr);
 }
 
 void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
@@ -388,7 +388,7 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
     char     buf[80];
     bool     bCont = true;
     int      i, nlines = 0;
-    char   **lines = NULL;
+    char   **lines = nullptr;
 
     if (!dlgitem->help)
     {
@@ -431,7 +431,7 @@ void HelpNow(t_dlg *dlg, t_dlgitem *dlgitem)
     while (bCont);
     MessageBox(dlg->x11, dlg->wDad, "Help",
                nlines, lines,
-               MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, NULL, NULL);
+               MB_OK | MB_ICONINFORMATION | MB_APPLMODAL, nullptr, nullptr);
     for (i = 0; (i < nlines); i++)
     {
         sfree(lines[i]);
@@ -471,7 +471,7 @@ static bool DlgCB(t_x11 *x11, XEvent *event, Window w, void *data)
     int        i, nWndProc;
     t_dlgitem *dlgitem;
 
-    if ((dlgitem = FindWin(dlg, w)) != NULL)
+    if ((dlgitem = FindWin(dlg, w)) != nullptr)
     {
         nWndProc = (dlgitem->WndProc)(x11, dlgitem, event);
 #ifdef DEBUG
@@ -630,7 +630,7 @@ void DoCreateDlg(t_dlg *dlg)
     hints.y     = dlg->win.y;
     hints.flags = PPosition;
     XSetStandardProperties(dlg->x11->disp, dlg->win.self, dlg->title,
-                           dlg->title, None, NULL, 0, &hints);
+                           dlg->title, None, nullptr, 0, &hints);
 }
 
 void AddDlgItem(t_dlg *dlg, t_dlgitem *item)
@@ -699,7 +699,7 @@ void FreeDlgItem(t_dlg *dlg, t_id id)
     t_dlgitem *dlgitem;
     int        i;
 
-    if ((dlgitem = FindItem(dlg, id)) != NULL)
+    if ((dlgitem = FindItem(dlg, id)) != nullptr)
     {
         dlg->x11->UnRegisterCallback(dlg->x11, dlgitem->win.self);
         if (dlgitem->win.self)
@@ -757,7 +757,7 @@ void FreeDlg(t_dlg *dlg)
         {
             XDestroyWindow(dlg->x11->disp, dlg->win.self);
         }
-        dlg->dlgitem = NULL;
+        dlg->dlgitem = nullptr;
     }
 }
 
@@ -783,7 +783,7 @@ t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
     }
     else
     {
-        dlg->title = NULL;
+        dlg->title = nullptr;
     }
     if (w == 0)
     {
@@ -820,14 +820,14 @@ t_dlg *CreateDlg(t_x11 *x11, Window Parent, const char *title,
     {
         y = y0;
     }
-    InitWin(&(dlg->win), x, y, w, h, bw, NULL);
+    InitWin(&(dlg->win), x, y, w, h, bw, nullptr);
     SetDlgSize(dlg, w, h, x0 || y0);
 
     dlg->wDad    = Parent;
     dlg->fg      = x11->fg;
     dlg->bg      = x11->bg;
     dlg->nitem   = 0;
-    dlg->dlgitem = NULL;
+    dlg->dlgitem = nullptr;
 
     DoCreateDlg(dlg);
     return dlg;
index 3fc04abfd6d6f0cf05a16a9ed91da0eb812a2116..3cae52d971c57c2df6d1809dbee9f26857a33cc3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -250,7 +250,7 @@ static t_dlgitemlist **NewDlgitemList(int w, int h)
         for (j = 0; (j < h); j++)
         {
             grid[i][j].nitem = 0;
-            grid[i][j].list  = NULL;
+            grid[i][j].list  = nullptr;
         }
     }
     return grid;
@@ -348,7 +348,7 @@ static void AddListFGroup(t_x11 *x11, t_dlgitemlist **grid,
     GroupID = (*ID)++;
     item    = &(grid[fgroup->x][fgroup->y]);
     AddListItem(item, CreateGroupBox(x11, fgroup->name, GroupID,
-                                     0, NULL, 0, 0, 0, 0, 0));
+                                     0, nullptr, 0, 0, 0, 0, 0));
     x = 2*OFFS_X;
     y = item->list[0]->win.y+item->list[0]->win.height;
     w = 0;
index 87c5b903cbbd2acaa293ba1acb7dff4aaf2328d7..cf75e603cdedba7b7d2ac8d24e69de35a02854d1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -436,7 +436,7 @@ static int WndProcET(t_x11 *x11, t_dlgitem *dlgitem, XEvent *event)
             {
                 return DefWndProc(x11, dlgitem, event);
             }
-            XLookupString(&(event->xkey), c, BUFSIZE, &keysym, NULL);
+            XLookupString(&(event->xkey), c, BUFSIZE, &keysym, nullptr);
 #ifdef DEBUG
             std::printf("Keysym: %x\n", keysym);
 #endif
@@ -670,7 +670,7 @@ t_dlgitem *CreatePixmap(Pixmap pm, t_id id,
     t_dlgitem *dlgitem;
 
     dlgitem = newitem();
-    InitWin(&(dlgitem->win), x0, y0, w, h, bw, NULL);
+    InitWin(&(dlgitem->win), x0, y0, w, h, bw, nullptr);
     dlgitem->ID          = id;
     dlgitem->type        = edlgPM;
     dlgitem->u.pixmap.pm = pm;
@@ -700,7 +700,7 @@ t_dlgitem *CreateStaticText(t_x11 *x11,
         }
         w += 2*OFFS_X;
     }
-    InitWin(&(dlgitem->win), x0, y0, w, h, bw, NULL);
+    InitWin(&(dlgitem->win), x0, y0, w, h, bw, nullptr);
     dlgitem->ID                  = id;
     dlgitem->GroupID             = groupid;
     dlgitem->type                = edlgST;
index 51db50c433219f7094089657da090f27032f3bdb..69f1228665ecc4eac9a420a8c922bdf8404318df 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -56,7 +56,7 @@
 #define ID_ICON    -2
 #define ID_TEXT    -1
 
-static bmchar         *icon_bits   = NULL;
+static bmchar         *icon_bits   = nullptr;
 static int             icon_width  = 0;
 static int             icon_height = 0;
 static unsigned long   icon_fg     = 0;
index 8bbc3b358feed5f9f09b7fbf297ad9fb07b7bca0..2c53b3e78508953665f28840446ce925e1130a69 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -145,7 +145,7 @@ void TextInRect(t_x11 *x11, Drawable win,
                 const char *s, int x, int y, int width, int height,
                 eXPos eX, eYPos eY)
 {
-    SpecialTextInRect(x11, NULL, win, s, x, y, width, height, eX, eY);
+    SpecialTextInRect(x11, nullptr, win, s, x, y, width, height, eX, eY);
 }
 
 void TextInWin(t_x11 *x11, t_windata *win,
@@ -171,7 +171,7 @@ void InitWin(t_windata *win, int x0, int y0, int w, int h, int bw, const char *t
     }
     else
     {
-        win->text = NULL;
+        win->text = nullptr;
     }
 #ifdef DEBUG
     std::printf("%s: %d x %d at %d, %d\n", text, w, h, x0, y0);
@@ -255,7 +255,7 @@ typedef struct t_mpos {
     struct t_mpos *prev;
 } t_mpos;
 
-static t_mpos *mpos = NULL;
+static t_mpos *mpos = nullptr;
 
 void PushMouse(Display *disp, Window dest, int x, int y)
 {
index eb05df8a9bf31eb6c8b91fc61e229ffb77b624a9..4cc338fe6c7fdb7eee49486a612018ef099f0df6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -94,14 +94,14 @@ CommandLine::Impl::Impl(const char *const cmdline[], size_t count)
     for (size_t i = 0; i < count; ++i)
     {
         char *arg = strdup(cmdline[i]);
-        if (arg == NULL)
+        if (arg == nullptr)
         {
             throw std::bad_alloc();
         }
         args_.push_back(arg);
         argv_.push_back(arg);
     }
-    argv_.push_back(NULL);
+    argv_.push_back(nullptr);
 }
 
 CommandLine::Impl::~Impl()
@@ -117,7 +117,7 @@ CommandLine::Impl::~Impl()
  */
 
 CommandLine::CommandLine()
-    : impl_(new Impl(NULL, 0))
+    : impl_(new Impl(nullptr, 0))
 {
 }
 
@@ -148,14 +148,14 @@ void CommandLine::append(const char *arg)
     impl_->args_.reserve(newSize);
     impl_->argv_.reserve(newSize + 1);
     char *newArg = strdup(arg);
-    if (newArg == NULL)
+    if (newArg == nullptr)
     {
         throw std::bad_alloc();
     }
     impl_->args_.push_back(newArg);
     impl_->argv_.pop_back(); // Remove the trailing NULL.
     impl_->argv_.push_back(newArg);
-    impl_->argv_.push_back(NULL);
+    impl_->argv_.push_back(nullptr);
     impl_->argc_ = static_cast<int>(newSize);
 }
 
@@ -298,7 +298,7 @@ int CommandLineTestHelper::runModuleDirect(
 {
     // The name and description are not used in the tests, so they can be NULL.
     const std::unique_ptr<ICommandLineModule> wrapperModule(
-            ICommandLineOptionsModule::createModule(NULL, NULL, std::move(module)));
+            ICommandLineOptionsModule::createModule(nullptr, nullptr, std::move(module)));
     return runModuleDirect(wrapperModule.get(), commandLine);
 }
 
index 9913f6053ee00b7ff7e115d0596b669d8434aa62..41582553f30c013abb56f07fe5763c4e0537fc67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,7 @@ IntegrationTestFixture::redirectStringToStdin(const char* theString)
 {
     std::string fakeStdin("fake-stdin");
     gmx::TextWriter::writeFileFromString(fakeStdin, theString);
-    if (NULL == std::freopen(fakeStdin.c_str(), "r", stdin))
+    if (nullptr == std::freopen(fakeStdin.c_str(), "r", stdin))
     {
         GMX_THROW_WITH_ERRNO(FileIOError("Failed to redirect a string to stdin"),
                              "freopen",
index 3ac5b644c9b20d070a038440560d8527386a24f7..144668763cd4fe7d8e8400b51ec759f7f5fc9e24 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,8 +66,8 @@ class ReferenceDataEntry
         }
 
         ReferenceDataEntry(const char *type, const char *id)
-            : type_(type), id_(id != NULL ? id : ""), isTextBlock_(false),
-              hasBeenChecked_(false), correspondingOutputEntry_(NULL)
+            : type_(type), id_(id != nullptr ? id : ""), isTextBlock_(false),
+              hasBeenChecked_(false), correspondingOutputEntry_(nullptr)
         {
         }
 
@@ -84,7 +84,7 @@ class ReferenceDataEntry
 
         bool idMatches(const char *id) const
         {
-            return (id == NULL && id_.empty()) || (id != NULL && id_ == id);
+            return (id == nullptr && id_.empty()) || (id != nullptr && id_ == id);
         }
 
         ChildIterator findChild(const char *id, const ChildIterator &prev) const
@@ -97,7 +97,7 @@ class ReferenceDataEntry
             bool           wrappingSearch = true;
             if (child != children_.end())
             {
-                if (id == NULL && (*child)->id().empty())
+                if (id == nullptr && (*child)->id().empty())
                 {
                     wrappingSearch = false;
                     ++child;
@@ -174,7 +174,7 @@ class ReferenceDataEntry
         }
         void setCorrespondingOutputEntry(ReferenceDataEntry *entry)
         {
-            GMX_RELEASE_ASSERT(correspondingOutputEntry_ == NULL,
+            GMX_RELEASE_ASSERT(correspondingOutputEntry_ == nullptr,
                                "Output entry already exists");
             correspondingOutputEntry_ = entry;
         }
index 9a37881d871baff25aaaba55c12c1c507c31aa93..d42f97f98dca796b589c7e9d492d0d03271feaef 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -492,7 +492,7 @@ class TestReferenceChecker::Impl
         {
             GMX_RELEASE_ASSERT(initialized(),
                                "Accessing uninitialized reference data checker.");
-            return compareRootEntry_ == NULL;
+            return compareRootEntry_ == nullptr;
         }
 
         //! Whether initialized with other means than the default constructor.
@@ -567,7 +567,7 @@ const char *const TestReferenceChecker::Impl::cSequenceLengthName = "Length";
 
 TestReferenceChecker::Impl::Impl(bool initialized)
     : initialized_(initialized), defaultTolerance_(defaultRealTolerance()),
-      compareRootEntry_(NULL), outputRootEntry_(NULL),
+      compareRootEntry_(nullptr), outputRootEntry_(nullptr),
       updateMismatchingEntries_(false), bSelfTestMode_(false), seqIndex_(-1)
 {
 }
@@ -605,7 +605,7 @@ ReferenceDataEntry *TestReferenceChecker::Impl::findEntry(const char *id)
         lastFoundEntry_ = entry;
         return entry->get();
     }
-    return NULL;
+    return nullptr;
 }
 
 ReferenceDataEntry *
@@ -614,7 +614,7 @@ TestReferenceChecker::Impl::findOrCreateEntry(
         const IReferenceDataEntryChecker &checker)
 {
     ReferenceDataEntry *entry = findEntry(id);
-    if (entry == NULL && outputRootEntry_ != NULL)
+    if (entry == nullptr && outputRootEntry_ != nullptr)
     {
         lastFoundEntry_ = compareRootEntry_->addChild(createEntry(type, id, checker));
         entry           = lastFoundEntry_->get();
@@ -632,14 +632,14 @@ TestReferenceChecker::Impl::processItem(const char *type, const char *id,
     }
     std::string         fullId = appendPath(id);
     ReferenceDataEntry *entry  = findOrCreateEntry(type, id, checker);
-    if (entry == NULL)
+    if (entry == nullptr)
     {
         return ::testing::AssertionFailure()
                << "Reference data item " << fullId << " not found";
     }
     entry->setChecked();
     ::testing::AssertionResult result(checkEntry(*entry, fullId, type, checker));
-    if (outputRootEntry_ != NULL && entry->correspondingOutputEntry() == NULL)
+    if (outputRootEntry_ != nullptr && entry->correspondingOutputEntry() == nullptr)
     {
         if (!updateMismatchingEntries_ || result)
         {
@@ -768,7 +768,7 @@ void TestReferenceChecker::checkUnusedEntries()
 
 bool TestReferenceChecker::checkPresent(bool bPresent, const char *id)
 {
-    if (impl_->shouldIgnore() || impl_->outputRootEntry_ != NULL)
+    if (impl_->shouldIgnore() || impl_->outputRootEntry_ != nullptr)
     {
         return bPresent;
     }
@@ -801,7 +801,7 @@ TestReferenceChecker TestReferenceChecker::checkCompound(const char *type, const
     std::string         fullId = impl_->appendPath(id);
     NullChecker         checker;
     ReferenceDataEntry *entry  = impl_->findOrCreateEntry(type, id, checker);
-    if (entry == NULL)
+    if (entry == nullptr)
     {
         ADD_FAILURE() << "Reference data item " << fullId << " not found";
         return TestReferenceChecker(new Impl(true));
@@ -820,7 +820,7 @@ TestReferenceChecker TestReferenceChecker::checkCompound(const char *type, const
             return TestReferenceChecker(new Impl(true));
         }
     }
-    if (impl_->outputRootEntry_ != NULL && entry->correspondingOutputEntry() == NULL)
+    if (impl_->outputRootEntry_ != nullptr && entry->correspondingOutputEntry() == nullptr)
     {
         impl_->outputRootEntry_->addChild(entry->cloneToOutputEntry());
     }
index 1fd128ecdc0d3eeb1a111969b281a7415f4caebf..e1cd287fe753dec81c9d6db29a5db4482c846f12 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -492,7 +492,7 @@ class TestReferenceChecker
             TestReferenceChecker compound(checkSequenceCompound(id, length));
             for (Iterator i = begin; i != end; ++i)
             {
-                compound.checkValue(*i, NULL);
+                compound.checkValue(*i, nullptr);
             }
         }
         /*! \brief
index e3841fb48cabe7caab479c80d494b883327930d4..5d55a584348eb10155d133232164af2e8e888899 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,7 +112,7 @@ class TestFileManager::Impl
 };
 
 std::string TestFileManager::Impl::s_inputDirectory;
-const char *TestFileManager::Impl::s_globalOutputTempDirectory = NULL;
+const char *TestFileManager::Impl::s_globalOutputTempDirectory = nullptr;
 /** Controls whether TestFileManager should delete temporary files
     after the test finishes. */
 static bool g_bDeleteFilesAfterTest = true;
@@ -206,7 +206,7 @@ const char *TestFileManager::getInputDataDirectory()
 
 const char *TestFileManager::getGlobalOutputTempDirectory()
 {
-    GMX_RELEASE_ASSERT(Impl::s_globalOutputTempDirectory != NULL, "Global path for temporary output files from tests is not set");
+    GMX_RELEASE_ASSERT(Impl::s_globalOutputTempDirectory != nullptr, "Global path for temporary output files from tests is not set");
     return Impl::s_globalOutputTempDirectory;
 }
 
index ef233ddf90ae5c060ad46e02591439468d0ca1b7..993b4070e7a87d0395e6348d23ba9f7731751910 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -80,7 +80,7 @@ bool TestFileInputRedirector::fileExists(const char            *filename,
 {
     if (existingFiles_.count(filename) == 0)
     {
-        File::NotFoundInfo info(filename, "File not present in test", NULL, false, 0);
+        File::NotFoundInfo info(filename, "File not present in test", nullptr, false, 0);
         onNotFound(info);
         return false;
     }
index 5ade1e5a1d373a388a9cd52023682611c1d77c22..751e3e5d18d078a98478f353700f77d7cf1a2b22 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -145,7 +145,7 @@ void printHelp(const Options &options)
                  "\nYou can use the following GROMACS-specific command-line flags\n"
                  "to control the behavior of the tests:\n\n");
     TextWriter             writer(&TextOutputFile::standardError());
-    CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, NULL, program);
+    CommandLineHelpContext context(&writer, eHelpOutputFormat_Console, nullptr, program);
     context.setModuleDisplayName(program);
     CommandLineHelpWriter(options).writeHelp(context);
 }
@@ -185,14 +185,14 @@ void initTestUtils(const char *dataPath, const char *tempPath, bool usesMpi,
         setProgramContext(g_testContext.get());
         // Use the default finder that does not respect GMXLIB, since the tests
         // generally can only get confused by a different set of data files.
-        setLibraryFileFinder(NULL);
+        setLibraryFileFinder(nullptr);
         ::testing::InitGoogleMock(argc, *argv);
-        if (dataPath != NULL)
+        if (dataPath != nullptr)
         {
             TestFileManager::setInputDataDirectory(
                     Path::join(CMAKE_SOURCE_DIR, dataPath));
         }
-        if (tempPath != NULL)
+        if (tempPath != nullptr)
         {
             TestFileManager::setGlobalOutputTempDirectory(tempPath);
         }
@@ -256,7 +256,7 @@ void initTestUtils(const char *dataPath, const char *tempPath, bool usesMpi,
 
 void finalizeTestUtils()
 {
-    setProgramContext(NULL);
+    setProgramContext(nullptr);
     g_testContext.reset();
     finalizeForCommandLine();
 }
index 52b4ba7b0b5ff785772490c6e2bae31a0c99694e..f81272a73aaf876b06ffe42fe6367c6162ee8bad 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -195,7 +195,7 @@ typedef double dvec[3];
 //! Helper function for HandlesSequenceOfCustomData
 void checkCustomVector(TestReferenceChecker *checker, const dvec &value)
 {
-    checker->checkVector(value, NULL);
+    checker->checkVector(value, nullptr);
 }
 
 TEST(ReferenceDataTest, HandlesSequenceOfCustomData)
@@ -514,8 +514,8 @@ TEST(ReferenceDataTest, HandlesStringsWithTextAndWhitespace)
         TestReferenceChecker checker(data.rootChecker());
         for (const auto &s : strings)
         {
-            checker.checkString(s, NULL);
-            checker.checkTextBlock(s, NULL);
+            checker.checkString(s, nullptr);
+            checker.checkTextBlock(s, nullptr);
         }
     }
     {
@@ -523,8 +523,8 @@ TEST(ReferenceDataTest, HandlesStringsWithTextAndWhitespace)
         TestReferenceChecker checker(data.rootChecker());
         for (const auto &s : strings)
         {
-            checker.checkString(s, NULL);
-            checker.checkTextBlock(s, NULL);
+            checker.checkString(s, nullptr);
+            checker.checkTextBlock(s, nullptr);
         }
     }
 }
@@ -625,15 +625,15 @@ TEST(ReferenceDataTest, HandlesMultipleNullIds)
     {
         TestReferenceData    data(gmx::test::erefdataUpdateAll);
         TestReferenceChecker checker(data.rootChecker());
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
     }
     {
         TestReferenceData    data(gmx::test::erefdataCompare);
         TestReferenceChecker checker(data.rootChecker());
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", NULL), "");
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", nullptr), "");
     }
 }
 
@@ -644,26 +644,26 @@ TEST(ReferenceDataTest, HandlesMultipleComparisonsAgainstNullIds)
         TestReferenceData    data(gmx::test::erefdataUpdateAll);
         TestReferenceChecker checker(data.rootChecker());
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
-        checker.checkString("Test2", NULL);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
+        checker.checkString("Test2", nullptr);
     }
     {
         TestReferenceData    data(gmx::test::erefdataCompare);
         TestReferenceChecker checker(data.rootChecker());
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
         checker.checkInteger(1, "int1");
-        checker.checkString("Test", NULL);
-        checker.checkString("Test2", NULL);
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", NULL), "");
+        checker.checkString("Test", nullptr);
+        checker.checkString("Test2", nullptr);
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test", nullptr), "");
         checker.checkInteger(2, "int2");
-        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", NULL), "");
+        EXPECT_NONFATAL_FAILURE(checker.checkString("Test3", nullptr), "");
     }
 }
 
index 560232fd3886ad798adda0d251da0cb5dd82d11d..d1b2a3e6f0f189cf891753211bedd64c292ee0c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -96,7 +96,7 @@ bool isRelevantXvgCommand(const std::string &line)
 //! Helper function to check a single xvg value in a sequence.
 void checkXvgDataPoint(TestReferenceChecker *checker, const std::string &value)
 {
-    checker->checkRealFromString(value, NULL);
+    checker->checkRealFromString(value, nullptr);
 }
 
 }       // namespace