From 1675ddb4d1880b834a2bd0bbae5a9ffa17eb596d Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 25 Jun 2009 06:15:04 +0000 Subject: [PATCH] Miscellaneous unused functions, including one which was basically a duplicate. Found by lint. --- grid.c | 25 ------------------------- server-fn.c | 16 ---------------- tmux.h | 8 -------- tty-write.c | 25 ------------------------- tty.c | 10 ---------- utf8.c | 23 ----------------------- window-more.c | 10 ---------- window.c | 15 --------------- 8 files changed, 132 deletions(-) diff --git a/grid.c b/grid.c index 071248ee..2df28fd7 100644 --- a/grid.c +++ b/grid.c @@ -430,31 +430,6 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny) } } -/* Clear a group of cells. */ -void -grid_clear_cells(struct grid *gd, u_int px, u_int py, u_int nx) -{ - u_int xx; - - GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); - - if (nx == 0) - return; - - if (grid_check_x(gd, px) != 0) - return; - if (grid_check_x(gd, px + nx - 1) != 0) - return; - if (grid_check_y(gd, py) != 0) - return; - - for (xx = px; xx < px + nx; xx++) { - if (xx >= gd->size[py]) - break; - grid_put_cell(gd, xx, py, &grid_default_cell); - } -} - /* Move a group of cells. */ void grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx) diff --git a/server-fn.c b/server-fn.c index 69926d8e..a025bf0a 100644 --- a/server-fn.c +++ b/server-fn.c @@ -75,22 +75,6 @@ server_write_session( } } -void -server_write_window( - struct window *w, enum hdrtype type, const void *buf, size_t len) -{ - struct client *c; - u_int i; - - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) - continue; - if (c->session->curw->window == w) - server_write_client(c, type, buf, len); - } -} - void server_redraw_client(struct client *c) { diff --git a/tmux.h b/tmux.h index 48c54c91..bd941887 100644 --- a/tmux.h +++ b/tmux.h @@ -1007,8 +1007,6 @@ void tty_redraw_region(struct tty *, struct window_pane *); int tty_open(struct tty *, char **); void tty_close(struct tty *, int); void tty_free(struct tty *, int); -void tty_write( - struct tty *, struct window_pane *, enum tty_cmd, ...); void tty_vwrite( struct tty *, struct window_pane *, enum tty_cmd, va_list); @@ -1034,7 +1032,6 @@ int tty_keys_next(struct tty *, int *, u_char *); /* tty-write.c */ void tty_write_cmd(struct window_pane *, enum tty_cmd, ...); -void tty_write_mode(struct window_pane *, int); /* options-cmd.c */ void set_option_string(struct cmd_ctx *, @@ -1263,8 +1260,6 @@ void server_write_client( struct client *, enum hdrtype, const void *, size_t); void server_write_session( struct session *, enum hdrtype, const void *, size_t); -void server_write_window( - struct window *, enum hdrtype, const void *, size_t); void server_redraw_client(struct client *); void server_status_client(struct client *); void server_redraw_session(struct session *); @@ -1325,7 +1320,6 @@ void grid_set_utf8(struct grid *, u_int, u_int, const struct grid_utf8 *); void grid_clear(struct grid *, u_int, u_int, u_int, u_int); void grid_clear_lines(struct grid *, u_int, u_int); void grid_move_lines(struct grid *, u_int, u_int, u_int); -void grid_clear_cells(struct grid *, u_int, u_int, u_int); void grid_move_cells(struct grid *, u_int, u_int, u_int, u_int); char *grid_string_cells(struct grid *, u_int, u_int, u_int); @@ -1439,7 +1433,6 @@ void window_set_active_pane(struct window *, struct window_pane *); struct window_pane *window_add_pane(struct window *, int, const char *, const char *, const char **, u_int, char **); void window_remove_pane(struct window *, struct window_pane *); -u_int window_index_of_pane(struct window *, struct window_pane *); struct window_pane *window_pane_at_index(struct window *, u_int); u_int window_count_panes(struct window *); void window_destroy_panes(struct window *); @@ -1486,7 +1479,6 @@ void window_scroll_pageup(struct window_pane *); /* window-more.c */ extern const struct window_mode window_more_mode; void window_more_vadd(struct window_pane *, const char *, va_list); -void printflike2 window_more_add(struct window_pane *, const char *, ...); /* window-choose.c */ extern const struct window_mode window_choose_mode; diff --git a/tty-write.c b/tty-write.c index 83aeea75..889075b2 100644 --- a/tty-write.c +++ b/tty-write.c @@ -63,28 +63,3 @@ tty_vwrite_cmd(struct window_pane *wp, enum tty_cmd cmd, va_list ap) } } } - -void -tty_write_mode(struct window_pane *wp, int mode) -{ - struct client *c; - u_int i; - - if (wp == NULL) - return; - - if (wp->window->flags & WINDOW_REDRAW || wp->flags & PANE_REDRAW) - return; - if (wp->window->flags & WINDOW_HIDDEN || wp->flags & PANE_HIDDEN) - return; - - for (i = 0; i < ARRAY_LENGTH(&clients); i++) { - c = ARRAY_ITEM(&clients, i); - if (c == NULL || c->session == NULL) - continue; - if (c->flags & CLIENT_SUSPENDED) - continue; - - tty_update_mode(&c->tty, mode); - } -} diff --git a/tty.c b/tty.c index 1a9307c5..459db0a4 100644 --- a/tty.c +++ b/tty.c @@ -546,16 +546,6 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy) } } -void -tty_write(struct tty *tty, struct window_pane *wp, enum tty_cmd cmd, ...) -{ - va_list ap; - - va_start(ap, cmd); - tty_vwrite(tty, wp, cmd, ap); - va_end(ap); -} - void tty_vwrite( struct tty *tty, struct window_pane *wp, enum tty_cmd cmd, va_list ap) diff --git a/utf8.c b/utf8.c index 9458d8b2..9b499d1c 100644 --- a/utf8.c +++ b/utf8.c @@ -198,7 +198,6 @@ struct utf8_width_entry *utf8_width_root = NULL; int utf8_overlap(struct utf8_width_entry *, struct utf8_width_entry *); void utf8_print(struct utf8_width_entry *, int); u_int utf8_combine(const u_char *); -void utf8_split(u_int, u_char *); int utf8_overlap( @@ -274,28 +273,6 @@ utf8_combine(const u_char *data) return (uvalue); } -void -utf8_split(u_int uvalue, u_char *data) -{ - memset(data, 0xff, 4); - - if (uvalue <= 0x7f) - data[0] = uvalue; - else if (uvalue > 0x7f && uvalue <= 0x7ff) { - data[0] = (uvalue >> 6) | 0xc0; - data[1] = (uvalue & 0x3f) | 0x80; - } else if (uvalue > 0x7ff && uvalue <= 0xffff) { - data[0] = (uvalue >> 12) | 0xe0; - data[1] = ((uvalue >> 6) & 0x3f) | 0x80; - data[2] = (uvalue & 0x3f) | 0x80; - } else if (uvalue > 0xffff && uvalue <= 0x10ffff) { - data[0] = (uvalue >> 18) | 0xf0; - data[1] = ((uvalue >> 12) & 0x3f) | 0x80; - data[2] = ((uvalue >> 6) & 0x3f) | 0x80; - data[3] = (uvalue & 0x3f) | 0x80; - } -} - int utf8_width(const u_char *udata) { diff --git a/window-more.c b/window-more.c index 721dac3d..6f75f120 100644 --- a/window-more.c +++ b/window-more.c @@ -75,16 +75,6 @@ window_more_vadd(struct window_pane *wp, const char *fmt, va_list ap) screen_write_stop(&ctx); } -void printflike2 -window_more_add(struct window_pane *wp, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - window_more_vadd(wp, fmt, ap); - va_end(ap); -} - struct screen * window_more_init(struct window_pane *wp) { diff --git a/window.c b/window.c index 834f1248..37e65d83 100644 --- a/window.c +++ b/window.c @@ -327,21 +327,6 @@ window_remove_pane(struct window *w, struct window_pane *wp) window_pane_destroy(wp); } -u_int -window_index_of_pane(struct window *w, struct window_pane *find) -{ - struct window_pane *wp; - u_int n; - - n = 0; - TAILQ_FOREACH(wp, &w->panes, entry) { - if (wp == find) - return (n); - n++; - } - fatalx("unknown pane"); -} - struct window_pane * window_pane_at_index(struct window *w, u_int idx) {