From 7ab1cd7b1b10a9b355ad05a6acd4412069af44cc Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sun, 28 Feb 2010 14:13:35 +0000 Subject: Save some RAM by changing a char[] into a const char * in struct afmt_entry. Make other fields const too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24970 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_tokens.c | 4 ++-- apps/metadata.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index e6dfc95f12..5228dd16bc 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -64,10 +64,10 @@ extern struct wps_state wps_state; -static char* get_codectype(const struct mp3entry* id3) +static const char* get_codectype(const struct mp3entry* id3) { if (id3 && id3->codectype < AFMT_NUM_CODECS) { - return (char*)audio_formats[id3->codectype].label; + return audio_formats[id3->codectype].label; } else { return NULL; } diff --git a/apps/metadata.h b/apps/metadata.h index 7bf086f27d..0d0f6c5aac 100644 --- a/apps/metadata.h +++ b/apps/metadata.h @@ -153,16 +153,16 @@ extern const int afmt_rec_format[AFMT_NUM_CODECS]; /* record describing the audio format */ struct afmt_entry { - char label[8]; /* format label */ + const char *label; /* format label */ #if CONFIG_CODEC == SWCODEC - char *codec_root_fn; /* root codec filename (sans _enc and .codec) */ + const char *codec_root_fn; /* root codec filename (sans _enc and .codec) */ #ifdef HAVE_RECORDING - char *codec_enc_root_fn; /* filename of encoder codec */ + const char *codec_enc_root_fn; /* filename of encoder codec */ #endif #endif - char *ext_list; /* double NULL terminated extension - list for type with the first as - the default for recording */ + const char *ext_list; /* double NULL terminated extension + list for type with the first as + the default for recording */ }; /* database of labels and codecs. add formats per above enum */ -- cgit v1.2.3