comparison main.c @ 699:e9232ce52bf8

Fix signedness checks.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 17 Jan 2020 19:30:48 +0200
parents 28fe6a1be852
children f3ec1cb11cea
comparison
equal deleted inserted replaced
698:28fe6a1be852 699:e9232ce52bf8
1739 { 1739 {
1740 int oldPos = currWin->pos, page = (scrHeight - 4) / 3; 1740 int oldPos = currWin->pos, page = (scrHeight - 4) / 3;
1741 1741
1742 currWin->pos += (c == KEY_NPAGE) ? - page : page; 1742 currWin->pos += (c == KEY_NPAGE) ? - page : page;
1743 1743
1744 if (currWin->pos >= currWin->data->n - page) 1744 if ((size_t) (currWin->pos + page) >= currWin->data->n)
1745 currWin->pos = currWin->data->n - page; 1745 currWin->pos = (int) (currWin->data->n - page);
1746 if (currWin->pos < 0) 1746 if (currWin->pos < 0)
1747 currWin->pos = 0; 1747 currWin->pos = 0;
1748 1748
1749 if (oldPos != currWin->pos) 1749 if (oldPos != currWin->pos)
1750 editState->update = TRUE; 1750 editState->update = TRUE;