summaryrefslogtreecommitdiff
path: root/src/basic/virt.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-06-11 16:02:03 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commitd9537fde9944a03f48054e0f4b6a9aea7d3c2a9d (patch)
tree1f4d52653dea6867cba74e3c950d251646581822 /src/basic/virt.c
parent5794614c99bdb57a405f293923bf17f24dad25e9 (diff)
tree-wide: drop !! casts to booleans
They are not needed, because anything that is non-zero is converted to true. C11: > 6.3.1.2: When any scalar value is converted to _Bool, the result is 0 if the > value compares equal to 0; otherwise, the result is 1. https://stackoverflow.com/questions/31551888/casting-int-to-bool-in-c-c
Diffstat (limited to 'src/basic/virt.c')
-rw-r--r--src/basic/virt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 3b2f1b917..dfc384ede 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -57,7 +57,7 @@ static int detect_vm_cpuid(void) {
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) == 0)
return VIRTUALIZATION_NONE;
- hypervisor = !!(ecx & 0x80000000U);
+ hypervisor = ecx & 0x80000000U;
if (hypervisor) {
union {