summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-10-15 07:59:13 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-10-15 07:59:13 +0000
commit0b0c23ff130f7445cd5cfd61bc7c8c3796d2484d (patch)
tree6b7516997ba4289ecc9d8c95c52ae8788b022065
parent887ff33f2e288dc449eb9a69d4bbeb801f02d790 (diff)
downloadrockbox-0b0c23ff130f7445cd5cfd61bc7c8c3796d2484d.tar.gz
rockbox-0b0c23ff130f7445cd5cfd61bc7c8c3796d2484d.zip
Fix some plugins that use NULL instead of -1 when not using a voice id in struct opt_items. Change as many '#define NULL 0' to '#define NULL ((void*)0)' as grep would find - somewehere the former is still hiding it seems. :\
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15117 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/fireworks.c100
-rw-r--r--apps/plugins/reversi/reversi-gui.c14
-rw-r--r--apps/plugins/test_sampr.c32
-rw-r--r--apps/plugins/zxbox/spmain.c24
-rw-r--r--firmware/include/stdlib.h2
-rw-r--r--firmware/include/string.h2
6 files changed, 87 insertions, 87 deletions
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index b95895342b..4ad487d242 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -140,60 +140,60 @@ LCD_RGBPACK(19,10,26) };
#endif
static const struct opt_items autofire_delay_settings[15] = {
- { "Off", NULL },
- { "50ms", NULL },
- { "100ms", NULL },
- { "200ms", NULL },
- { "300ms", NULL },
- { "400ms", NULL },
- { "500ms", NULL },
- { "600ms", NULL },
- { "700ms", NULL },
- { "800ms", NULL },
- { "900ms", NULL },
- { "1s", NULL },
- { "2s", NULL },
- { "3s", NULL },
- { "4s", NULL }
+ { "Off", -1 },
+ { "50ms", -1 },
+ { "100ms", -1 },
+ { "200ms", -1 },
+ { "300ms", -1 },
+ { "400ms", -1 },
+ { "500ms", -1 },
+ { "600ms", -1 },
+ { "700ms", -1 },
+ { "800ms", -1 },
+ { "900ms", -1 },
+ { "1s", -1 },
+ { "2s", -1 },
+ { "3s", -1 },
+ { "4s", -1 }
};
int autofire_delay_values[15] = {
0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400 };
static const struct opt_items particle_settings[8] = {
- { "5", NULL },
- { "10", NULL },
- { "15", NULL },
- { "20", NULL },
- { "25", NULL },
- { "30", NULL },
- { "35", NULL },
- { "40", NULL },
+ { "5", -1 },
+ { "10", -1 },
+ { "15", -1 },
+ { "20", -1 },
+ { "25", -1 },
+ { "30", -1 },
+ { "35", -1 },
+ { "40", -1 },
};
int particle_values[8] = {
5, 10, 15, 20, 25, 30, 35, 40 };
static const struct opt_items particle_life_settings[9] = {
- { "20 cycles", NULL },
- { "30 cycles", NULL },
- { "40 cycles", NULL },
- { "50 cycles", NULL },
- { "60 cycles", NULL },
- { "70 cycles", NULL },
- { "80 cycles", NULL },
- { "90 cycles", NULL },
- { "100 cycles", NULL }
+ { "20 cycles", -1 },
+ { "30 cycles", -1 },
+ { "40 cycles", -1 },
+ { "50 cycles", -1 },
+ { "60 cycles", -1 },
+ { "70 cycles", -1 },
+ { "80 cycles", -1 },
+ { "90 cycles", -1 },
+ { "100 cycles", -1 }
};
int particle_life_values[9] = {
20, 30, 40, 50, 60, 70, 80, 90, 100 };
static const struct opt_items gravity_settings[4] = {
- { "Off", NULL },
- { "Weak", NULL },
- { "Moderate", NULL },
- { "Strong", NULL },
+ { "Off", -1 },
+ { "Weak", -1 },
+ { "Moderate", -1 },
+ { "Strong", -1 },
};
int gravity_values[4] = {
@@ -202,9 +202,9 @@ int gravity_values[4] = {
#ifdef HAVE_LCD_COLOR
static const struct opt_items rocket_settings[3] = {
- { "No", NULL },
- { "Yes (no trails)", NULL },
- { "Yes (with trails)", NULL },
+ { "No", -1 },
+ { "Yes (no trails)", -1 },
+ { "Yes (with trails)", -1 },
};
int rocket_values[4] = {
2, 1, 0 };
@@ -212,8 +212,8 @@ int rocket_values[4] = {
#else
static const struct opt_items rocket_settings[2] = {
- { "No", NULL },
- { "Yes", NULL },
+ { "No", -1 },
+ { "Yes", -1 },
};
int rocket_values[4] = {
1, 0 };
@@ -221,15 +221,15 @@ int rocket_values[4] = {
#endif
static const struct opt_items fps_settings[9] = {
- { "20 FPS", NULL },
- { "25 FPS", NULL },
- { "30 FPS", NULL },
- { "35 FPS", NULL },
- { "40 FPS", NULL },
- { "45 FPS", NULL },
- { "50 FPS", NULL },
- { "55 FPS", NULL },
- { "60 FPS", NULL }
+ { "20 FPS", -1 },
+ { "25 FPS", -1 },
+ { "30 FPS", -1 },
+ { "35 FPS", -1 },
+ { "40 FPS", -1 },
+ { "45 FPS", -1 },
+ { "50 FPS", -1 },
+ { "55 FPS", -1 },
+ { "60 FPS", -1 }
};
int fps_values[9] = {
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c
index f99f616668..6bfa4ae1af 100644
--- a/apps/plugins/reversi/reversi-gui.c
+++ b/apps/plugins/reversi/reversi-gui.c
@@ -322,9 +322,9 @@ static void reversi_gui_display_board(void) {
/* Menu entries and the corresponding values for cursor wrap mode */
#define MENU_TEXT_WRAP_MODE "Cursor wrap mode"
static const struct opt_items cursor_wrap_mode_settings[] = {
- { "Flat board", NULL },
- { "Sphere", NULL },
- { "Torus", NULL },
+ { "Flat board", -1 },
+ { "Sphere", -1 },
+ { "Torus", -1 },
};
static const cursor_wrap_mode_t cursor_wrap_mode_values[3] = {
WRAP_FLAT, WRAP_SPHERE, WRAP_TORUS };
@@ -335,10 +335,10 @@ static const cursor_wrap_mode_t cursor_wrap_mode_values[3] = {
#define MENU_TEXT_STRAT_BLACK "Strategy for black"
static struct opt_items strategy_settings[] = {
- { "Human", NULL },
- { "Naive robot", NULL },
- { "Simple robot", NULL },
- //{ "AB robot", NULL },
+ { "Human", -1 },
+ { "Naive robot", -1 },
+ { "Simple robot", -1 },
+ //{ "AB robot", -1 },
};
static const game_strategy_t * const strategy_values[] = {
&strategy_human, &strategy_naive, &strategy_simple, /*&strategy_ab*/ };
diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c
index d1c9c2ba71..2cd95d7983 100644
--- a/apps/plugins/test_sampr.c
+++ b/apps/plugins/test_sampr.c
@@ -138,18 +138,18 @@ void play_waveform(void)
{
static struct opt_items names[HW_NUM_FREQ] =
{
- HW_HAVE_96_([HW_FREQ_96] = { "96kHz", NULL },)
- HW_HAVE_88_([HW_FREQ_88] = { "88.2kHz", NULL },)
- HW_HAVE_64_([HW_FREQ_64] = { "64kHz", NULL },)
- HW_HAVE_48_([HW_FREQ_48] = { "48kHz", NULL },)
- HW_HAVE_44_([HW_FREQ_44] = { "44.1kHz", NULL },)
- HW_HAVE_32_([HW_FREQ_32] = { "32kHz", NULL },)
- HW_HAVE_24_([HW_FREQ_24] = { "24kHz", NULL },)
- HW_HAVE_22_([HW_FREQ_22] = { "22.05kHz", NULL },)
- HW_HAVE_16_([HW_FREQ_16] = { "16kHz", NULL },)
- HW_HAVE_12_([HW_FREQ_12] = { "12kHz", NULL },)
- HW_HAVE_11_([HW_FREQ_11] = { "11.025kHz", NULL },)
- HW_HAVE_8_( [HW_FREQ_8 ] = { "8kHz", NULL },)
+ HW_HAVE_96_([HW_FREQ_96] = { "96kHz", -1 },)
+ HW_HAVE_88_([HW_FREQ_88] = { "88.2kHz", -1 },)
+ HW_HAVE_64_([HW_FREQ_64] = { "64kHz", -1 },)
+ HW_HAVE_48_([HW_FREQ_48] = { "48kHz", -1 },)
+ HW_HAVE_44_([HW_FREQ_44] = { "44.1kHz", -1 },)
+ HW_HAVE_32_([HW_FREQ_32] = { "32kHz", -1 },)
+ HW_HAVE_24_([HW_FREQ_24] = { "24kHz", -1 },)
+ HW_HAVE_22_([HW_FREQ_22] = { "22.05kHz", -1 },)
+ HW_HAVE_16_([HW_FREQ_16] = { "16kHz", -1 },)
+ HW_HAVE_12_([HW_FREQ_12] = { "12kHz", -1 },)
+ HW_HAVE_11_([HW_FREQ_11] = { "11.025kHz", -1 },)
+ HW_HAVE_8_( [HW_FREQ_8 ] = { "8kHz", -1 },)
};
/* 50 cycles of wavform */
@@ -241,10 +241,10 @@ void set_waveform(void)
{
static struct opt_items names[NUM_WAVEFORMS] =
{
- [TONE_SINE] = { "Sine", NULL },
- [TONE_TRIANGLE] = { "Triangle", NULL },
- [TONE_SAWTOOTH] = { "Sawtooth", NULL },
- [TONE_SQUARE] = { "Square", NULL },
+ [TONE_SINE] = { "Sine", -1 },
+ [TONE_TRIANGLE] = { "Triangle", -1 },
+ [TONE_SAWTOOTH] = { "Sawtooth", -1 },
+ [TONE_SQUARE] = { "Square", -1 },
};
rb->set_option("Waveform", &waveform, INT, names,
diff --git a/apps/plugins/zxbox/spmain.c b/apps/plugins/zxbox/spmain.c
index 3f0bc9319e..ca0fa9bc71 100644
--- a/apps/plugins/zxbox/spmain.c
+++ b/apps/plugins/zxbox/spmain.c
@@ -237,8 +237,8 @@ static void select_keymap(void){
/* options menu */
static void options_menu(void){
static const struct opt_items no_yes[2] = {
- { "No", NULL },
- { "Yes", NULL },
+ { "No", -1 },
+ { "Yes", -1 },
};
int m;
int result;
@@ -255,16 +255,16 @@ static void options_menu(void){
{ "Custom keymap", NULL },
};
static struct opt_items frameskip_items[] = {
- { "0", NULL },
- { "1", NULL },
- { "2", NULL },
- { "3", NULL },
- { "4", NULL },
- { "5", NULL },
- { "6", NULL },
- { "7", NULL },
- { "8", NULL },
- { "9", NULL },
+ { "0", -1 },
+ { "1", -1 },
+ { "2", -1 },
+ { "3", -1 },
+ { "4", -1 },
+ { "5", -1 },
+ { "6", -1 },
+ { "7", -1 },
+ { "8", -1 },
+ { "9", -1 },
};
diff --git a/firmware/include/stdlib.h b/firmware/include/stdlib.h
index 0074fe65e5..1f4fb88668 100644
--- a/firmware/include/stdlib.h
+++ b/firmware/include/stdlib.h
@@ -17,7 +17,7 @@ extern "C" {
#include <stddef.h>
#ifndef NULL
-#define NULL 0
+#define NULL ((void*)0)
#endif
#define EXIT_FAILURE 1
diff --git a/firmware/include/string.h b/firmware/include/string.h
index 713a875698..32b86cd2b0 100644
--- a/firmware/include/string.h
+++ b/firmware/include/string.h
@@ -17,7 +17,7 @@ extern "C" {
#include <stddef.h>
#ifndef NULL
-#define NULL 0
+#define NULL ((void*)0)
#endif
_PTR _EXFUN(memchr,(const _PTR, int, size_t));