From 2af887d39f6cba4cbbcaac8b51ffa773be809f23 Mon Sep 17 00:00:00 2001 From: sabetts Date: Thu, 16 Mar 2006 01:15:39 +0000 Subject: * src/main.c (clean_up): use list_size not rp_num_frame_undos * src/globals.c: remove global var rp_num_frame_undos. All callers updated. * src/actions.c (push_frame_undo): use list_size, not rp_num_frame_undos (set_maxundos): likewise --- src/actions.c | 6 ++---- src/globals.c | 1 - src/globals.h | 1 - src/main.c | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index 00f3962..4586e25 100644 --- a/src/actions.c +++ b/src/actions.c @@ -380,14 +380,13 @@ del_frame_undo (rp_frame_undo *u) if (u->frames) free (u->frames); list_del (&(u->node)); free (u); - rp_num_frame_undos--; /* decrement counter */ } static void push_frame_undo(rp_screen *screen) { rp_frame_undo *cur; - if (rp_num_frame_undos > defaults.maxundos) + if (list_size (&rp_frame_undos) > defaults.maxundos) { /* Delete the oldest node */ list_last (cur, &rp_frame_undos, node); @@ -397,7 +396,6 @@ push_frame_undo(rp_screen *screen) cur->frames = fdump (screen); cur->screen = screen; list_add (&cur->node, &rp_frame_undos); - rp_num_frame_undos++; /* increment counter */ /* Since we're creating new frames the redo list is now invalid, so clear it. */ clear_frame_redos(); @@ -4970,7 +4968,7 @@ set_maxundos (struct cmdarg **args) defaults.maxundos = ARG(0,number); /* Delete any superfluous undos */ - while (rp_num_frame_undos > defaults.maxundos) + while (list_size (&rp_frame_undos) > defaults.maxundos) { /* Delete the oldest node */ list_last (cur, &rp_frame_undos, node); diff --git a/src/globals.c b/src/globals.c index e9755dd..cff1646 100644 --- a/src/globals.c +++ b/src/globals.c @@ -253,7 +253,6 @@ set_window_focus (Window window) LIST_HEAD (rp_frame_undos); LIST_HEAD (rp_frame_redos); -int rp_num_frame_undos = 0; void init_globals () diff --git a/src/globals.h b/src/globals.h index 59561dc..a2d466f 100644 --- a/src/globals.h +++ b/src/globals.h @@ -163,7 +163,6 @@ extern struct numset *rp_frame_numset; extern struct list_head rp_frame_undos; extern struct list_head rp_frame_redos; -extern int rp_num_frame_undos; /* Selection handling globals */ extern rp_xselection selection; diff --git a/src/main.c b/src/main.c index 4d9a8ba..c3732e3 100644 --- a/src/main.c +++ b/src/main.c @@ -740,7 +740,7 @@ clean_up () free (screens); /* Delete the undo histories */ - while (rp_num_frame_undos > 0) + while (list_size (&rp_frame_undos) > 0) { /* Delete the oldest node */ rp_frame_undo *cur; -- cgit v1.2.3