diff --git a/src/list_window.c b/src/list_window.c
index 66c6d21361817ce61202d125be1564c085be707f..c2a4b012f51a76d12ae18fdec3a095b221bfbc8b 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
/* ncmpc (Ncurses MPD Client)
* (c) 2004-2010 The Music Player Daemon Project
* Project homepage: http://musicpd.org
-
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+ */
#include "list_window.h"
#include "config.h"
#include "command.h"
#include "colors.h"
#include "paint.h"
-#include "screen_message.h"
+#include "screen_status.h"
#include "i18n.h"
#include <assert.h>
list_window_get_range(lw, &range);
for (unsigned i = 0; i < lw->rows; i++) {
- const char *label;
-
wmove(lw->w, i, 0);
if (lw->start + i >= lw->length) {
break;
}
- label = callback(lw->start + i, callback_data);
+ const char *label = callback(lw->start + i, callback_data);
assert(label != NULL);
list_window_paint_row(lw->w, lw->cols,
void
list_window_paint2(const struct list_window *lw,
list_window_paint_callback_t paint_callback,
- void *callback_data)
+ const void *callback_data)
{
bool show_cursor = !lw->hide_cursor &&
(!options.hardware_cursor || lw->range_selection);
list_window_get_range(lw, &range);
for (unsigned i = 0; i < lw->rows; i++) {
- bool selected;
-
wmove(lw->w, i, 0);
if (lw->start + i >= lw->length) {
break;
}
- selected = show_cursor &&
+ bool selected = show_cursor &&
lw->start + i >= range.start &&
lw->start + i < range.end;
bool bell_on_wrap)
{
unsigned i = lw->selected + 1;
- const char *label;
assert(str != NULL);
do {
while (i < lw->length) {
- label = callback(i, callback_data);
+ const char *label = callback(i, callback_data);
assert(label != NULL);
if (match_line(label, str)) {
bool bell_on_wrap)
{
int i = lw->selected - 1;
- const char *label;
assert(str != NULL);
do {
while (i >= 0) {
- label = callback(i, callback_data);
+ const char *label = callback(i, callback_data);
assert(label != NULL);
if (match_line(label, str)) {
void *callback_data,
const char *str)
{
- unsigned i;
- const char *label;
-
assert(str != NULL);
- for (i = 0; i < lw->length; i++) {
- label = callback(i, callback_data);
+ for (unsigned i = 0; i < lw->length; i++) {
+ const char *label = callback(i, callback_data);
assert(label != NULL);
if (g_ascii_strncasecmp(label, str, strlen(str)) == 0) {
void *callback_data,
const char *str)
{
- unsigned i;
- const char *label;
- GRegex *regex;
-
assert(str != NULL);
- regex = compile_regex(str, options.jump_prefix_only);
+ GRegex *regex = compile_regex(str, options.jump_prefix_only);
if (regex == NULL)
return false;
- for (i = 0; i < lw->length; i++) {
- label = callback(i, callback_data);
+ for (unsigned i = 0; i < lw->length; i++) {
+ const char *label = callback(i, callback_data);
assert(label != NULL);
if (match_regex(regex, label)) {