]> git.mdlowis.com Git - projs/tide.git/commitdiff
general cleanup of warnings and unused functions
authorMike Lowis <mike.lowis@gentex.com>
Mon, 24 Oct 2016 13:18:04 +0000 (09:18 -0400)
committerMike Lowis <mike.lowis@gentex.com>
Mon, 24 Oct 2016 13:18:04 +0000 (09:18 -0400)
edit.h
mouse.c
screen.c
tests/tests.c

diff --git a/edit.h b/edit.h
index f350b6208a927cec307947868a4664ff77bfd760..10556641089dd2a2d5fa6c589a4d5628a47a38be 100644 (file)
--- 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 decd576094569f85e9663b0cfde646ee25386ccd..89b378e9540dd9bfe69ca0ecec798c14921757fd 100644 (file)
--- 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] = {
index 799b2db24fc6d93b67d487fb1182d37f975828d2..cb084cbe9df2ae0e0071c3233b5cc978fb90fc7e 100644 (file)
--- 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);
index 57822ad820c6832f672a5f72086daee27ccad296..0ed3712a54f174a19294f2c751bce878dd5fbcdb 100644 (file)
@@ -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);