shithub: sox

Download patch

ref: 16071e06627a4b52f0342d6dea5a7443d2e56722
parent: 6ab46f5ce1be3069d817e83304b716c728a30b13
author: robs <robs>
date: Sat Nov 25 15:32:56 EST 2006

Rename a global variable so it's less likely to cause name clash problems.

--- a/src/st.h
+++ b/src/st.h
@@ -356,7 +356,7 @@
 ft_t st_initformat(void);
 int st_parsesamples(st_rate_t rate, char *str, st_size_t *samples, char def);
 
-extern char const * filename;
+extern char const * st_message_filename;
 
 #define ST_EOF (-1)
 #define ST_SUCCESS (0)
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -115,12 +115,12 @@
 void st_debug_more(char const * fmt, ...);
 void st_debug_most(char const * fmt, ...);
 
-#define st_fail       filename=__FILE__,st_fail
-#define st_warn       filename=__FILE__,st_warn
-#define st_report     filename=__FILE__,st_report
-#define st_debug      filename=__FILE__,st_debug
-#define st_debug_more filename=__FILE__,st_debug_more
-#define st_debug_most filename=__FILE__,st_debug_most
+#define st_fail       st_message_filename=__FILE__,st_fail
+#define st_warn       st_message_filename=__FILE__,st_warn
+#define st_report     st_message_filename=__FILE__,st_report
+#define st_debug      st_message_filename=__FILE__,st_debug
+#define st_debug_more st_message_filename=__FILE__,st_debug_more
+#define st_debug_most st_message_filename=__FILE__,st_debug_most
 
 void st_fail_errno(ft_t, int, const char *, ...);
 
--- a/src/util.c
+++ b/src/util.c
@@ -41,15 +41,6 @@
 
 
 
-/* This is a bit of a hack.  It's useful to have the ST library
- * report which driver (i.e. format or effect handler) is outputing
- * the message.  Using the filename for this purpose is only an
- * approximation, but it saves a lot of work. ;)
- */
-char const * filename = 0;
-
-
-
 void st_output_message(FILE * file, st_output_message_t message)
 {
   char buffer[10];
@@ -88,12 +79,21 @@
 
 
 
+/* This is a bit of a hack.  It's useful to have the ST library
+ * report which driver (i.e. format or effect handler) is outputing
+ * the message.  Using the filename for this purpose is only an
+ * approximation, but it saves a lot of work. ;)
+ */
+char const * st_message_filename = 0;
+
+
+
 static void st_emit_message(int level, char const * fmt, va_list ap)
 {
   if (st_output_message_handler != NULL)
   {
     struct st_output_message_s m;
-    m.filename = filename;
+    m.filename = st_message_filename;
     m.fmt = fmt;
     m.ap = ap;
     (*st_output_message_handler)(level, &m);