summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2006-03-16 01:15:39 +0000
committersabetts <sabetts>2006-03-16 01:15:39 +0000
commit2af887d39f6cba4cbbcaac8b51ffa773be809f23 (patch)
tree6a4f1fc8230e82e669fb011459c072b43b01fd3d /src
parent73a3c5a465dbe5df9bed5f163d2c105065b861f2 (diff)
downloadratpoison-2af887d39f6cba4cbbcaac8b51ffa773be809f23.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/actions.c6
-rw-r--r--src/globals.c1
-rw-r--r--src/globals.h1
-rw-r--r--src/main.c2
4 files changed, 3 insertions, 7 deletions
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;