summaryrefslogtreecommitdiff
path: root/src/plugin_xmms
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2012-02-01 20:34:04 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2012-02-01 20:34:04 +1100
commitce8a75134cace056f6c436d54b57bad1a1d93797 (patch)
treead3225304d65339597d053f930328a9cf437a5fb /src/plugin_xmms
parent8bbbf56403808ff75126cd0840a936aedbc4113b (diff)
downloadflac-ce8a75134cace056f6c436d54b57bad1a1d93797.tar.gz
Fix a bunch of printf format warnings.
Diffstat (limited to 'src/plugin_xmms')
-rw-r--r--src/plugin_xmms/fileinfo.c10
-rw-r--r--src/plugin_xmms/http.c50
2 files changed, 28 insertions, 32 deletions
diff --git a/src/plugin_xmms/fileinfo.c b/src/plugin_xmms/fileinfo.c
index 096d2210..c3ea8af2 100644
--- a/src/plugin_xmms/fileinfo.c
+++ b/src/plugin_xmms/fileinfo.c
@@ -182,7 +182,7 @@ static void remove_tag(GtkWidget * w, gpointer data)
{
(void)w;
(void)data;
-
+
FLAC_plugin__tags_delete_tag(tags_, "TITLE");
FLAC_plugin__tags_delete_tag(tags_, "ARTIST");
FLAC_plugin__tags_delete_tag(tags_, "ALBUM");
@@ -221,17 +221,13 @@ static void show_file_info(void)
label_set_text(flac_blocksize, _("Blocksize: variable\n min/max: %d/%d"), streaminfo.data.stream_info.min_blocksize, streaminfo.data.stream_info.max_blocksize);
if (streaminfo.data.stream_info.total_samples)
- label_set_text(flac_samples, _("Samples: %llu\nLength: %d:%.2d"),
+ label_set_text(flac_samples, _("Samples: %" PRIu64 "\nLength: %d:%.2d"),
streaminfo.data.stream_info.total_samples,
(int)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate / 60),
(int)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate % 60));
if(!stat(current_filename, &_stat) && S_ISREG(_stat.st_mode)) {
-#if _FILE_OFFSET_BITS == 64
- label_set_text(flac_filesize, _("Filesize: %lld B"), _stat.st_size);
-#else
- label_set_text(flac_filesize, _("Filesize: %ld B"), _stat.st_size);
-#endif
+ label_set_text(flac_filesize, _("Filesize: %zd B"), _stat.st_size);
if (streaminfo.data.stream_info.total_samples)
label_set_text(flac_bitrate, _("Avg. bitrate: %.1f kb/s\nCompression ratio: %.1f%%"),
8.0 * (float)(_stat.st_size) / (1000.0 * (float)streaminfo.data.stream_info.total_samples / (float)streaminfo.data.stream_info.sample_rate),
diff --git a/src/plugin_xmms/http.c b/src/plugin_xmms/http.c
index af3235fb..d8959f27 100644
--- a/src/plugin_xmms/http.c
+++ b/src/plugin_xmms/http.c
@@ -131,7 +131,7 @@ static gchar *basic_authentication_encode (const gchar *user, const gchar *passw
res = g_strdup_printf("%s: Basic %s\r\n", header, t2);
g_free(t2);
g_free(t1);
-
+
return res;
}
@@ -181,7 +181,7 @@ static void parse_url(const gchar * url, gchar ** user, gchar ** pass, gchar **
*port = 80;
}
*host = g_strdup(h);
-
+
if (f)
*filename = g_strdup(f + 1);
else
@@ -369,7 +369,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
do
{
redirect=FALSE;
-
+
g_strstrip(url);
parse_url(url, &user, &pass, &host, &port, &filename);
@@ -441,7 +441,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
flac_ip.set_info_text(NULL);
eof = TRUE;
-
+
}
break;
}
@@ -455,12 +455,12 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
if (flac_cfg.stream.use_udp_channel)
{
udp_port = udp_establish_listener (&udp_sock);
- if (udp_port > 0)
+ if (udp_port > 0)
sprintf (udpspace, "x-audiocast-udpport: %d\r\n", udp_port);
else
udp_sock = 0;
}
-
+
if(user && pass)
auth = basic_authentication_encode(user, pass, "Authorization");
@@ -481,17 +481,17 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
"Host: %s\r\n"
"User-Agent: %s/%s\r\n"
"%s%s%s%s",
- file, host, "Reference FLAC Player", FLAC__VERSION_STRING,
+ file, host, "Reference FLAC Player", FLAC__VERSION_STRING,
proxy_auth ? proxy_auth : "", auth ? auth : "",
flac_cfg.stream.cast_title_streaming ? "Icy-MetaData:1\r\n" : "",
flac_cfg.stream.use_udp_channel ? udpspace : "");
if (offset && !head) {
gchar *temp_dead = temp;
- temp = g_strdup_printf ("%sRange: %llu-\r\n", temp, offset);
+ temp = g_strdup_printf ("%sRange: %" PRIu64 "-\r\n", temp, offset);
fprintf (stderr, "%s", temp);
g_free (temp_dead);
}
-
+
g_free(file);
if(proxy_auth)
g_free(proxy_auth);
@@ -535,7 +535,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
break;
}
}
- }
+ }
redirect=TRUE;
break;
}
@@ -576,7 +576,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
#endif
/*udp_serverport = atoi (line + 20);*/
}
-
+
}
else
{
@@ -588,7 +588,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
}
}
}
-
+
if(redirect)
{
if (output_file)
@@ -617,7 +617,7 @@ static void *http_buffer_loop(void *arg)
url = (gchar *) arg;
sock = http_connect (url, false, offset);
-
+
if (sock >= 0 && flac_cfg.stream.save_http_stream) {
gchar *output_name;
file = flac_http_get_title(url);
@@ -705,7 +705,7 @@ static void *http_buffer_loop(void *arg)
g_free(buffer);
g_free(url);
-
+
pthread_exit(NULL);
return NULL; /* avoid compiler warning */
}
@@ -749,11 +749,11 @@ static int udp_establish_listener(int *sock)
{
struct sockaddr_in sin;
socklen_t sinlen = sizeof (struct sockaddr_in);
-
+
#ifdef DEBUG_UDP
fprintf (stderr,"Establishing udp listener\n");
#endif
-
+
if ((*sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
{
g_log(NULL, G_LOG_LEVEL_CRITICAL,
@@ -764,7 +764,7 @@ static int udp_establish_listener(int *sock)
memset(&sin, 0, sinlen);
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = g_htonl(INADDR_ANY);
-
+
if (bind(*sock, (struct sockaddr *)&sin, sinlen) < 0)
{
g_log(NULL, G_LOG_LEVEL_CRITICAL,
@@ -792,7 +792,7 @@ static int udp_establish_listener(int *sock)
#ifdef DEBUG_UDP
fprintf (stderr,"Listening on local %s:%d\n", inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port));
#endif
-
+
return g_ntohs(sin.sin_port);
}
@@ -806,7 +806,7 @@ static int udp_check_for_data(int sock)
socklen_t fromlen;
fromlen = sizeof(struct sockaddr_in);
-
+
if ((len = recvfrom(sock, buf, 1024, 0, (struct sockaddr *)&from, &fromlen)) < 0)
{
if (errno != EAGAIN)
@@ -824,24 +824,24 @@ static int udp_check_for_data(int sock)
lines = g_strsplit(buf, "\n", 0);
if (!lines)
return 0;
-
+
for (i = 0; lines[i]; i++)
{
while ((lines[i][strlen(lines[i]) - 1] == '\n') ||
(lines[i][strlen(lines[i]) - 1] == '\r'))
lines[i][strlen(lines[i]) - 1] = '\0';
-
+
valptr = strchr(lines[i], ':');
-
+
if (!valptr)
continue;
else
valptr++;
-
+
g_strstrip(valptr);
if (!strlen(valptr))
continue;
-
+
if (strstr(lines[i], "x-audiocast-streamtitle") != NULL)
{
title = g_strdup_printf ("%s (%s)", valptr, icy_name);
@@ -857,7 +857,7 @@ static int udp_check_for_data(int sock)
set_track_info(NULL, atoi(valptr));
}
#endif
-
+
else if (strstr(lines[i], "x-audiocast-streammsg") != NULL)
{
/* set_track_info(title, -1); */