On Thu, Dec 03, 2020 at 13:36:10 +0100, Michal Privoznik wrote:
The virDomainMemoryModel structure has a @type member which is
really type of virDomainMemoryModel but we store it as int
because the virDomainMemoryModelTypeFromString() call stores its
retval right into it. Then, to have compiler do compile time
check for us, every switch() typecasts the @type. This is
needlessly verbose because the parses already has @val - a
variable to store temporary values. Switch @type in the struct to
I actually wanted to ramble about reuse of @val, but it's there multiple
times ...
virDomainMemoryModel and drop all typecasts.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 9 +++++----
src/conf/domain_conf.h | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.c | 4 ++--
src/security/security_apparmor.c | 2 +-
src/security/security_dac.c | 4 ++--
src/security/security_selinux.c | 4 ++--
7 files changed, 14 insertions(+), 13 deletions(-)
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>