]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Fix deprecated 'prog_*' typedef - Issue #34
authortmk <nobody@nowhere>
Mon, 20 May 2013 13:42:29 +0000 (22:42 +0900)
committertmk <nobody@nowhere>
Tue, 21 May 2013 01:16:55 +0000 (10:16 +0900)
- Remove prog_char from xpritnf
- Remove prog_macro_t from acton_macro

avr-libc-1.8 removed 'prog_*' typedef because the usage of
the __progmem__ attribute on a type is not supported in GCC.
http://www.nongnu.org/avr-libc/changes-1.8.html

common/action.h
common/action_macro.c
common/action_macro.h
common/keymap.c
common/xprintf.S
common/xprintf.h
converter/pc98_usb/keymap.c
keyboard/hhkb/keymap.c

index 98c4ef81a664c7e3121cf7564e02a364660a06a5..8f1f5b7986add2ed2028423d8c75f5f731bb04ec 100644 (file)
@@ -50,7 +50,7 @@ void action_exec(keyevent_t event);
 action_t action_for_key(uint8_t layer, key_t key);
 
 /* macro */
-const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
 
 /* user defined special function */
 void action_function(keyrecord_t *record, uint8_t id, uint8_t opt);
index 71d1506f5cabbe6e16392f8a0c6f1c9f4b105f7e..29cfd23df147ad43546b87b788bc24b0b8c0672b 100644 (file)
@@ -28,7 +28,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef NO_ACTION_MACRO
 
 #define MACRO_READ()  (macro = pgm_read_byte(macro_p++))
-void action_macro_play(const prog_macro_t *macro_p)
+void action_macro_play(const macro_t *macro_p)
 {
     macro_t macro = END;
     uint8_t interval = 0;
index ee5c7c4266db059946540e7d0789e82d1f000e57..eea8ef57d173645109b674dff85aa9228da9474b 100644 (file)
@@ -21,15 +21,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 #define MACRO_NONE  0
-#define MACRO(...) ({ static prog_macro_t _m[] PROGMEM = { __VA_ARGS__ }; _m; })
+#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; })
 
 
 typedef uint8_t macro_t;
-typedef macro_t prog_macro_t PROGMEM;
 
 
 #ifndef NO_ACTION_MACRO
-void action_macro_play(const prog_macro_t *macro);
+void action_macro_play(const macro_t *macro_p);
 #else
 #define action_macro_play(macro)
 #endif
index 8e2b8607c8339d78e8a3c37af580bcc710197b16..cf4711bf66880594ff91730f499818201fdacf69 100644 (file)
@@ -106,7 +106,7 @@ action_t action_for_key(uint8_t layer, key_t key)
 
 /* Macro */
 __attribute__ ((weak))
-const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
     return MACRO_NONE;
 }
index b5a97b20a9e63719d0ed09ffb93370aaf23f5e62..0cec70ce224f4317af446d1cacaeb6d13de2ad9c 100644 (file)
@@ -80,7 +80,7 @@ xputc:
 ;---------------------------------------------------------------------------\r
 ; Direct ROM string output\r
 ;\r
-;Prototype: void xputs (const prog_char *str // rom string to be output\r
+;Prototype: void xputs (const char *str_p // rom string to be output\r
 ;                      );\r
 \r
 .func xputs\r
@@ -179,9 +179,9 @@ xitoa:
 ; Formatted string output (16/32bit version)\r
 ;\r
 ;Prototype:\r
-; void xprintf (const prog_char *format, ...);\r
-; void xsprintf(char*, const prog_char *format, ...);\r
-; void xfprintf(void(*func)(char), const prog_char *format, ...);\r
+; void __xprintf (const char *format_p, ...);\r
+; void __xsprintf(char*, const char *format_p, ...);\r
+; void __xfprintf(void(*func)(char), const char *format_p, ...);\r
 ;\r
 \r
 #if USE_XPRINTF\r
index cddec994098e1b6525bd7a5209642f4528234ea8..f58bca817be791356cc11b2aed9a16841e03618d 100644 (file)
@@ -23,7 +23,7 @@ void xputc(char chr);
 \r
 \r
 /*-----------------------------------------------------------------------------*/\r
-void xputs(const prog_char *string);\r
+void xputs(const char *string_p);\r
 \r
 /*  The string placed in the ROM is forwarded to xputc() directly.\r
 */\r
@@ -51,9 +51,9 @@ void xitoa(long value, char radix, char width);
 #define xsprintf(str, format, ...)      __xsprintf(str, PSTR(format), ##__VA_ARGS__)\r
 #define xfprintf(func, format, ...)     __xfprintf(func, PSTR(format), ##__VA_ARGS__)\r
 \r
-void __xprintf(const prog_char *format, ...);  /* Send formatted string to the registered device */\r
-void __xsprintf(char*, const prog_char *format, ...);  /* Put formatted string to the memory */\r
-void __xfprintf(void(*func)(uint8_t), const prog_char *format, ...); /* Send formatted string to the specified device */\r
+void __xprintf(const char *format_p, ...);     /* Send formatted string to the registered device */\r
+void __xsprintf(char*, const char *format_p, ...);     /* Put formatted string to the memory */\r
+void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */\r
 \r
 /* Format string is placed in the ROM. The format flags is similar to printf().\r
 \r
index 3ab0a4dbea0d8c43c0e668ab083bae3259d07a8a..7420e24ac833c248eebee7920103390e6c2bb5cd 100644 (file)
@@ -125,7 +125,7 @@ enum macro_id {
     DUMMY,
 };
 
-const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
     keyevent_t event = record->event;
     //uint8_t tap_count = record->tap_count;
index eb66b9dc02c03017796c80ee4dc73cfaf252d27e..265fb87290a4e3a441a2c5d6a23c886b5ca01b6b 100644 (file)
@@ -209,7 +209,7 @@ static const uint16_t PROGMEM fn_actions[] = {
 /*
  * Macro definition
  */
-const prog_macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
 {
     keyevent_t event = record->event;
     tap_t tap = record->tap;