Improve enum option interface.
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 12 Feb 2013 12:44:17 +0000 (14:44 +0200)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 7 Mar 2013 18:57:28 +0000 (20:57 +0200)
commitee2dd3fc0ed3eff8461e93d7f22af95f0f7fa836
treeda98a424998642d59bce75b6381823846d0cfc68
parentcd965ad62519264340211875aa7c776aeca3e58b
Improve enum option interface.

It is no longer necessary to have explicit NULL terminating arrays
passed to StringOption::enumValue().  Instead, let the compiler deduce
the size of the array.  Reduces the potential for coding mistakes, as it
is now impossible to forget to terminate the array.

Added a separate enumValueFromNullTerminatedArray() for those rare cases
where the array is programmatically constructed or the compiler for
other reasons doesn't know its size at compile time.

Change-Id: I5e7d63db1eeea6d9d271fa299c98c781f52bd89c
src/gromacs/analysisdata/modules/plot.cpp
src/gromacs/commandline/tests/cmdlinehelpwriter.cpp
src/gromacs/options/basicoptions.cpp
src/gromacs/options/basicoptions.h
src/gromacs/options/tests/option.cpp
src/gromacs/options/tests/optionsassigner.cpp
src/gromacs/options/timeunitmanager.cpp
src/gromacs/selection/selectioncollection.cpp
src/gromacs/trajectoryanalysis/modules/angle.cpp
src/gromacs/trajectoryanalysis/modules/select.cpp