diff options
author | Max Kellermann <max@duempel.org> | 2008-09-15 12:27:29 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-15 12:27:29 +0200 |
commit | 6e81a1b3e08a423c6f4c6976aecae915bd1a3f0b (patch) | |
tree | c8f9ebb406e85fcb712e2dae8e5c80a2acaa8421 /src/screen_lyrics.c | |
parent | 08c055113f2eacd42fde57b952b548ca45e29eb2 (diff) | |
download | mpd-6e81a1b3e08a423c6f4c6976aecae915bd1a3f0b.tar.gz mpd-6e81a1b3e08a423c6f4c6976aecae915bd1a3f0b.tar.xz mpd-6e81a1b3e08a423c6f4c6976aecae915bd1a3f0b.zip |
fixed mixed declaration + code
Although they are allowedd in C99, try to avoid them. Move variable
declarations to the top of the current scope.
Diffstat (limited to 'src/screen_lyrics.c')
-rw-r--r-- | src/screen_lyrics.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 8943d4f22..2c770ff59 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -71,6 +71,8 @@ static int store_lyr_hd(void) char title[512]; static char path[1024]; FILE *lyr_file; + int i; + char line_buf[1024]; get_text_line(&lyr_text, 0, artist, 512); get_text_line(&lyr_text, 1, title, 512); @@ -83,9 +85,6 @@ static int store_lyr_hd(void) if (lyr_file == NULL) return -1; - int i; - char line_buf[1024]; - for (i = 3; i <= lyr_text.text->len; i++) { if(get_text_line(&lyr_text, i, line_buf, 1024) == -1); fputs(line_buf, lyr_file); @@ -106,6 +105,9 @@ static gpointer get_lyr(void *c) { mpd_Status *status = ((retrieval_spec*)c)->client->status; mpd_Song *cur = ((retrieval_spec*)c)->client->song; + char artist[MAX_SONGNAME_LENGTH]; + char title[MAX_SONGNAME_LENGTH]; + //mpdclient_update((mpdclient_t*)c); if(!(IS_PAUSED(status->state)||IS_PLAYING(status->state))) { @@ -114,8 +116,6 @@ static gpointer get_lyr(void *c) } - char artist[MAX_SONGNAME_LENGTH]; - char title[MAX_SONGNAME_LENGTH]; lock=2; result = 0; @@ -160,8 +160,8 @@ list_callback(int idx, int *highlight, void *data) if ((idx == lyr_text.lines->len && lyr_text.lines->len > 4) || ((lyr_text.lines->len == 0 || lyr_text.lines->len == 4) && idx == 0)) { - *highlight=3; src_lyr* selected = g_array_index(src_lyr_stack, src_lyr*, src_selection); + *highlight=3; if (selected != NULL) return selected->description; return ""; |