diff options
Diffstat (limited to 'src/c_keys.c')
-rw-r--r-- | src/c_keys.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/c_keys.c b/src/c_keys.c index cd3e6f1..78b3d8f 100644 --- a/src/c_keys.c +++ b/src/c_keys.c @@ -29,8 +29,8 @@ int16_t int16_t c_home_key(t_caps *tcaps) { - int16_t i; - int16_t j; + uint32_t i; + int16_t j; i = tcaps->cpos; j = tcaps->lpos; @@ -40,7 +40,7 @@ int16_t while (--j > 0) tputs(tgetstr("up", NULL), 1, ft_putchar); tputs(tgetstr("cr", NULL), 1, ft_putchar); - while ((uint32_t)++i <= 13) + while (++i <= 13) tputs(tgetstr("nd", NULL), 1, ft_putchar); } else @@ -54,24 +54,24 @@ int16_t } int16_t - c_end_key(uint16_t size, t_caps *tcaps) + c_end_key(uint16_t size, uint32_t plen, t_caps *tcaps) { uint16_t i; uint16_t j; i = tcaps->cpos; j = tcaps->lpos; - if (tcaps->cpos < size && j < tcaps->nlines) + if ((tcaps->cpos < size) && (j < tcaps->nlines)) { i = 0; - while (j < (tcaps->nlines)) + while (j < tcaps->nlines) { tputs(tgetstr("do", NULL), 1, ft_putchar); i += tcaps->ws.ws_col; j++; } tputs(tgetstr("cr", NULL), 1, ft_putchar); - while (i++ < (size + 13)) + while (i++ < (size + plen)) tputs(tgetstr("nd", NULL), 1, ft_putchar); } else @@ -85,8 +85,8 @@ int16_t int16_t c_key_right(uint32_t len, uint32_t plen, t_caps *tcaps) { - if ((((tcaps->cpos + plen + 1) % (tcaps->ws.ws_col)) == 0) - && tcaps->cpos < len) + if ((((tcaps->cpos + plen + 1) % (tcaps->ws.ws_col)) == 0) && + tcaps->cpos < len) { tputs(tgetstr("do", NULL), 1, ft_putchar); tputs(tgetstr("cr", NULL), 1, ft_putchar); @@ -107,11 +107,11 @@ int16_t int32_t pos; pos = -1; - if (((tcaps->cpos + plen) % (tcaps->ws.ws_col)) == 0 - && tcaps->cpos >= 1) + if (((tcaps->cpos + plen) % tcaps->ws.ws_col) == 0 && + tcaps->cpos >= 1) { tputs(tgetstr("up", NULL), 1, ft_putchar); - while(++pos <= (tcaps->ws.ws_col)) + while (++pos <= tcaps->ws.ws_col) tputs(tgetstr("nd", NULL), 1, ft_putchar); tcaps->cpos--; tcaps->lpos--; |