Projects
Multimedia
ncmpc
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
ncmpc.changes
Changed
@@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Tue Aug 26 14:02:26 UTC 2014 - pascal.bleser@opensuse.org + +- enable chat screen feature from 0.21 +- update to 0.24: + * fix crash on "jump" (hotkey ".") + * save keys to path specified by --key-file +- changes from 0.22: + * rename "playlist" to "queue" + * remove useless "Connected to ..." message + * require libmpdclient 2.3, MPD 0.16 + * patched color line-flags + * configuration option "search-format" + * remove broken leoslyrics plugin + * show audio format in song screen + +------------------------------------------------------------------- Mon Feb 10 09:51:54 UTC 2014 - pascal.bleser@opensuse.org - update to 0.21:
View file
ncmpc.spec
Changed
@@ -14,15 +14,18 @@ Name: ncmpc -Version: 0.21 +Version: 0.24 Release: 1 Summary: Curses Client for the Music Player Daemon License: GPL-2.0+ Group: Productivity/Multimedia/Sound/Players -Source: http://www.musicpd.org/download/ncmpc/0/ncmpc-%{version}.tar.bz2 +Source: http://www.musicpd.org/download/ncmpc/0/ncmpc-%{version}.tar.xz URL: http://mpd.wikia.com/wiki/Client:Ncmpc BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -BuildRequires: glib2-devel libmpdclient-devel pkgconfig ncurses-devel +BuildRequires: glib2-devel +BuildRequires: libmpdclient-devel >= 2.3 +BuildRequires: pkgconfig +BuildRequires: ncurses-devel %description ncmpc is a curses client for the Music Player Daemon (MPD). ncmpc connects to @@ -46,9 +49,10 @@ --enable-key-screen \ --disable-lyrics-screen \ --enable-outputs-screen \ + --enable-chat-screen \ --disable-werror -%__make %{?_smp_mflags} +%__make %{?_smp_mflags} V=1 %install %makeinstall
View file
ncmpc-0.21.tar.bz2/build/mkinstalldirs
Deleted
@@ -1,162 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2009-04-28.21; # UTC - -# Original author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to <bug-automake@gnu.org> or send patches to -# <automake-patches@gnu.org>. - -nl=' -' -IFS=" "" $nl" -errstatus=0 -dirmode= - -usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. - -Report bugs to <bug-automake@gnu.org>." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" - exit $? - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --version) - echo "$0 $scriptversion" - exit $? - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and -# mkdir -p a/c at the same time, both will detect that a is missing, -# one will create a, then the other will try to create a and die with -# a "File exists" error. This is a problem when calling mkinstalldirs -# from a parallel make. We use --version in the probe to restrict -# ourselves to GNU mkdir, which is thread-safe. -case $dirmode in - '') - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./--version && rmdir ./--version - fi - ;; - *) - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && - test ! -d ./--version; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./--version "./$dirmode"; - do - test -d $d && rmdir $d - done - fi - ;; -esac - -for file -do - case $file in - /*) pathcomp=/ ;; - *) pathcomp= ;; - esac - oIFS=$IFS - IFS=/ - set fnord $file - shift - IFS=$oIFS - - for d - do - test "x$d" = x && continue - - pathcomp=$pathcomp$d - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr= - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp=$pathcomp/ - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
View file
ncmpc-0.21.tar.bz2/lyrics/15-leoslyrics.sh
Deleted
@@ -1,21 +0,0 @@ -#!/bin/bash - -set -e - -search="http://api.leoslyrics.com/api_search.php?auth=ncmpc" -lyrics="http://api.leoslyrics.com/api_lyrics.php?auth=ncmpc" -cache="$HOME/.lyrics/$1 - $2.txt" - -hid=$(wget -q -O- "$search&artist=$1&songtitle=$2" | - sed -n 's/.*hid="\([^"]*\)".*exactMatch="true".*/\1/p' | - head -n 1) - -test "$hid" - -mkdir -p "$(dirname "$cache")" - -wget -q -O- "$lyrics&hid=$hid" | awk ' - /<text>/ { go=1; sub(".*<text>", "") }; - /<\/text>/ { go=0; sub("</text>.*", "") }; - go { sub("
", ""); print }; -' | tee "$cache"
View file
ncmpc-0.21.tar.bz2/lyrics/30-leoslyrics.py
Deleted
@@ -1,96 +0,0 @@ -#!/usr/bin/python -# -# (c) 2004-2008 The Music Player Daemon Project -# http://www.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -# -# Load lyrics from leoslyrics.com -# - -from sys import argv, exit, stderr -from urllib import urlencode, urlopen -from xml.sax import make_parser, SAXException -from xml.sax.handler import ContentHandler - -class SearchContentHandler(ContentHandler): - def __init__(self): - self.code = None - self.hid = None - - def startElement(self, name, attrs): - if name == 'response': - self.code = int(attrs['code']) - elif name == 'result': - if self.hid is None or attrs['exactMatch'] == 'true': - self.hid = attrs['hid'] - -def search(artist, title): - query = urlencode({'auth': 'ncmpc', - 'artist': artist, - 'songtitle': title}) - url = "http://api.leoslyrics.com/api_search.php?" + query - try: - f = urlopen(url) - except IOError: - stderr.write("Failed to connect to http://api.leoslyrics.com, it seems down!\n") - exit(1) - handler = SearchContentHandler() - parser = make_parser() - parser.setContentHandler(handler) - try: - parser.parse(f) - except SAXException: - stderr.write("Failed to parse the search result!\n") - exit(1) - return handler.hid - -class LyricsContentHandler(ContentHandler): - def __init__(self): - self.code = None - self.is_text = False - self.text = None - - def startElement(self, name, attrs): - if name == 'text': - self.text = '' - self.is_text = True - else: - self.is_text = False - - def characters(self, chars): - if self.is_text: - self.text += chars - -def lyrics(hid): - query = urlencode({'auth': 'ncmpc', - 'hid': hid}) - url = "http://api.leoslyrics.com/api_lyrics.php?" + query - f = urlopen(url) - handler = LyricsContentHandler() - parser = make_parser() - parser.setContentHandler(handler) - try: - parser.parse(f) - except SAXException: - stderr.write("Failed to parse the lyrics!\n") - exit(1) - return handler.text - -hid = search(argv[1], argv[2]) -if hid is None: - exit(69) -print lyrics(hid).encode('utf-8').rstrip()
View file
ncmpc-0.21.tar.bz2/src/glib_compat.h
Deleted
@@ -1,62 +0,0 @@ -/* - * Copyright (C) 2003-2009 The Music Player Daemon Project - * http://www.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. - */ - -/* - * Compatibility with older GLib versions. Some of this isn't - * implemented properly, just "good enough" to allow users with older - * operating systems to run MPD. - */ - -#ifndef MPD_GLIB_COMPAT_H -#define MPD_GLIB_COMPAT_H - -#include <glib.h> - -#if !GLIB_CHECK_VERSION(2,14,0) - -#define g_queue_clear(q) do { g_queue_free(q); q = g_queue_new(); } while (0) - -static inline guint -g_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data) -{ - return g_timeout_add(interval * 1000, function, data); -} - -#endif /* !2.14 */ - -#if !GLIB_CHECK_VERSION(2,16,0) - -static inline void -g_propagate_prefixed_error(GError **dest_r, GError *src, - G_GNUC_UNUSED const gchar *format, ...) -{ - g_propagate_error(dest_r, src); -} - -static inline char * -g_uri_escape_string(const char *unescaped, - G_GNUC_UNUSED const char *reserved_chars_allowed, - G_GNUC_UNUSED gboolean allow_utf8) -{ - return g_strdup(unescaped); -} - -#endif /* !2.16 */ - -#endif
View file
ncmpc-0.21.tar.bz2/src/resolver.c
Deleted
@@ -1,196 +0,0 @@ -/* libmpdclient - (c) 2008 Max Kellermann <max@duempel.org> - This project's homepage is: http://www.musicpd.org - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Music Player Daemon nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "config.h" -#include "resolver.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#ifdef WIN32 -# include <ws2tcpip.h> -# include <winsock.h> -#else -# include <netdb.h> -# include <netinet/in.h> -# include <arpa/inet.h> -# include <sys/socket.h> -# include <sys/un.h> -# include <netdb.h> -#endif - -#ifndef MPD_NO_GAI -# ifdef AI_ADDRCONFIG -# define MPD_HAVE_GAI -# endif -#endif - -struct resolver { - enum { - TYPE_ZERO, TYPE_ONE, TYPE_ANY - } type; - -#ifdef MPD_HAVE_GAI - struct addrinfo *ai; - const struct addrinfo *next; -#else - struct sockaddr_in sin; -#endif - - struct resolver_address current; - -#ifndef WIN32 - struct sockaddr_un saun; -#endif -}; - -struct resolver * -resolver_new(const char *host, int port) -{ - struct resolver *resolver; - - resolver = malloc(sizeof(*resolver)); - if (resolver == NULL) - return NULL; - -#ifndef WIN32 - if (host[0] == '/') { - size_t path_length = strlen(host); - if (path_length >= sizeof(resolver->saun.sun_path)) { - free(resolver); - return NULL; - } - - resolver->saun.sun_family = AF_UNIX; - memcpy(resolver->saun.sun_path, host, path_length + 1); - - resolver->current.family = PF_UNIX; - resolver->current.protocol = 0; - resolver->current.addrlen = sizeof(resolver->saun); - resolver->current.addr = (const struct sockaddr *)&resolver->saun; - resolver->type = TYPE_ONE; - } else { -#endif -#ifdef MPD_HAVE_GAI - struct addrinfo hints; - char service[20]; - int ret; - - memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_ADDRCONFIG; - hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_protocol = IPPROTO_TCP; - - snprintf(service, sizeof(service), "%d", port); - - ret = getaddrinfo(host, service, &hints, &resolver->ai); - if (ret != 0) { - free(resolver); - return NULL; - } - - resolver->next = resolver->ai; - resolver->type = TYPE_ANY; -#else - const struct hostent *he; - - he = gethostbyname(host); - if (he == NULL) { - free(resolver); - return NULL; - } - - if (he->h_addrtype != AF_INET) { - free(resolver); - return NULL; - } - - - memset(&resolver->sin, 0, sizeof(resolver->sin)); - resolver->sin.sin_family = AF_INET; - resolver->sin.sin_port = htons(port); - memcpy((char *)&resolver->sin.sin_addr.s_addr, - (char *)he->h_addr, he->h_length); - - resolver->current.family = PF_INET; - resolver->current.protocol = 0; - resolver->current.addrlen = sizeof(resolver->sin); - resolver->current.addr = (const struct sockaddr *)&resolver->sin; - - resolver->type = TYPE_ONE; -#endif -#ifndef WIN32 - } -#endif - - return resolver; -} - -void -resolver_free(struct resolver *resolver) -{ -#ifdef MPD_HAVE_GAI - if (resolver->type == TYPE_ANY) - freeaddrinfo(resolver->ai); -#endif - free(resolver); -} - -const struct resolver_address * -resolver_next(struct resolver *resolver) -{ - if (resolver->type == TYPE_ZERO) - return NULL; - - if (resolver->type == TYPE_ONE) { - resolver->type = TYPE_ZERO; - return &resolver->current; - } - -#ifdef MPD_HAVE_GAI - if (resolver->next == NULL) - return NULL; - - resolver->current.family = resolver->next->ai_family; - resolver->current.protocol = resolver->next->ai_protocol; - resolver->current.addrlen = resolver->next->ai_addrlen; - resolver->current.addr = resolver->next->ai_addr; - - resolver->next = resolver->next->ai_next; - - return &resolver->current; -#else - return NULL; -#endif -}
View file
ncmpc-0.21.tar.bz2/src/resolver.h
Deleted
@@ -1,56 +0,0 @@ -/* libmpdclient - (c) 2008 Max Kellermann <max@duempel.org> - This project's homepage is: http://www.musicpd.org - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - - Neither the name of the Music Player Daemon nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef LIBMPDCLIENT_RESOLVER_H -#define LIBMPDCLIENT_RESOLVER_H - -#include <stddef.h> - -struct resolver; - -struct resolver_address { - int family; - int protocol; - size_t addrlen; - const struct sockaddr *addr; -}; - -struct resolver * -resolver_new(const char *host, int port); - -void -resolver_free(struct resolver *resolver); - -const struct resolver_address * -resolver_next(struct resolver *resolver); - -#endif
View file
ncmpc-0.21.tar.bz2/INSTALL -> ncmpc-0.24.tar.xz/INSTALL
Changed
@@ -5,7 +5,7 @@ ------------ * a C99 compliant compiler (e.g. gcc) - * libmpdclient 2.2 + * libmpdclient 2.3 * ncurses (ncursesw for unicode / wide character support) * GLib 2.14
View file
ncmpc-0.21.tar.bz2/Makefile.am -> ncmpc-0.24.tar.xz/Makefile.am
Changed
@@ -2,7 +2,7 @@ po ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = foreign 1.10 dist-bzip2 subdir-objects +AUTOMAKE_OPTIONS = foreign 1.11 dist-xz subdir-objects AM_CPPFLAGS = \ $(LIBMPDCLIENT_CFLAGS) \ @@ -12,8 +12,6 @@ -DSYSCONFDIR=\""$(sysconfdir)"\" ncmpc_headers = \ - src/glib_compat.h \ - src/resolver.h \ src/gidle.h \ src/mpdclient.h \ src/playlist.h \ @@ -74,8 +72,8 @@ $(LIBLIRCCLIENT_LIBS) src_ncmpc_SOURCES = \ + src/Compiler.h \ $(ncmpc_headers) \ - src/resolver.c \ src/main.c \ src/gidle.c \ src/mpdclient.c \ @@ -207,7 +205,7 @@ # lyrics plugins # -lyrics_plugins = lyrics/10-hd.sh lyrics/15-leoslyrics.sh lyrics/20-lyricwiki.rb lyrics/30-leoslyrics.py +lyrics_plugins = lyrics/10-hd.sh lyrics/20-lyricwiki.rb if ENABLE_LYRICS_SCREEN
View file
ncmpc-0.21.tar.bz2/Makefile.in -> ncmpc-0.24.tar.xz/Makefile.in
Changed
@@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -18,23 +17,51 @@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -76,16 +103,23 @@ @ENABLE_LIRC_TRUE@am__append_12 = src/lirc.c check_PROGRAMS = test/run_hscroll$(EXEEXT) subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure $(top_srcdir)/doc/doxygen.conf.in \ - $(top_srcdir)/src/win/ncmpc_win32_rc.rc.in AUTHORS COPYING \ - INSTALL NEWS build/config.guess build/config.sub build/depcomp \ - build/install-sh build/missing build/mkinstalldirs +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in \ + $(top_srcdir)/src/win/ncmpc_win32_rc.rc.in \ + $(top_srcdir)/doc/doxygen.conf.in $(top_srcdir)/build/depcomp \ + AUTHORS COPYING INSTALL NEWS README build/compile \ + build/config.guess build/config.sub build/depcomp \ + build/install-sh build/missing $(top_srcdir)/build/compile \ + $(top_srcdir)/build/config.guess \ + $(top_srcdir)/build/config.sub $(top_srcdir)/build/install-sh \ + $(top_srcdir)/build/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/m4/glib-gettext.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/po.m4 \ @@ -94,16 +128,16 @@ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno -mkinstalldirs = $(SHELL) $(top_srcdir)/build/mkinstalldirs +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = src/win/ncmpc_win32_rc.rc doc/doxygen.conf CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(lyricsdir)" \ "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)" PROGRAMS = $(bin_PROGRAMS) -am__src_ncmpc_SOURCES_DIST = src/glib_compat.h src/resolver.h \ - src/gidle.h src/mpdclient.h src/playlist.h src/filelist.h \ - src/options.h src/conf.h src/command.h src/ncu.h src/ncfix.h \ +am__src_ncmpc_SOURCES_DIST = src/Compiler.h src/gidle.h \ + src/mpdclient.h src/playlist.h src/filelist.h src/options.h \ + src/conf.h src/command.h src/ncu.h src/ncfix.h \ src/player_command.h src/window.h src/title_bar.h \ src/progress_bar.h src/status_bar.h src/screen.h \ src/screen_status.h src/screen_interface.h src/screen_list.h \ @@ -116,9 +150,9 @@ src/screen_search.h src/screen_song.h src/screen_keydef.h \ src/screen_lyrics.h src/screen_outputs.h src/screen_chat.h \ src/screen_text.h src/plugin.h src/lyrics.h src/lirc.h \ - src/ncmpc_curses.h src/resolver.c src/main.c src/gidle.c \ - src/mpdclient.c src/playlist.c src/filelist.c src/options.c \ - src/command.c src/ncu.c src/player_command.c src/title_bar.c \ + src/ncmpc_curses.h src/main.c src/gidle.c src/mpdclient.c \ + src/playlist.c src/filelist.c src/options.c src/command.c \ + src/ncu.c src/player_command.c src/title_bar.c \ src/progress_bar.c src/status_bar.c src/screen.c \ src/screen_status.c src/screen_list.c src/screen_find.c \ src/screen_utils.c src/screen_client.c src/screen_queue.c \ @@ -150,8 +184,8 @@ @ENABLE_OUTPUTS_SCREEN_TRUE@ src/screen_outputs.$(OBJEXT) @ENABLE_CHAT_SCREEN_TRUE@am__objects_12 = src/screen_chat.$(OBJEXT) @ENABLE_LIRC_TRUE@am__objects_13 = src/lirc.$(OBJEXT) -am_src_ncmpc_OBJECTS = $(am__objects_1) src/resolver.$(OBJEXT) \ - src/main.$(OBJEXT) src/gidle.$(OBJEXT) src/mpdclient.$(OBJEXT) \ +am_src_ncmpc_OBJECTS = $(am__objects_1) src/main.$(OBJEXT) \ + src/gidle.$(OBJEXT) src/mpdclient.$(OBJEXT) \ src/playlist.$(OBJEXT) src/filelist.$(OBJEXT) \ src/options.$(OBJEXT) src/command.$(OBJEXT) src/ncu.$(OBJEXT) \ src/player_command.$(OBJEXT) src/title_bar.$(OBJEXT) \ @@ -206,24 +240,49 @@ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(lyrics_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(src_ncmpc_SOURCES) $(test_run_hscroll_SOURCES) DIST_SOURCES = $(am__src_ncmpc_SOURCES_DIST) \ $(test_run_hscroll_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive
View file
ncmpc-0.21.tar.bz2/NEWS -> ncmpc-0.24.tar.xz/NEWS
Changed
@@ -1,3 +1,22 @@ +ncmpc 0.24 - (2014-07-14) +* fix crash on "jump" (hotkey ".") +* save keys to path specified by --key-file + + +ncmpc 0.23 - (2014-07-10) +* fix broken l10n in out-of-tree builds + + +ncmpc 0.22 - (2014-06-09) +* rename "playlist" to "queue" +* remove useless "Connected to ..." message +* require libmpdclient 2.3, MPD 0.16 +* patched color line-flags +* configuration option "search-format" +* remove broken leoslyrics plugin +* show audio format in song screen + + ncmpc 0.21 - (2013-04-11) * add a chat screen for communication with other clients on the same server * song format: evaluate literal strings as true
View file
ncmpc-0.21.tar.bz2/README -> ncmpc-0.24.tar.xz/README
Changed
@@ -37,13 +37,13 @@ ------------------------------------------------------------------------------- Home page and download: - http://mpd.wikia.com/wiki/Client:ncmpc + http://www.musicpd.org/clients/ncmpc/ MPD's home page: http://www.musicpd.org/ Bug tracker: - http://www.musicpd.org/mantis/ + http://bugs.musicpd.org/ Forum: - http://www.musicpd.org/forum + http://forum.musicpd.org/
View file
ncmpc-0.21.tar.bz2/aclocal.m4 -> ncmpc-0.24.tar.xz/aclocal.m4
Changed
@@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.6 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,69 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_REQUIRE_DEFINED(MACRO) +# +# DESCRIPTION +# +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have +# been defined and thus are available for use. This avoids random issues +# where a macro isn't expanded. Instead the configure script emits a +# non-fatal: +# +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found +# +# It's like AC_REQUIRE except it doesn't expand the required macro. +# +# Here's an example: +# +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +# +# LICENSE +# +# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 1 + +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])]) +])dnl AX_REQUIRE_DEFINED -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.6], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,24 +89,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.6])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -90,7 +123,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -116,22 +149,19 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -150,16 +180,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -169,7 +197,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -182,12 +210,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=])
View file
ncmpc-0.24.tar.xz/build/compile
Added
@@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# 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, 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, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker)
View file
ncmpc-0.21.tar.bz2/build/config.guess -> ncmpc-0.24.tar.xz/build/config.guess
Changed
@@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2014-03-23' # This file 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 +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to <config-patches@gnu.org> and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include <features.h> + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,10 +820,13 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -852,21 +874,21 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c
View file
ncmpc-0.21.tar.bz2/build/config.sub -> ncmpc-0.24.tar.xz/build/config.sub
Changed
@@ -1,24 +1,18 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2012-04-18' +timestamp='2014-05-01' -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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 +# This file 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 3 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. +# 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, see <http://www.gnu.org/licenses/>. @@ -26,11 +20,12 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,10 +252,12 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -270,10 +265,11 @@ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -287,20 +283,22 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -328,7 +326,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -370,13 +368,13 @@ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -385,11 +383,13 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -403,18 +403,22 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -788,11 +792,15 @@ basic_machine=ns32k-utek
View file
ncmpc-0.21.tar.bz2/build/depcomp -> ncmpc-0.24.tar.xz/build/depcomp
Changed
@@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-03-27.16; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # 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 @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -57,11 +56,65 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + # A tabulation character. tab=' ' # A newline character. nl=' ' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 @@ -75,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -86,32 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 fi if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. - gccflag=-qmakedep=gcc,-MF - depmode=gcc + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -134,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -143,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -157,15 +216,14 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. @@ -174,15 +232,15 @@
View file
ncmpc-0.21.tar.bz2/build/install-sh -> ncmpc-0.24.tar.xz/build/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in
View file
ncmpc-0.21.tar.bz2/build/missing -> ncmpc-0.24.tar.xz/build/missing
Changed
@@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # 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 @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to <bug-automake@gnu.org>." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU
View file
ncmpc-0.21.tar.bz2/configure -> ncmpc-0.24.tar.xz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ncmpc 0.21. +# Generated by GNU Autoconf 2.69 for ncmpc 0.24. # # Report bugs to <max@duempel.org>. # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='ncmpc' PACKAGE_TARNAME='ncmpc' -PACKAGE_VERSION='0.21' -PACKAGE_STRING='ncmpc 0.21' +PACKAGE_VERSION='0.24' +PACKAGE_STRING='ncmpc 0.24' PACKAGE_BUGREPORT='max@duempel.org' PACKAGE_URL='' @@ -667,6 +667,7 @@ GMSGFMT_015 MSGFMT_015 GETTEXT_MACRO_VERSION +SED GETTEXT_PACKAGE MKINSTALLDIRS POSUB @@ -691,6 +692,8 @@ LIBMPDCLIENT_CFLAGS GLIB_LIBS GLIB_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG HAVE_WINDOWS_FALSE HAVE_WINDOWS_TRUE @@ -723,6 +726,10 @@ LDFLAGS CFLAGS CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -787,6 +794,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking with_ncurses with_ncursesw @@ -821,6 +829,8 @@ CPPFLAGS CURSES_LIB PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS LIBMPDCLIENT_CFLAGS @@ -1368,7 +1378,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ncmpc 0.21 to adapt to many kinds of systems. +\`configure' configures ncmpc 0.24 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1448,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ncmpc 0.21:";; + short | recursive ) echo "Configuration of ncmpc 0.24:";; esac cat <<\_ACEOF @@ -1446,8 +1456,12 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-mini Build ncmpc-mini, i.e. without all optional features [default=no] --disable-multibyte Disable multibyte character support [default=yes] @@ -1488,6 +1502,10 @@ you have headers in a nonstandard directory <include dir> CURSES_LIB linker library for Curses, e.g. -lcurses PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config LIBMPDCLIENT_CFLAGS @@ -1566,7 +1584,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ncmpc configure 0.21 +ncmpc configure 0.24 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1935,7 +1953,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ncmpc $as_me 0.21, which was +It was created by ncmpc $as_me 0.24, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2285,7 +2303,7 @@ VERSION_MAJOR=0 -VERSION_MINOR=21 +VERSION_MINOR=24 VERSION_REVISION=0 VERSION_EXTRA=0 @@ -2319,7 +2337,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2416,9 +2434,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2429,32 +2444,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane".
View file
ncmpc-0.21.tar.bz2/configure.ac -> ncmpc-0.24.tar.xz/configure.ac
Changed
@@ -1,17 +1,19 @@ AC_PREREQ(2.60) -AC_INIT(ncmpc, 0.21, max@duempel.org) +AC_INIT(ncmpc, 0.24, max@duempel.org) VERSION_MAJOR=0 -VERSION_MINOR=21 +VERSION_MINOR=24 VERSION_REVISION=0 VERSION_EXTRA=0 AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(build) -AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects]) +AM_INIT_AUTOMAKE([foreign 1.11 dist-xz subdir-objects]) +AM_SILENT_RULES AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) + dnl Check for programs AC_PROG_CC_C99 AC_PROG_INSTALL @@ -26,7 +28,7 @@ dnl ======================================================= dnl i18n -ALL_LINGUAS=`grep -v '^\#' po/LINGUAS` +ALL_LINGUAS=`grep -v '^\#' $srcdir/po/LINGUAS` set -- $CFLAGS @@ -100,8 +102,8 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14],, [AC_MSG_ERROR([glib 2.14 is required])]) -dnl Check for libmpdclient 2.2 -PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.2],, +dnl Check for libmpdclient 2.3 +PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.3],, [AC_MSG_ERROR([libmpdclient2 is required])]) dnl Check for libmpdclient 2.5 (the chat screen requires this version) @@ -392,6 +394,11 @@ if test "x$enable_debug" = xno; then AM_CFLAGS="$AM_CFLAGS -DNDEBUG" + + AX_APPEND_COMPILE_FLAGS([-ffunction-sections]) + AX_APPEND_COMPILE_FLAGS([-fdata-sections]) + + AX_APPEND_LINK_FLAGS([-Wl,--gc-sections]) fi AC_ARG_ENABLE(test, @@ -426,6 +433,10 @@ AC_SUBST(AM_CFLAGS) +AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden]) +AX_APPEND_COMPILE_FLAGS([-ffast-math]) +AX_APPEND_COMPILE_FLAGS([-ftree-vectorize]) + AX_APPEND_COMPILE_FLAGS([-Wall]) AX_APPEND_COMPILE_FLAGS([-Wextra]) AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations])
View file
ncmpc-0.21.tar.bz2/doc/config.sample -> ncmpc-0.24.tar.xz/doc/config.sample
Changed
@@ -79,6 +79,9 @@ ## The format used to display songs in the main window. #list-format = "%name%|[%artist% - ]%title%|%file%" +## The format used to display songs in the search window. +#search-format = "%name%|[%artist% - ]%title%|%file%" + ## The format used to display songs on the status line. #status-format = "[%artist% - ]%title%|%shortfile%"
View file
ncmpc-0.21.tar.bz2/doc/doxygen.conf -> ncmpc-0.24.tar.xz/doc/doxygen.conf
Changed
@@ -31,7 +31,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.21 +PROJECT_NUMBER = 0.24 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer
View file
ncmpc-0.21.tar.bz2/doc/ncmpc.1 -> ncmpc-0.24.tar.xz/doc/ncmpc.1
Changed
@@ -167,6 +167,9 @@ .B list\-format = SONG FORMAT The format used to display songs in the main window. .TP +.B search\-format = SONG FORMAT +The format used to display songs in the search window. Default is to use list\-format. +.TP .B status\-format = SONG FORMAT The format used to display songs on the status line. .TP
View file
ncmpc-0.21.tar.bz2/m4/ax_append_compile_flags.m4 -> ncmpc-0.24.tar.xz/m4/ax_append_compile_flags.m4
Changed
@@ -54,10 +54,12 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 2 +#serial 4 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], -[for flag in $1; do +[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) +for flag in $1; do AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3]) done ])dnl AX_APPEND_COMPILE_FLAGS
View file
ncmpc-0.24.tar.xz/m4/ax_append_link_flags.m4
Added
@@ -0,0 +1,63 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS]) +# +# DESCRIPTION +# +# For every FLAG1, FLAG2 it is checked whether the linker works with the +# flag. If it does, the flag is added FLAGS-VARIABLE +# +# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is +# used. During the check the flag is always added to the linker's flags. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG. +# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS. +# +# LICENSE +# +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +# +# 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 3 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, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_APPEND_LINK_FLAGS], +[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) +AX_REQUIRE_DEFINED([AX_APPEND_FLAG]) +for flag in $1; do + AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3]) +done +])dnl AX_APPEND_LINK_FLAGS
View file
ncmpc-0.21.tar.bz2/m4/ax_check_compile_flag.m4 -> ncmpc-0.24.tar.xz/m4/ax_check_compile_flag.m4
Changed
@@ -4,7 +4,7 @@ # # SYNOPSIS # -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # @@ -19,6 +19,8 @@ # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # @@ -53,7 +55,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 2 +#serial 3 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX @@ -61,7 +63,7 @@ AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
View file
ncmpc-0.24.tar.xz/m4/ax_check_link_flag.m4
Added
@@ -0,0 +1,73 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the linker or gives an error. +# (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the linker's default flags +# when the check is done. The check is thus made with the flags: "LDFLAGS +# EXTRA-FLAGS FLAG". This can for example be used to force the linker to +# issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_LINK_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> +# +# 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 3 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, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 3 + +AC_DEFUN([AX_CHECK_LINK_FLAG], +[AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl +AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ + ax_check_save_flags=$LDFLAGS + LDFLAGS="$LDFLAGS $4 $1" + AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + LDFLAGS=$ax_check_save_flags]) +AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes], + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_LINK_FLAGS
View file
ncmpc-0.21.tar.bz2/m4/ax_with_curses.m4 -> ncmpc-0.24.tar.xz/m4/ax_with_curses.m4
Changed
@@ -88,7 +88,7 @@ # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then -# AX_MSG_ERROR([requires either NcursesW or Ncurses library]) +# AC_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # # If any Curses library will do (but one must be present and must support @@ -127,15 +127,15 @@ # To use the HAVE_xxx_H preprocessor symbols, insert the following into # your system.h (or equivalent) header file: # -# #if defined(HAVE_NCURSESW_CURSES_H) +# #if defined HAVE_NCURSESW_CURSES_H # # include <ncursesw/curses.h> -# #elif defined(HAVE_NCURSESW_H) +# #elif defined HAVE_NCURSESW_H # # include <ncursesw.h> -# #elif defined(HAVE_NCURSES_CURSES_H) +# #elif defined HAVE_NCURSES_CURSES_H # # include <ncurses/curses.h> -# #elif defined(HAVE_NCURSES_H) +# #elif defined HAVE_NCURSES_H # # include <ncurses.h> -# #elif defined(HAVE_CURSES_H) +# #elif defined HAVE_CURSES_H # # include <curses.h> # #else # # error "SysV or X/Open-compatible Curses header file required" @@ -153,7 +153,7 @@ # # Copyright (c) 2009 Mark Pulford <mark@kyne.com.au> # Copyright (c) 2009 Damian Pietras <daper@daper.net> -# Copyright (c) 2011 Reuben Thomas <rrt@sc3d.org> +# Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org> # Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au> # # This program is free software: you can redistribute it and/or modify it @@ -182,7 +182,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 11 +#serial 15 AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) AC_DEFUN([AX_WITH_CURSES], [
View file
ncmpc-0.21.tar.bz2/m4/nls.m4 -> ncmpc-0.24.tar.xz/m4/nls.m4
Changed
@@ -1,5 +1,5 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it,
View file
ncmpc-0.21.tar.bz2/m4/pkg.m4 -> ncmpc-0.24.tar.xz/m4/pkg.m4
Changed
@@ -1,4 +1,5 @@ # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. # @@ -25,8 +26,12 @@ # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi @@ -39,7 +44,6 @@ AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl ])# PKG_PROG_PKG_CONFIG @@ -48,34 +52,32 @@ # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -117,16 +119,17 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -134,24 +137,78 @@ Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT])[]dnl + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], - [$4]) +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl ])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR
View file
ncmpc-0.21.tar.bz2/m4/po.m4 -> ncmpc-0.24.tar.xz/m4/po.m4
Changed
@@ -1,5 +1,5 @@ -# po.m4 serial 15 (gettext-0.17) -dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. +# po.m4 serial 21 (gettext-0.18.3) +dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -17,19 +17,20 @@ dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl - AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.17]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -41,7 +42,7 @@ [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl @@ -102,7 +103,7 @@ case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -118,7 +119,8 @@ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" + gt_tab=`printf '\t'` + cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration @@ -129,12 +131,12 @@ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES @@ -226,7 +228,7 @@ changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. @@ -254,6 +256,7 @@ fi # A sed script that extracts the value of VARIABLE from a Makefile. + tab=`printf '\t'` sed_x_variable=' # Test if the hold space is empty. x @@ -261,9 +264,9 @@ x ta # Yes it was empty. Look if we have the expected variable definition. -/^[ ]*VARIABLE[ ]*=/{ +/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{ # Seen the first line of the variable definition. - s/^[ ]*VARIABLE[ ]*=// + s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=// ba } bd @@ -315,7 +318,7 @@ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi - # Hide the ALL_LINGUAS assigment from automake < 1.5. + # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -405,14 +408,15 @@ fi sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" <<EOF $frobbedlang.msg: $lang.po - @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ - \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ +${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } EOF done fi @@ -422,8 +426,8 @@ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <<EOF $frobbedlang/\$(DOMAIN).resources.dll: $lang.po - @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ - \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } +${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ +${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } EOF done fi
View file
ncmpc-0.21.tar.bz2/po/Makefile.in.in -> ncmpc-0.24.tar.xz/po/Makefile.in.in
Changed
@@ -35,7 +35,7 @@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ +MKINSTALLDIRS = mkdir -p CC = @CC@ GENCAT = @GENCAT@ @@ -130,12 +130,8 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ - else \ - $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ - fi - @catalogs='$(CATALOGS)'; \ + $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ + catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ @@ -144,11 +140,7 @@ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $$dir; \ - else \ - $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ - fi; \ + $(MKINSTALLDIRS) $$dir; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ @@ -172,11 +164,7 @@ fi; \ done if test "$(PACKAGE)" = "glib"; then \ - if test -r "$(MKINSTALLDIRS)"; then \ - $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ - else \ - $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ - fi; \ + $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \
View file
ncmpc-0.21.tar.bz2/po/ncmpc.pot -> ncmpc-0.24.tar.xz/po/ncmpc.pot
Changed
@@ -9,7 +9,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=glib&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2013-04-11 10:23+0200\n" +"POT-Creation-Date: 2014-07-14 11:56+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -18,66 +18,59 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/i18n.h:42 +#: /home/max/git/ncmpc/src/i18n.h:42 msgid "y" msgstr "" -#: src/i18n.h:43 +#: /home/max/git/ncmpc/src/i18n.h:43 msgid "n" msgstr "" -#: src/main.c:245 ../src/main.c:267 ../src/main.c:290 +#: /home/max/git/ncmpc/src/main.c:244 /home/max/git/ncmpc/src/main.c:266 msgid "unknown" msgstr "" -#: src/main.c:315 +#: /home/max/git/ncmpc/src/main.c:294 #, c-format msgid "Connecting to %s... [Press %s to abort]" msgstr "" -#: src/main.c:339 +#: /home/max/git/ncmpc/src/main.c:316 #, c-format -msgid "Error: MPD version %d.%d.%d is to old (%s needed)" +msgid "Error: MPD version %d.%d.%d is too old (%s needed)" msgstr "" -#: src/main.c:358 -#, c-format -msgid "Connected to %s" -msgstr "" - -#. to translators: a key was bound twice in the key editor, -#. and this is a hint for the user what to press to correct -#. that -#: src/main.c:529 +#: /home/max/git/ncmpc/src/main.c:496 #, c-format msgid "press %s for the key editor" msgstr "" -#: src/player_command.c:177 ../src/screen_queue.c:755 -msgid "Shuffled playlist" +#: /home/max/git/ncmpc/src/player_command.c:175 +#: /home/max/git/ncmpc/src/screen_queue.c:740 +msgid "Shuffled queue" msgstr "" -#: src/player_command.c:187 -msgid "Cleared playlist" +#: /home/max/git/ncmpc/src/player_command.c:185 +msgid "Cleared queue" msgstr "" -#: src/screen.c:206 ../src/screen.c:273 +#: /home/max/git/ncmpc/src/screen.c:204 /home/max/git/ncmpc/src/screen.c:271 msgid "Error: Screen too small" msgstr "" -#: src/screen.c:395 +#: /home/max/git/ncmpc/src/screen.c:393 msgid "Repeat mode is on" msgstr "" -#: src/screen.c:396 +#: /home/max/git/ncmpc/src/screen.c:394 msgid "Repeat mode is off" msgstr "" -#: src/screen.c:400 +#: /home/max/git/ncmpc/src/screen.c:398 msgid "Random mode is on" msgstr "" -#: src/screen.c:401 +#: /home/max/git/ncmpc/src/screen.c:399 msgid "Random mode is off" msgstr "" @@ -86,11 +79,11 @@ #. automatically stop #. after playing one #. single song -#: src/screen.c:410 +#: /home/max/git/ncmpc/src/screen.c:408 msgid "Single mode is on" msgstr "" -#: src/screen.c:411 +#: /home/max/git/ncmpc/src/screen.c:409 msgid "Single mode is off" msgstr "" @@ -98,1074 +91,1109 @@ #. that MPD removes each #. song which has #. finished playing -#: src/screen.c:419 +#: /home/max/git/ncmpc/src/screen.c:417 msgid "Consume mode is on" msgstr "" -#: src/screen.c:420 +#: /home/max/git/ncmpc/src/screen.c:418 msgid "Consume mode is off" msgstr "" -#: src/screen.c:423 +#: /home/max/git/ncmpc/src/screen.c:421 #, c-format msgid "Crossfade %d seconds" msgstr "" -#: src/screen.c:435 +#: /home/max/git/ncmpc/src/screen.c:433 msgid "Database updated" msgstr "" -#: src/screen.c:515 +#: /home/max/git/ncmpc/src/screen.c:513 msgid "Find mode: Wrapped" msgstr "" -#: src/screen.c:516 +#: /home/max/git/ncmpc/src/screen.c:514 msgid "Find mode: Normal" msgstr "" -#: src/screen.c:521 +#: /home/max/git/ncmpc/src/screen.c:519 msgid "Auto center mode: On" msgstr "" -#: src/screen.c:522 +#: /home/max/git/ncmpc/src/screen.c:520 msgid "Auto center mode: Off" msgstr "" -#: src/screen_artist.c:75 ../src/screen_artist.c:366 +#: /home/max/git/ncmpc/src/screen_artist.c:72 +#: /home/max/git/ncmpc/src/screen_artist.c:364 msgid "All tracks" msgstr "" -#: src/screen_artist.c:398 +#: /home/max/git/ncmpc/src/screen_artist.c:396 #, c-format msgid "All artists" msgstr "" -#: src/screen_artist.c:403 +#: /home/max/git/ncmpc/src/screen_artist.c:401 #, c-format msgid "Albums of artist: %s" msgstr "" -#: src/screen_artist.c:412 +#: /home/max/git/ncmpc/src/screen_artist.c:410 #, c-format msgid "All tracks of artist: %s" msgstr "" -#: src/screen_artist.c:415 +#: /home/max/git/ncmpc/src/screen_artist.c:413 #, c-format msgid "Album: %s - %s" msgstr "" -#: src/screen_artist.c:419 +#: /home/max/git/ncmpc/src/screen_artist.c:417 #, c-format msgid "Tracks of no album of artist: %s" msgstr "" -#: src/screen_artist.c:466 +#: /home/max/git/ncmpc/src/screen_artist.c:462 #, c-format msgid "Adding album %s..." msgstr "" -#: src/screen_artist.c:468 +#: /home/max/git/ncmpc/src/screen_artist.c:464 #, c-format msgid "Adding %s..." msgstr ""
View file
ncmpc-0.24.tar.xz/src/Compiler.h
Added
@@ -0,0 +1,159 @@ +/* + * Copyright (C) 2003-2013 The Music Player Daemon Project + * http://www.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. + */ + +#ifndef COMPILER_H +#define COMPILER_H + +#define GCC_CHECK_VERSION(major, minor) \ + (defined(__GNUC__) && \ + (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) + +#ifdef __GNUC__ +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#else +#define GCC_VERSION 0 +#endif + +#if GCC_CHECK_VERSION(4,0) + +/* GCC 4.x */ + +#define gcc_const __attribute__((const)) +#define gcc_deprecated __attribute__((deprecated)) +#define gcc_may_alias __attribute__((may_alias)) +#define gcc_malloc __attribute__((malloc)) +#define gcc_noreturn __attribute__((noreturn)) +#define gcc_packed __attribute__((packed)) +#define gcc_printf(a,b) __attribute__((format(printf, a, b))) +#define gcc_pure __attribute__((pure)) +#define gcc_sentinel __attribute__((sentinel)) +#define gcc_unused __attribute__((unused)) +#define gcc_warn_unused_result __attribute__((warn_unused_result)) + +#define gcc_nonnull(...) __attribute__((nonnull(__VA_ARGS__))) +#define gcc_nonnull_all __attribute__((nonnull)) + +#define gcc_likely(x) __builtin_expect (!!(x), 1) +#define gcc_unlikely(x) __builtin_expect (!!(x), 0) + +#define gcc_aligned(n) __attribute__((aligned(n))) + +#define gcc_visibility_hidden __attribute__((visibility("hidden"))) +#define gcc_visibility_default __attribute__((visibility("default"))) + +#define gcc_always_inline __attribute__((always_inline)) + +#else + +/* generic C compiler */ + +#define gcc_const +#define gcc_deprecated +#define gcc_may_alias +#define gcc_malloc +#define gcc_noreturn +#define gcc_packed +#define gcc_printf(a,b) +#define gcc_pure +#define gcc_sentinel +#define gcc_unused +#define gcc_warn_unused_result + +#define gcc_nonnull(...) +#define gcc_nonnull_all + +#define gcc_likely(x) (x) +#define gcc_unlikely(x) (x) + +#define gcc_aligned(n) + +#define gcc_visibility_hidden +#define gcc_visibility_default + +#define gcc_always_inline inline + +#endif + +#if GCC_CHECK_VERSION(4,3) + +#define gcc_hot __attribute__((hot)) +#define gcc_cold __attribute__((cold)) + +#else /* ! GCC_UNUSED >= 40300 */ + +#define gcc_hot +#define gcc_cold + +#endif /* ! GCC_UNUSED >= 40300 */ + +#if GCC_CHECK_VERSION(4,6) && !defined(__clang__) +#define gcc_flatten __attribute__((flatten)) +#else +#define gcc_flatten +#endif + +#ifndef __cplusplus +/* plain C99 has "restrict" */ +#define gcc_restrict restrict +#elif GCC_CHECK_VERSION(4,0) +/* "__restrict__" is a GCC extension for C++ */ +#define gcc_restrict __restrict__ +#else +/* disable it on other compilers */ +#define gcc_restrict +#endif + +/* C++11 features */ + +#if defined(__cplusplus) + +/* support for C++11 "override" was added in gcc 4.7 */ +#if !defined(__clang__) && !GCC_CHECK_VERSION(4,7) +#define override +#define final +#endif + +#if defined(__clang__) || GCC_CHECK_VERSION(4,8) +#define gcc_alignas(T, fallback) alignas(T) +#else +#define gcc_alignas(T, fallback) gcc_aligned(fallback) +#endif + +#endif + +#ifndef __has_feature + // define dummy macro for non-clang compilers + #define __has_feature(x) 0 +#endif + +#if __has_feature(attribute_unused_on_fields) +#define gcc_unused_field gcc_unused +#else +#define gcc_unused_field +#endif + +#if defined(__GNUC__) || defined(__clang__) +#define gcc_unreachable() __builtin_unreachable() +#else +#define gcc_unreachable() +#endif + +#endif
View file
ncmpc-0.21.tar.bz2/src/charset.c -> ncmpc-0.24.tar.xz/src/charset.c
Changed
@@ -39,10 +39,8 @@ static inline unsigned unicode_char_width(gunichar ch) { -#if GLIB_CHECK_VERSION(2,14,0) if (g_unichar_iszerowidth(ch)) return 0; -#endif if (g_unichar_iswide(ch)) return 2; @@ -98,7 +96,8 @@ #endif } -static inline unsigned +gcc_unused +static unsigned ascii_cut_width(char *p, unsigned max_width) { size_t length = strlen(p); @@ -109,7 +108,8 @@ return max_width; } -static inline unsigned +gcc_unused +static unsigned narrow_cut_width(char *p, unsigned max_width) { size_t length = g_utf8_strlen(p, -1); @@ -120,15 +120,15 @@ return max_width; } -static inline unsigned +gcc_unused +static unsigned wide_cut_width(char *p, unsigned max_width) { size_t length = g_utf8_strlen(p, -1); unsigned width = 0, prev_width; - gunichar c; while (length-- > 0) { - c = g_utf8_get_char(p); + gunichar c = g_utf8_get_char(p); prev_width = width; width += g_unichar_iswide(c) ? 2 : 1; if (width > max_width) { @@ -164,16 +164,14 @@ utf8_to_locale(const char *utf8str) { #ifdef ENABLE_LOCALE - gchar *str; - assert(utf8str != NULL); if (noconvert) return g_strdup(utf8str); - str = g_convert_with_fallback(utf8str, -1, - charset, "utf-8", - NULL, NULL, NULL, NULL); + gchar *str = g_convert_with_fallback(utf8str, -1, + charset, "utf-8", + NULL, NULL, NULL, NULL); if (str == NULL) return g_strdup(utf8str); @@ -187,16 +185,14 @@ locale_to_utf8(const char *localestr) { #ifdef ENABLE_LOCALE - gchar *str; - assert(localestr != NULL); if (noconvert) return g_strdup(localestr); - str = g_convert_with_fallback(localestr, -1, - "utf-8", charset, - NULL, NULL, NULL, NULL); + gchar *str = g_convert_with_fallback(localestr, -1, + "utf-8", charset, + NULL, NULL, NULL, NULL); if (str == NULL) return g_strdup(localestr);
View file
ncmpc-0.21.tar.bz2/src/charset.h -> ncmpc-0.24.tar.xz/src/charset.h
Changed
@@ -21,8 +21,7 @@ #define CHARSET_H #include "config.h" - -#include <glib.h> +#include "Compiler.h" #include <stdbool.h> @@ -34,14 +33,14 @@ /** * Returns the number of terminal cells occupied by this string. */ -G_GNUC_PURE +gcc_pure unsigned utf8_width(const char *str); /** * Returns the number of terminal cells occupied by this string. */ -G_GNUC_PURE +gcc_pure unsigned locale_width(const char *p);
View file
ncmpc-0.21.tar.bz2/src/colors.c -> ncmpc-0.24.tar.xz/src/colors.c
Changed
@@ -53,6 +53,7 @@ [COLOR_TITLE_BOLD] = {"title-bold", COLOR_YELLOW | A_BOLD, A_BOLD }, [COLOR_LINE] = {"line", COLOR_WHITE, A_NORMAL}, [COLOR_LINE_BOLD] = {"line-bold", COLOR_WHITE | A_BOLD, A_BOLD }, + [COLOR_LINE_FLAGS] = {"line-flags", COLOR_YELLOW, A_NORMAL}, [COLOR_LIST] = {"list", COLOR_GREEN, A_NORMAL}, [COLOR_LIST_BOLD] = {"list-bold", COLOR_GREEN | A_BOLD, A_BOLD }, [COLOR_PROGRESSBAR] = {"progressbar", COLOR_WHITE, A_NORMAL}, @@ -72,9 +73,7 @@ static color_entry_t * colors_lookup_by_name(const char *name) { - enum color i; - - for (i = 1; i < COLOR_END; ++i) + for (enum color i = 1; i < COLOR_END; ++i) if (!strcasecmp(colors[i].name, name)) return &colors[i]; @@ -84,12 +83,10 @@ static int colors_update_pair(enum color id) { - int fg, bg; - assert(id > 0 && id < COLOR_END); - fg = colors[id].color; - bg = colors[COLOR_BACKGROUND].color; + int fg = colors[id].color; + int bg = colors[COLOR_BACKGROUND].color; /* If color == COLOR_NONE (negative), * pass -1 to avoid cast errors */ @@ -102,9 +99,9 @@ int colors_str2color(const char *str) { - int i, color = 0; + int color = 0; char **parts = g_strsplit(str, ",", 0); - for (i = 0; parts[i]; i++) { + for (int i = 0; parts[i]; i++) { char *cur = parts[i]; /* Legacy colors (brightblue,etc) */ @@ -171,13 +168,13 @@ int colors_define(const char *name, short r, short g, short b) { - color_definition_entry_t *entry; int color = colors_str2color(name); if (color < 0) return color; - entry = g_malloc(sizeof(color_definition_entry_t)); + color_definition_entry_t *entry = + g_malloc(sizeof(color_definition_entry_t)); entry->color = color; entry->r = r; entry->g = g; @@ -192,14 +189,14 @@ colors_assign(const char *name, const char *value) { color_entry_t *entry = colors_lookup_by_name(name); - int color; if (!entry) { fprintf(stderr,_("Warning: Unknown color field - %s\n"), name); return -1; } - if ((color = colors_str2color(value)) == COLOR_ERROR) + const int color = colors_str2color(value); + if (color == COLOR_ERROR) return -1; entry->color = color; @@ -231,9 +228,7 @@ _("Terminal lacks support for changing colors")); if (options.enable_colors) { - enum color i; - - for (i = 1; i < COLOR_END; ++i) + for (enum color i = 1; i < COLOR_END; ++i) /* update the color pairs */ colors_update_pair(i); } @@ -264,11 +259,11 @@ colors_use(WINDOW *w, enum color id) { color_entry_t *entry = &colors[id]; - short pair; - attr_t attrs; assert(id > 0 && id < COLOR_END); + attr_t attrs; + short pair; fix_wattr_get(w, &attrs, &pair, NULL); #ifdef ENABLE_COLORS
View file
ncmpc-0.21.tar.bz2/src/colors.h -> ncmpc-0.24.tar.xz/src/colors.h
Changed
@@ -22,12 +22,14 @@ #include "config.h" #include "ncmpc_curses.h" +#include "Compiler.h" enum color { COLOR_TITLE = 1, COLOR_TITLE_BOLD, COLOR_LINE, COLOR_LINE_BOLD, + COLOR_LINE_FLAGS, COLOR_LIST, COLOR_LIST_BOLD, COLOR_PROGRESSBAR, @@ -41,6 +43,7 @@ COLOR_END }; +gcc_pure int colors_str2color(const char *str); #ifdef ENABLE_COLORS
View file
ncmpc-0.21.tar.bz2/src/command.c -> ncmpc-0.24.tar.xz/src/command.c
Changed
@@ -104,7 +104,7 @@ { { '1', F1, 'h' }, 0, CMD_SCREEN_HELP, "screen-help", N_("Help screen") }, { { '2', F2, 0 }, 0, CMD_SCREEN_PLAY, "screen-playlist", - N_("Playlist screen") }, + N_("Queue screen") }, { { '3', F3, 0 }, 0, CMD_SCREEN_FILE, "screen-browse", N_("Browse screen") }, @@ -131,15 +131,15 @@ { { '-', LEFT, 0 }, 0, CMD_VOLUME_DOWN, "volume-down", N_("Decrease volume") }, { { ' ', 0, 0 }, 0, CMD_SELECT, "select", - N_("Select/deselect song in playlist") }, + N_("Select/deselect song in queue") }, { { 't', 0, 0 }, 0, CMD_SELECT_ALL, "select_all", N_("Select all listed items") }, { { DEL, 'd', 0 }, 0, CMD_DELETE, "delete", - N_("Delete song from playlist") }, + N_("Delete song from queue") }, { { 'Z', 0, 0 }, 0, CMD_SHUFFLE, "shuffle", - N_("Shuffle playlist") }, + N_("Shuffle queue") }, { { 'c', 0, 0 }, 0, CMD_CLEAR, "clear", - N_("Clear playlist") }, + N_("Clear queue") }, { { 'r', 0, 0 }, 0, CMD_REPEAT, "repeat", N_("Toggle repeat mode") }, { { 'z', 0, 0 }, 0, CMD_RANDOM, "random", @@ -153,9 +153,9 @@ { { C('U'), 0, 0 }, 0, CMD_DB_UPDATE, "db-update", N_("Start a music database update") }, { { 'S', 0, 0 }, 0, CMD_SAVE_PLAYLIST, "save", - N_("Save playlist") }, + N_("Save queue") }, { { 'a', 0, 0 }, 0, CMD_ADD, "add", - N_("Add url/file to playlist") }, + N_("Add url/file to queue") }, { { '!', 0, 0 }, 0, CMD_GO_ROOT_DIRECTORY, "go-root-directory", N_("Go to root directory") }, @@ -268,15 +268,12 @@ if (max != 0) return max; - size_t len; - command_definition_t *p; - - for (p = c; p->name != NULL; p++) { + for (command_definition_t *p = c; p->name != NULL; p++) { /* * width and length are considered the same here, as command * names are not translated. */ - len = (size_t) strlen(p->name); + size_t len = strlen(p->name); if (len > max) max = len; } @@ -288,11 +285,9 @@ const char * key2str(int key) { - static char buf[32]; - int i; - - buf[0] = 0; switch(key) { + static char buf[32]; + case 0: return _("Undefined"); case ' ': @@ -328,7 +323,7 @@ case KEY_IC: return _("Insert"); default: - for (i = 0; i <= 63; i++) + for (int i = 0; i <= 63; i++) if (key == KEY_F(i)) { g_snprintf(buf, 32, _("F%d"), i ); return buf; @@ -341,15 +336,14 @@ g_snprintf(buf, 32, "%c", key); else g_snprintf(buf, 32, "0x%03X", key); + return buf; } - - return buf; } void command_dump_keys(void) { - for (int i = 0; cmds[i].description; i++) + for (size_t i = 0; cmds[i].description; i++) if (cmds[i].command != CMD_NONE) printf(" %20s : %s\n", get_key_names(cmds[i].command, true), @@ -361,7 +355,7 @@ static void set_key_flags(command_definition_t *cp, command_t command, int flags) { - for (int i = 0; cp[i].name; i++) { + for (size_t i = 0; cp[i].name; i++) { if (cp[i].command == command) { cp[i].flags |= flags; break; @@ -382,7 +376,7 @@ if (!all) return keystr; - for (int j = 1; j < MAX_COMMAND_KEYS && + for (unsigned j = 1; j < MAX_COMMAND_KEYS && cmds[i].keys[j] > 0; j++) { g_strlcat(keystr, " ", sizeof(keystr)); g_strlcat(keystr, key2str(cmds[i].keys[j]), sizeof(keystr)); @@ -396,7 +390,7 @@ const char * get_key_description(command_t command) { - for (int i = 0; cmds[i].description; i++) + for (size_t i = 0; cmds[i].description; i++) if (cmds[i].command == command) return _(cmds[i].description); @@ -406,7 +400,7 @@ const char * get_key_command_name(command_t command) { - for (int i = 0; cmds[i].name; i++) + for (size_t i = 0; cmds[i].name; i++) if (cmds[i].command == command) return cmds[i].name; @@ -414,9 +408,9 @@ } command_t -get_key_command_from_name(char *name) +get_key_command_from_name(const char *name) { - for (int i = 0; cmds[i].name; i++) + for (size_t i = 0; cmds[i].name; i++) if (strcmp(name, cmds[i].name) == 0) return cmds[i].command; @@ -424,12 +418,12 @@ } command_t -find_key_command(int key, command_definition_t *c) +find_key_command(int key, const command_definition_t *c) { assert(key != 0); assert(c != NULL); - for (int i = 0; c[i].name; i++) { + for (size_t i = 0; c[i].name; i++) { for (int j = 0; j < MAX_COMMAND_KEYS; j++) if (c[i].keys[j] == key) return c[i].command; @@ -447,9 +441,7 @@ command_t get_keyboard_command(void) { - int key; - - key = wgetch(stdscr); + int key = wgetch(stdscr); if (key == ERR || key == '\0') return CMD_NONE; @@ -461,37 +453,36 @@ return get_key_command(key); } -int +bool assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]) { - for (int i = 0; cmds[i].name; i++) { + for (size_t i = 0; cmds[i].name; i++) { if (cmds[i].command == command) { memcpy(cmds[i].keys, keys, sizeof(int)*MAX_COMMAND_KEYS); #ifndef NCMPC_MINI cmds[i].flags |= COMMAND_KEY_MODIFIED; #endif - return 0; + return true; } } - return -1; + return false; } #ifndef NCMPC_MINI
View file
ncmpc-0.21.tar.bz2/src/command.h -> ncmpc-0.24.tar.xz/src/command.h
Changed
@@ -21,6 +21,7 @@ #define COMMAND_H #include "config.h" +#include "Compiler.h" #include <stddef.h> #include <stdbool.h> @@ -131,25 +132,54 @@ size_t get_cmds_max_name_width(command_definition_t *cmds); #endif -command_t find_key_command(int key, command_definition_t *cmds); +gcc_pure +command_t +find_key_command(int key, const command_definition_t *cmds); void command_dump_keys(void); #ifndef NCMPC_MINI -int check_key_bindings(command_definition_t *cmds, char *buf, size_t size); -int write_key_bindings(FILE *f, int all); +/** + * @return true on success, false on error + */ +bool +check_key_bindings(command_definition_t *cmds, char *buf, size_t size); + +/** + * @return true on success, false on error + */ +bool +write_key_bindings(FILE *f, int all); #endif +gcc_pure const char *key2str(int key); + +gcc_pure const char *get_key_description(command_t command); + +gcc_pure const char *get_key_command_name(command_t command); + +gcc_pure const char *get_key_names(command_t command, bool all); + +gcc_pure command_t get_key_command(int key); -command_t get_key_command_from_name(char *name); -int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); +gcc_pure +command_t +get_key_command_from_name(const char *name); + +/** + * @return true on success, false on error + */ +bool +assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); + +gcc_pure command_t get_keyboard_command(void); #endif
View file
ncmpc-0.21.tar.bz2/src/conf.c -> ncmpc-0.24.tar.xz/src/conf.c
Changed
@@ -24,14 +24,14 @@ #include "command.h" #include "colors.h" #include "screen_list.h" +#include "options.h" +#include <assert.h> #include <ctype.h> #include <stdio.h> #include <errno.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> -#include <fcntl.h> #include <glib.h> #include <glib/gstdio.h> @@ -47,6 +47,7 @@ #define CONF_COLOR "color" #define CONF_COLOR_DEFINITION "colordef" #define CONF_LIST_FORMAT "list-format" +#define CONF_SEARCH_FORMAT "search-format" #define CONF_STATUS_FORMAT "status-format" #define CONF_XTERM_TITLE_FORMAT "xterm-title-format" #define CONF_LIST_WRAP "wrap-around" @@ -120,27 +121,24 @@ } } -static int +static bool parse_key_definition(char *str) { - char buf[MAX_LINE_LENGTH]; - char *p; - size_t len = strlen(str), i; - int j,key; - int keys[MAX_COMMAND_KEYS]; - command_t cmd; - /* get the command name */ - i=0; - j=0; + const size_t len = strlen(str); + size_t i = 0; + int j = 0; + char buf[MAX_LINE_LENGTH]; memset(buf, 0, MAX_LINE_LENGTH); while (i < len && str[i] != '=' && !g_ascii_isspace(str[i])) buf[j++] = str[i++]; - if( (cmd=get_key_command_from_name(buf)) == CMD_NONE ) { + + command_t cmd = get_key_command_from_name(buf); + if(cmd == CMD_NONE) { /* the hotkey configuration contains an unknown command */ print_error(_("Unknown command"), buf); - return -1; + return false; } /* skip whitespace */ @@ -153,13 +151,15 @@ if (*buf == 0) { /* the hotkey configuration line is incomplete */ print_error(_("Incomplete hotkey configuration"), str); - return -1; + return false; } /* parse key values */ i = 0; - key = 0; - p = buf; + int key = 0; + char *p = buf; + + int keys[MAX_COMMAND_KEYS]; memset(keys, 0, sizeof(int)*MAX_COMMAND_KEYS); while (i < MAX_COMMAND_KEYS && *p != 0 && (key = parse_key_value(p, &p)) >= 0) { @@ -169,7 +169,7 @@ } if (key < 0) - return -1; + return false; return assign_keys(cmd, keys); } @@ -195,9 +195,7 @@ static char * separate_value(char *p) { - char *value; - - value = strchr(p, '='); + char *value = strchr(p, '='); if (value == NULL) { /* an equals sign '=' was expected while parsing a configuration file line */ @@ -214,9 +212,7 @@ static int parse_color(char *str) { - char *value; - - value = separate_value(str); + char *value = separate_value(str); if (value == NULL) return -1; @@ -246,23 +242,21 @@ static int parse_color_definition(char *str) { - char buf[MAX_LINE_LENGTH]; - char *value; - short color, rgb[3]; - - value = separate_value(str); + char *value = separate_value(str); if (value == NULL) return -1; /* get the command name */ - color = colors_str2color(str); + short color = colors_str2color(str); if (color < 0) { + char buf[MAX_LINE_LENGTH]; print_error(_("Bad color name"), buf); return -1; } /* parse r,g,b values */ + short rgb[3]; for (unsigned i = 0; i < 3; ++i) { char *next = after_comma(value), *endptr; if (*value == 0) { @@ -335,8 +329,7 @@ get_search_mode(char *value) { char * test; - int mode; - mode= strtol(value, &test, 10); + const int mode = strtol(value, &test, 10); if (*test == '\0') { if (0 <= mode && mode <= 4) @@ -376,11 +369,9 @@ parse_line(char *line) { size_t len = strlen(line), i = 0, j = 0; - char name[MAX_LINE_LENGTH]; - char value[MAX_LINE_LENGTH]; - bool match_found; /* get the name part */ + char name[MAX_LINE_LENGTH]; while (i < len && line[i] != '=' && !g_ascii_isspace(line[i])) name[j++] = line[i++]; @@ -391,13 +382,12 @@ i++; /* get the value part */ + char value[MAX_LINE_LENGTH]; j = 0; while (i < len) value[j++] = line[i++]; value[j] = '\0'; - match_found = true; - /* key definition */ if (!strcasecmp(CONF_KEY_DEFINITION, name)) parse_key_definition(value); @@ -445,6 +435,10 @@ else if (!strcasecmp(CONF_LIST_FORMAT, name)) { g_free(options.list_format); options.list_format = get_format(value); + /* search format string */ + } else if (!strcasecmp(CONF_SEARCH_FORMAT, name)) { + g_free(options.search_format); + options.search_format = get_format(value); /* status format string */ } else if (!strcasecmp(CONF_STATUS_FORMAT, name)) { g_free(options.status_format); @@ -557,30 +551,26 @@ #else options.second_column = str2bool(value); #endif - else - match_found = false; - - if (!match_found) + else { print_error(_("Unknown configuration parameter"), name); + return false;
View file
ncmpc-0.21.tar.bz2/src/conf.h -> ncmpc-0.24.tar.xz/src/conf.h
Changed
@@ -17,9 +17,10 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "options.h" +#include <stdbool.h> -int check_user_conf_dir(void); +bool +check_user_conf_dir(void); char *build_user_conf_filename(void); char *build_system_conf_filename(void);
View file
ncmpc-0.21.tar.bz2/src/filelist.c -> ncmpc-0.24.tar.xz/src/filelist.c
Changed
@@ -38,9 +38,7 @@ void filelist_free(struct filelist *filelist) { - guint i; - - for (i = 0; i < filelist_length(filelist); ++i) { + for (unsigned i = 0; i < filelist_length(filelist); ++i) { struct filelist_entry *entry = filelist_get(filelist, i); if (entry->entity) @@ -69,9 +67,7 @@ void filelist_move(struct filelist *filelist, struct filelist *from) { - guint i; - - for (i = 0; i < filelist_length(from); ++i) + for (unsigned i = 0; i < filelist_length(from); ++i) g_ptr_array_add(filelist->entries, g_ptr_array_index(from->entries, i)); @@ -93,11 +89,11 @@ gconstpointer filelist_entry2) { const struct mpd_entity *e1, *e2; - int n = 0; e1 = ((const struct filelist_entry *)filelist_entry1)->entity; e2 = ((const struct filelist_entry *)filelist_entry2)->entity; + int n = 0; if (e1 != NULL && e2 != NULL && mpd_entity_get_type(e1) == mpd_entity_get_type(e2)) { switch (mpd_entity_get_type(e1)) { @@ -132,7 +128,6 @@ void filelist_sort_dir_play(struct filelist *filelist, GCompareFunc compare_func) { - unsigned first, last; const struct mpd_entity *iter; assert(filelist && filelist->entries); @@ -142,7 +137,7 @@ /* If the first entry is NULL, skip it, because NULL stands for "[..]" */ iter = ((struct filelist_entry*) g_ptr_array_index(filelist->entries, 0))->entity; - first = (iter == NULL)? 1 : 0; + unsigned first = iter == NULL ? 1 : 0, last; /* find the last directory entry */ for (last = first+1; last < filelist->entries->len; last++) { @@ -197,13 +192,11 @@ } int -filelist_find_song(struct filelist *fl, const struct mpd_song *song) +filelist_find_song(const struct filelist *fl, const struct mpd_song *song) { - guint i; - assert(song != NULL); - for (i = 0; i < filelist_length(fl); ++i) { + for (unsigned i = 0; i < filelist_length(fl); ++i) { struct filelist_entry *entry = filelist_get(fl, i); const struct mpd_entity *entity = entry->entity; @@ -221,13 +214,11 @@ } int -filelist_find_directory(struct filelist *filelist, const char *name) +filelist_find_directory(const struct filelist *filelist, const char *name) { - guint i; - assert(name != NULL); - for (i = 0; i < filelist_length(filelist); ++i) { + for (unsigned i = 0; i < filelist_length(filelist); ++i) { struct filelist_entry *entry = filelist_get(filelist, i); const struct mpd_entity *entity = entry->entity;
View file
ncmpc-0.21.tar.bz2/src/filelist.h -> ncmpc-0.24.tar.xz/src/filelist.h
Changed
@@ -20,6 +20,8 @@ #ifndef FILELIST_H #define FILELIST_H +#include "Compiler.h" + #include <glib.h> struct mpd_connection; @@ -53,6 +55,7 @@ return filelist_length(filelist) == 0; } +gcc_pure static inline struct filelist_entry * filelist_get(const struct filelist *filelist, guint i) { @@ -65,6 +68,7 @@ void filelist_move(struct filelist *filelist, struct filelist *from); +gcc_pure gint compare_filelist_entry_path(gconstpointer filelist_entry1, gconstpointer filelist_entry2); @@ -84,11 +88,13 @@ void filelist_no_duplicates(struct filelist *filelist); +gcc_pure int -filelist_find_song(struct filelist *flist, const struct mpd_song *song); +filelist_find_song(const struct filelist *flist, const struct mpd_song *song); +gcc_pure int -filelist_find_directory(struct filelist *filelist, const char *name); +filelist_find_directory(const struct filelist *filelist, const char *name); /** * Receives entities from the connection, and appends them to the
View file
ncmpc-0.21.tar.bz2/src/gidle.c -> ncmpc-0.24.tar.xz/src/gidle.c
Changed
@@ -27,11 +27,13 @@ */ #include "gidle.h" +#include "Compiler.h" #include <mpd/async.h> #include <mpd/parser.h> #include <glib.h> + #include <assert.h> #include <string.h> #include <errno.h> @@ -245,11 +247,8 @@ mpd_glib_recv(struct mpd_glib_source *source) { char *line; - bool success; - while ((line = mpd_async_recv_line(source->async)) != NULL) { - success = mpd_glib_feed(source, line); - if (!success) + if (!mpd_glib_feed(source, line)) return false; } @@ -265,21 +264,18 @@ } static gboolean -mpd_glib_source_callback(G_GNUC_UNUSED GIOChannel *_source, +mpd_glib_source_callback(gcc_unused GIOChannel *_source, GIOCondition condition, gpointer data) { struct mpd_glib_source *source = data; - bool success; - enum mpd_async_event events; assert(source->id != 0); assert(source->io_events != 0); /* let libmpdclient do some I/O */ - success = mpd_async_io(source->async, - g_io_condition_to_mpd_async_event(condition)); - if (!success) { + if (!mpd_async_io(source->async, + g_io_condition_to_mpd_async_event(condition))) { source->id = 0; source->io_events = 0; @@ -290,14 +286,13 @@ /* receive the response */ if ((condition & G_IO_IN) != 0) { - success = mpd_glib_recv(source); - if (!success) + if (!mpd_glib_recv(source)) return false; } /* continue polling? */ - events = mpd_async_events(source->async); + enum mpd_async_event events = mpd_async_events(source->async); if (events == 0) { /* no events - disable watch */ source->id = 0; @@ -324,13 +319,11 @@ mpd_glib_add_watch(struct mpd_glib_source *source) { enum mpd_async_event events = mpd_async_events(source->async); - GIOCondition condition; assert(source->io_events == 0); assert(source->id == 0); - condition = mpd_async_events_to_g_io_condition(events); - + GIOCondition condition = mpd_async_events_to_g_io_condition(events); source->id = g_io_add_watch(source->channel, condition, mpd_glib_source_callback, source); source->io_events = events; @@ -339,8 +332,6 @@ bool mpd_glib_enter(struct mpd_glib_source *source) { - bool success; - assert(source->io_events == 0); assert(source->id == 0); assert(!source->destroyed); @@ -350,8 +341,7 @@ source->idle_events = 0; - success = mpd_async_send_command(source->async, "idle", NULL); - if (!success) { + if (!mpd_async_send_command(source->async, "idle", NULL)) { mpd_glib_invoke_async_error(source); return false; } @@ -363,8 +353,6 @@ bool mpd_glib_leave(struct mpd_glib_source *source) { - enum mpd_idle events; - assert(!source->destroyed); if (source->id == 0) @@ -375,7 +363,7 @@ source->id = 0; source->io_events = 0; - events = source->idle_events == 0 + enum mpd_idle events = source->idle_events == 0 ? mpd_run_noidle(source->connection) : mpd_recv_idle(source->connection, false);
View file
ncmpc-0.21.tar.bz2/src/hscroll.c -> ncmpc-0.24.tar.xz/src/hscroll.c
Changed
@@ -20,7 +20,6 @@ #include "hscroll.h" #include "charset.h" #include "ncfix.h" -#include "glib_compat.h" #include <assert.h> #include <string.h> @@ -29,21 +28,18 @@ strscroll(struct hscroll *hscroll, const char *str, const char *separator, unsigned width) { - gchar *tmp, *buf; - assert(hscroll != NULL); assert(str != NULL); assert(separator != NULL); /* create a buffer containing the string and the separator */ - tmp = replace_locale_to_utf8(g_strconcat(str, separator, - str, separator, NULL)); - + char *tmp = replace_locale_to_utf8(g_strconcat(str, separator, + str, separator, NULL)); if (hscroll->offset >= (unsigned)g_utf8_strlen(tmp, -1) / 2) hscroll->offset = 0; /* create the new scrolled string */ - buf = g_utf8_offset_to_pointer(tmp, hscroll->offset); + char *buf = g_utf8_offset_to_pointer(tmp, hscroll->offset); utf8_cut_width(buf, width); /* convert back to locale */ @@ -113,21 +109,19 @@ void hscroll_draw(struct hscroll *hscroll) { - attr_t old_attrs; - short old_pair; - char *p; - assert(hscroll != NULL); assert(hscroll->w != NULL); assert(hscroll->text != NULL); /* set stored attributes and color */ + attr_t old_attrs; + short old_pair; fix_wattr_get(hscroll->w, &old_attrs, &old_pair, NULL); wattr_set(hscroll->w, hscroll->attrs, hscroll->pair, NULL); /* scroll the string, and draw it */ - p = strscroll(hscroll, hscroll->text, hscroll->separator, - hscroll->width); + char *p = strscroll(hscroll, hscroll->text, hscroll->separator, + hscroll->width); mvwaddstr(hscroll->w, hscroll->y, hscroll->x, p); g_free(p);
View file
ncmpc-0.21.tar.bz2/src/lirc.c -> ncmpc-0.24.tar.xz/src/lirc.c
Changed
@@ -17,9 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include <lirc/lirc_client.h> #include "lirc.h" #include "ncmpc.h" +#include "Compiler.h" + +#include <lirc/lirc_client.h> static struct lirc_config *lc = NULL; @@ -47,8 +49,8 @@ } gboolean -lirc_event(G_GNUC_UNUSED GIOChannel *source, - G_GNUC_UNUSED GIOCondition condition, G_GNUC_UNUSED gpointer data) +lirc_event(gcc_unused GIOChannel *source, + gcc_unused GIOCondition condition, gcc_unused gpointer data) { char *code, *txt; command_t cmd;
View file
ncmpc-0.21.tar.bz2/src/list_window.c -> ncmpc-0.24.tar.xz/src/list_window.c
Changed
@@ -351,8 +351,6 @@ 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) { @@ -360,7 +358,7 @@ 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, @@ -382,7 +380,7 @@ 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); @@ -392,8 +390,6 @@ 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) { @@ -401,7 +397,7 @@ break; } - selected = show_cursor && + bool selected = show_cursor && lw->start + i >= range.start && lw->start + i < range.end; @@ -425,13 +421,12 @@ 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)) { @@ -464,7 +459,6 @@ bool bell_on_wrap) { int i = lw->selected - 1; - const char *label; assert(str != NULL); @@ -473,7 +467,7 @@ do { while (i >= 0) { - label = callback(i, callback_data); + const char *label = callback(i, callback_data); assert(label != NULL); if (match_line(label, str)) { @@ -502,13 +496,10 @@ 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) { @@ -525,18 +516,14 @@ 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)) {
View file
ncmpc-0.21.tar.bz2/src/list_window.h -> ncmpc-0.24.tar.xz/src/list_window.h
Changed
@@ -35,7 +35,7 @@ (*list_window_paint_callback_t)(WINDOW *w, unsigned i, unsigned y, unsigned width, bool selected, - void *data); + const void *data); struct list_window { WINDOW *w; @@ -94,7 +94,7 @@ void list_window_paint2(const struct list_window *lw, list_window_paint_callback_t paint_callback, - void *callback_data); + const void *callback_data); /* perform basic list window commands (movement) */ bool
View file
ncmpc-0.21.tar.bz2/src/main.c -> ncmpc-0.24.tar.xz/src/main.c
Changed
@@ -74,22 +74,21 @@ static void update_xterm_title(void) { - static char title[BUFSIZE]; - char tmp[BUFSIZE]; struct mpd_status *status = NULL; const struct mpd_song *song = NULL; - if (mpd) { status = mpd->status; song = mpd->song; } + char tmp[BUFSIZE]; if (options.xterm_title_format && status && song && mpd_status_get_state(status) == MPD_STATE_PLAY) strfsong(tmp, BUFSIZE, options.xterm_title_format, song); else g_strlcpy(tmp, PACKAGE " version " VERSION, BUFSIZE); + static char title[BUFSIZE]; if (strncmp(title, tmp, BUFSIZE)) { g_strlcpy(title, tmp, BUFSIZE); set_xterm_title("%s", title); @@ -114,14 +113,14 @@ #ifndef WIN32 static void -catch_sigint(G_GNUC_UNUSED int sig) +catch_sigint(gcc_unused int sig) { g_main_loop_quit(main_loop); } static void -catch_sigcont(G_GNUC_UNUSED int sig) +catch_sigcont(gcc_unused int sig) { char irrelevant = 'a'; if (1 != write(sigwinch_pipes[1], &irrelevant, 1)) @@ -137,8 +136,8 @@ } static gboolean -sigwinch_event(G_GNUC_UNUSED GIOChannel *source, - G_GNUC_UNUSED GIOCondition condition, G_GNUC_UNUSED gpointer data) +sigwinch_event(gcc_unused GIOChannel *source, + gcc_unused GIOCondition condition, gcc_unused gpointer data) { char ignoreme[64]; if (1 > read(sigwinch_pipes[0], ignoreme, 64)) @@ -152,7 +151,7 @@ } static void -catch_sigwinch(G_GNUC_UNUSED int sig) +catch_sigwinch(gcc_unused int sig) { char irrelevant = 'a'; if (1 != write(sigwinch_pipes[1], &irrelevant, 1)) @@ -162,9 +161,9 @@ static void idle_callback(enum mpd_error error, - G_GNUC_UNUSED enum mpd_server_error server_error, + gcc_unused enum mpd_server_error server_error, const char *message, enum mpd_idle events, - G_GNUC_UNUSED void *ctx); + gcc_unused void *ctx); static gboolean timer_mpd_update(gpointer data); @@ -280,33 +279,13 @@ #endif } -static char * -connection_settings_name(const struct mpd_connection *connection) -{ -#if LIBMPDCLIENT_CHECK_VERSION(2,4,0) - const struct mpd_settings *settings = - mpd_connection_get_settings(connection); - if (settings == NULL) - return g_strdup(_("unknown")); - - return settings_name(settings); -#else - (void)connection; - - return default_settings_name(); -#endif -} - /** * This timer is installed when the connection to the MPD server is * broken. It tries to recover by reconnecting periodically. */ static gboolean -timer_reconnect(G_GNUC_UNUSED gpointer data) +timer_reconnect(gcc_unused gpointer data) { - bool success; - struct mpd_connection *connection; - assert(!mpdclient_is_connected(mpd)); reconnect_source_id = 0; @@ -318,27 +297,25 @@ doupdate(); mpdclient_disconnect(mpd); - success = mpdclient_connect(mpd, - options.host, options.port, - options.timeout_ms, - options.password); - if (!success) { + if (!mpdclient_connect(mpd, options.host, options.port, + options.timeout_ms, + options.password)) { /* try again in 5 seconds */ reconnect_source_id = g_timeout_add(5000, timer_reconnect, NULL); return FALSE; } - connection = mpdclient_get_connection(mpd); + struct mpd_connection *connection = mpdclient_get_connection(mpd); #ifndef NCMPC_MINI - /* quit if mpd is pre 0.11.0 - song id not supported by mpd */ - if (mpd_connection_cmp_server_version(connection, 0, 12, 0) < 0) { + /* quit if mpd is pre 0.14 - song id not supported by mpd */ + if (mpd_connection_cmp_server_version(connection, 0, 16, 0) < 0) { const unsigned *version = mpd_connection_get_server_version(connection); - screen_status_printf(_("Error: MPD version %d.%d.%d is to old (%s needed)"), + screen_status_printf(_("Error: MPD version %d.%d.%d is too old (%s needed)"), version[0], version[1], version[2], - "0.12.0"); + "0.16.0"); mpdclient_disconnect(mpd); doupdate(); @@ -349,14 +326,10 @@ } #endif - if (mpd_connection_cmp_server_version(connection, - 0, 14, 0) >= 0) - mpd->source = mpd_glib_new(connection, - idle_callback, mpd); + mpd->source = mpd_glib_new(connection, + idle_callback, mpd); - name = connection_settings_name(connection); - screen_status_printf(_("Connected to %s"), name); - g_free(name); + screen_status_clear_message(); doupdate(); /* update immediately */ @@ -394,8 +367,6 @@ assert(mpdclient_is_connected(c)); if (error != MPD_ERROR_SUCCESS) { - char *allocated; - if (error == MPD_ERROR_SERVER && server_error == MPD_SERVER_ERROR_UNKNOWN_CMD) { /* the "idle" command is not supported - fall @@ -406,6 +377,7 @@ return; } + char *allocated; if (error == MPD_ERROR_SERVER) message = allocated = utf8_to_locale(message); else @@ -439,7 +411,7 @@ } static gboolean -timer_mpd_update(G_GNUC_UNUSED gpointer data) +timer_mpd_update(gcc_unused gpointer data) { do_mpd_update(); @@ -482,15 +454,14 @@ } static gboolean -keyboard_event(G_GNUC_UNUSED GIOChannel *source, - G_GNUC_UNUSED GIOCondition condition, - G_GNUC_UNUSED gpointer data) +keyboard_event(gcc_unused GIOChannel *source, + gcc_unused GIOCondition condition, + gcc_unused gpointer data) {
View file
ncmpc-0.21.tar.bz2/src/match.c -> ncmpc-0.24.tar.xz/src/match.c
Changed
@@ -37,15 +37,14 @@ GRegex * compile_regex(const char *src, bool anchor) { - GRegex *regex; - GRegexCompileFlags compile_flags; - char *src_folded = locale_casefold(src); - - compile_flags = G_REGEX_CASELESS | G_REGEX_DOTALL | G_REGEX_OPTIMIZE; + GRegexCompileFlags compile_flags = + G_REGEX_CASELESS | G_REGEX_DOTALL | G_REGEX_OPTIMIZE; if (anchor) compile_flags |= G_REGEX_ANCHORED; - regex = g_regex_new ((const gchar*)src_folded, compile_flags, 0, NULL); + char *src_folded = locale_casefold(src); + GRegex *regex = g_regex_new ((const gchar*)src_folded, compile_flags, + 0, NULL); g_free(src_folded); @@ -55,12 +54,10 @@ bool match_regex(GRegex *regex, const char *line) { - GMatchInfo *match_info; - bool match; char *line_folded = locale_casefold(line); - + GMatchInfo *match_info; g_regex_match(regex, line_folded, 0, &match_info); - match = (bool)g_match_info_matches(match_info); + bool match = (bool)g_match_info_matches(match_info); g_match_info_free(match_info); g_free(line_folded); @@ -74,14 +71,10 @@ char *line_folded = locale_casefold(line); char *needle_folded = locale_casefold(needle); -#if GLIB_CHECK_VERSION(2,14,0) bool ret = (bool)g_regex_match_simple((const gchar*)needle_folded, (const gchar*)line_folded, G_REGEX_CASELESS | G_REGEX_DOTALL | G_REGEX_OPTIMIZE, 0); -#else - bool ret = strstr(line_folded, needle_folded) != NULL; -#endif g_free(line_folded); g_free(needle_folded);
View file
ncmpc-0.21.tar.bz2/src/match.h -> ncmpc-0.24.tar.xz/src/match.h
Changed
@@ -21,6 +21,7 @@ #define MATCH_H #include "config.h" +#include "Compiler.h" #include <stdbool.h> @@ -40,6 +41,7 @@ GRegex * compile_regex(const char *src, bool anchor); +gcc_pure bool match_regex(GRegex *regex, const char *line); @@ -47,6 +49,7 @@ * Checks whether the specified line matches the search string. Case * is ignored. */ +gcc_pure bool match_line(const char *line, const char *needle);
View file
ncmpc-0.21.tar.bz2/src/mpdclient.c -> ncmpc-0.24.tar.xz/src/mpdclient.c
Changed
@@ -35,23 +35,24 @@ #define BUFSIZE 1024 -/* sort by list-format */ +/* sort by song format */ gint compare_filelistentry_format(gconstpointer filelist_entry1, - gconstpointer filelist_entry2) + gconstpointer filelist_entry2, + const char *song_format) { - const struct mpd_entity *e1, *e2; - char key1[BUFSIZE], key2[BUFSIZE]; - int n = 0; - - e1 = ((const struct filelist_entry *)filelist_entry1)->entity; - e2 = ((const struct filelist_entry *)filelist_entry2)->entity; + const struct mpd_entity *e1 = + ((const struct filelist_entry *)filelist_entry1)->entity; + const struct mpd_entity *e2 = + ((const struct filelist_entry *)filelist_entry2)->entity; + int n = 0; if (e1 && e2 && mpd_entity_get_type(e1) == MPD_ENTITY_TYPE_SONG && mpd_entity_get_type(e2) == MPD_ENTITY_TYPE_SONG) { - strfsong(key1, BUFSIZE, options.list_format, mpd_entity_get_song(e1)); - strfsong(key2, BUFSIZE, options.list_format, mpd_entity_get_song(e2)); + char key1[BUFSIZE], key2[BUFSIZE]; + strfsong(key1, BUFSIZE, song_format, mpd_entity_get_song(e1)); + strfsong(key2, BUFSIZE, song_format, mpd_entity_get_song(e2)); n = strcmp(key1,key2); } @@ -86,9 +87,7 @@ struct mpdclient * mpdclient_new(void) { - struct mpdclient *c; - - c = g_new0(struct mpdclient, 1); + struct mpdclient *c = g_new0(struct mpdclient, 1); playlist_init(&c->playlist); c->volume = -1; c->events = 0; @@ -256,11 +255,9 @@ static struct mpd_status * mpdclient_recv_status(struct mpdclient *c) { - struct mpd_status *status; - assert(c->connection != NULL); - status = mpd_recv_status(c->connection); + struct mpd_status *status = mpd_recv_status(c->connection); if (status == NULL) { mpdclient_handle_error(c); return NULL; @@ -278,32 +275,24 @@ bool mpdclient_cmd_crop(struct mpdclient *c) { - struct mpd_connection *connection; - int length, current; - if (!mpdclient_is_playing(c)) return false; - length = mpd_status_get_queue_length(c->status); - current = mpd_status_get_song_pos(c->status); + int length = mpd_status_get_queue_length(c->status); + int current = mpd_status_get_song_pos(c->status); if (current < 0 || mpd_status_get_queue_length(c->status) < 2) return true; - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) return false; mpd_command_list_begin(connection, false); - if (mpd_connection_cmp_server_version(connection, 0, 16, 0) >= 0) { - if (current < length - 1) - mpd_send_delete_range(connection, current + 1, length); - if (current > 0) - mpd_send_delete_range(connection, 0, current); - } else - while (--length >= 0) - if (length != current) - mpd_send_delete(connection, length); + if (current < length - 1) + mpd_send_delete_range(connection, current + 1, length); + if (current > 0) + mpd_send_delete_range(connection, 0, current); mpd_command_list_end(connection); @@ -314,8 +303,6 @@ mpdclient_cmd_clear(struct mpdclient *c) { struct mpd_connection *connection = mpdclient_get_connection(c); - struct mpd_status *status; - if (connection == NULL) return false; @@ -328,7 +315,7 @@ /* receive the new status, store it in the mpdclient struct */ - status = mpdclient_recv_status(c); + struct mpd_status *status = mpdclient_recv_status(c); if (status == NULL) return false; @@ -414,13 +401,10 @@ bool mpdclient_cmd_add(struct mpdclient *c, const struct mpd_song *song) { - struct mpd_connection *connection = mpdclient_get_connection(c); - struct mpd_status *status; - struct mpd_song *new_song; - assert(c != NULL); assert(song != NULL); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL || c->status == NULL) return false; @@ -439,14 +423,14 @@ c->events |= MPD_IDLE_QUEUE; - status = mpdclient_recv_status(c); + struct mpd_status *status = mpdclient_recv_status(c); if (status == NULL) return false; if (!mpd_response_next(connection)) return mpdclient_handle_error(c); - new_song = mpd_recv_song(connection); + struct mpd_song *new_song = mpd_recv_song(connection); if (!mpd_response_finish(connection) || new_song == NULL) { if (new_song != NULL) mpd_song_free(new_song); @@ -476,8 +460,6 @@ mpdclient_cmd_delete(struct mpdclient *c, gint idx) { struct mpd_connection *connection = mpdclient_get_connection(c); - const struct mpd_song *song; - struct mpd_status *status; if (connection == NULL || c->status == NULL) return false; @@ -485,7 +467,7 @@ if (idx < 0 || (guint)idx >= playlist_length(&c->playlist)) return false; - song = playlist_get(&c->playlist, idx); + const struct mpd_song *song = playlist_get(&c->playlist, idx); /* send the delete command to mpd; at the same time, get the new status (to verify the playlist id) */ @@ -498,7 +480,7 @@ c->events |= MPD_IDLE_QUEUE; - status = mpdclient_recv_status(c); + struct mpd_status *status = mpdclient_recv_status(c); if (status == NULL) return false; @@ -523,52 +505,18 @@ return true; } -/** - * Fallback for mpdclient_cmd_delete_range() on MPD older than 0.16. - * It emulates the "delete range" command with a list of simple - * "delete" commands. - */ -static bool -mpdclient_cmd_delete_range_fallback(struct mpdclient *c, - unsigned start, unsigned end) -{ - struct mpd_connection *connection = mpdclient_get_connection(c); - if (connection == NULL) - return false; - - if (!mpd_command_list_begin(connection, false)) - return mpdclient_handle_error(c); - - for (; start < end; --end) - mpd_send_delete(connection, start); - - if (!mpd_command_list_end(connection) ||
View file
ncmpc-0.21.tar.bz2/src/mpdclient.h -> ncmpc-0.24.tar.xz/src/mpdclient.h
Changed
@@ -2,6 +2,7 @@ #define MPDCLIENT_H #include "playlist.h" +#include "Compiler.h" #include <mpd/client.h> @@ -84,14 +85,14 @@ void mpdclient_free(struct mpdclient *c); -G_GNUC_PURE +gcc_pure static inline bool mpdclient_is_connected(const struct mpdclient *c) { return c->connection != NULL; } -G_GNUC_PURE +gcc_pure static inline bool mpdclient_is_playing(const struct mpdclient *c) { @@ -100,7 +101,7 @@ mpd_status_get_state(c->status) == MPD_STATE_PAUSE); } -G_GNUC_PURE +gcc_pure static inline const struct mpd_song * mpdclient_get_current_song(const struct mpdclient *c) { @@ -196,7 +197,10 @@ bool mpdclient_filelist_add_all(struct mpdclient *c, struct filelist *fl); -/* sort by list-format */ -gint compare_filelistentry_format(gconstpointer filelist_entry1, gconstpointer filelist_entry2); +/* sort by song format */ +gcc_pure +gint compare_filelistentry_format(gconstpointer filelist_entry1, + gconstpointer filelist_entry2, + const char *song_format); #endif
View file
ncmpc-0.21.tar.bz2/src/options.c -> ncmpc-0.24.tar.xz/src/options.c
Changed
@@ -134,11 +134,9 @@ static void display_help(void) { - unsigned i; - printf("Usage: %s [OPTION]...\n", PACKAGE); - for (i = 0; i < option_table_size; ++i) { + for (unsigned i = 0; i < option_table_size; ++i) { char tmp[32]; if (option_table[i].argument) @@ -295,11 +293,10 @@ void options_parse(int argc, const char *argv[]) { - int i; const arg_opt_t *opt = NULL; option_callback_fn_t option_cb = handle_option; - for (i = 1; i < argc; i++) { + for (int i = 1; i < argc; i++) { const char *arg = argv[i]; size_t len = strlen(arg); @@ -381,6 +378,7 @@ { /* default option values */ options.list_format = g_strdup(DEFAULT_LIST_FORMAT); + options.search_format = NULL; options.status_format = g_strdup(DEFAULT_STATUS_FORMAT); options.screen_list = g_strsplit_set(DEFAULT_SCREEN_LIST, " ", 0); #ifndef NCMPC_MINI @@ -400,6 +398,7 @@ g_free(options.config_file); g_free(options.key_file); g_free(options.list_format); + g_free(options.search_format); g_free(options.status_format); g_strfreev(options.screen_list); #ifndef NCMPC_MINI
View file
ncmpc-0.21.tar.bz2/src/options.h -> ncmpc-0.24.tar.xz/src/options.h
Changed
@@ -32,6 +32,7 @@ char *config_file; char *key_file; char *list_format; + char *search_format; char *status_format; #ifndef NCMPC_MINI char *xterm_title_format;
View file
ncmpc-0.21.tar.bz2/src/player_command.c -> ncmpc-0.24.tar.xz/src/player_command.c
Changed
@@ -32,12 +32,10 @@ static void commit_seek(struct mpdclient *c) { - struct mpd_connection *connection; - if (seek_id < 0) return; - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) { seek_id = -1; return; @@ -101,14 +99,14 @@ bool handle_player_command(struct mpdclient *c, command_t cmd) { - struct mpd_connection *connection; - if (!mpdclient_is_connected(c) || c->status == NULL) return false; cancel_seek_timer(); switch(cmd) { + struct mpd_connection *connection; + /* case CMD_PLAY: mpdclient_cmd_play(c, MPD_PLAY_AT_BEGINNING); @@ -174,7 +172,7 @@ break; if (mpd_run_shuffle(connection)) - screen_status_message(_("Shuffled playlist")); + screen_status_message(_("Shuffled queue")); else mpdclient_handle_error(c); break; @@ -184,7 +182,7 @@ break; if (mpdclient_cmd_clear(c)) - screen_status_message(_("Cleared playlist")); + screen_status_message(_("Cleared queue")); break; case CMD_REPEAT: connection = mpdclient_get_connection(c);
View file
ncmpc-0.21.tar.bz2/src/playlist.c -> ncmpc-0.24.tar.xz/src/playlist.c
Changed
@@ -31,11 +31,9 @@ void playlist_clear(struct mpdclient_playlist *playlist) { - guint i; - playlist->version = 0; - for (i = 0; i < playlist->list->len; ++i) { + for (unsigned i = 0; i < playlist->list->len; ++i) { struct mpd_song *song = playlist_get(playlist, i); mpd_song_free(song); @@ -69,14 +67,12 @@ playlist_move(struct mpdclient_playlist *playlist, unsigned dest, unsigned src) { - struct mpd_song *song; - assert(playlist != NULL); assert(src < playlist_length(playlist)); assert(dest < playlist_length(playlist)); assert(src != dest); - song = playlist_get(playlist, src); + struct mpd_song *song = playlist_get(playlist, src); if (src < dest) { memmove(&playlist->list->pdata[src],
View file
ncmpc-0.21.tar.bz2/src/playlist.h -> ncmpc-0.24.tar.xz/src/playlist.h
Changed
@@ -20,6 +20,8 @@ #ifndef MPDCLIENT_PLAYLIST_H #define MPDCLIENT_PLAYLIST_H +#include "Compiler.h" + #include <mpd/client.h> #include <assert.h> @@ -131,10 +133,12 @@ return playlist_get_index_from_file(playlist, mpd_song_get_uri(song)); } +gcc_pure gint playlist_get_id_from_uri(const struct mpdclient_playlist *playlist, const gchar *uri); +gcc_pure static inline gint playlist_get_id_from_same_song(const struct mpdclient_playlist *playlist, const struct mpd_song *song)
View file
ncmpc-0.21.tar.bz2/src/plugin.c -> ncmpc-0.24.tar.xz/src/plugin.c
Changed
@@ -18,6 +18,7 @@ */ #include "plugin.h" +#include "Compiler.h" #include <assert.h> #include <stdlib.h> @@ -71,18 +72,15 @@ static bool register_plugin(struct plugin_list *list, char *path) { - int ret; struct stat st; - - ret = stat(path, &st); - if (ret < 0) + if (stat(path, &st) < 0) return false; g_ptr_array_add(list->plugins, path); return true; } -static gint +static gint plugin_compare_func_alpha(gconstpointer plugin1, gconstpointer plugin2) { return strcmp(* (char * const *) plugin1, * (char * const *) plugin2); @@ -98,19 +96,14 @@ bool plugin_list_load_directory(struct plugin_list *list, const char *path) { - GDir *dir; - const char *name; - char *plugin; - bool ret; - - dir = g_dir_open(path, 0, NULL); + GDir *dir = g_dir_open(path, 0, NULL); if (dir == NULL) return false; + const char *name; while ((name = g_dir_read_name(dir)) != NULL) { - plugin = g_build_filename(path, name, NULL); - ret = register_plugin(list, plugin); - if (!ret) + char *plugin = g_build_filename(path, name, NULL); + if (!register_plugin(list, plugin)) g_free(plugin); } @@ -134,8 +127,6 @@ static void plugin_eof(struct plugin_cycle *cycle, struct plugin_pipe *p) { - int ret, status; - g_io_channel_unref(p->channel); close(p->fd); p->fd = -1; @@ -144,7 +135,7 @@ if (cycle->pipe_stdout.fd != -1 || cycle->pipe_stderr.fd != -1) return; - ret = waitpid(cycle->pid, &status, 0); + int status, ret = waitpid(cycle->pid, &status, 0); cycle->pid = -1; if (ret < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) { @@ -173,16 +164,14 @@ } static gboolean -plugin_data(G_GNUC_UNUSED GIOChannel *source, - G_GNUC_UNUSED GIOCondition condition, gpointer data) +plugin_data(gcc_unused GIOChannel *source, + gcc_unused GIOCondition condition, gpointer data) { struct plugin_cycle *cycle = data; - struct plugin_pipe *p = NULL; - char buffer[256]; - ssize_t nbytes; - assert(cycle != NULL); assert(cycle->pid > 0); + + struct plugin_pipe *p = NULL; if (source == cycle->pipe_stdout.channel) p = &cycle->pipe_stdout; else if (source == cycle->pipe_stderr.channel) @@ -190,7 +179,10 @@ assert(p != NULL); assert(p->fd >= 0); - nbytes = condition & G_IO_IN ? read(p->fd, buffer, sizeof(buffer)) : 0; + char buffer[256]; + ssize_t nbytes = condition & G_IO_IN + ? read(p->fd, buffer, sizeof(buffer)) + : 0; if (nbytes <= 0) { plugin_eof(cycle, p); return FALSE; @@ -235,9 +227,6 @@ static int start_plugin(struct plugin_cycle *cycle, const char *plugin_path) { - int ret, fds_stdout[2], fds_stderr[2]; - pid_t pid; - assert(cycle != NULL); assert(cycle->pid < 0); assert(cycle->pipe_stdout.fd < 0); @@ -250,17 +239,18 @@ g_free(cycle->argv[0]); cycle->argv[0] = g_path_get_basename(plugin_path); - ret = pipe(fds_stdout); - if (ret < 0) + int fds_stdout[2]; + if (pipe(fds_stdout) < 0) return -1; - ret = pipe(fds_stderr); - if (ret < 0) { + + int fds_stderr[2]; + if (pipe(fds_stderr) < 0) { close(fds_stdout[0]); close(fds_stdout[1]); return -1; } - pid = fork(); + pid_t pid = fork(); if (pid < 0) { close(fds_stdout[0]); @@ -300,9 +290,6 @@ static void next_plugin(struct plugin_cycle *cycle) { - const char *plugin_path; - int ret = -1; - assert(cycle->pid < 0); assert(cycle->pipe_stdout.fd < 0); assert(cycle->pipe_stderr.fd < 0); @@ -315,10 +302,9 @@ return; } - plugin_path = g_ptr_array_index(cycle->list->plugins, - cycle->next_plugin++); - ret = start_plugin(cycle, plugin_path); - if (ret < 0) { + const char *plugin_path = g_ptr_array_index(cycle->list->plugins, + cycle->next_plugin++); + if (start_plugin(cycle, plugin_path) < 0) { /* system error */ g_timeout_add(0, plugin_delayed_fail, cycle); return; @@ -329,13 +315,11 @@ make_argv(const char*const* args) { unsigned num = 0; - char **ret; - while (args[num] != NULL) ++num; num += 2; - ret = g_new(char*, num); + char **ret = g_new(char *, num); /* reserve space for the program name */ *ret++ = NULL;
View file
ncmpc-0.21.tar.bz2/src/progress_bar.c -> ncmpc-0.24.tar.xz/src/progress_bar.c
Changed
@@ -43,12 +43,10 @@ static bool progress_bar_calc(struct progress_bar *p) { - unsigned old_width; - if (p->max == 0) return false; - old_width = p->width; + unsigned old_width = p->width; p->width = (p->window.cols * p->current) / (p->max + 1); assert(p->width < p->window.cols); @@ -70,14 +68,12 @@ bool progress_bar_set(struct progress_bar *p, unsigned current, unsigned max) { - bool modified; - assert(p != NULL); if (current > max) current = max; - modified = (max == 0) != (p->max == 0); + bool modified = (max == 0) != (p->max == 0); p->max = max; p->current = current;
View file
ncmpc-0.21.tar.bz2/src/screen.c -> ncmpc-0.24.tar.xz/src/screen.c
Changed
@@ -132,18 +132,17 @@ screen_next_mode(struct mpdclient *c, int offset) { int max = g_strv_length(options.screen_list); - int current, next; - const struct screen_functions *sf; /* find current screen */ - current = find_configured_screen(screen_get_name(mode_fn)); - next = current + offset; + int current = find_configured_screen(screen_get_name(mode_fn)); + int next = current + offset; if (next<0) next = max-1; else if (next>=max) next = 0; - sf = screen_lookup_name(options.screen_list[next]); + const struct screen_functions *sf = + screen_lookup_name(options.screen_list[next]); if (sf != NULL) screen_switch(sf, c); } @@ -157,8 +156,7 @@ static void update_progress_window(struct mpdclient *c, bool repaint) { - unsigned elapsed, duration; - + unsigned elapsed; if (c->status == NULL) elapsed = 0; else if (seek_id >= 0 && seek_id == mpd_status_get_song_id(c->status)) @@ -166,7 +164,7 @@ else elapsed = mpd_status_get_elapsed_time(c->status); - duration = mpdclient_is_playing(c) + unsigned duration = mpdclient_is_playing(c) ? mpd_status_get_total_time(c->status) : 0;
View file
ncmpc-0.21.tar.bz2/src/screen_artist.c -> ncmpc-0.24.tar.xz/src/screen_artist.c
Changed
@@ -28,6 +28,7 @@ #include "mpdclient.h" #include "screen_browser.h" #include "filelist.h" +#include "options.h" #include <assert.h> #include <string.h> @@ -49,12 +50,10 @@ compare_utf8(gconstpointer s1, gconstpointer s2) { const char *const*t1 = s1, *const*t2 = s2; - char *key1, *key2; - int n; - key1 = g_utf8_collate_key(*t1,-1); - key2 = g_utf8_collate_key(*t2,-1); - n = strcmp(key1,key2); + char *key1 = g_utf8_collate_key(*t1,-1); + char *key2 = g_utf8_collate_key(*t2,-1); + int n = strcmp(key1,key2); g_free(key1); g_free(key2); return n; @@ -65,8 +64,6 @@ screen_artist_lw_callback(unsigned idx, void *data) { GPtrArray *list = data; - static char buf[BUFSIZE]; - char *str, *str_utf8; if (mode == LIST_ALBUMS) { if (idx == 0) @@ -79,10 +76,12 @@ assert(idx < list->len); - str_utf8 = g_ptr_array_index(list, idx); + char *str_utf8 = g_ptr_array_index(list, idx); assert(str_utf8 != NULL); - str = utf8_to_locale(str_utf8); + char *str = utf8_to_locale(str_utf8); + + static char buf[BUFSIZE]; g_strlcpy(buf, str, sizeof(buf)); g_free(str); @@ -102,9 +101,7 @@ static void string_array_free(GPtrArray *array) { - unsigned i; - - for (i = 0; i < array->len; ++i) { + for (unsigned i = 0; i < array->len; ++i) { char *value = g_ptr_array_index(array, i); g_free(value); } @@ -305,6 +302,7 @@ screen_artist_init(WINDOW *w, int cols, int rows) { browser.lw = list_window_init(w, cols, rows); + browser.song_format = options.list_format; artist = NULL; album = NULL; } @@ -335,10 +333,10 @@ */ static void paint_artist_callback(WINDOW *w, unsigned i, - G_GNUC_UNUSED unsigned y, unsigned width, - bool selected, void *data) + gcc_unused unsigned y, unsigned width, + bool selected, const void *data) { - GPtrArray *list = data; + const GPtrArray *list = data; char *p = utf8_to_locale(g_ptr_array_index(list, i)); screen_browser_paint_directory(w, width, selected, p); @@ -353,10 +351,10 @@ */ static void paint_album_callback(WINDOW *w, unsigned i, - G_GNUC_UNUSED unsigned y, unsigned width, - bool selected, void *data) + gcc_unused unsigned y, unsigned width, + bool selected, const void *data) { - GPtrArray *list = data; + const GPtrArray *list = data; const char *p; char *q = NULL; @@ -391,9 +389,9 @@ static const char * screen_artist_get_title(char *str, size_t size) { - char *s1, *s2; - switch(mode) { + char *s1, *s2; + case LIST_ARTISTS: g_snprintf(str, size, _("All artists")); break; @@ -453,15 +451,13 @@ const char *_artist) { struct mpd_connection *connection = mpdclient_get_connection(c); - char *str; - struct filelist *addlist; assert(_filter != NULL); if (connection == NULL) return; - str = utf8_to_locale(_filter); + char *str = utf8_to_locale(_filter); if (table == MPD_TAG_ALBUM) screen_status_printf(_("Adding album %s..."), str); else @@ -476,7 +472,7 @@ MPD_TAG_ARTIST, _artist); mpd_search_commit(connection); - addlist = filelist_new_recv(connection); + struct filelist *addlist = filelist_new_recv(connection); if (mpdclient_finish_command(c)) mpdclient_filelist_add_all(c, addlist); @@ -516,13 +512,13 @@ static bool screen_artist_cmd(struct mpdclient *c, command_t cmd) { - struct list_window_range range; - char *selected; - char *old; - char *old_ptr; - int idx; - switch(cmd) { + struct list_window_range range; + char *selected; + char *old; + char *old_ptr; + int idx; + case CMD_PLAY: switch (mode) { case LIST_ARTISTS: @@ -721,13 +717,15 @@ case CMD_LIST_JUMP: switch (mode) { case LIST_ARTISTS: - screen_jump(browser.lw, screen_artist_lw_callback, + screen_jump(browser.lw, + screen_artist_lw_callback, artist_list, paint_artist_callback, artist_list); artist_repaint(); return true; case LIST_ALBUMS: - screen_jump(browser.lw, screen_artist_lw_callback, + screen_jump(browser.lw, + screen_artist_lw_callback, album_list, paint_album_callback, album_list); artist_repaint(); return true;
View file
ncmpc-0.21.tar.bz2/src/screen_browser.c -> ncmpc-0.24.tar.xz/src/screen_browser.c
Changed
@@ -52,9 +52,7 @@ screen_browser_sync_highlights(struct filelist *fl, const struct mpdclient_playlist *playlist) { - guint i; - - for (i = 0; i < filelist_length(fl); ++i) { + for (unsigned i = 0; i < filelist_length(fl); ++i) { struct filelist_entry *entry = filelist_get(fl, i); const struct mpd_entity *entity = entry->entity; @@ -79,16 +77,14 @@ { const struct filelist *fl = (const struct filelist *) data; static char buf[BUFSIZE]; - const struct filelist_entry *entry; - const struct mpd_entity *entity; assert(fl != NULL); assert(idx < filelist_length(fl)); - entry = filelist_get(fl, idx); + const struct filelist_entry *entry = filelist_get(fl, idx); assert(entry != NULL); - entity = entry->entity; + const struct mpd_entity *entity = entry->entity; if( entity == NULL ) return ".."; @@ -169,7 +165,7 @@ entry->flags |= HIGHLIGHT; #endif strfsong(buf, BUFSIZE, options.list_format, song); - screen_status_printf(_("Adding \'%s\' to playlist"), buf); + screen_status_printf(_("Adding \'%s\' to queue"), buf); } if (!mpd_run_play_id(connection, id)) { @@ -231,12 +227,10 @@ browser_handle_enter(struct screen_browser *browser, struct mpdclient *c) { struct filelist_entry *entry = browser_get_selected_entry(browser); - struct mpd_entity *entity; - if (entry == NULL) return false; - entity = entry->entity; + struct mpd_entity *entity = entry->entity; if (entity == NULL) return false; @@ -249,7 +243,7 @@ static bool browser_select_entry(struct mpdclient *c, struct filelist_entry *entry, - G_GNUC_UNUSED gboolean toggle) + gcc_unused gboolean toggle) { assert(entry != NULL); assert(entry->entity != NULL); @@ -264,7 +258,7 @@ if (mpdclient_cmd_add_path(c, mpd_directory_get_path(dir))) { char *tmp = utf8_to_locale(mpd_directory_get_path(dir)); - screen_status_printf(_("Adding \'%s\' to playlist"), tmp); + screen_status_printf(_("Adding \'%s\' to queue"), tmp); g_free(tmp); } @@ -289,7 +283,7 @@ char buf[BUFSIZE]; strfsong(buf, BUFSIZE, options.list_format, song); - screen_status_printf(_("Adding \'%s\' to playlist"), buf); + screen_status_printf(_("Adding \'%s\' to queue"), buf); } #ifndef NCMPC_MINI } else { @@ -313,13 +307,11 @@ browser_handle_select(struct screen_browser *browser, struct mpdclient *c) { struct list_window_range range; - struct filelist_entry *entry; bool success = false; list_window_get_range(browser->lw, &range); for (unsigned i = range.start; i < range.end; ++i) { - entry = browser_get_index(browser, i); - + struct filelist_entry *entry = browser_get_index(browser, i); if (entry != NULL && entry->entity != NULL) success = browser_select_entry(c, entry, TRUE); } @@ -331,13 +323,11 @@ browser_handle_add(struct screen_browser *browser, struct mpdclient *c) { struct list_window_range range; - struct filelist_entry *entry; bool success = false; list_window_get_range(browser->lw, &range); for (unsigned i = range.start; i < range.end; ++i) { - entry = browser_get_index(browser, i); - + struct filelist_entry *entry = browser_get_index(browser, i); if (entry != NULL && entry->entity != NULL) success = browser_select_entry(c, entry, FALSE) || success; @@ -349,12 +339,10 @@ static void browser_handle_select_all(struct screen_browser *browser, struct mpdclient *c) { - guint i; - if (browser->filelist == NULL) return; - for (i = 0; i < filelist_length(browser->filelist); ++i) { + for (unsigned i = 0; i < filelist_length(browser->filelist); ++i) { struct filelist_entry *entry = filelist_get(browser->filelist, i); if (entry != NULL && entry->entity != NULL) @@ -390,14 +378,12 @@ static void screen_browser_paint_callback(WINDOW *w, unsigned i, unsigned y, - unsigned width, bool selected, void *data); + unsigned width, bool selected, const void *data); bool browser_cmd(struct screen_browser *browser, struct mpdclient *c, command_t cmd) { - const struct mpd_song *song; - if (browser->filelist == NULL) return false; @@ -405,6 +391,10 @@ return true; switch (cmd) { +#if defined(ENABLE_SONG_SCREEN) || defined(ENABLE_LYRICS_SCREEN) + const struct mpd_song *song; +#endif + case CMD_LIST_FIND: case CMD_LIST_RFIND: case CMD_LIST_FIND_NEXT: @@ -413,8 +403,9 @@ browser->filelist); return true; case CMD_LIST_JUMP: - screen_jump(browser->lw, browser_lw_callback, - screen_browser_paint_callback, browser->filelist); + screen_jump(browser->lw, + browser_lw_callback, browser->filelist, + screen_browser_paint_callback, browser); return true; #ifdef HAVE_GETMOUSE @@ -454,6 +445,8 @@ return false; switch (cmd) { + const struct mpd_song *song; + case CMD_PLAY: browser_handle_enter(browser, c); return true; @@ -511,35 +504,34 @@ static void screen_browser_paint_callback(WINDOW *w, unsigned i, unsigned y, unsigned width, - bool selected, void *data) + bool selected, const void *data) { - const struct filelist *fl = (const struct filelist *) data; - const struct filelist_entry *entry; - const struct mpd_entity *entity; - bool highlight; - const struct mpd_directory *directory; - const struct mpd_playlist *playlist; - char *p; + const struct screen_browser *browser = (const struct screen_browser *) data; - assert(fl != NULL); - assert(i < filelist_length(fl)); + assert(browser != NULL); + assert(browser->filelist != NULL); + assert(i < filelist_length(browser->filelist)); - entry = filelist_get(fl, i); + const struct filelist_entry *entry = filelist_get(browser->filelist, i); assert(entry != NULL); - entity = entry->entity; + const struct mpd_entity *entity = entry->entity;
View file
ncmpc-0.21.tar.bz2/src/screen_browser.h -> ncmpc-0.24.tar.xz/src/screen_browser.h
Changed
@@ -36,6 +36,7 @@ struct list_window *lw; struct filelist *filelist; + const char *song_format; }; #ifndef NCMPC_MINI @@ -48,8 +49,8 @@ #include <glib.h> static inline void -screen_browser_sync_highlights(G_GNUC_UNUSED struct filelist *fl, - G_GNUC_UNUSED const struct mpdclient_playlist *playlist) +screen_browser_sync_highlights(gcc_unused struct filelist *fl, + gcc_unused const struct mpdclient_playlist *playlist) { }
View file
ncmpc-0.21.tar.bz2/src/screen_chat.c -> ncmpc-0.24.tar.xz/src/screen_chat.c
Changed
@@ -106,14 +106,12 @@ static void process_message(struct mpd_message *message) { - char *message_text; - assert(message != NULL); /* You'll have to move this out of screen_chat, if you want to use client-to-client messages anywhere else */ assert(g_strcmp0(mpd_message_get_channel(message), chat_channel) == 0); - message_text = utf8_to_locale(mpd_message_get_text(message)); + char *message_text = utf8_to_locale(mpd_message_get_text(message)); screen_text_append(&text, message_text); g_free(message_text); @@ -196,7 +194,7 @@ } static const char * -screen_chat_title(G_GNUC_UNUSED char *s, G_GNUC_UNUSED size_t size) +screen_chat_title(gcc_unused char *s, gcc_unused size_t size) { return _("Chat"); }
View file
ncmpc-0.21.tar.bz2/src/screen_client.c -> ncmpc-0.24.tar.xz/src/screen_client.c
Changed
@@ -27,10 +27,7 @@ static bool _screen_auth(struct mpdclient *c, gint recursion) { - struct mpd_connection *connection; - char *password; - - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) return false; @@ -38,7 +35,7 @@ if (recursion > 2) return false; - password = screen_read_password(NULL); + char *password = screen_read_password(NULL); if (password == NULL) return false; @@ -75,17 +72,14 @@ void screen_database_update(struct mpdclient *c, const char *path) { - struct mpd_connection *connection; - unsigned id; - assert(c != NULL); assert(mpdclient_is_connected(c)); - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) return; - id = mpd_run_update(connection, path); + unsigned id = mpd_run_update(connection, path); if (id == 0) { if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER && mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_UPDATE_ALREADY &&
View file
ncmpc-0.21.tar.bz2/src/screen_file.c -> ncmpc-0.24.tar.xz/src/screen_file.c
Changed
@@ -30,6 +30,7 @@ #include "filelist.h" #include "screen_utils.h" #include "screen_client.h" +#include "options.h" #include <mpd/client.h> @@ -109,20 +110,16 @@ change_to_parent(struct mpdclient *c) { char *parent = g_path_get_dirname(current_path); - char *old_path; - int idx; - bool success; - if (strcmp(parent, ".") == 0) parent[0] = '\0'; - old_path = current_path; + char *old_path = current_path; current_path = NULL; - success = change_directory(c, parent); + bool success = change_directory(c, parent); g_free(parent); - idx = success + int idx = success ? filelist_find_directory(browser.filelist, old_path) : -1; g_free(old_path); @@ -169,7 +166,6 @@ { struct list_window_range range; const char *defaultname = NULL; - char *defaultname_utf8 = NULL; list_window_get_range(browser.lw, &range); if (range.start == range.end) @@ -188,6 +184,7 @@ } } + char *defaultname_utf8 = NULL; if(defaultname) defaultname_utf8 = utf8_to_locale(defaultname); playlist_save(c, NULL, defaultname_utf8); @@ -198,14 +195,11 @@ handle_delete(struct mpdclient *c) { struct mpd_connection *connection = mpdclient_get_connection(c); - struct list_window_range range; - struct mpd_entity *entity; - const struct mpd_playlist *playlist; - char *str, *buf; if (connection == NULL) return; + struct list_window_range range; list_window_get_range(browser.lw, &range); for (unsigned i = range.start; i < range.end; ++i) { struct filelist_entry *entry = @@ -213,7 +207,7 @@ if( entry==NULL || entry->entity==NULL ) continue; - entity = entry->entity; + struct mpd_entity *entity = entry->entity; if (mpd_entity_get_type(entity) != MPD_ENTITY_TYPE_PLAYLIST) { /* translators: the "delete" command is only possible @@ -224,9 +218,9 @@ continue; } - playlist = mpd_entity_get_playlist(entity); - str = utf8_to_locale(g_basename(mpd_playlist_get_path(playlist))); - buf = g_strdup_printf(_("Delete playlist %s [%s/%s] ? "), str, YES, NO); + const struct mpd_playlist *playlist = mpd_entity_get_playlist(entity); + char *str = utf8_to_locale(g_basename(mpd_playlist_get_path(playlist))); + char *buf = g_strdup_printf(_("Delete playlist %s [%s/%s] ? "), str, YES, NO); g_free(str); bool delete = screen_get_yesno(buf, false); g_free(buf); @@ -256,6 +250,7 @@ current_path = g_strdup(""); browser.lw = list_window_init(w, cols, rows); + browser.song_format = options.list_format; } static void @@ -285,7 +280,6 @@ screen_file_get_title(char *str, size_t size) { const char *path = NULL, *prev = NULL, *slash = current_path; - char *path_locale; /* determine the last 2 parts of the path */ while ((slash = strchr(slash, '/')) != NULL) { @@ -297,7 +291,7 @@ /* fall back to full path */ path = current_path; - path_locale = utf8_to_locale(path); + char *path_locale = utf8_to_locale(path); g_snprintf(str, size, "%s: %s", /* translators: caption of the browser screen */ _("Browse"), path_locale); @@ -412,8 +406,6 @@ { const char *uri, *slash, *parent; char *allocated = NULL; - bool ret; - int i; assert(song != NULL); @@ -431,14 +423,14 @@ else parent = ""; - ret = change_directory(c, parent); + bool ret = change_directory(c, parent); g_free(allocated); if (!ret) return false; /* select the specified song */ - i = filelist_find_song(browser.filelist, song); + int i = filelist_find_song(browser.filelist, song); if (i < 0) i = 0;
View file
ncmpc-0.21.tar.bz2/src/screen_find.c -> ncmpc-0.24.tar.xz/src/screen_find.c
Changed
@@ -35,15 +35,13 @@ list_window_callback_fn_t callback_fn, void *callback_data) { - int reversed = 0; bool found; const char *prompt = FIND_PROMPT; - char *value = options.find_show_last_pattern ? (char *) -1 : NULL; - if (findcmd == CMD_LIST_RFIND || findcmd == CMD_LIST_RFIND_NEXT) { + const bool reversed = + findcmd == CMD_LIST_RFIND || findcmd == CMD_LIST_RFIND_NEXT; + if (reversed) prompt = RFIND_PROMPT; - reversed = 1; - } switch (findcmd) { case CMD_LIST_FIND: @@ -56,11 +54,14 @@ case CMD_LIST_FIND_NEXT: case CMD_LIST_RFIND_NEXT: - if (!screen.findbuf) + if (!screen.findbuf) { + char *value = options.find_show_last_pattern + ? (char *) -1 : NULL; screen.findbuf=screen_readln(prompt, value, &screen.find_history, NULL); + } if (screen.findbuf == NULL) return 1; @@ -92,14 +93,11 @@ * which begins with this string while the users types */ void screen_jump(struct list_window *lw, - list_window_callback_fn_t callback_fn, - list_window_paint_callback_t paint_callback, - void *callback_data) + list_window_callback_fn_t callback_fn, void *callback_data, + list_window_paint_callback_t paint_callback, void *paint_data) { - char *search_str, *iter, *temp; const int WRLN_MAX_LINE_SIZE = 1024; int key = 65; - command_t cmd; if (screen.findbuf) { g_free(screen.findbuf); @@ -108,8 +106,8 @@ screen.findbuf = g_malloc0(WRLN_MAX_LINE_SIZE); /* In screen.findbuf is the whole string which is displayed in the status_window * and search_str is the string the user entered (without the prompt) */ - search_str = screen.findbuf + g_snprintf(screen.findbuf, WRLN_MAX_LINE_SIZE, "%s: ", JUMP_PROMPT); - iter = search_str; + char *search_str = screen.findbuf + g_snprintf(screen.findbuf, WRLN_MAX_LINE_SIZE, "%s: ", JUMP_PROMPT); + char *iter = search_str; while(1) { key = screen_getch(screen.findbuf); @@ -135,7 +133,7 @@ /* repaint the list_window */ if (paint_callback != NULL) - list_window_paint2(lw, paint_callback, callback_data); + list_window_paint2(lw, paint_callback, paint_data); else list_window_paint(lw, callback_fn, callback_data); wrefresh(lw->w); @@ -143,10 +141,12 @@ /* ncmpc should get the command */ ungetch(key); + + command_t cmd; if ((cmd=get_keyboard_command()) != CMD_NONE) do_input_event(cmd); - temp = g_strdup(search_str); + char *temp = g_strdup(search_str); g_free(screen.findbuf); screen.findbuf = temp; }
View file
ncmpc-0.21.tar.bz2/src/screen_find.h -> ncmpc-0.24.tar.xz/src/screen_find.h
Changed
@@ -32,16 +32,17 @@ * @param callback_data a pointer passed to callback_fn * @return true if the command has been handled, false if not */ -bool screen_find(struct list_window *lw, - command_t findcmd, - list_window_callback_fn_t callback_fn, - void *callback_data); +bool +screen_find(struct list_window *lw, + command_t findcmd, + list_window_callback_fn_t callback_fn, + void *callback_data); /* query user for a string and jump to the entry * which begins with this string while the users types */ -void screen_jump(struct list_window *lw, - list_window_callback_fn_t callback_fn, - list_window_paint_callback_t paint_callback, - void *callback_data); +void +screen_jump(struct list_window *lw, + list_window_callback_fn_t callback_fn, void *callback_data, + list_window_paint_callback_t paint_callback, void *paint_data); #endif
View file
ncmpc-0.21.tar.bz2/src/screen_help.c -> ncmpc-0.24.tar.xz/src/screen_help.c
Changed
@@ -116,7 +116,7 @@ { 0, CMD_NONE, NULL }, { 0, CMD_NONE, NULL }, - { 1, CMD_NONE, N_("Playlist screen") }, + { 1, CMD_NONE, N_("Queue screen") }, { 2, CMD_NONE, NULL }, { 0, CMD_PLAY, N_("Play") }, { 0, CMD_DELETE, NULL }, @@ -135,7 +135,7 @@ { 2, CMD_NONE, NULL }, { 0, CMD_PLAY, N_("Enter directory/Select and play song") }, { 0, CMD_SELECT, NULL }, - { 0, CMD_ADD, N_("Append song to playlist") }, + { 0, CMD_ADD, N_("Append song to queue") }, { 0, CMD_SAVE_PLAYLIST, NULL }, { 0, CMD_DELETE, N_("Delete playlist") }, { 0, CMD_GO_PARENT_DIRECTORY, NULL }, @@ -150,7 +150,7 @@ { 0, CMD_SCREEN_SEARCH, N_("Search") }, { 0, CMD_PLAY, N_("Select and play") }, { 0, CMD_SELECT, NULL }, - { 0, CMD_ADD, N_("Append song to playlist") }, + { 0, CMD_ADD, N_("Append song to queue") }, { 0, CMD_SELECT_ALL, NULL }, { 0, CMD_SEARCH_MODE, NULL }, #endif @@ -199,7 +199,7 @@ static struct list_window *lw; static const char * -list_callback(unsigned i, G_GNUC_UNUSED void *data) +list_callback(unsigned i, gcc_unused void *data) { const struct help_text_row *row = &help_text[i]; @@ -236,7 +236,7 @@ static const char * -help_title(G_GNUC_UNUSED char *str, G_GNUC_UNUSED size_t size) +help_title(gcc_unused char *str, gcc_unused size_t size) { return _("Help"); } @@ -244,8 +244,8 @@ static void screen_help_paint_callback(WINDOW *w, unsigned i, unsigned y, unsigned width, - G_GNUC_UNUSED bool selected, - G_GNUC_UNUSED void *data) + gcc_unused bool selected, + gcc_unused const void *data) { const struct help_text_row *row = &help_text[i]; @@ -281,7 +281,7 @@ } static bool -help_cmd(G_GNUC_UNUSED struct mpdclient *c, command_t cmd) +help_cmd(gcc_unused struct mpdclient *c, command_t cmd) { if (list_window_scroll_cmd(lw, cmd)) { help_paint();
View file
ncmpc-0.21.tar.bz2/src/screen_keydef.c -> ncmpc-0.24.tar.xz/src/screen_keydef.c
Changed
@@ -25,6 +25,8 @@ #include "conf.h" #include "screen.h" #include "screen_utils.h" +#include "options.h" +#include "Compiler.h" #include <assert.h> #include <errno.h> @@ -42,21 +44,24 @@ * the position of the "apply" item. It's the same as command_n_commands, * because array subscripts start at 0, while numbers of items start at 1. */ -static G_GNUC_PURE inline unsigned +gcc_pure +static inline unsigned command_item_apply(void) { return command_n_commands; } /** the position of the "apply and save" item */ -static G_GNUC_PURE inline unsigned +gcc_pure +static inline unsigned command_item_save(void) { return command_item_apply() + 1; } /** the number of items in the "command" view */ -static G_GNUC_PURE inline unsigned +gcc_pure +static inline unsigned command_length(void) { return command_item_save() + 1; @@ -73,28 +78,32 @@ static unsigned subcmd_n_keys = 0; /** The position of the up ("[..]") item */ -static G_GNUC_CONST inline unsigned +gcc_const +static inline unsigned subcmd_item_up(void) { return 0; } /** The position of the "add a key" item */ -static G_GNUC_PURE inline unsigned +gcc_pure +static inline unsigned subcmd_item_add(void) { return subcmd_n_keys + 1; } /** The number of items in the list_window, if there's a command being edited */ -static G_GNUC_PURE inline unsigned +gcc_pure +static inline unsigned subcmd_length(void) { return subcmd_item_add() + 1; } /** Check whether a given item is a key */ -static G_GNUC_PURE inline bool +gcc_pure +static inline bool subcmd_item_is_key(unsigned i) { return (i > subcmd_item_up() && i < subcmd_item_add()); @@ -104,7 +113,8 @@ * Convert an item id (as in lw->selected) into a "key id", which is an array * subscript to cmds[subcmd].keys. */ -static G_GNUC_CONST inline unsigned +gcc_const +static inline unsigned subcmd_item_to_key_id(unsigned i) { return i - 1; @@ -136,31 +146,33 @@ static int save_keys(void) { - FILE *f; - char *filename; + char *allocated = NULL; + const char *filename = options.key_file; + if (filename == NULL) { + if (!check_user_conf_dir()) { + screen_status_printf(_("Error: Unable to create directory ~/.ncmpc - %s"), + strerror(errno)); + screen_bell(); + return -1; + } - if (check_user_conf_dir()) { - screen_status_printf(_("Error: Unable to create directory ~/.ncmpc - %s"), - strerror(errno)); - screen_bell(); - return -1; + filename = allocated = build_user_key_binding_filename(); } - filename = build_user_key_binding_filename(); - - if ((f = fopen(filename,"w")) == NULL) { + FILE *f = fopen(filename, "w"); + if (f == NULL) { screen_status_printf(_("Error: %s - %s"), filename, strerror(errno)); screen_bell(); - g_free(filename); + g_free(allocated); return -1; } if (write_key_bindings(f, KEYDEF_WRITE_HEADER)) - screen_status_printf(_("Error: %s - %s"), filename, strerror(errno)); - else screen_status_printf(_("Wrote %s"), filename); + else + screen_status_printf(_("Error: %s - %s"), filename, strerror(errno)); - g_free(filename); + g_free(allocated); return fclose(f); } @@ -255,14 +267,11 @@ static void overwrite_key(int cmd_index, int key_index) { - int key; - char *buf; - command_t cmd; - assert(key_index < MAX_COMMAND_KEYS); - buf = g_strdup_printf(_("Enter new key for %s: "), cmds[cmd_index].name); - key = screen_getch(buf); + char *buf = g_strdup_printf(_("Enter new key for %s: "), + cmds[cmd_index].name); + const int key = screen_getch(buf); g_free(buf); if (key == ERR) { @@ -275,7 +284,7 @@ return; } - cmd = find_key_command(key, cmds); + const command_t cmd = find_key_command(key, cmds); if (cmd != CMD_NONE) { screen_status_printf(_("Error: key %s is already used for %s"), key2str(key), get_key_command_name(cmd)); @@ -306,7 +315,7 @@ } static const char * -list_callback(unsigned idx, G_GNUC_UNUSED void *data) +list_callback(unsigned idx, gcc_unused void *data) { static char buf[256]; @@ -379,18 +388,17 @@ } static void -keydef_open(G_GNUC_UNUSED struct mpdclient *c) +keydef_open(gcc_unused struct mpdclient *c) { if (cmds == NULL) { command_definition_t *current_cmds = get_command_definitions(); - size_t cmds_size; - command_n_commands = 0; while (current_cmds[command_n_commands].name) command_n_commands++; /* +1 for the terminator element */ - cmds_size = (command_n_commands + 1) * sizeof(command_definition_t); + size_t cmds_size = (command_n_commands + 1) + * sizeof(command_definition_t); cmds = g_malloc0(cmds_size); memcpy(cmds, current_cmds, cmds_size); } @@ -426,7 +434,7 @@ } static bool -keydef_cmd(G_GNUC_UNUSED struct mpdclient *c, command_t cmd) +keydef_cmd(gcc_unused struct mpdclient *c, command_t cmd) { if (cmd == CMD_LIST_RANGE_SELECT) return false;
View file
ncmpc-0.21.tar.bz2/src/screen_list.c -> ncmpc-0.24.tar.xz/src/screen_list.c
Changed
@@ -69,9 +69,7 @@ void screen_list_init(WINDOW *w, unsigned cols, unsigned rows) { - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(screens); ++i) { + for (unsigned i = 0; i < G_N_ELEMENTS(screens); ++i) { const struct screen_functions *sf = screens[i].functions; if (sf->init) @@ -82,9 +80,7 @@ void screen_list_exit(void) { - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(screens); ++i) { + for (unsigned i = 0; i < G_N_ELEMENTS(screens); ++i) { const struct screen_functions *sf = screens[i].functions; if (sf->exit) @@ -95,9 +91,7 @@ void screen_list_resize(unsigned cols, unsigned rows) { - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(screens); ++i) { + for (unsigned i = 0; i < G_N_ELEMENTS(screens); ++i) { const struct screen_functions *sf = screens[i].functions; if (sf->resize) @@ -108,9 +102,7 @@ const char * screen_get_name(const struct screen_functions *sf) { - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(screens); ++i) + for (unsigned i = 0; i < G_N_ELEMENTS(screens); ++i) if (screens[i].functions == sf) return screens[i].name; @@ -120,9 +112,7 @@ const struct screen_functions * screen_lookup_name(const char *name) { - unsigned i; - - for (i = 0; i < G_N_ELEMENTS(screens); ++i) + for (unsigned i = 0; i < G_N_ELEMENTS(screens); ++i) if (strcmp(name, screens[i].name) == 0) return screens[i].functions;
View file
ncmpc-0.21.tar.bz2/src/screen_lyrics.c -> ncmpc-0.24.tar.xz/src/screen_lyrics.c
Changed
@@ -117,10 +117,9 @@ exists_lyr_file(const char *artist, const char *title) { char path[1024]; - struct stat result; - path_lyr_file(path, 1024, artist, title); + struct stat result; return (stat(path, &result) == 0); } @@ -128,7 +127,6 @@ create_lyr_file(const char *artist, const char *title) { char path[1024]; - snprintf(path, 1024, "%s/.lyrics", getenv("HOME")); mkdir(path, S_IRWXU); @@ -141,14 +139,11 @@ static int store_lyr_hd(void) { - FILE *lyr_file; - unsigned i; - - lyr_file = create_lyr_file(current.artist, current.title); + FILE *lyr_file = create_lyr_file(current.artist, current.title); if (lyr_file == NULL) return -1; - for (i = 0; i < text.lines->len; ++i) + for (unsigned i = 0; i < text.lines->len; ++i) fprintf(lyr_file, "%s\n", (const char*)g_ptr_array_index(text.lines, i)); @@ -159,11 +154,10 @@ static int delete_lyr_hd(void) { - char path[1024]; - if (!exists_lyr_file(current.artist, current.title)) return -1; + char path[1024]; path_lyr_file(path, 1024, current.artist, current.title); if (unlink(path) != 0) return -2; @@ -195,7 +189,7 @@ static void screen_lyrics_callback(const GString *result, const bool success, - const char *plugin_name, G_GNUC_UNUSED void *data) + const char *plugin_name, gcc_unused void *data) { assert(current.loader != NULL); @@ -224,7 +218,7 @@ } static gboolean -screen_lyrics_timeout_callback(gpointer G_GNUC_UNUSED data) +screen_lyrics_timeout_callback(gpointer gcc_unused data) { plugin_stop(current.loader); current.loader = NULL; @@ -239,15 +233,13 @@ static void screen_lyrics_load(const struct mpd_song *song) { - const char *artist, *title; - assert(song != NULL); screen_lyrics_abort(); screen_text_clear(&text); - artist = mpd_song_get_tag(song, MPD_TAG_ARTIST, 0); - title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0); + const char *artist = mpd_song_get_tag(song, MPD_TAG_ARTIST, 0); + const char *title = mpd_song_get_tag(song, MPD_TAG_TITLE, 0); current.song = mpd_song_dup(song); current.artist = g_strdup(artist); @@ -365,8 +357,6 @@ lyrics_edit(void) { char *editor = options.text_editor; - int status; - if (editor == NULL) { screen_status_message(_("Editor not configured")); return; @@ -391,6 +381,7 @@ /* TODO: fork/exec/wait won't work on Windows, but building a command string for system() is too tricky */ + int status; pid_t pid = fork(); if (pid == -1) { screen_status_printf(("%s (%s)"), _("Can't start editor"), g_strerror(errno));
View file
ncmpc-0.21.tar.bz2/src/screen_outputs.c -> ncmpc-0.24.tar.xz/src/screen_outputs.c
Changed
@@ -47,20 +47,17 @@ static bool toggle_output(struct mpdclient *c, unsigned int output_index) { - struct mpd_connection *connection; - struct mpd_output *output; - assert(mpd_outputs != NULL); if (output_index >= mpd_outputs->len) return false; - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) return false; - output = g_ptr_array_index(mpd_outputs, output_index); - + struct mpd_output *output = + g_ptr_array_index(mpd_outputs, output_index); if (!mpd_output_get_enabled(output)) { if (!mpd_run_enable_output(connection, mpd_output_get_id(output))) { @@ -89,7 +86,7 @@ } static void -clear_output_element(gpointer data, G_GNUC_UNUSED gpointer user_data) +clear_output_element(gpointer data, gcc_unused gpointer user_data) { mpd_output_free(data); } @@ -114,18 +111,17 @@ static void fill_outputs_list(struct mpdclient *c) { - struct mpd_connection *connection; - struct mpd_output *output; - assert(mpd_outputs != NULL); - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) { list_window_set_length(lw, 0); return; } mpd_send_outputs(connection); + + struct mpd_output *output; while ((output = mpd_recv_output(connection)) != NULL) { g_ptr_array_add(mpd_outputs, output); } @@ -170,15 +166,15 @@ } static const char * -outputs_title(G_GNUC_UNUSED char *str, G_GNUC_UNUSED size_t size) +outputs_title(gcc_unused char *str, gcc_unused size_t size) { return _("Outputs"); } static void screen_outputs_paint_callback(WINDOW *w, unsigned i, - G_GNUC_UNUSED unsigned y, unsigned width, - bool selected, G_GNUC_UNUSED void *data) + gcc_unused unsigned y, unsigned width, + bool selected, gcc_unused const void *data) { const struct mpd_output *output;
View file
ncmpc-0.21.tar.bz2/src/screen_queue.c -> ncmpc-0.24.tar.xz/src/screen_queue.c
Changed
@@ -35,6 +35,7 @@ #include "screen_utils.h" #include "screen_song.h" #include "screen_lyrics.h" +#include "Compiler.h" #ifndef NCMPC_MINI #include "hscroll.h" @@ -95,22 +96,19 @@ static void screen_queue_restore_selection(void) { - const struct mpd_song *song; - int pos; - list_window_set_length(lw, playlist_length(playlist)); if (selected_song_id < 0) /* there was no selection */ return; - song = screen_queue_selected_song(); + const struct mpd_song *song = screen_queue_selected_song(); if (song != NULL && mpd_song_get_id(song) == (unsigned)selected_song_id) /* selection is still valid */ return; - pos = playlist_get_index_from_id(playlist, selected_song_id); + int pos = playlist_get_index_from_id(playlist, selected_song_id); if (pos >= 0) list_window_set_cursor(lw, pos); @@ -118,15 +116,14 @@ } static const char * -screen_queue_lw_callback(unsigned idx, G_GNUC_UNUSED void *data) +screen_queue_lw_callback(unsigned idx, gcc_unused void *data) { static char songname[MAX_SONG_LENGTH]; - struct mpd_song *song; assert(playlist != NULL); assert(idx < playlist_length(playlist)); - song = playlist_get(playlist, idx); + struct mpd_song *song = playlist_get(playlist, idx); strfsong(songname, MAX_SONG_LENGTH, options.list_format, song); @@ -136,15 +133,13 @@ static void center_playing_item(const struct mpd_status *status, bool center_cursor) { - int idx; - if (status == NULL || (mpd_status_get_state(status) != MPD_STATE_PLAY && mpd_status_get_state(status) != MPD_STATE_PAUSE)) return; /* try to center the song that are playing */ - idx = mpd_status_get_song_pos(status); + int idx = mpd_status_get_song_pos(status); if (idx < 0) return; @@ -159,7 +154,7 @@ list_window_fetch_cursor(lw); } -G_GNUC_PURE +gcc_pure static int get_current_song_id(const struct mpd_status *status) { @@ -187,7 +182,7 @@ #ifndef NCMPC_MINI static void -save_pre_completion_cb(GCompletion *gcmp, G_GNUC_UNUSED gchar *line, +save_pre_completion_cb(GCompletion *gcmp, gcc_unused gchar *line, void *data) { completion_callback_data_t *tmp = (completion_callback_data_t *)data; @@ -202,9 +197,9 @@ } static void -save_post_completion_cb(G_GNUC_UNUSED GCompletion *gcmp, - G_GNUC_UNUSED gchar *line, GList *items, - G_GNUC_UNUSED void *data) +save_post_completion_cb(gcc_unused GCompletion *gcmp, + gcc_unused gchar *line, GList *items, + gcc_unused void *data) { if (g_list_length(items) >= 1) screen_display_completion_list(items); @@ -228,12 +223,7 @@ playlist_save(struct mpdclient *c, char *name, char *defaultname) { struct mpd_connection *connection; - gchar *filename, *filename_utf8; -#ifndef NCMPC_MINI - GCompletion *gcmp; - GList *list = NULL; - completion_callback_data_t data; -#endif + gchar *filename; #ifdef NCMPC_MINI (void)defaultname; @@ -242,18 +232,21 @@ #ifndef NCMPC_MINI if (name == NULL) { /* initialize completion support */ - gcmp = g_completion_new(NULL); + GCompletion *gcmp = g_completion_new(NULL); g_completion_set_compare(gcmp, completion_strncmp); - data.list = &list; - data.dir_list = NULL; - data.c = c; + GList *list = NULL; + completion_callback_data_t data = { + .list = &list, + .dir_list = NULL, + .c = c, + }; wrln_completion_callback_data = &data; wrln_pre_completion_callback = save_pre_completion_cb; wrln_post_completion_callback = save_post_completion_cb; /* query the user for a filename */ - filename = screen_readln(_("Save playlist as"), + filename = screen_readln(_("Save queue as"), defaultname, NULL, gcmp); @@ -281,17 +274,14 @@ return -1; } - filename_utf8 = locale_to_utf8(filename); + char *filename_utf8 = locale_to_utf8(filename); if (!mpd_run_save(connection, filename_utf8)) { if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER && mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_EXIST && mpd_connection_clear_error(connection)) { - char *buf; - bool replace; - - buf = g_strdup_printf(_("Replace %s [%s/%s] ? "), - filename, YES, NO); - replace = screen_get_yesno(buf, false); + char *buf = g_strdup_printf(_("Replace %s [%s/%s] ? "), + filename, YES, NO); + bool replace = screen_get_yesno(buf, false); g_free(buf); if (!replace) { @@ -377,31 +367,31 @@ static int handle_add_to_playlist(struct mpdclient *c) { - gchar *path; - GCompletion *gcmp; #ifndef NCMPC_MINI + /* initialize completion support */ + GCompletion *gcmp = g_completion_new(NULL); + g_completion_set_compare(gcmp, completion_strncmp); + GList *list = NULL; GList *dir_list = NULL; - completion_callback_data_t data; + completion_callback_data_t data = { + .list = &list, + .dir_list = &dir_list, + .c = c, + }; - /* initialize completion support */ - gcmp = g_completion_new(NULL); - g_completion_set_compare(gcmp, completion_strncmp); - data.list = &list; - data.dir_list = &dir_list; - data.c = c; wrln_completion_callback_data = &data; wrln_pre_completion_callback = add_pre_completion_cb; wrln_post_completion_callback = add_post_completion_cb; #else - gcmp = NULL; + GCompletion *gcmp = NULL; #endif /* get path */ - path = screen_readln(_("Add"), - NULL, - NULL,
View file
ncmpc-0.21.tar.bz2/src/screen_search.c -> ncmpc-0.24.tar.xz/src/screen_search.c
Changed
@@ -58,13 +58,11 @@ static int search_get_tag_id(const char *name) { - unsigned i; - if (g_ascii_strcasecmp(name, "file") == 0 || strcasecmp(name, _("file")) == 0) return SEARCH_URI; - for (i = 0; i < MPD_TAG_COUNT; ++i) + for (unsigned i = 0; i < MPD_TAG_COUNT; ++i) if (search_tag[i].name != NULL && (strcasecmp(search_tag[i].name, name) == 0 || strcasecmp(search_tag[i].localname, name) == 0)) @@ -107,7 +105,7 @@ /* search info */ static const char * -lw_search_help_callback(unsigned idx, G_GNUC_UNUSED void *data) +lw_search_help_callback(unsigned idx, gcc_unused void *data) { assert(idx < G_N_ELEMENTS(help_text)); @@ -204,23 +202,19 @@ static struct filelist * search_advanced_query(struct mpd_connection *connection, char *query) { - int i,j; - char **strv; - int table[10]; - char *arg[10]; - struct filelist *fl = NULL; - advanced_search_mode = FALSE; if (strchr(query, ':') == NULL) return NULL; - strv = g_strsplit_set(query, ": ", 0); + char **strv = g_strsplit_set(query, ": ", 0); + int table[10]; memset(table, 0, 10*sizeof(int)); + + char *arg[10]; memset(arg, 0, 10*sizeof(char *)); - i=0; - j=0; + int i = 0, j = 0; while (strv[i] && strlen(strv[i]) > 0 && i < 9) { int id = search_get_tag_id(strv[i]); if (id == -1) { @@ -277,7 +271,7 @@ } mpd_search_commit(connection); - fl = filelist_new_recv(connection); + struct filelist *fl = filelist_new_recv(connection); if (!mpd_response_finish(connection)) { filelist_free(fl); fl = NULL; @@ -358,6 +352,11 @@ screen_search_init(WINDOW *w, int cols, int rows) { browser.lw = list_window_init(w, cols, rows); + if (options.search_format != NULL) { + browser.song_format = options.search_format; + } else { + browser.song_format = options.list_format; + } list_window_set_length(browser.lw, G_N_ELEMENTS(help_text)); } @@ -377,7 +376,7 @@ } static void -screen_search_open(G_GNUC_UNUSED struct mpdclient *c) +screen_search_open(gcc_unused struct mpdclient *c) { // if( pattern==NULL ) // search_new(screen, c);
View file
ncmpc-0.21.tar.bz2/src/screen_song.c -> ncmpc-0.24.tar.xz/src/screen_song.c
Changed
@@ -38,6 +38,7 @@ LABEL_LENGTH = MPD_TAG_COUNT, LABEL_PATH, LABEL_BITRATE, + LABEL_FORMAT, LABEL_POSITION, }; @@ -56,6 +57,7 @@ [MPD_TAG_COMMENT] = N_("Comment"), [LABEL_PATH] = N_("Path"), [LABEL_BITRATE] = N_("Bitrate"), + [LABEL_FORMAT] = N_("Format"), }; static unsigned max_tag_label_width; @@ -124,7 +126,7 @@ } static const char * -screen_song_list_callback(unsigned idx, G_GNUC_UNUSED void *data) +screen_song_list_callback(unsigned idx, gcc_unused void *data) { assert(idx < current.lines->len); @@ -177,7 +179,7 @@ } static const char * -screen_song_title(G_GNUC_UNUSED char *str, G_GNUC_UNUSED size_t size) +screen_song_title(gcc_unused char *str, gcc_unused size_t size) { return _("Song viewer"); } @@ -193,12 +195,7 @@ static void screen_song_append(const char *label, const char *value, unsigned label_col) { - unsigned label_width = locale_width(label) + 2; - int value_col, label_size; - gchar *entry, *entry_iter; - const gchar *value_iter; - char *p, *q; - unsigned width; + const unsigned label_width = locale_width(label) + 2; assert(label != NULL); assert(value != NULL); @@ -206,13 +203,13 @@ /* +2 for ': ' */ label_col += 2; - value_col = lw->cols - label_col; + const int value_col = lw->cols - label_col; /* calculate the number of required linebreaks */ - value_iter = value; - label_size = strlen(label) + label_col; + const gchar *value_iter = value; + const int label_size = strlen(label) + label_col; while (*value_iter != 0) { - entry = g_malloc(label_size); + char *entry = g_malloc(label_size), *entry_iter; if (value_iter == value) { entry_iter = entry + g_sprintf(entry, "%s: ", label); /* fill the label column with whitespaces */ @@ -227,8 +224,8 @@ /* skip whitespaces */ while (g_ascii_isspace(*value_iter)) ++value_iter; - p = g_strdup(value_iter); - width = utf8_cut_width(p, value_col); + char *p = g_strdup(value_iter); + unsigned width = utf8_cut_width(p, value_col); if (width == 0) /* not enough room for anything - bail out */ break; @@ -237,7 +234,7 @@ value_iter += strlen(p); p = replace_utf8_to_locale(p); - q = g_strconcat(entry, p, NULL); + char *q = g_strconcat(entry, p, NULL); g_free(entry); g_free(p); @@ -260,7 +257,7 @@ } static void -screen_song_add_song(const struct mpd_song *song, const struct mpdclient *c) +screen_song_add_song(const struct mpd_song *song) { assert(song != NULL); @@ -281,7 +278,6 @@ const char *value = length; -#if LIBMPDCLIENT_CHECK_VERSION(2,3,0) char buffer[64]; if (mpd_song_get_end(song) > 0) { @@ -303,7 +299,6 @@ length, start); value = buffer; } -#endif screen_song_append(_(tag_labels[LABEL_LENGTH]), value, max_tag_label_width); @@ -319,15 +314,6 @@ screen_song_append(_(tag_labels[LABEL_PATH]), mpd_song_get_uri(song), max_tag_label_width); - if (mpdclient_is_playing(c) && c->song != NULL && - strcmp(mpd_song_get_uri(c->song), mpd_song_get_uri(song)) == 0 && - mpd_status_get_kbit_rate(c->status)) { - char buf[16]; - g_snprintf(buf, sizeof(buf), _("%d kbps"), - mpd_status_get_kbit_rate(c->status)); - screen_song_append(_(tag_labels[LABEL_BITRATE]), buf, - max_tag_label_width); - } } static void @@ -340,15 +326,13 @@ static bool screen_song_add_stats(struct mpd_connection *connection) { - char buf[64]; - GDate *date; - struct mpd_stats *mpd_stats; - - mpd_stats = mpd_run_stats(connection); + struct mpd_stats *mpd_stats = mpd_run_stats(connection); if (mpd_stats == NULL) return false; g_ptr_array_add(current.lines, g_strdup(_("MPD statistics")) ); + + char buf[64]; g_snprintf(buf, sizeof(buf), "%d", mpd_stats_get_number_of_artists(mpd_stats)); screen_song_append_stats(STATS_ARTISTS, buf); @@ -371,7 +355,7 @@ mpd_stats_get_uptime(mpd_stats)); screen_song_append_stats(STATS_UPTIME, buf); - date = g_date_new(); + GDate *date = g_date_new(); g_date_set_time_t(date, mpd_stats_get_db_update_time(mpd_stats)); g_date_strftime(buf, sizeof(buf), "%x", date); screen_song_append_stats(STATS_DBUPTIME, buf); @@ -384,8 +368,6 @@ static void screen_song_update(struct mpdclient *c) { - struct mpd_connection *connection; - /* Clear all lines */ for (guint i = 0; i < current.lines->len; ++i) g_free(g_ptr_array_index(current.lines, i)); @@ -404,7 +386,7 @@ mpd_song_get_uri(c->song)) != 0 || !mpdclient_is_playing(c))) { g_ptr_array_add(current.lines, g_strdup(_("Selected song")) ); - screen_song_add_song(current.selected_song, c); + screen_song_add_song(current.selected_song); g_ptr_array_add(current.lines, g_strdup("\0")); } @@ -414,12 +396,32 @@ } current.played_song = mpd_song_dup(c->song); g_ptr_array_add(current.lines, g_strdup(_("Currently playing song"))); - screen_song_add_song(current.played_song, c); + screen_song_add_song(current.played_song); + + if (mpd_status_get_kbit_rate(c->status) > 0) { + char buf[16]; + g_snprintf(buf, sizeof(buf), _("%d kbps"), + mpd_status_get_kbit_rate(c->status)); + screen_song_append(_(tag_labels[LABEL_BITRATE]), buf, + max_tag_label_width); + } + + const struct mpd_audio_format *format = + mpd_status_get_audio_format(c->status); + if (format) { + char buf[32]; + g_snprintf(buf, sizeof(buf), _("%u:%u:%u"), + format->sample_rate, format->bits, + format->channels); + screen_song_append(_(tag_labels[LABEL_FORMAT]), buf, + max_tag_label_width); + } + g_ptr_array_add(current.lines, g_strdup("\0"));
View file
ncmpc-0.21.tar.bz2/src/screen_status.c -> ncmpc-0.24.tar.xz/src/screen_status.c
Changed
@@ -23,6 +23,12 @@ #include <stdarg.h> void +screen_status_clear_message(void) +{ + status_bar_clear_message(&screen.status_bar); +} + +void screen_status_message(const char *msg) { status_bar_message(&screen.status_bar, msg); @@ -31,11 +37,9 @@ void screen_status_printf(const char *format, ...) { - char *msg; va_list ap; - va_start(ap,format); - msg = g_strdup_vprintf(format,ap); + char *msg = g_strdup_vprintf(format,ap); va_end(ap); screen_status_message(msg); g_free(msg);
View file
ncmpc-0.21.tar.bz2/src/screen_status.h -> ncmpc-0.24.tar.xz/src/screen_status.h
Changed
@@ -21,6 +21,9 @@ #define NCMPC_SCREEN_STATUS_H void +screen_status_clear_message(void); + +void screen_status_message(const char *msg); void
View file
ncmpc-0.21.tar.bz2/src/screen_text.c -> ncmpc-0.24.tar.xz/src/screen_text.c
Changed
@@ -39,14 +39,13 @@ void screen_text_append(struct screen_text *text, const char *str) { - const char *eol, *next; - assert(str != NULL); + const char *eol; while ((eol = strchr(str, '\n')) != NULL) { char *line; - next = eol + 1; + const char *next = eol + 1; /* strip whitespace at end */ @@ -80,12 +79,12 @@ screen_text_list_callback(unsigned idx, void *data) { const struct screen_text *text = data; - static char buffer[256]; - char *value; assert(idx < text->lines->len); - value = utf8_to_locale(g_ptr_array_index(text->lines, idx)); + char *value = utf8_to_locale(g_ptr_array_index(text->lines, idx)); + + static char buffer[256]; g_strlcpy(buffer, value, sizeof(buffer)); g_free(value); @@ -94,7 +93,7 @@ bool screen_text_cmd(struct screen_text *text, - G_GNUC_UNUSED struct mpdclient *c, command_t cmd) + gcc_unused struct mpdclient *c, command_t cmd) { if (list_window_scroll_cmd(text->lw, cmd)) { screen_text_repaint(text);
View file
ncmpc-0.21.tar.bz2/src/screen_utils.c -> ncmpc-0.24.tar.xz/src/screen_utils.c
Changed
@@ -42,7 +42,6 @@ screen_getch(const char *prompt) { WINDOW *w = screen.status_bar.window.w; - int key = -1; colors_use(w, COLOR_STATUS_ALERT); werase(w); @@ -52,6 +51,7 @@ echo(); curs_set(1); + int key; while ((key = wgetch(w)) == ERR) ; @@ -105,7 +105,6 @@ { struct window *window = &screen.status_bar.window; WINDOW *w = window->w; - char *ret; wmove(w, 0,0); curs_set(1); @@ -113,7 +112,7 @@ if (prompt == NULL) prompt = _("Password"); - ret = wreadln_masked(w, prompt, NULL, window->cols, NULL, NULL); + char *ret = wreadln_masked(w, prompt, NULL, window->cols, NULL, NULL); curs_set(0); return ret; @@ -126,9 +125,8 @@ static guint prev_length = 0; static guint offset = 0; WINDOW *w = screen.main_window.w; - guint length, y=0; - length = g_list_length(list); + unsigned length = g_list_length(list); if (list == prev_list && length == prev_length) { offset += screen.main_window.rows; if (offset >= length) @@ -140,6 +138,8 @@ } colors_use(w, COLOR_STATUS_ALERT); + + unsigned y = 0; while (y < screen.main_window.rows) { GList *item = g_list_nth(list, y+offset); @@ -166,13 +166,12 @@ if (options.enable_xterm_title) { if (g_getenv("WINDOWID")) { - char *msg; va_list ap; - va_start(ap,format); - msg = g_strdup_vprintf(format,ap); + char *msg = g_strdup_vprintf(format,ap); va_end(ap); - printf("%c]0;%s%c", '\033', msg, '\007'); + printf("\033]0;%s\033\\", msg); + fflush(stdout); g_free(msg); } else options.enable_xterm_title = FALSE;
View file
ncmpc-0.21.tar.bz2/src/song_paint.c -> ncmpc-0.24.tar.xz/src/song_paint.c
Changed
@@ -32,13 +32,13 @@ #include <string.h> void -paint_song_row(WINDOW *w, G_GNUC_UNUSED unsigned y, unsigned width, +paint_song_row(WINDOW *w, gcc_unused unsigned y, unsigned width, bool selected, bool highlight, const struct mpd_song *song, - G_GNUC_UNUSED struct hscroll *hscroll) + gcc_unused struct hscroll *hscroll, const char *format) { char buffer[width * 4]; - strfsong(buffer, sizeof(buffer), options.list_format, song); + strfsong(buffer, sizeof(buffer), format, song); row_paint_text(w, width, highlight ? COLOR_LIST_BOLD : COLOR_LIST, selected, buffer);
View file
ncmpc-0.21.tar.bz2/src/song_paint.h -> ncmpc-0.24.tar.xz/src/song_paint.h
Changed
@@ -39,10 +39,11 @@ * @param highlight true if the row is highlighted * @param song the song object * @param hscroll an optional hscroll object + * @param format the song format */ void paint_song_row(WINDOW *w, unsigned y, unsigned width, bool selected, bool highlight, const struct mpd_song *song, - struct hscroll *hscroll); + struct hscroll *hscroll, const char *format); #endif
View file
ncmpc-0.21.tar.bz2/src/status_bar.c -> ncmpc-0.24.tar.xz/src/status_bar.c
Changed
@@ -61,22 +61,21 @@ #endif } -static gboolean -status_bar_clear_message(gpointer data) +void +status_bar_clear_message(struct status_bar *p) { - struct status_bar *p = data; - WINDOW *w = p->window.w; - assert(p != NULL); - assert(p->message_source_id != 0); - p->message_source_id = 0; + if (p->message_source_id != 0) { + g_source_remove(p->message_source_id); + p->message_source_id = 0; + } + + WINDOW *w = p->window.w; wmove(w, 0, 0); wclrtoeol(w); wrefresh(w); - - return false; } #ifndef NCMPC_MINI @@ -99,9 +98,6 @@ const struct mpd_song *song) { WINDOW *w = p->window.w; - enum mpd_state state; - const char *str = NULL; - int x = 0; char buffer[p->window.cols * 4 + 1]; #ifndef NCMPC_MINI @@ -116,9 +112,10 @@ wclrtoeol(w); colors_use(w, COLOR_STATUS_BOLD); - state = status == NULL ? MPD_STATE_UNKNOWN + enum mpd_state state = status == NULL ? MPD_STATE_UNKNOWN : mpd_status_get_state(status); + const char *str = NULL; switch (state) { case MPD_STATE_PLAY: str = _("Playing:"); @@ -131,6 +128,7 @@ break; } + int x = 0; if (str) { waddstr(w, str); x += utf8_width(str) + 1; @@ -242,6 +240,17 @@ mvwin(p->window.w, y, x); } +static gboolean +status_bar_clear_message_cb(gpointer data) +{ + struct status_bar *p = data; + assert(p->message_source_id != 0); + p->message_source_id = 0; + + status_bar_clear_message(p); + return false; +} + void status_bar_message(struct status_bar *p, const char *msg) { @@ -261,5 +270,5 @@ if (p->message_source_id != 0) g_source_remove(p->message_source_id); p->message_source_id = g_timeout_add(options.status_message_time * 1000, - status_bar_clear_message, p); + status_bar_clear_message_cb, p); }
View file
ncmpc-0.21.tar.bz2/src/status_bar.h -> ncmpc-0.24.tar.xz/src/status_bar.h
Changed
@@ -60,4 +60,7 @@ void status_bar_message(struct status_bar *p, const char *msg); +void +status_bar_clear_message(struct status_bar *p); + #endif
View file
ncmpc-0.21.tar.bz2/src/strfsong.c -> ncmpc-0.24.tar.xz/src/strfsong.c
Changed
@@ -62,15 +62,13 @@ const char *first) { const char *p = mpd_song_get_tag(song, tag, 1); - char *buffer, *prev; - if (p == NULL) return NULL; - buffer = concat_tag_values(first, p); + char *buffer = concat_tag_values(first, p); for (unsigned i = 2; (p = mpd_song_get_tag(song, tag, i)) != NULL; ++i) { - prev = buffer; + char *prev = buffer; buffer = concat_tag_values(buffer, p); g_free(prev); } @@ -84,21 +82,16 @@ song_tag_locale(const struct mpd_song *song, enum mpd_tag_type tag) { const char *value = mpd_song_get_tag(song, tag, 0); - char *result; -#ifndef NCMPC_MINI - char *all; -#endif /* !NCMPC_MINI */ - if (value == NULL) return NULL; #ifndef NCMPC_MINI - all = song_more_tag_values(song, tag, value); + char *all = song_more_tag_values(song, tag, value); if (all != NULL) value = all; #endif /* !NCMPC_MINI */ - result = utf8_to_locale(value); + char *result = utf8_to_locale(value); #ifndef NCMPC_MINI g_free(all); @@ -114,19 +107,18 @@ const struct mpd_song *song, const gchar **last) { - const gchar *p, *end; - gchar *temp; - gsize n, length = 0; - gboolean found = FALSE; + bool found = false; /* "missed" helps handling the case of mere literal text like - found==TRUE instead of found==FALSE. */ - gboolean missed = FALSE; + found==true instead of found==false. */ + bool missed = false; s[0] = '\0'; if (song == NULL) return 0; + const char *p; + size_t length = 0; for (p = format; *p != '\0' && length<max;) { /* OR */ if (p[0] == '|') { @@ -134,7 +126,7 @@ if(missed && !found) { s[0] = '\0'; length = 0; - missed = FALSE; + missed = false; } else { p = skip(p); } @@ -147,21 +139,21 @@ if(missed && !found) { p = skip(p); } else { - found = FALSE; - missed = FALSE; + found = false; + missed = false; } continue; } /* EXPRESSION START */ if (p[0] == '[') { - temp = g_malloc0(max); + char *temp = g_malloc0(max); if( _strfsong(temp, max, p+1, song, &p) >0 ) { g_strlcat(s, temp, max); length = strlen(s); - found = TRUE; + found = true; } else { - missed = TRUE; + missed = true; } g_free(temp); continue; @@ -196,12 +188,12 @@ /* advance past the esc character */ /* find the extent of this format specifier (stop at \0, ' ', or esc) */ - temp = NULL; - end = p+1; + char *temp = NULL; + const char *end = p + 1; while(*end >= 'a' && *end <= 'z') { end++; } - n = end - p + 1; + size_t n = end - p + 1; if(*end != '%') n--; else if (strncmp("%file%", p, n) == 0) @@ -273,11 +265,11 @@ length+=templen; g_free(ident); - missed = TRUE; + missed = true; } else { gsize templen = strlen(temp); - found = TRUE; + found = true; if( length+templen > max ) templen = max-length; g_strlcat(s, temp, max);
View file
ncmpc-0.21.tar.bz2/src/title_bar.c -> ncmpc-0.24.tar.xz/src/title_bar.c
Changed
@@ -59,9 +59,6 @@ const struct mpd_status *status) { WINDOW *w = p->window.w; - int volume; - char flags[5]; - char buf[32]; assert(p != NULL); @@ -76,7 +73,7 @@ #ifdef ENABLE_HELP_SCREEN print_hotkey(w, CMD_SCREEN_HELP, _("Help")); #endif - print_hotkey(w, CMD_SCREEN_PLAY, _("Playlist")); + print_hotkey(w, CMD_SCREEN_PLAY, _("Queue")); print_hotkey(w, CMD_SCREEN_FILE, _("Browse")); #ifdef ENABLE_ARTIST_SCREEN print_hotkey(w, CMD_SCREEN_ARTIST, _("Artist")); @@ -96,7 +93,8 @@ #endif } - volume = get_volume(status); + int volume = get_volume(status); + char buf[32]; if (volume < 0) g_snprintf(buf, 32, _("Volume n/a")); else @@ -105,6 +103,7 @@ colors_use(w, COLOR_TITLE); mvwaddstr(w, 0, p->window.cols - utf8_width(buf), buf); + char flags[5]; flags[0] = 0; if (status != NULL) { if (mpd_status_get_repeat(status)) @@ -126,7 +125,7 @@ if (flags[0]) { wmove(w, 1, p->window.cols - strlen(flags) - 3); waddch(w, '['); - colors_use(w, COLOR_LINE_BOLD); + colors_use(w, COLOR_LINE_FLAGS); waddstr(w, flags); colors_use(w, COLOR_LINE); waddch(w, ']');
View file
ncmpc-0.21.tar.bz2/src/utils.c -> ncmpc-0.24.tar.xz/src/utils.c
Changed
@@ -76,15 +76,13 @@ gcmp_list_from_path(struct mpdclient *c, const gchar *path, GList *list, gint types) { - struct mpd_connection *connection; - struct mpd_entity *entity; - - connection = mpdclient_get_connection(c); + struct mpd_connection *connection = mpdclient_get_connection(c); if (connection == NULL) return list; mpd_send_list_meta(connection, path); + struct mpd_entity *entity; while ((entity = mpd_recv_entity(connection)) != NULL) { char *name; @@ -136,37 +134,35 @@ void format_duration_long(char *p, size_t length, unsigned long duration) { - const char *year = _("year"); - const char *years = _("years"); - const char *week = _("week"); - const char *weeks = _("weeks"); - const char *day = _("day"); - const char *days = _("days"); unsigned bytes_written = 0; if (duration / 31536000 > 0) { if (duration / 31536000 == 1) - bytes_written = g_snprintf(p, length, "%d %s, ", 1, year); + bytes_written = g_snprintf(p, length, "%d %s, ", 1, _("year")); else - bytes_written = g_snprintf(p, length, "%lu %s, ", duration / 31536000, years); + bytes_written = g_snprintf(p, length, "%lu %s, ", duration / 31536000, _("years")); duration %= 31536000; length -= bytes_written; p += bytes_written; } if (duration / 604800 > 0) { if (duration / 604800 == 1) - bytes_written = g_snprintf(p, length, "%d %s, ", 1, week); + bytes_written = g_snprintf(p, length, "%d %s, ", + 1, _("week")); else - bytes_written = g_snprintf(p, length, "%lu %s, ", duration / 604800, weeks); + bytes_written = g_snprintf(p, length, "%lu %s, ", + duration / 604800, _("weeks")); duration %= 604800; length -= bytes_written; p += bytes_written; } if (duration / 86400 > 0) { if (duration / 86400 == 1) - bytes_written = g_snprintf(p, length, "%d %s, ", 1, day); + bytes_written = g_snprintf(p, length, "%d %s, ", + 1, _("day")); else - bytes_written = g_snprintf(p, length, "%lu %s, ", duration / 86400, days); + bytes_written = g_snprintf(p, length, "%lu %s, ", + duration / 86400, _("days")); duration %= 86400; length -= bytes_written; p += bytes_written;
View file
ncmpc-0.21.tar.bz2/src/wreadln.c -> ncmpc-0.24.tar.xz/src/wreadln.c
Changed
@@ -85,17 +85,13 @@ byte_to_screen(const gchar *data, size_t x) { #if defined(HAVE_CURSES_ENHANCED) || defined(ENABLE_MULTIBYTE) - gchar *dup; - char *p; - unsigned width; - assert(x <= strlen(data)); - dup = g_strdup(data); + char *dup = g_strdup(data); dup[x] = 0; - p = replace_locale_to_utf8(dup); + char *p = replace_locale_to_utf8(dup); - width = utf8_width(p); + unsigned width = utf8_width(p); g_free(p); return width; @@ -113,13 +109,11 @@ #if defined(HAVE_CURSES_ENHANCED) || defined(ENABLE_MULTIBYTE) size_t length = strlen(data); gchar *dup = g_strdup(data); - char *p; - unsigned p_width; while (true) { dup[length] = 0; - p = locale_to_utf8(dup); - p_width = utf8_width(p); + char *p = locale_to_utf8(dup); + unsigned p_width = utf8_width(p); g_free(p); if (p_width <= width) break; @@ -162,14 +156,13 @@ while (dup[start] != 0) { char *p = locale_to_utf8(dup + start), *q; unsigned p_width = utf8_width(p); - gunichar c; if (p_width < width) { g_free(p); break; } - c = g_utf8_get_char(p); + gunichar c = g_utf8_get_char(p); p[g_unichar_to_utf8(c, NULL)] = 0; q = utf8_to_locale(p); g_free(p); @@ -194,15 +187,13 @@ { #if defined(HAVE_CURSES_ENHANCED) || defined(ENABLE_MULTIBYTE) char *p = locale_to_utf8(data), *q; - gunichar c; - size_t size; - c = g_utf8_get_char(p); + gunichar c = g_utf8_get_char(p); p[g_unichar_to_utf8(c, NULL)] = 0; q = utf8_to_locale(p); g_free(p); - size = strlen(q); + size_t size = strlen(q); g_free(q); return size; @@ -218,16 +209,14 @@ prev_char_size(const gchar *data, size_t x) { #if defined(HAVE_CURSES_ENHANCED) || defined(ENABLE_MULTIBYTE) - char *p = locale_to_utf8(data), *q; - gunichar c; - size_t size; - assert(x > 0); - q = p; + char *p = locale_to_utf8(data); + + char *q = p; while (true) { - c = g_utf8_get_char(q); - size = g_unichar_to_utf8(c, NULL); + gunichar c = g_utf8_get_char(q); + size_t size = g_unichar_to_utf8(c, NULL); if (size > x) size = x; x -= size; @@ -249,12 +238,10 @@ /* move the cursor one step to the right */ static inline void cursor_move_right(struct wreadln *wr) { - size_t size; - if (wr->line[wr->cursor] == 0) return; - size = next_char_size(wr->line + wr->cursor); + size_t size = next_char_size(wr->line + wr->cursor); wr->cursor += size; if (cursor_column(wr) >= wr->width) wr->start = right_align_bytes(wr->line, wr->cursor, wr->width); @@ -263,12 +250,10 @@ /* move the cursor one step to the left */ static inline void cursor_move_left(struct wreadln *wr) { - size_t size; - if (wr->cursor == 0) return; - size = prev_char_size(wr->line, wr->cursor); + size_t size = prev_char_size(wr->line, wr->cursor); assert(wr->cursor >= size); wr->cursor -= size; if (wr->cursor < wr->start) @@ -329,7 +314,6 @@ .fd = 0, .events = POLLIN, }; - int ret; /* wide version: try to complete the multibyte sequence */ @@ -340,8 +324,7 @@ /* poll for more bytes on stdin, without timeout */ - ret = poll(&pfd, 1, 0); - if (ret <= 0) + if (poll(&pfd, 1, 0) <= 0) /* no more input from keyboard */ break; @@ -369,12 +352,10 @@ static void wreadln_delete_char(struct wreadln *wr, size_t x) { - size_t rest, length; - assert(x < strlen(wr->line)); - length = next_char_size(&wr->line[x]); - rest = strlen(&wr->line[x + length]) + 1; + size_t length = next_char_size(&wr->line[x]); + size_t rest = strlen(&wr->line[x + length]) + 1; memmove(&wr->line[x], &wr->line[x + length], rest); } @@ -396,8 +377,6 @@ .start = 0, }; GList *hlist = NULL, *hcurrent = NULL; - gint key = 0; - size_t i; #ifdef NCMPC_MINI (void)gcmp; @@ -449,17 +428,20 @@ drawline(&wr); } + gint key = 0; while (key != 13 && key != '\n') { key = wgetch(w); /* check if key is a function key */ - for (i = 0; i < 63; i++) + for (size_t i = 0; i < 63; i++) if (key == (int)KEY_F(i)) { key = KEY_F(1); i = 64; } switch (key) { + size_t i; + #ifdef HAVE_GETMOUSE case KEY_MOUSE: /* ignore mouse events */ #endif
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.