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

moritz at svn.xiph.org moritz at svn.xiph.org
Sat Mar 3 12:17:36 PST 2007


Author: moritz
Date: 2007-03-03 12:17:33 -0800 (Sat, 03 Mar 2007)
New Revision: 12620

Modified:
   trunk/ezstream/src/compat.h
   trunk/ezstream/src/configfile.c
   trunk/ezstream/src/ezstream.c
   trunk/ezstream/src/strtonum.c
Log:
Some more cosmetic tweaks.


Modified: trunk/ezstream/src/compat.h
===================================================================
--- trunk/ezstream/src/compat.h	2007-03-03 19:53:17 UTC (rev 12619)
+++ trunk/ezstream/src/compat.h	2007-03-03 20:17:33 UTC (rev 12620)
@@ -17,18 +17,19 @@
 
 # define _PATH_DEVNULL	"nul"
 
-# define strncasecmp	strnicmp
+# define pclose 	_pclose
 # define popen		_popen
-# define pclose 	_pclose
 # define snprintf	_snprintf
 # define stat		_stat
+# define strncasecmp	strnicmp
+# define strtoll	_strtoi64
 
+# define S_IRGRP	0
+# define S_IROTH	0
+# define S_IWGRP	0
+# define S_IWOTH	0
 # define S_IXGRP	0
 # define S_IXOTH	0
-# define S_IWGRP	0
-# define S_IWOTH	0
-# define S_IRGRP	0
-# define S_IROTH	0
 
 #else
 

Modified: trunk/ezstream/src/configfile.c
===================================================================
--- trunk/ezstream/src/configfile.c	2007-03-03 19:53:17 UTC (rev 12619)
+++ trunk/ezstream/src/configfile.c	2007-03-03 20:17:33 UTC (rev 12620)
@@ -244,7 +244,7 @@
 				const char *errstr;
 
 				ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-				ezConfig.fileNameIsProgram = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
+				ezConfig.fileNameIsProgram = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
 				if (errstr) {
 					printf("%s[%ld]: Error: <playlist_program> may only contain 1 or 0\n",
 					       fileName, xmlGetLineNo(cur));
@@ -266,7 +266,7 @@
 				const char *errstr;
 
 				ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-				ezConfig.shuffle = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
+				ezConfig.shuffle = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
 				if (errstr) {
 					printf("%s[%ld]: Error: <shuffle> may only contain 1 or 0\n",
 					       fileName, xmlGetLineNo(cur));
@@ -288,7 +288,7 @@
 				const char *errstr;
 
 				ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-				ezConfig.streamOnce = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
+				ezConfig.streamOnce = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
 				if (errstr) {
 					printf("%s[%ld]: Error: <stream_once> may only contain 1 or 0\n",
 					       fileName, xmlGetLineNo(cur));
@@ -310,7 +310,7 @@
 				const char *errstr;
 
 				ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-				ezConfig.reconnectAttempts = strtonum(ls_xmlContentPtr, 0, UINT_MAX, &errstr);
+				ezConfig.reconnectAttempts = (unsigned int)strtonum(ls_xmlContentPtr, 0, UINT_MAX, &errstr);
 				if (errstr) {
 					printf("%s[%ld]: Error: In <reconnect_tries>: '%s' is %s\n",
 					       fileName, xmlGetLineNo(cur), ls_xmlContentPtr, errstr);
@@ -437,7 +437,7 @@
 				const char *errstr;
 
 				ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
-				ezConfig.serverPublic = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
+				ezConfig.serverPublic = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
 				if (errstr) {
 					printf("%s[%ld]: Error: <svrinfopublic> may only contain 1 or 0\n",
 					       fileName, xmlGetLineNo(cur));
@@ -466,7 +466,7 @@
 						const char *errstr;
 
 						ls_xmlContentPtr = (char *)xmlNodeListGetString(doc, cur2->xmlChildrenNode, 1);
-						ezConfig.reencode = strtonum(ls_xmlContentPtr, 0, 1, &errstr);
+						ezConfig.reencode = (int)strtonum(ls_xmlContentPtr, 0, 1, &errstr);
 						if (errstr) {
 							printf("%s[%ld]: Error: <enable> may only contain 1 or 0\n",
 							       fileName, xmlGetLineNo(cur));

Modified: trunk/ezstream/src/ezstream.c
===================================================================
--- trunk/ezstream/src/ezstream.c	2007-03-03 19:53:17 UTC (rev 12619)
+++ trunk/ezstream/src/ezstream.c	2007-03-03 20:17:33 UTC (rev 12620)
@@ -217,7 +217,7 @@
 	}
 
 	strlcpy(tmpPort, p2, (p3 - p2) + 1);
-	*port = strtonum(tmpPort, 1, 65535, &errstr);
+	*port = (int)strtonum(tmpPort, 1, 65535, &errstr);
 	if (errstr) {
 		printf("%s: Error: Invalid <url>: Port '%s' is %s\n",
 		       __progname, tmpPort, errstr);

Modified: trunk/ezstream/src/strtonum.c
===================================================================
--- trunk/ezstream/src/strtonum.c	2007-03-03 19:53:17 UTC (rev 12619)
+++ trunk/ezstream/src/strtonum.c	2007-03-03 20:17:33 UTC (rev 12620)
@@ -25,6 +25,7 @@
 #include <limits.h>
 #include <stdlib.h>
 #include "strfctns.h"
+#include "compat.h"
 
 #define INVALID 	1
 #define TOOSMALL	2
@@ -37,10 +38,6 @@
 # define LLONG_MAX	LONG_LONG_MAX
 #endif
 
-#ifdef WIN32
-# define strtoll	_strtoi64
-#endif
-
 long long
 local_strtonum(const char *numstr, long long minval, long long maxval,
     const char **errstrp)



More information about the commits mailing list