]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed some lint
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 15 May 2018 19:56:04 +0000 (15:56 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 15 May 2018 19:56:04 +0000 (15:56 -0400)
TODO.md
analyze.sh
config.mk
lib/buf.c
lib/job.c
lib/utf8.c
lib/x11.c
tests/lib/buf.c

diff --git a/TODO.md b/TODO.md
index fe4b80ec14ecb55abf1278e084c4ee1feaf05e95..54fab8ede4c3dd2cc26919d3c8a0e10a66e30ffa 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -3,6 +3,8 @@
 BUGS:
 
 * Repeatedly pasting eventually causes an assertion
+* Segfault while scrolling through testdocs/sherlock.txt
+* Middle click on selected command does not execute
 
 Up Next:
 
index 14cd79bebfae7507f450a801dad87d685f62fff5..3de6fcb600e78817468c9d1c4c01909e4842d260 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/sh
-(
-    flawfinder -DQSI -m 0 "$@" | tee flaws.txt
-       rats -i -lc -w 3 "$@"| tee -a flaws.txt
-) | grep '.\+:[0-9]\+'
+
+type cppcheck && cppcheck \
+       --enable=all \
+       --std=c99 \
+       --inconclusive \
+       --quiet \
+       -I inc/ \
+       tide.c lib/*.c
index b46121fe658e9e2840a5900796dcf932f855741e..16a1cff462c99d4d814851cf57d29fb94d77b9bb 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -16,7 +16,7 @@ INCS += -I/usr/include/freetype2
 # Compiler Setup
 CC = cc
 CFLAGS = -g --std=c99 -MMD $(INCS)
-#CFLAGS += -Wall -Werror
+CFLAGS += -Wall -Werror
 
 # Linker Setup
 LD = $(CC)
index 47350d3aa70a56893bf609397370633ca93b3328..f00477c0970880b710072026d169d43a91727a8c 100644 (file)
--- a/lib/buf.c
+++ b/lib/buf.c
@@ -252,14 +252,6 @@ size_t buf_eol(Buf* buf, size_t off) {
     return off;
 }
 
-void buf_selline(Buf* buf) {
-    Sel sel = getsel(buf);
-    sel.beg = buf_bol(buf, sel.end);
-    sel.end = buf_eol(buf, sel.end);
-    sel.end = buf_byrune(buf, sel.end, RIGHT);
-    buf->selection = sel;
-}
-
 void buf_selword(Buf* buf, bool (*isword)(Rune)) {
     Sel sel = getsel(buf);
     for (; isword(buf_getrat(buf, sel.beg-1)); sel.beg--);
index e8a79bbfe02b8ab77be5d406f79f6b10b00b3a03..7d8f57c0309681bd1f0c2a5fecf390cf5fd0362f 100644 (file)
--- a/lib/job.c
+++ b/lib/job.c
@@ -11,7 +11,7 @@
 
 struct PipeData {
     char* data;
-    size_t ndata;
+    ssize_t ndata;
     size_t nwrite;
     View* dest;
 };
index dc095ac82c443bd1ce6bf9fac02e6421d1208ede..813bf8c830d74721e8632eb4e7f275a52e6ee42c 100644 (file)
@@ -91,7 +91,7 @@ bool rissigil(Rune r) {
 }
 
 bool risfile(Rune r) {
-    return (risword(r) || r == '/' || r == '.' || r == ':' ||  r == '-' || r == '.' || r == '~');
+    return (risword(r) || r == '/' || r == '.' || r == ':' ||  r == '-' || r == '~');
 }
 
 bool riscmd(Rune r) {
index c958b5e47c07f71551e9753c908c6a443c5d28b2..0993524f755a65322cc483597eb061494bc961f7 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -45,7 +45,6 @@ struct XWin {
 };
 
 /******************************************************************************/
-static Atom XA_REGISTER, XA_DEREGISTER;
 static struct XWin X;
 static int KeyBtnState;
 static WinRegion Focused = EDIT;
@@ -295,6 +294,7 @@ static void draw_statbox(drawcsr* csr) {
     switch (win_view(EDIT)->buffer.status) {
         case NORMAL:   draw_rect(TagsBg, 0, 0, ScrollWidth, X.height/4); break;
         case MODIFIED: draw_rect(Purple, 0, 0, ScrollWidth, X.height/4); break;
+        case OUTDATED: draw_rect(Orange, 0, 0, ScrollWidth, X.height/4); break;
         case ERRORED:  draw_rect(Red, 0, 0, ScrollWidth, X.height/4);    break;
     }
 }
index 6fe5d2f16077e88bd3cd5398bb58e5528679849b..7e130d5bf27e0c12416c076a06d12560a2f3e1e3 100644 (file)
@@ -10,6 +10,7 @@ static void set_buffer_text(char* str) {
     buf_puts(&TestBuf, str);
 }
 
+/*
 static bool buf_text_eq(char* str) {
     buf_selall(&TestBuf);
     char* bstr = buf_gets(&TestBuf);
@@ -17,6 +18,7 @@ static bool buf_text_eq(char* str) {
     free(bstr);
     return (ret == 0);
 }
+*/
 
 TEST_SUITE(BufferTests) {
     /* Initializing