From d58b14e880580671a297be81303acbef5e28e0b3 Mon Sep 17 00:00:00 2001 From: yoyoerx Date: Wed, 9 Mar 2016 14:04:14 -0500 Subject: [PATCH] Addressed void* return warning & coding style --- keyboard/atomic/atomic.c | 24 ++++++++++-------------- keyboard/atomic/atomic.h | 4 ++-- keyboard/planck/keymaps/lock/keymap.c | 2 +- keyboard/planck/planck.c | 24 ++++++++++-------------- keyboard/planck/planck.h | 4 ++-- quantum/matrix.c | 16 ++++++---------- quantum/template/template.c | 26 ++++++++++---------------- quantum/template/template.h | 4 ++-- tmk_core/common/matrix.h | 4 ++-- 9 files changed, 45 insertions(+), 63 deletions(-) diff --git a/keyboard/atomic/atomic.c b/keyboard/atomic/atomic.c index fa66266a..30e81228 100644 --- a/keyboard/atomic/atomic.c +++ b/keyboard/atomic/atomic.c @@ -1,16 +1,16 @@ #include "atomic.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { // leave these blank -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { // leave these blank -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up @@ -25,16 +25,12 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; \ No newline at end of file + matrix_scan_user(); +} \ No newline at end of file diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 95982eca..d8574efa 100644 --- a/keyboard/atomic/atomic.h +++ b/keyboard/atomic/atomic.h @@ -24,7 +24,7 @@ { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif \ No newline at end of file diff --git a/keyboard/planck/keymaps/lock/keymap.c b/keyboard/planck/keymaps/lock/keymap.c index 95857646..f1629492 100644 --- a/keyboard/planck/keymaps/lock/keymap.c +++ b/keyboard/planck/keymaps/lock/keymap.c @@ -150,7 +150,7 @@ float start_up[][2] = { {440.0*pow(2.0,(64)/12.0), 1000}, }; -void * matrix_init_user(void) { +void matrix_init_user(void) { init_notes(); play_notes(&start_up, 9, false); } \ No newline at end of file diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index 63ca5476..fe8731ec 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c @@ -1,16 +1,16 @@ #include "planck.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { #ifdef BACKLIGHT_ENABLE backlight_init_ports(); #endif @@ -24,13 +24,9 @@ void * matrix_init_kb(void) { DDRE |= (1<<6); PORTE |= (1<<6); - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; + matrix_init_user(); +} -void * matrix_scan_kb(void) { - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; +void matrix_scan_kb(void) { + matrix_scan_user(); +} diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 00b01b54..e9566b92 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -40,7 +40,7 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif diff --git a/quantum/matrix.c b/quantum/matrix.c index 95bf4c09..2dab6ae9 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -48,14 +48,14 @@ static void unselect_rows(void); static void select_row(uint8_t row); __attribute__ ((weak)) -void * matrix_init_kb(void) { +void matrix_init_kb(void) { -}; +} __attribute__ ((weak)) -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { -}; +} inline uint8_t matrix_rows(void) @@ -86,9 +86,7 @@ void matrix_init(void) matrix_debouncing[i] = 0; } - if (matrix_init_kb) { - (*matrix_init_kb)(); - } + matrix_init_kb(); } @@ -152,9 +150,7 @@ uint8_t matrix_scan(void) } #endif - if (matrix_scan_kb) { - (*matrix_scan_kb)(); - } + matrix_scan_kb(); return 1; } diff --git a/quantum/template/template.c b/quantum/template/template.c index 7be7dfc3..7dcd67cf 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -1,29 +1,23 @@ #include "%KEYBOARD%.h" __attribute__ ((weak)) -void * matrix_init_user(void) { +void matrix_init_user(void) { // leave these blank -}; +} __attribute__ ((weak)) -void * matrix_scan_user(void) { +void matrix_scan_user(void) { // leave these blank -}; +} -void * matrix_init_kb(void) { +void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up + matrix_init_user(); +} - if (matrix_init_user) { - (*matrix_init_user)(); - } -}; - -void * matrix_scan_kb(void) { +void matrix_scan_kb(void) { // put your looping keyboard code here // runs every cycle (a lot) - - if (matrix_scan_user) { - (*matrix_scan_user)(); - } -}; \ No newline at end of file + matrix_scan_user(); +} \ No newline at end of file diff --git a/quantum/template/template.h b/quantum/template/template.h index a15061b2..1171dc8e 100644 --- a/quantum/template/template.h +++ b/quantum/template/template.h @@ -19,7 +19,7 @@ { k10, KC_NO, k11 }, \ } -void * matrix_init_user(void); -void * matrix_scan_user(void); +void matrix_init_user(void); +void matrix_scan_user(void); #endif \ No newline at end of file diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 85415df7..0b013fc9 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -64,8 +64,8 @@ void matrix_power_up(void); void matrix_power_down(void); /* keyboard-specific setup/loop functionality */ -void * matrix_init_kb(void); -void * matrix_scan_kb(void); +void matrix_init_kb(void); +void matrix_scan_kb(void); #ifdef __cplusplus }