[xiph-commits] r15780 - trunk/ezstream/src

moritz at svn.xiph.org moritz at svn.xiph.org
Mon Mar 16 13:22:56 PDT 2009


Author: moritz
Date: 2009-03-16 13:22:56 -0700 (Mon, 16 Mar 2009)
New Revision: 15780

Modified:
   trunk/ezstream/src/configfile.c
   trunk/ezstream/src/ezstream.c
   trunk/ezstream/src/metadata.c
   trunk/ezstream/src/playlist.c
   trunk/ezstream/src/util.c
Log:
Squelch another bunch of warnings after checking that what's happening is what's
wanted.


Modified: trunk/ezstream/src/configfile.c
===================================================================
--- trunk/ezstream/src/configfile.c	2009-03-16 20:12:29 UTC (rev 15779)
+++ trunk/ezstream/src/configfile.c	2009-03-16 20:22:56 UTC (rev 15780)
@@ -468,7 +468,7 @@
 					xmlNodePtr	 cur3;
 					FORMAT_ENCDEC	*pformatEncDec;
 
-					pformatEncDec = xcalloc(1, sizeof(FORMAT_ENCDEC));
+					pformatEncDec = xcalloc(1UL, sizeof(FORMAT_ENCDEC));
 
 					for (cur3 = cur2->xmlChildrenNode;
 					     cur3 != NULL; cur3 = cur3->next) {

Modified: trunk/ezstream/src/ezstream.c
===================================================================
--- trunk/ezstream/src/ezstream.c	2009-03-16 20:12:29 UTC (rev 15779)
+++ trunk/ezstream/src/ezstream.c	2009-03-16 20:22:56 UTC (rev 15780)
@@ -116,9 +116,9 @@
 metadata_t *	getMetadata(const char *);
 int		setMetadata(shout_t *, metadata_t *, char **);
 FILE *		openResource(shout_t *, const char *, int *, metadata_t **,
-			     int *, int *);
+			     int *, long *);
 int		reconnectServer(shout_t *, int);
-const char *	getTimeString(int);
+const char *	getTimeString(long);
 int		sendStream(shout_t *, FILE *, const char *, int, const char *,
 			   struct timeval *);
 int		streamFile(shout_t *, const char *);
@@ -568,7 +568,7 @@
 
 FILE *
 openResource(shout_t *shout, const char *fileName, int *popenFlag,
-	     metadata_t **mdata_p, int *isStdin, int *songLen)
+	     metadata_t **mdata_p, int *isStdin, long *songLen)
 {
 	FILE		*filep = NULL;
 	char		 extension[25];
@@ -743,10 +743,10 @@
 }
 
 const char *
-getTimeString(int seconds)
+getTimeString(long seconds)
 {
 	static char	str[20];
-	int		secs, mins, hours;
+	long		secs, mins, hours;
 
 	if (seconds < 0)
 		return (NULL);
@@ -757,7 +757,7 @@
 	mins = secs / 60;
 	secs %= 60;
 
-	snprintf(str, sizeof(str), "%uh%02um%02us", hours, mins, secs);
+	snprintf(str, sizeof(str), "%ldh%02ldm%02lds", hours, mins, secs);
 	return ((const char *)str);
 }
 
@@ -782,7 +782,7 @@
 
 	total = oldTotal = 0;
 	ret = STREAM_DONE;
