Skip to content

Commit 598cfa1

Browse files
committed
fixed compiler warnings
1 parent 015c71a commit 598cfa1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/vmaware.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ struct VM {
14861486
}
14871487

14881488
u64 number = std::stoull(number_str);
1489-
if (is_mb) number = static_cast<u64>(std::round(number / 1024.0));
1489+
if (is_mb) number = static_cast<u64>(std::round(static_cast<double>(number) / 1024.0));
14901490

14911491
return static_cast<u32>(std::min<u64>(number, std::numeric_limits<u32>::max()));
14921492
#elif (WINDOWS)
@@ -1978,9 +1978,9 @@ struct VM {
19781978

19791979
// For these, we only care that it's virtualized:
19801980
if (v.size == 7 // "monitor"
1981-
|| v.size == 6 && v.data[0] == 'h' // "hvisor"
1982-
|| v.size == 10 && v.data[0] == 'h') // "hypervisor"
1983-
{
1981+
|| ((v.size == 6) && (v.data[0] == 'h')) // "hvisor"
1982+
|| ((v.size == 10) && (v.data[0] == 'h')) // "hypervisor"
1983+
) {
19841984
return true;
19851985
}
19861986

@@ -2160,7 +2160,7 @@ struct VM {
21602160
}
21612161
std::free(table);
21622162

2163-
#ifdef __VMAWARE_DEBUG__
2163+
#ifdef __VMAWARE_DEBUG__
21642164
{
21652165
std::stringstream ss;
21662166
ss << std::hex << std::setw(2) << std::setfill('0')
@@ -2169,6 +2169,9 @@ struct VM {
21692169
<< static_cast<int>(mac[2]) << ":XX:XX:XX";
21702170
debug("MAC: ", ss.str());
21712171
}
2172+
#endif
2173+
#else
2174+
return false;
21722175
#endif
21732176

21742177
if ((mac[0] | mac[1] | mac[2]) == 0) {
@@ -2202,9 +2205,6 @@ struct VM {
22022205
}
22032206

22042207
return false;
2205-
#else
2206-
return false;
2207-
#endif
22082208
}
22092209

22102210

0 commit comments

Comments
 (0)