Replace C-style library file handling with RAII approaches
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 11 Sep 2018 08:55:58 +0000 (10:55 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 11 Sep 2018 16:02:39 +0000 (18:02 +0200)
commit462d15adf56717337783bc12798a517c39e31815
tree56c4c3a29f74fc06b1ee7facec2b963b6c667884
parent677683fd78d76c16ed7948734ff102120ec36aa4
Replace C-style library file handling with RAII approaches

Avoids and fixes leaks of filename strings and file pointers, in
normal and exceptional cases. Also cleans up some possible mismatched
file open and close routines.

Introduced a new header to declare the new smart FILE-pointer type.

Minor fixes to doxygen.

Change-Id: Ia7fcf5c93f2b91a6540cdd3d0e710a787960af98
24 files changed:
src/gromacs/fileio/matio.cpp
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/pp2shift.cpp
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/gen_vsite.cpp
src/gromacs/gmxpreprocess/gmxcpp.cpp
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/tomorse.cpp
src/gromacs/gmxpreprocess/xlate.cpp
src/gromacs/tables/forcetable.cpp
src/gromacs/topology/atomprop.cpp
src/gromacs/topology/residuetypes.cpp
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/datafilefinder.cpp
src/gromacs/utility/datafilefinder.h
src/gromacs/utility/fileptr.h [new file with mode: 0644]
src/gromacs/utility/filestream.cpp
src/gromacs/utility/filestream.h
src/gromacs/utility/futil.cpp
src/gromacs/utility/futil.h
src/gromacs/utility/strdb.cpp
src/programs/view/fgrid.cpp