Merge pull request #743 from CapeLeidokos/pr_member_function_pointers

Fixed clang problems with member function pointers
pull/748/head
Gergely Nagy 5 years ago committed by GitHub
commit ed53d80627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,7 +40,7 @@ uint32_t Layer_::layer_state_;
uint8_t Layer_::top_active_layer_; uint8_t Layer_::top_active_layer_;
Key Layer_::live_composite_keymap_[Kaleidoscope.device().numKeys()]; Key Layer_::live_composite_keymap_[Kaleidoscope.device().numKeys()];
uint8_t Layer_::active_layers_[Kaleidoscope.device().numKeys()]; uint8_t Layer_::active_layers_[Kaleidoscope.device().numKeys()];
Key(*Layer_::getKey)(uint8_t layer, KeyAddr key_addr) = Layer.getKeyFromPROGMEM; Layer_::GetKeyFunction Layer_::getKey = &Layer_::getKeyFromPROGMEM;
void Layer_::handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState) { void Layer_::handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState) {
if (keymapEntry.getKeyCode() >= LAYER_SHIFT_OFFSET) { if (keymapEntry.getKeyCode() >= LAYER_SHIFT_OFFSET) {

@ -116,7 +116,8 @@ class Layer_ {
return eventHandler(mappedKey, KeyAddr(row, col), keyState); return eventHandler(mappedKey, KeyAddr(row, col), keyState);
} }
static Key(*getKey)(uint8_t layer, KeyAddr key_addr); typedef Key(*GetKeyFunction)(uint8_t layer, KeyAddr key_addr);
static GetKeyFunction getKey;
static Key getKeyFromPROGMEM(uint8_t layer, KeyAddr key_addr); static Key getKeyFromPROGMEM(uint8_t layer, KeyAddr key_addr);
DEPRECATED(ROW_COL_FUNC) static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col) { DEPRECATED(ROW_COL_FUNC) static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col) {

@ -130,7 +130,7 @@ EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) {
// we actully want. // we actully want.
// //
dumpKeymap(progmem_layers_, dumpKeymap(progmem_layers_,
static_cast<Key(*)(uint8_t, KeyAddr)>(Layer.getKeyFromPROGMEM)); static_cast<Key(*)(uint8_t, KeyAddr)>(Layer_::getKeyFromPROGMEM));
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }

Loading…
Cancel
Save