From: Mike Lowis Date: Mon, 24 Oct 2016 13:18:04 +0000 (-0400) Subject: general cleanup of warnings and unused functions X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5fe68e2b4633d14de9d2b0c9119f2514e3a6b9b5;p=projs%2Ftide.git general cleanup of warnings and unused functions --- diff --git a/edit.h b/edit.h index f350b62..1055664 100644 --- a/edit.h +++ b/edit.h @@ -64,13 +64,11 @@ Rune buf_get(Buf* buf, unsigned pos); bool buf_iseol(Buf* buf, unsigned pos); unsigned buf_bol(Buf* buf, unsigned pos); unsigned buf_eol(Buf* buf, unsigned pos); - unsigned buf_bow(Buf* buf, unsigned pos); unsigned buf_eow(Buf* buf, unsigned pos); unsigned buf_lscan(Buf* buf, unsigned pos, Rune r); unsigned buf_rscan(Buf* buf, unsigned pos, Rune r); void buf_find(Buf* buf, unsigned* beg, unsigned* end); - unsigned buf_end(Buf* buf); unsigned buf_byrune(Buf* buf, unsigned pos, int count); unsigned buf_byline(Buf* buf, unsigned pos, int count); @@ -206,9 +204,6 @@ typedef struct { void screen_update(Buf* buf, unsigned crsr, unsigned* csrx, unsigned* csry); unsigned screen_getoff(Buf* buf, unsigned pos, unsigned row, unsigned col); - -void screen_getcoords(Buf* buf, unsigned pos, unsigned* posx, unsigned* posy); - void screen_setsize(Buf* buf, unsigned nrows, unsigned ncols); void screen_getsize(unsigned* nrows, unsigned* ncols); Row* screen_getrow(unsigned row); diff --git a/mouse.c b/mouse.c index decd576..89b378e 100644 --- a/mouse.c +++ b/mouse.c @@ -19,7 +19,7 @@ void bigword(MouseEvent* mevnt) { DotBeg = mbeg, DotEnd = mend-1; } -void select(MouseEvent* mevnt) { +void selection(MouseEvent* mevnt) { (void)mevnt; unsigned bol = buf_bol(&Buffer, DotEnd); Rune r = buf_get(&Buffer, DotEnd); @@ -50,7 +50,7 @@ void select(MouseEvent* mevnt) { void search(MouseEvent* mevnt) { if (DotBeg == DotEnd) { move_cursor(mevnt); - select(mevnt); + selection(mevnt); } buf_find(&Buffer, &DotBeg, &DotEnd); unsigned x, y; @@ -85,7 +85,7 @@ struct { void (*Actions[5][3])(MouseEvent* mevnt) = { [MOUSE_LEFT] = { [SINGLE_CLICK] = move_cursor, - [DOUBLE_CLICK] = select, + [DOUBLE_CLICK] = selection, [TRIPLE_CLICK] = bigword, }, [MOUSE_MIDDLE] = { diff --git a/screen.c b/screen.c index 799b2db..cb084cb 100644 --- a/screen.c +++ b/screen.c @@ -162,24 +162,6 @@ static void sync_view(Buf* buf, unsigned csr) { } } -void screen_getcoords(Buf* buf, unsigned pos, unsigned* posx, unsigned* posy) { - for (unsigned y = 0; y < NumRows; y++) { - unsigned start = Rows[y]->off; - unsigned end = Rows[y]->off + Rows[y]->rlen - 1; - if (start <= pos && pos <= end) { - unsigned off = start; - for (unsigned x = 0; x < NumCols;) { - if (off == pos) { - *posy = y, *posx = x; - return; - } - x += runewidth(x, buf_get(buf,off++)); - } - break; - } - } -} - void screen_update(Buf* buf, unsigned csr, unsigned* csrx, unsigned* csry) { /* scroll the view and reflow the screen lines */ sync_view(buf, csr); diff --git a/tests/tests.c b/tests/tests.c index 57822ad..0ed3712 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -9,7 +9,10 @@ unsigned DotBeg; unsigned DotEnd; enum ColorScheme ColorBase; -void move_pointer(unsigned x, unsigned y) { } +void move_pointer(unsigned x, unsigned y) { + (void)x; + (void)y; +} int main(int argc, char** argv) { atf_init(argc,argv);