From 1d3b753b428842fc9c0bdc6d9ccc9e2289239ffa Mon Sep 17 00:00:00 2001 From: sabetts Date: Tue, 3 Jan 2006 21:34:20 +0000 Subject: * src/number.c (numset_add_num): store the ret val of numset_find_empty_cell in a variable and use it as an index into the numbers_taken array. * src/actions.c (cmd_curframe): return the frame number in non-interactive mode. * src/split.c (cleanup_frame): in the maxsize windows are transients check either the width or height must be less than the screen width/height (just like in windows.c). --- src/actions.c | 16 +++++++++------- src/main.c | 4 ---- src/number.c | 8 ++++++-- src/split.c | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/actions.c b/src/actions.c index ff4a5bf..15372be 100644 --- a/src/actions.c +++ b/src/actions.c @@ -209,7 +209,7 @@ init_user_commands() "Name: ", arg_STRING); add_command ("gnext", cmd_gnext, 0, 0, 0); add_command ("gprev", cmd_gprev, 0, 0, 0); - add_command ("gravity", cmd_gravity, 1, 0, 1, + add_command ("gravity", cmd_gravity, 1, 0, 0, "Gravity: ", arg_GRAVITY); add_command ("groups", cmd_groups, 0, 0, 0); add_command ("gselect", cmd_gselect, 1, 1, 1, @@ -3036,8 +3036,13 @@ cmd_rathold (int interactive, struct cmdarg **args) cmdret * cmd_curframe (int interactive, struct cmdarg **args) { - show_frame_indicator(); - return cmdret_new (RET_SUCCESS, NULL); + if (interactive) + { + show_frame_indicator(); + return cmdret_new (RET_SUCCESS, NULL); + } + else + return cmdret_new(RET_SUCCESS, "%d", current_frame()->number); } /* Thanks to Martin Samuelsson for the @@ -3379,11 +3384,8 @@ set_maxsizegravity (struct cmdarg **args) cmdret * cmd_msgwait (int interactive, struct cmdarg **args) { - if (args[0] == NULL && !interactive) - return cmdret_new (RET_SUCCESS, "%d", defaults.bar_timeout); - if (args[0] == NULL) - return cmdret_new (RET_FAILURE, "msgwait: one argument required"); + return cmdret_new (RET_SUCCESS, "%d", defaults.bar_timeout); if (ARG(0,number) < 0) return cmdret_new (RET_FAILURE, "msgwait: invalid argument"); diff --git a/src/main.c b/src/main.c index 7dd1f07..2cf6809 100644 --- a/src/main.c +++ b/src/main.c @@ -592,13 +592,9 @@ main (int argc, char *argv[]) /* Set ratpoison specific Atoms. */ rp_command = XInternAtom (dpy, "RP_COMMAND", False); - PRINT_DEBUG (("RP_COMMAND = %ld\n", rp_command)); rp_command_request = XInternAtom (dpy, "RP_COMMAND_REQUEST", False); - PRINT_DEBUG (("RP_COMMAND_REQUEST = %ld\n", rp_command_request)); rp_command_result = XInternAtom (dpy, "RP_COMMAND_RESULT", False); - PRINT_DEBUG (("RP_COMMAND_RESULT = %ld\n", rp_command_result)); rp_selection = XInternAtom (dpy, "RP_SELECTION", False); - PRINT_DEBUG (("RP_SELECTION = %ld\n", rp_selection)); if (cmd_count > 0) { diff --git a/src/number.c b/src/number.c index 7fb48c9..ee96b42 100644 --- a/src/number.c +++ b/src/number.c @@ -71,12 +71,16 @@ numset_find_empty_cell (struct numset *ns) int numset_add_num (struct numset *ns, int n) { + int ec; + PRINT_DEBUG(("ns=%p add_num %d\n", ns, n)); if (numset_num_is_taken (ns, n)) return 0; /* failed. */ - - ns->numbers_taken[numset_find_empty_cell(ns)] = n; + /* numset_find_empty_cell calls realloc on numbers_taken. So store + the ret val in ec then use ec as an index into the array. */ + ec = numset_find_empty_cell(ns); + ns->numbers_taken[ec] = n; return 1; /* success! */ } diff --git a/src/split.c b/src/split.c index e481670..26231c7 100644 --- a/src/split.c +++ b/src/split.c @@ -85,8 +85,8 @@ cleanup_frame (rp_frame *frame) #ifdef MAXSIZE_WINDOWS_ARE_TRANSIENTS if (!win->transient && !(win->hints->flags & PMaxSize - && win->hints->max_width < win->scr->width - && win->hints->max_height < win->scr->height)) + && (win->hints->max_width < win->scr->width + || win->hints->max_height < win->scr->height))) #else if (!win->transient) #endif -- cgit v1.2.3