From 5cff101603a536b37f12b2eaad2def42a63a954b Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 13 Jul 2004 08:30:22 +0000 Subject: [PATCH] resurrected some bit-rotting debug code. Might become useful one day. 2004-07-13 Sven Neumann * app/core/gimpimage-undo.c: resurrected some bit-rotting debug code. Might become useful one day. --- ChangeLog | 5 ++++ app/core/gimpimage-undo.c | 49 ++++++++++++++++++--------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebfc92510f..14ee2ccb50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-07-13 Sven Neumann + + * app/core/gimpimage-undo.c: resurrected some bit-rotting debug + code. Might become useful one day. + 2004-07-13 Sven Neumann * autogen.sh: when automake 1.8 is being used, require at least diff --git a/app/core/gimpimage-undo.c b/app/core/gimpimage-undo.c index d90512ec84..55fe3ff19d 100644 --- a/app/core/gimpimage-undo.c +++ b/app/core/gimpimage-undo.c @@ -147,8 +147,7 @@ gimp_image_undo_group_start (GimpImage *gimage, gimp_object_set_name (GIMP_OBJECT (undo_group), name); GIMP_UNDO (undo_group)->undo_type = type; - gimp_undo_stack_push_undo (gimage->undo_stack, - GIMP_UNDO (undo_group)); + gimp_undo_stack_push_undo (gimage->undo_stack, GIMP_UNDO (undo_group)); gimage->pushing_undo_group = type; @@ -338,10 +337,10 @@ gimp_image_undo_free_space (GimpImage *gimage) max_undo_levels = 1024; /* FIXME */ undo_size = gimage->gimp->config->undo_size; -#if 0 - g_print ("undo_steps: %d undo_bytes: %d\n", - gimp_container_num_children (container), - gimp_object_get_memsize (GIMP_OBJECT (container), NULL)); +#ifdef DEBUG_IMAGE_UNDO + g_printerr ("undo_steps: %d undo_bytes: %ld\n", + gimp_container_num_children (container), + (glong) gimp_object_get_memsize (GIMP_OBJECT (container), NULL)); #endif /* keep at least min_undo_levels undo steps */ @@ -351,15 +350,14 @@ gimp_image_undo_free_space (GimpImage *gimage) while ((gimp_object_get_memsize (GIMP_OBJECT (container), NULL) > undo_size) || (gimp_container_num_children (container) > max_undo_levels)) { - GimpUndo *freed; + GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->undo_stack, + GIMP_UNDO_MODE_UNDO); - freed = gimp_undo_stack_free_bottom (gimage->undo_stack, - GIMP_UNDO_MODE_UNDO); - -#if 0 - g_print ("freed one step: undo_steps: %d undo_bytes: %d\n", - gimp_container_num_children (container), - gimp_object_get_memsize (GIMP_OBJECT (container), NULL)); +#ifdef DEBUG_IMAGE_UNDO + g_printerr ("freed one step: undo_steps: %d undo_bytes: %ld\n", + gimp_container_num_children (container), + (glong) gimp_object_get_memsize (GIMP_OBJECT (container), + NULL)); #endif gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_EXPIRED, freed); @@ -378,23 +376,22 @@ gimp_image_undo_free_redo (GimpImage *gimage) container = gimage->redo_stack->undos; -#if 0 - g_print ("redo_steps: %d redo_bytes: %d\n", - gimp_container_num_children (container), - gimp_object_get_memsize (GIMP_OBJECT (container)), NULL); +#ifdef DEBUG_IMAGE_UNDO + g_printerr ("redo_steps: %d redo_bytes: %ld\n", + gimp_container_num_children (container), + (glong) gimp_object_get_memsize (GIMP_OBJECT (container), NULL)); #endif while (gimp_container_num_children (container) > 0) { - GimpUndo *freed; + GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->redo_stack, + GIMP_UNDO_MODE_REDO); - freed = gimp_undo_stack_free_bottom (gimage->redo_stack, - GIMP_UNDO_MODE_REDO); - -#if 0 - g_print ("freed one step: redo_steps: %d redo_bytes: %d\n", - gimp_container_num_children (container), - gimp_object_get_memsize (GIMP_OBJECT (container)), NULL); +#ifdef DEBUG_IMAGE_UNDO + g_printerr ("freed one step: redo_steps: %d redo_bytes: %ld\n", + gimp_container_num_children (container), + (glong )gimp_object_get_memsize (GIMP_OBJECT (container), + NULL)); #endif gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_REDO_EXPIRED, freed);