summaryrefslogtreecommitdiff
path: root/src/frame.c
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 /src/frame.c
parent3e3d939ff5ddbbabe2a6a299519ba430ebc2cde5 (diff)
downloadratpoison-968499469167c972d607f64373352dad7a9d5894.zip
(init_frame): new static function
(frame_new): call init_frame (frame_read): likewise
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c17
1 files changed, 15 insertions, 2 deletions
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));