summaryrefslogtreecommitdiffstats
path: root/linenoise/linenoise.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-20 06:46:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-20 06:46:58 -0700
commit95e3dbd17b7620d885a3fe92c6d3d6ae4e6fb570 (patch)
treebc009d32ee0da09b1287bb2a83c5a239e1129175 /linenoise/linenoise.c
parentd167da13024b536dc75b00a9f458de1bc7518b22 (diff)
downloadtxr-95e3dbd17b7620d885a3fe92c6d3d6ae4e6fb570.tar.gz
txr-95e3dbd17b7620d885a3fe92c6d3d6ae4e6fb570.tar.bz2
txr-95e3dbd17b7620d885a3fe92c6d3d6ae4e6fb570.zip
linenoise: g++ signed/unsigned warnings.
* linenoise/linenoise.c (free_completions): Use size_t for iterating over completions vector. (complete_line): Likewise. (edit_insert, edit_insert_str): Cast size_t value to int before comparing with l->dlen.
Diffstat (limited to 'linenoise/linenoise.c')
-rw-r--r--linenoise/linenoise.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 1f9c0bc9..d49a3d67 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -433,7 +433,7 @@ static void undo_renumber_hist_idx(lino_t *l, int delta)
/* Free a list of completion option populated by lino_add_completion(). */
static void free_completions(lino_completions_t *lc) {
- int i;
+ size_t i;
for (i = 0; i < lc->len; i++)
free(lc->cvec[i]);
if (lc->cvec != NULL)
@@ -485,7 +485,8 @@ static int complete_line(lino_t *ls, int substring) {
if (lc.len == 0) {
generate_beep(ls);
} else {
- int stop = 0, i = 0;
+ int stop = 0;
+ size_t i = 0;
while(!stop) {
/* Show completion or original buffer */
@@ -1270,7 +1271,7 @@ static void delete_sel(lino_t *l)
*
* On error writing to the terminal -1 is returned, otherwise 0. */
static int edit_insert(lino_t *l, char c) {
- if (l->dlen < sizeof l->data - 1) {
+ if (l->dlen < (int) sizeof l->data - 1) {
record_triv_undo(l);
delete_sel(l);
if (l->dpos == l->dlen) {
@@ -1299,7 +1300,7 @@ static int edit_insert(lino_t *l, char c) {
static int edit_insert_str(lino_t *l, const char *s, int nchar)
{
- if (l->dlen < sizeof l->data - nchar) {
+ if (l->dlen < (int) sizeof l->data - nchar) {
record_undo(l);
delete_sel(l);