diff src/image-load.c @ 495:c7a2471e5c4e

Introduce macros to display debug messages. if (debug) printf(...) is now replaced by variadic macros: DEBUG_1() And for higher debugging levels: DEBUG_2() DEBUG_3() DEBUG_4()
author zas_
date Wed, 23 Apr 2008 20:47:19 +0000
parents 48c8e49b571c
children 01fe7ca55c69
line wrap: on
line diff
--- a/src/image-load.c	Wed Apr 23 13:46:18 2008 +0000
+++ b/src/image-load.c	Wed Apr 23 20:47:19 2008 +0000
@@ -164,7 +164,7 @@
 {
 	image_loader_stop(il);
 
-	if (debug) printf("pixbuf_loader reported load error for: %s\n", image_loader_path(il));
+	DEBUG_1("pixbuf_loader reported load error for: %s\n", image_loader_path(il));
 
 	if (il->func_error) il->func_error(il, il->data_error);
 }
@@ -221,7 +221,7 @@
 	if (b > 0 &&
 	    format_raw_img_exif_offsets_fd(il->load_fd, image_loader_path(il), il->read_buffer, b, &offset, NULL))
 		{
-		if (debug) printf("Raw file %s contains embedded image\n", image_loader_path(il));
+		DEBUG_1("Raw file %s contains embedded image\n", image_loader_path(il));
 
 		b = read(il->load_fd, il->read_buffer, il->read_buffer_size);
 		}
@@ -332,7 +332,7 @@
 	il->requested_width = 0;
 	il->requested_height = 0;
 	il->shrunk = FALSE;
-	if (debug) printf("new image loader %p, bufsize=%u idle_loop=%u\n", il, il->read_buffer_size, il->idle_read_loop_count);
+	DEBUG_1("new image loader %p, bufsize=%u idle_loop=%u\n", il, il->read_buffer_size, il->idle_read_loop_count);
 	return il;
 }
 
@@ -356,7 +356,7 @@
 	if (il->fd) file_data_unref(il->fd);
 	if (il->path) g_free(il->path);
 	if (il->read_buffer) g_free(il->read_buffer);
-	if (debug) printf("freeing image loader %p bytes_read=%d\n", il, il->bytes_read);
+	DEBUG_1("freeing image loader %p bytes_read=%d\n", il, il->bytes_read);
 	g_free(il);
 }