1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fix compiler warnings from MSVC 2017

The MS C++ compiler doesn't seem to understand that a small constant
like 0, although strictly being an integer, will fit perfectly fine
into an 8 bit type so add some safe casts to silence that warning.
This commit is contained in:
Kasper Laudrup
2019-12-20 14:37:38 +01:00
parent 28663b0e93
commit 9e61286a59
3 changed files with 8 additions and 8 deletions

View File

@@ -174,9 +174,9 @@ public:
option_identifier(OptionNumber number, OptionClass op_class,
small_uint<1> copied)
#if TINS_IS_LITTLE_ENDIAN
: number(number), op_class(op_class), copied(copied) {}
: number(static_cast<uint8_t>(number)), op_class(static_cast<uint8_t>(op_class)), copied(copied) {}
#else
: copied(copied), op_class(op_class), number(number) {}
: copied(copied), op_class(static_cast<uint8_t>(op_class)), number(static_cast<uint8_t>(number)) {}
#endif
/**