summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--itypes.c6
-rw-r--r--linenoise/linenoise.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/itypes.c b/itypes.c
index d5821638..ba8705e2 100644
--- a/itypes.c
+++ b/itypes.c
@@ -90,7 +90,7 @@ i32_t c_i32(val n, val self)
u32_t c_u32(val n, val self)
{
uint_ptr_t v = c_unum(n);
- if (v < 0 || v > 0xFFFFFFFF)
+ if (v > 0xFFFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned 32 bit range"),
self, n, nao);
return v;
@@ -228,7 +228,7 @@ int c_int(val n, val self)
unsigned int c_uint(val n, val self)
{
uint_ptr_t v = c_unum(n);
- if (v < 0 || v > UINT_MAX)
+ if (v > UINT_MAX)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned int range"),
self, n, nao);
return v;
@@ -253,7 +253,7 @@ unsigned long c_ulong(val n, val self)
{
#if SIZEOF_LONG <= SIZEOF_PTR
uint_ptr_t v = c_unum(n);
- if (v < 0 || v > ULONG_MAX)
+ if (v > ULONG_MAX)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned long range"),
self, n, nao);
return v;
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 998314cf..83a08ec7 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -840,14 +840,14 @@ static void show_help(lino_t *l)
break;
continue;
case ESC:
- if ((seq[0] = lino_os.getch_fn(l->tty_ifs)) < 0)
+ if ((seq[0] = lino_os.getch_fn(l->tty_ifs)) == WEOF)
break;
- if ((seq[1] = lino_os.getch_fn(l->tty_ifs)) < 0)
+ if ((seq[1] = lino_os.getch_fn(l->tty_ifs)) == WEOF)
break;
if (seq[0] == '[') {
if (seq[1] >= '0' && seq[1] <= '9') {
- if ((seq[2] = lino_os.getch_fn(l->tty_ifs)) < 0)
+ if ((seq[2] = lino_os.getch_fn(l->tty_ifs)) == WEOF)
break;
if (seq[2] == '~') {
switch(seq[1]) {
@@ -2261,7 +2261,7 @@ static int edit(lino_t *l, const wchar_t *prompt)
break;
}
- if (c < 0)
+ if (c == WEOF)
goto out;
if (c == 0)
continue;