summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74f964e)
raw | patch | inline | side by side (parent: 74f964e)
author | Max Kellermann <max@duempel.org> | |
Sun, 13 Sep 2009 10:25:17 +0000 (12:25 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 13 Sep 2009 10:25:17 +0000 (12:25 +0200) |
No caller modifies these objects. It's safe to return const.
src/screen_browser.c | patch | blob | history | |
src/screen_file.c | patch | blob | history |
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 5f6e048810ab00a8a6b97efe72b4bb8961bdc7fa..501c875ea5352c4225123e10b598e29d7f4d7312 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
@@ -148,7 +148,7 @@ browser_lw_callback(unsigned idx, bool *highlight, G_GNUC_UNUSED char **second_c
g_free(directory);
return buf;
} else if( entity->type==MPD_INFO_ENTITY_TYPE_SONG ) {
- mpd_Song *song = entity->info.song;
+ const mpd_Song *song = entity->info.song;
strfsong(buf, BUFSIZE, options.list_format, song);
return buf;
return filelist_get(browser->filelist, browser->lw->selected);
}
-static struct mpd_InfoEntity *
+static const struct mpd_InfoEntity *
browser_get_selected_entity(const struct screen_browser *browser)
{
- struct filelist_entry *entry = browser_get_selected_entry(browser);
+ const struct filelist_entry *entry = browser_get_selected_entry(browser);
return entry != NULL
? entry->entity
: NULL;
}
-static struct mpd_song *
+static const struct mpd_song *
browser_get_selected_song(const struct screen_browser *browser)
{
- struct mpd_InfoEntity *entity = browser_get_selected_entity(browser);
+ const struct mpd_InfoEntity *entity = browser_get_selected_entity(browser);
return entity != NULL && entity->type == MPD_INFO_ENTITY_TYPE_SONG
? entity->info.song
browser_cmd(struct screen_browser *browser,
struct mpdclient *c, command_t cmd)
{
- struct mpd_song *song;
+ const struct mpd_song *song;
if (browser->filelist == NULL)
return false;
diff --git a/src/screen_file.c b/src/screen_file.c
index 00b505f9b909cc82d3df6a8a08e8fe2ed38e71b0..8393816456a28d7cf2c65990bcc47bb2b66dd40e 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
#endif
static bool
-file_change_directory(mpdclient_t *c, filelist_entry_t *entry,
+file_change_directory(mpdclient_t *c, const filelist_entry_t *entry,
const char *new_path)
{
- mpd_InfoEntity *entity = NULL;
+ const mpd_InfoEntity *entity = NULL;
gchar *path = NULL;
char *old_path;
int idx;
static bool
file_handle_enter(struct mpdclient *c)
{
- struct filelist_entry *entry = browser_get_selected_entry(&browser);
- struct mpd_InfoEntity *entity;
+ const struct filelist_entry *entry = browser_get_selected_entry(&browser);
+ const struct mpd_InfoEntity *entity;
if (entry == NULL)
return false;