Skip to content

Commit 525bd62

Browse files
author
nicm
committed
Miscellaneous unused functions, including one which was basically a
duplicate. Found by lint.
1 parent d604c43 commit 525bd62

8 files changed

+8
-140
lines changed

grid.c

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: grid.c,v 1.4 2009/06/24 22:49:56 nicm Exp $ */
1+
/* $OpenBSD: grid.c,v 1.5 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2008 Nicholas Marriott <[email protected]>
@@ -430,31 +430,6 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny)
430430
}
431431
}
432432

433-
/* Clear a group of cells. */
434-
void
435-
grid_clear_cells(struct grid *gd, u_int px, u_int py, u_int nx)
436-
{
437-
u_int xx;
438-
439-
GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
440-
441-
if (nx == 0)
442-
return;
443-
444-
if (grid_check_x(gd, px) != 0)
445-
return;
446-
if (grid_check_x(gd, px + nx - 1) != 0)
447-
return;
448-
if (grid_check_y(gd, py) != 0)
449-
return;
450-
451-
for (xx = px; xx < px + nx; xx++) {
452-
if (xx >= gd->size[py])
453-
break;
454-
grid_put_cell(gd, xx, py, &grid_default_cell);
455-
}
456-
}
457-
458433
/* Move a group of cells. */
459434
void
460435
grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx)

server-fn.c

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: server-fn.c,v 1.61 2009-05-29 23:25:26 nicm Exp $ */
1+
/* $OpenBSD: server-fn.c,v 1.2 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -75,22 +75,6 @@ server_write_session(
7575
}
7676
}
7777

78-
void
79-
server_write_window(
80-
struct window *w, enum hdrtype type, const void *buf, size_t len)
81-
{
82-
struct client *c;
83-
u_int i;
84-
85-
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
86-
c = ARRAY_ITEM(&clients, i);
87-
if (c == NULL || c->session == NULL)
88-
continue;
89-
if (c->session->curw->window == w)
90-
server_write_client(c, type, buf, len);
91-
}
92-
}
93-
9478
void
9579
server_redraw_client(struct client *c)
9680
{

tmux.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: tmux.h,v 1.11 2009/06/25 06:05:47 nicm Exp $ */
1+
/* $OpenBSD: tmux.h,v 1.12 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -1128,8 +1128,6 @@ void tty_redraw_region(struct tty *, struct window_pane *);
11281128
int tty_open(struct tty *, char **);
11291129
void tty_close(struct tty *, int);
11301130
void tty_free(struct tty *, int);
1131-
void tty_write(
1132-
struct tty *, struct window_pane *, enum tty_cmd, ...);
11331131
void tty_vwrite(
11341132
struct tty *, struct window_pane *, enum tty_cmd, va_list);
11351133

@@ -1155,7 +1153,6 @@ int tty_keys_next(struct tty *, int *, u_char *);
11551153

11561154
/* tty-write.c */
11571155
void tty_write_cmd(struct window_pane *, enum tty_cmd, ...);
1158-
void tty_write_mode(struct window_pane *, int);
11591156

