]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Addressed void* return warning & coding style
authoryoyoerx <kevin.wepasnick@gmail.com>
Wed, 9 Mar 2016 19:04:14 +0000 (14:04 -0500)
committeryoyoerx <kevin.wepasnick@gmail.com>
Wed, 9 Mar 2016 19:04:14 +0000 (14:04 -0500)
keyboard/atomic/atomic.c
keyboard/atomic/atomic.h
keyboard/planck/keymaps/lock/keymap.c
keyboard/planck/planck.c
keyboard/planck/planck.h
quantum/matrix.c
quantum/template/template.c
quantum/template/template.h
tmk_core/common/matrix.h

index fa66266a4c3bf6a85875c7c60b43fd6d4393a8be..30e812289396099e3e463499d838bc7dd3e92ca8 100644 (file)
@@ -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
index 95982ecad1a63b406fd9a46c1b235c6365441c4c..d8574efa9397684f7543906d062beb0237cf7a75 100644 (file)
@@ -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
index 9585764629472906be6f1234f78e870af6051cee..f1629492efc32b26f0e7841d7c9b09236a2ccc2b 100644 (file)
@@ -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
index 63ca54761c251f8b60d45ae05d00b261395ddad8..fe8731ec7b5486fef4c410e41ba70c404ce4fe5f 100644 (file)
@@ -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();
+}
index 00b01b54dfa9cfc20ca45a0c0763ac56b28422a6..e9566b92286e18e2149558f15429ec5fe51aa1f2 100644 (file)
@@ -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
index 95bf4c0973b3f0cfe205f52104e20cedb0c4b150..2dab6ae941e0cf8320bb74b122b6c9151f2bdfcf 100644 (file)
@@ -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;
 }
index 7be7dfc3d163f2b96508050510b26010a3441cf7..7dcd67cfcfb6e4f31546d364d7a678a799642fb0 100644 (file)
@@ -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
index a15061b267b9fb32e5d782d8cdbffc68a2a6c691..1171dc8e0f50c418060dc4c0fa10d66419929141 100644 (file)
@@ -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
index 85415df7199b3c23ee1cd9ae9de7bff6109663e4..0b013fc989aedd8a10a2a50c9f2f9c7b7a61a74a 100644 (file)
@@ -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
 }