Replace C-style typedefs with idiomatic C++ code

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1194/head
Michael Richters 3 years ago
parent 920be03cad
commit 2df20b1a5a
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -62,10 +62,10 @@ constexpr Key LeaderKey(uint8_t n) {
class Leader : public kaleidoscope::Plugin { class Leader : public kaleidoscope::Plugin {
public: public:
typedef void (*action_t)(uint8_t seq_index); typedef void (*action_t)(uint8_t seq_index);
typedef struct { struct dictionary_t {
Key sequence[LEADER_MAX_SEQUENCE_LENGTH + 1]; Key sequence[LEADER_MAX_SEQUENCE_LENGTH + 1];
action_t action; action_t action;
} dictionary_t; };
const dictionary_t *dictionary; const dictionary_t *dictionary;

@ -52,10 +52,10 @@ namespace plugin {
class MagicCombo : public kaleidoscope::Plugin { class MagicCombo : public kaleidoscope::Plugin {
public: public:
typedef void (*ComboAction)(uint8_t combo_index); typedef void (*ComboAction)(uint8_t combo_index);
typedef struct { struct Combo {
ComboAction action; ComboAction action;
int8_t keys[MAX_COMBO_LENGTH + 1]; int8_t keys[MAX_COMBO_LENGTH + 1];
} Combo; };
#ifndef NDEPRECATED #ifndef NDEPRECATED
DEPRECATED(MAGICCOMBO_MIN_INTERVAL) DEPRECATED(MAGICCOMBO_MIN_INTERVAL)

@ -27,9 +27,9 @@ namespace plugin {
class ShapeShifter : public kaleidoscope::Plugin { class ShapeShifter : public kaleidoscope::Plugin {
public: public:
typedef struct { struct dictionary_t {
Key original, replacement; Key original, replacement;
} dictionary_t; };
const dictionary_t *dictionary = nullptr; const dictionary_t *dictionary = nullptr;

@ -35,11 +35,11 @@ namespace plugin {
class Syster : public kaleidoscope::Plugin { class Syster : public kaleidoscope::Plugin {
public: public:
typedef enum { enum action_t : uint8_t {
StartAction, StartAction,
EndAction, EndAction,
SymbolAction SymbolAction
} action_t; };
void reset(); void reset();

Loading…
Cancel
Save