11601157
/* options-cmd.c */
11611158
void set_option_string(struct cmd_ctx *,
@@ -1384,8 +1381,6 @@ void server_write_client(
13841381
struct client *, enum hdrtype, const void *, size_t);
13851382
void server_write_session(
13861383
struct session *, enum hdrtype, const void *, size_t);
1387-
void server_write_window(
1388-
struct window *, enum hdrtype, const void *, size_t);
13891384
void server_redraw_client(struct client *);
13901385
void server_status_client(struct client *);
13911386
void server_redraw_session(struct session *);
@@ -1446,7 +1441,6 @@ void grid_set_utf8(struct grid *, u_int, u_int, const struct grid_utf8 *);
14461441
void grid_clear(struct grid *, u_int, u_int, u_int, u_int);
14471442
void grid_clear_lines(struct grid *, u_int, u_int);
14481443
void grid_move_lines(struct grid *, u_int, u_int, u_int);
1449-
void grid_clear_cells(struct grid *, u_int, u_int, u_int);
14501444
void grid_move_cells(struct grid *, u_int, u_int, u_int, u_int);
14511445
char *grid_string_cells(struct grid *, u_int, u_int, u_int);
14521446

@@ -1560,7 +1554,6 @@ void window_set_active_pane(struct window *, struct window_pane *);
15601554
struct window_pane *window_add_pane(struct window *, int,
15611555
const char *, const char *, const char **, u_int, char **);
15621556
void window_remove_pane(struct window *, struct window_pane *);
1563-
u_int window_index_of_pane(struct window *, struct window_pane *);
15641557
struct window_pane *window_pane_at_index(struct window *, u_int);
15651558
u_int window_count_panes(struct window *);
15661559
void window_destroy_panes(struct window *);
@@ -1607,7 +1600,6 @@ void window_scroll_pageup(struct window_pane *);
16071600
/* window-more.c */
16081601
extern const struct window_mode window_more_mode;
16091602
void window_more_vadd(struct window_pane *, const char *, va_list);
1610-
void printflike2 window_more_add(struct window_pane *, const char *, ...);
16111603

16121604
/* window-choose.c */
16131605
extern const struct window_mode window_choose_mode;

tty-write.c

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: tty-write.c,v 1.15 2009-05-04 17:58:27 nicm Exp $ */
1+
/* $OpenBSD: tty-write.c,v 1.3 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -64,28 +64,3 @@ tty_vwrite_cmd(struct window_pane *wp, enum tty_cmd cmd, va_list ap)
6464
}
6565
}
6666

67-
void
68-
tty_write_mode(struct window_pane *wp, int mode)
69-
{
70-
struct client *c;
71-
u_int i;
72-
73-
if (wp == NULL)
74-
return;
75-
76-
if (wp->window->flags & WINDOW_REDRAW || wp->flags & PANE_REDRAW)
77-
return;
78-
if (wp->window->flags & WINDOW_HIDDEN || wp->flags & PANE_HIDDEN)
79-
return;
80-
81-
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
82-
c = ARRAY_ITEM(&clients, i);
83-
if (c == NULL || c->session == NULL)
84-
continue;
85-
if (c->flags & CLIENT_SUSPENDED)
86-
continue;
87-
88-
tty_update_mode(&c->tty, mode);
89-
}
90-
}
91-

tty.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: tty.c,v 1.6 2009/06/25 05:56:44 nicm Exp $ */
1+
/* $OpenBSD: tty.c,v 1.7 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -556,16 +556,6 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
556556
}
557557
}
558558

559-
void
560-
tty_write(struct tty *tty, struct window_pane *wp, enum tty_cmd cmd, ...)
561-
{
562-
va_list ap;
563-
564-
va_start(ap, cmd);
565-
tty_vwrite(tty, wp, cmd, ap);
566-
va_end(ap);
567-
}
568-
569559
void
570560
tty_vwrite(
571561
struct tty *tty, struct window_pane *wp, enum tty_cmd cmd, va_list ap)

utf8.c

+1-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: utf8.c,v 1.2 2009/06/24 05:35:07 nicm Exp $ */
1+
/* $OpenBSD: utf8.c,v 1.3 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2008 Nicholas Marriott <[email protected]>
@@ -198,7 +198,6 @@ struct utf8_width_entry *utf8_width_root = NULL;
198198
int utf8_overlap(struct utf8_width_entry *, struct utf8_width_entry *);
199199
void utf8_print(struct utf8_width_entry *, int);
200200
u_int utf8_combine(const u_char *);
201-
void utf8_split(u_int, u_char *);
202201

203202
int
204203
utf8_overlap(
@@ -274,28 +273,6 @@ utf8_combine(const u_char *data)
274273
return (uvalue);
275274
}
276275

277-
void
278-
utf8_split(u_int uvalue, u_char *data)
279-
{
280-
memset(data, 0xff, 4);
281-
282-
if (uvalue <= 0x7f)
283-
data[0] = uvalue;
284-
else if (uvalue > 0x7f && uvalue <= 0x7ff) {
285-
data[0] = (uvalue >> 6) | 0xc0;
286-
data[1] = (uvalue & 0x3f) | 0x80;
287-
} else if (uvalue > 0x7ff && uvalue <= 0xffff) {
288-
data[0] = (uvalue >> 12) | 0xe0;
289-
data[1] = ((uvalue >> 6) & 0x3f) | 0x80;
290-
data[2] = (uvalue & 0x3f) | 0x80;
291-
} else if (uvalue > 0xffff && uvalue <= 0x10ffff) {
292-
data[0] = (uvalue >> 18) | 0xf0;
293-
data[1] = ((uvalue >> 12) & 0x3f) | 0x80;
294-
data[2] = ((uvalue >> 6) & 0x3f) | 0x80;
295-
data[3] = (uvalue & 0x3f) | 0x80;
296-
}
297-
}
298-
299276
int
300277
utf8_width(const u_char *udata)
301278
{

window-more.c

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: window-more.c,v 1.2 2009/06/24 23:00:31 nicm Exp $ */
1+
/* $OpenBSD: window-more.c,v 1.3 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -75,16 +75,6 @@ window_more_vadd(struct window_pane *wp, const char *fmt, va_list ap)
7575
screen_write_stop(&ctx);
7676
}
7777

78-
void printflike2
79-
window_more_add(struct window_pane *wp, const char *fmt, ...)
80-
{
81-
va_list ap;
82-
83-
va_start(ap, fmt);
84-
window_more_vadd(wp, fmt, ap);
85-
va_end(ap);
86-
}
87-
8878
struct screen *
8979
window_more_init(struct window_pane *wp)
9080
{

window.c

+1-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: window.c,v 1.5 2009/06/24 22:49:56 nicm Exp $ */
1+
/* $OpenBSD: window.c,v 1.6 2009/06/25 06:15:04 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2007 Nicholas Marriott <[email protected]>
@@ -341,21 +341,6 @@ window_remove_pane(struct window *w, struct window_pane *wp)
341341
window_pane_destroy(wp);
342342
}
343343

344-
u_int
345-
window_index_of_pane(struct window *w, struct window_pane *find)
346-
{
347-
struct window_pane *wp;
348-
u_int n;
349-
350-
n = 0;
351-
TAILQ_FOREACH(wp, &w->panes, entry) {
352-
if (wp == find)
353-
return (n);
354-
n++;
355-
}
356-
fatalx("unknown pane");
357-
}
358-
359344
struct window_pane *
360345
window_pane_at_index(struct window *w, u_int idx)
361346
{

0 commit comments

Comments
 (0)