summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-03-14 09:50:10 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-03-14 09:50:10 +0000
commit3e1c6f45ac8c7b82c51357ffb6067cb8c8bca08f (patch)
treed2bfdd678ebed4842af9ab13e286adab86d3404e
parentadd611053b27ee4deffcb47a0c7f38249c4433c3 (diff)
Do not use const on struct window_pane, it causes more trouble than it
is worth.
-rw-r--r--usr.bin/tmux/tmux.h8
-rw-r--r--usr.bin/tmux/tty.c45
-rw-r--r--usr.bin/tmux/window.c4
3 files changed, 26 insertions, 31 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index e4ebfbbf6d8..f00af5548fe 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.862 2019/03/12 23:21:45 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.863 2019/03/14 09:50:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1707,7 +1707,7 @@ void tty_update_window_offset(struct window *);
void tty_update_client_offset(struct client *);
void tty_raw(struct tty *, const char *);
void tty_attributes(struct tty *, const struct grid_cell *,
- const struct window_pane *);
+ struct window_pane *);
void tty_reset(struct tty *);
void tty_region_off(struct tty *);
void tty_margin_off(struct tty *);
@@ -1729,7 +1729,7 @@ void tty_start_tty(struct tty *);
void tty_stop_tty(struct tty *);
void tty_set_title(struct tty *, const char *);
void tty_update_mode(struct tty *, int, struct screen *);
-void tty_draw_line(struct tty *, const struct window_pane *, struct screen *,
+void tty_draw_line(struct tty *, struct window_pane *, struct screen *,
u_int, u_int, u_int, u_int, u_int);
int tty_open(struct tty *, char **);
void tty_close(struct tty *);
@@ -2207,7 +2207,7 @@ void window_pane_alternate_off(struct window_pane *,
void window_pane_set_palette(struct window_pane *, u_int, int);
void window_pane_unset_palette(struct window_pane *, u_int);
void window_pane_reset_palette(struct window_pane *);
-int window_pane_get_palette(const struct window_pane *, int);
+int window_pane_get_palette(struct window_pane *, int);
int window_pane_set_mode(struct window_pane *,
const struct window_mode *, struct cmd_find_state *,
struct args *);
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 3527dc5508e..54222b6bee0 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.316 2019/03/13 22:01:22 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.317 2019/03/14 09:50:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -45,9 +45,9 @@ static void tty_cursor_pane_unless_wrap(struct tty *,
const struct tty_ctx *, u_int, u_int);
static void tty_invalidate(struct tty *);
static void tty_colours(struct tty *, const struct grid_cell *);
-static void tty_check_fg(struct tty *, const struct window_pane *,
+static void tty_check_fg(struct tty *, struct window_pane *,
struct grid_cell *);
-static void tty_check_bg(struct tty *, const struct window_pane *,
+static void tty_check_bg(struct tty *, struct window_pane *,
struct grid_cell *);
static void tty_colours_fg(struct tty *, const struct grid_cell *);
static void tty_colours_bg(struct tty *, const struct grid_cell *);
@@ -58,18 +58,16 @@ static void tty_region(struct tty *, u_int, u_int);
static void tty_margin_pane(struct tty *, const struct tty_ctx *);
static void tty_margin(struct tty *, u_int, u_int);
static int tty_large_region(struct tty *, const struct tty_ctx *);
-static int tty_fake_bce(const struct tty *, const struct window_pane *,
- u_int);
+static int tty_fake_bce(const struct tty *, struct window_pane *, u_int);
static void tty_redraw_region(struct tty *, const struct tty_ctx *);
static void tty_emulate_repeat(struct tty *, enum tty_code_code,
enum tty_code_code, u_int);
static void tty_repeat_space(struct tty *, u_int);
static void tty_draw_pane(struct tty *, const struct tty_ctx *, u_int);
static void tty_cell(struct tty *, const struct grid_cell *,
- const struct window_pane *);
-static void tty_default_colours(struct grid_cell *,
- const struct window_pane *);
-static void tty_default_attributes(struct tty *, const struct window_pane *,
+ struct window_pane *);
+static void tty_default_colours(struct grid_cell *, struct window_pane *);
+static void tty_default_attributes(struct tty *, struct window_pane *,
u_int);
#define tty_use_margin(tty) \
@@ -847,7 +845,7 @@ tty_large_region(__unused struct tty *tty, const struct tty_ctx *ctx)
* emulated.
*/
static int
-tty_fake_bce(const struct tty *tty, const struct window_pane *wp, u_int bg)
+tty_fake_bce(const struct tty *tty, struct window_pane *wp, u_int bg)
{
struct grid_cell gc;
@@ -956,8 +954,8 @@ tty_clamp_line(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
/* Clear a line. */
static void
-tty_clear_line(struct tty *tty, const struct window_pane *wp, u_int py,
- u_int px, u_int nx, u_int bg)
+tty_clear_line(struct tty *tty, struct window_pane *wp, u_int py, u_int px,
+ u_int nx, u_int bg)
{
struct client *c = tty->client;
@@ -1075,8 +1073,8 @@ tty_clamp_area(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
/* Clear an area, adjusting to visible part of pane. */
static void
-tty_clear_area(struct tty *tty, const struct window_pane *wp, u_int py,
- u_int ny, u_int px, u_int nx, u_int bg)
+tty_clear_area(struct tty *tty, struct window_pane *wp, u_int py, u_int ny,
+ u_int px, u_int nx, u_int bg)
{
struct client *c = tty->client;
u_int yy;
@@ -1198,8 +1196,8 @@ tty_check_codeset(struct tty *tty, const struct grid_cell *gc)
}
void
-tty_draw_line(struct tty *tty, const struct window_pane *wp,
- struct screen *s, u_int px, u_int py, u_int nx, u_int atx, u_int aty)
+tty_draw_line(struct tty *tty, struct window_pane *wp, struct screen *s,
+ u_int px, u_int py, u_int nx, u_int atx, u_int aty)
{
struct grid *gd = s->grid;
struct grid_cell gc, last;
@@ -1802,8 +1800,7 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx)
}
static void
-tty_cell(struct tty *tty, const struct grid_cell *gc,
- const struct window_pane *wp)
+tty_cell(struct tty *tty, const struct grid_cell *gc, struct window_pane *wp)
{
const struct grid_cell *gcp;
@@ -2117,7 +2114,7 @@ out:
void
tty_attributes(struct tty *tty, const struct grid_cell *gc,
- const struct window_pane *wp)
+ struct window_pane *wp)
{
struct grid_cell *tc = &tty->cell, gc2;
int changed;
@@ -2265,8 +2262,7 @@ tty_colours(struct tty *tty, const struct grid_cell *gc)
}
static void
-tty_check_fg(struct tty *tty, const struct window_pane *wp,
- struct grid_cell *gc)
+tty_check_fg(struct tty *tty, struct window_pane *wp, struct grid_cell *gc)
{
u_char r, g, b;
u_int colours;
@@ -2326,8 +2322,7 @@ tty_check_fg(struct tty *tty, const struct window_pane *wp,
}
static void
-tty_check_bg(struct tty *tty, const struct window_pane *wp,
- struct grid_cell *gc)
+tty_check_bg(struct tty *tty, struct window_pane *wp, struct grid_cell *gc)
{
u_char r, g, b;
u_int colours;
@@ -2499,7 +2494,7 @@ fallback_256:
}
static void
-tty_default_colours(struct grid_cell *gc, const struct window_pane *wp)
+tty_default_colours(struct grid_cell *gc, struct window_pane *wp)
{
struct window *w = wp->window;
struct options *oo = w->options;
@@ -2550,7 +2545,7 @@ tty_default_colours(struct grid_cell *gc, const struct window_pane *wp)
}
static void
-tty_default_attributes(struct tty *tty, const struct window_pane *wp, u_int bg)
+tty_default_attributes(struct tty *tty, struct window_pane *wp, u_int bg)
{
static struct grid_cell gc;
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 686fdccb6c1..ab62b905a8b 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.219 2019/03/12 13:56:30 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.220 2019/03/14 09:50:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1179,7 +1179,7 @@ window_pane_reset_palette(struct window_pane *wp)
}
int
-window_pane_get_palette(const struct window_pane *wp, int c)
+window_pane_get_palette(struct window_pane *wp, int c)
{
int new;