[totem-pl-parser] lib: Fix compile-time warnings



commit 09df02bd247b46429ac2b8b388f56584ee598cfb
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Sep 18 11:41:39 2011 +0100

    lib: Fix compile-time warnings
    
    We don't use the URI, so don't use a macro that uses it.

 plparse/totem-pl-parser-pla.c     |   10 +++++-----
 plparse/totem-pl-parser-private.h |    9 +++++----
 2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/plparse/totem-pl-parser-pla.c b/plparse/totem-pl-parser-pla.c
index d067d32..06f1920 100644
--- a/plparse/totem-pl-parser-pla.c
+++ b/plparse/totem-pl-parser-pla.c
@@ -104,7 +104,7 @@ totem_pl_parser_save_pla (TotemPlParser    *parser,
 
 		if (path == NULL)
 		{
-			DEBUG(NULL, g_print ("Couldn't convert URI '%s' to a filename: %s\n", euri, (*error)->message));
+			DEBUG1(g_print ("Couldn't convert URI '%s' to a filename: %s\n", euri, (*error)->message));
 			g_free (euri);
 			ret = FALSE;
 			break;
@@ -137,7 +137,7 @@ totem_pl_parser_save_pla (TotemPlParser    *parser,
 		converted = g_convert (path, -1, "UTF-16BE", "UTF-8", NULL, &written, error);
 		if (converted == NULL)
 		{
-			DEBUG(NULL, g_print ("Couldn't convert filename '%s' to UTF-16BE\n", path));
+			DEBUG1(g_print ("Couldn't convert filename '%s' to UTF-16BE\n", path));
 			g_free (path);
 			ret = FALSE;
 			break;
@@ -152,7 +152,7 @@ totem_pl_parser_save_pla (TotemPlParser    *parser,
 
 		if (totem_pl_parser_write_buffer (G_OUTPUT_STREAM (stream), buffer, RECORD_SIZE, error) == FALSE)
 		{
-			DEBUG(NULL, g_print ("Couldn't write entry %d to the file\n", i));
+			DEBUG1(g_print ("Couldn't write entry %d to the file\n", i));
 			ret = FALSE;
 			break;
 		}
@@ -220,7 +220,7 @@ totem_pl_parser_add_pla (TotemPlParser *parser,
 				  NULL, NULL, &error);
 		if (path == NULL)
 		{
-			DEBUG(NULL, g_print ("error converting entry %d to UTF-8: %s\n", entry, error->message));
+			DEBUG1(g_print ("error converting entry %d to UTF-8: %s\n", entry, error->message));
 			g_error_free (error);
 			retval = TOTEM_PL_PARSER_RESULT_ERROR;
 			break;
@@ -233,7 +233,7 @@ totem_pl_parser_add_pla (TotemPlParser *parser,
 		uri = g_filename_to_uri (path, NULL, NULL);
 		if (uri == NULL)
 		{
-			DEBUG(file, g_print ("error converting path %s to URI: %s\n", path, error->message));
+			DEBUG1(g_print ("error converting path %s to URI: %s\n", path, error->message));
 			g_error_free (error);
 			retval = TOTEM_PL_PARSER_RESULT_ERROR;
 			break;
diff --git a/plparse/totem-pl-parser-private.h b/plparse/totem-pl-parser-private.h
index 8e07260..24bae9e 100644
--- a/plparse/totem-pl-parser-private.h
+++ b/plparse/totem-pl-parser-private.h
@@ -84,7 +84,6 @@
 #define TOTEM_PL_PARSER_FIELD_FILE		"gfile-object"
 #define TOTEM_PL_PARSER_FIELD_BASE_FILE		"gfile-object-base"
 
-#ifndef TOTEM_PL_PARSER_MINI
 #define DEBUG(file, x) {					\
 	if (totem_pl_parser_is_debugging_enabled (parser)) {	\
 		if (file != NULL) {				\
@@ -99,9 +98,11 @@
 		}						\
 	}							\
 }
-#else
-#define DEBUG(x) { if (totem_pl_parser_is_debugging_enabled (parser)) x; }
-#endif
+#define DEBUG1(x) {						\
+	if (totem_pl_parser_is_debugging_enabled (parser)) {	\
+		x;						\
+	}							\
+}
 
 typedef struct {
 	guint recurse_level;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]