machyve / xhyve

xhyve, a lightweight OS X virtualization solution
Other
6.43k stars 353 forks source link

Explicitly cast to uint8_t #219

Closed catap closed 2 years ago

catap commented 2 years ago

Apple clang-1300.0.29.3 (ships with macOS 11.6) requires to use -Wno-shorten-64-to-32 and -Wsnoign-conversion, or explicitly cast to smaller type or signed type.

immediate is int64_t and opsize is 4 bits field which makes mask clearly no more than 5 bits => cast to uint8_t is safe here and just makes clang happy and code clean.

buf[] is also uint8_t and cast happened before but implicitly.