neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
951 stars 191 forks source link

warning: narrowing conversion with keyMap #308

Closed fmatray closed 4 years ago

fmatray commented 4 years ago

Hello, I get this WARNINg during the compilation.

src/display/display.cpp:25:76: warning: narrowing conversion of '(char)Menu::defaultNavCodes[2].Menu::navCode::ch' from 'char' to 'int8_t {aka signed char}' inside { } [-Wnarrowing]
 keyMap encoder_button_map[] = {{-ENCODER_BUTTON, defaultNavCodes[enterCmd].ch}};  

This is because defaultNavCodes[enterCmd].ch is a char and keyMap.code is an int8_t.

keyMap.code, in altKeyMapDef.h and keyMapDef.h, should uint8_t instead of int8_t, to avoid this warning.