-	while ((bytes_read = fread(buff, 1, sizeof(buff), filepstream)) > 0) {
+	while ((bytes_read = fread(buff, 1UL, sizeof(buff), filepstream)) > 0) {
 		if (shout_get_connected(shout) != SHOUTERR_CONNECTED &&
 		    reconnectServer(shout, 0) == 0) {
 			ret = STREAM_SERVERR;
@@ -889,7 +889,8 @@
 	int		 popenFlag = 0;
 	char		*songLenStr = NULL;
 	int		 isStdin = 0;
-	int		 ret, retval = 0, songLen;
+	int		 ret, retval = 0;
+	long		 songLen;
 	metadata_t	*mdata;
 	struct timeval	 startTime;
 

Modified: trunk/ezstream/src/metadata.c
===================================================================
--- trunk/ezstream/src/metadata.c	2009-03-16 20:12:29 UTC (rev 15779)
+++ trunk/ezstream/src/metadata.c	2009-03-16 20:22:56 UTC (rev 15780)
@@ -84,7 +84,7 @@
 {
 	metadata_t	*md;
 
-	md = xcalloc(1, sizeof(metadata_t));
+	md = xcalloc(1UL, sizeof(metadata_t));
 	md->filename = xstrdup(filename);
 	md->songLen = -1;
 
@@ -572,7 +572,7 @@
 		return (0);
 	}
 
-	if (fgets(buf, sizeof(buf), filep) == NULL) {
+	if (fgets(buf, (int)sizeof(buf), filep) == NULL) {
 		if (ferror(filep))
 			printf("%s: Error while reading output from program '%s': %s\n",
 			       __progname, md->filename, strerror(errno));

Modified: trunk/ezstream/src/playlist.c
===================================================================
--- trunk/ezstream/src/playlist.c	2009-03-16 20:12:29 UTC (rev 15779)
+++ trunk/ezstream/src/playlist.c	2009-03-16 20:22:56 UTC (rev 15780)
@@ -57,7 +57,7 @@
 {
 	playlist_t	*pl;
 
-	pl = xcalloc(1, sizeof(playlist_t));
+	pl = xcalloc(1UL, sizeof(playlist_t));
 	pl->filename = xstrdup(filename);
 
 	return (pl);
@@ -77,14 +77,14 @@
 	num = pl->num + 1;
 
 	if (pl->size == 0) {
-		pl->list = xcalloc(2, sizeof(char *));
+		pl->list = xcalloc(2UL, sizeof(char *));
 		pl->size = 2 * sizeof(char *);
 	}
 
 	if (pl->size / sizeof(char *) <= num) {
 		size_t	i;
 
-		pl->list = xrealloc(pl->list, 2, pl->size);
+		pl->list = xrealloc(pl->list, 2UL, pl->size);
 		pl->size = 2 * pl->size;
 
 		for (i = num; i < pl->size / sizeof(char *); i++)
@@ -146,7 +146,7 @@
 	}
 
 	line = 0;
-	while (fgets(buf, sizeof(buf), filep) != NULL) {
+	while (fgets(buf, (int)sizeof(buf), filep) != NULL) {
 		line++;
 
 		if (strlen(buf) == sizeof(buf) - 1) {
@@ -155,7 +155,7 @@
 			printf("%s[%lu]: File or path name too long\n",
 			       filename, line);
 			/* Discard any excess chars in that line. */
-			while (fgets(skip_buf, sizeof(skip_buf), filep) != NULL) {
+			while (fgets(skip_buf, (int)sizeof(skip_buf), filep) != NULL) {
 				if (skip_buf[0] == '\n')
 					break;
 			}
@@ -504,7 +504,7 @@
 		return (NULL);
 	}
 
-	if (fgets(buf, sizeof(buf), filep) == NULL) {
+	if (fgets(buf, (int)sizeof(buf), filep) == NULL) {
 		if (ferror(filep))
 			printf("%s: Error while reading output from program '%s': %s\n",
 			       __progname, pl->filename, strerror(errno));

Modified: trunk/ezstream/src/util.c
===================================================================
--- trunk/ezstream/src/util.c	2009-03-16 20:12:29 UTC (rev 15779)
+++ trunk/ezstream/src/util.c	2009-03-16 20:22:56 UTC (rev 15780)
@@ -237,7 +237,7 @@
 
 # if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
 	setlocale(LC_CTYPE, "");
-	codeset = nl_langinfo(CODESET);
+	codeset = nl_langinfo((nl_item)CODESET);
 	setlocale(LC_CTYPE, "C");
 # else
 	codeset = (char *)"";
@@ -259,7 +259,7 @@
 
 # if defined(HAVE_NL_LANGINFO) && defined(HAVE_SETLOCALE) && defined(CODESET)
 	setlocale(LC_CTYPE, "");
-	codeset = nl_langinfo(CODESET);
+	codeset = nl_langinfo((nl_item)CODESET);
 	setlocale(LC_CTYPE, "C");
 # else
 	codeset = (char *)"";



More information about the commits mailing list