summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2004-11-19 20:11:43 +0000
committersabetts <sabetts>2004-11-19 20:11:43 +0000
commit968499469167c972d607f64373352dad7a9d5894 (patch)
tree9fefea6e6193f5b4a4efab6638331df1c8d61e4a
parent3e3d939ff5ddbbabe2a6a299519ba430ebc2cde5 (diff)
downloadratpoison-968499469167c972d607f64373352dad7a9d5894.zip
(init_frame): new static function
(frame_new): call init_frame (frame_read): likewise
-rw-r--r--ChangeLog3
-rw-r--r--src/frame.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c6a4f3c..0849b0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* src/frame.c (frame_dump): dump the frame as an sexpr instead of
a list of numbers.
(frame_read): read the new frame dump format
+ (init_frame): new static function
+ (frame_new): call init_frame
+ (frame_read): likewise
* src/actions.c (cmd_describekey): fix error messages.
diff --git a/src/frame.c b/src/frame.c
index 46e22e9..b44f7c5 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -109,15 +109,27 @@ frame_move_down (rp_frame *frame, int amount)
frame->y += amount;
}
+static void
+init_frame (rp_frame *f)
+{
+ f->number = 0;
+ f->x = 0;
+ f->y = 0;
+ f->width = 0;
+ f->height = 0;
+ f->win_number = 0;
+ f->last_access = 0;
+ f->dedicated = 0;
+}
+
rp_frame *
frame_new (rp_screen *s)
{
rp_frame *f;
f = xmalloc (sizeof (rp_frame));
+ init_frame(f);
f->number = numset_request (s->frames_numset);
- f->last_access = 0;
- f->dedicated = 0;
return f;
}
@@ -188,6 +200,7 @@ frame_read (char *str)
/* Create a blank frame. */
f = xmalloc (sizeof (rp_frame));
+ init_frame(f);
PRINT_DEBUG(("parsing '%s'\n", str));