aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jim-aio.c2
-rw-r--r--jim-signal.c4
-rw-r--r--jim-tty.c4
-rw-r--r--jim.c4
-rw-r--r--jim.h2
-rw-r--r--utf8.c2
6 files changed, 9 insertions, 9 deletions
diff --git a/jim-aio.c b/jim-aio.c
index 878fabc..313108b 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -224,7 +224,7 @@ static int ssl_reader(struct AioFile *af, char *buf, int len)
static const char *ssl_getline(struct AioFile *af, char *buf, int len)
{
- int i;
+ size_t i;
for (i = 0; i < len + 1; i++) {
if (SSL_read(af->ssl, &buf[i], 1) != 1) {
if (i == 0) {
diff --git a/jim-signal.c b/jim-signal.c
index 5fb9c9f..cec541a 100644
--- a/jim-signal.c
+++ b/jim-signal.c
@@ -16,9 +16,9 @@
#define MAX_SIGNALS_WIDE (sizeof(jim_wide) * 8)
#if defined(NSIG)
- #define MAX_SIGNALS ((NSIG < MAX_SIGNALS_WIDE) ? NSIG : MAX_SIGNALS_WIDE)
+ #define MAX_SIGNALS (int)((NSIG < MAX_SIGNALS_WIDE) ? NSIG : MAX_SIGNALS_WIDE)
#else
- #define MAX_SIGNALS MAX_SIGNALS_WIDE
+ #define MAX_SIGNALS (int)MAX_SIGNALS_WIDE
#endif
static jim_wide *sigloc;
diff --git a/jim-tty.c b/jim-tty.c
index c120b69..0ccab7b 100644
--- a/jim-tty.c
+++ b/jim-tty.c
@@ -146,7 +146,7 @@ static void JimListAddPair(Jim_Interp *interp, Jim_Obj *listObjPtr, const char *
Jim_Obj *Jim_GetTtySettings(Jim_Interp *interp, int fd)
{
struct termios tio;
- int i;
+ size_t i;
const char *p;
Jim_Obj *listObjPtr;
speed_t speed;
@@ -215,7 +215,7 @@ int Jim_SetTtySettings(Jim_Interp *interp, int fd, Jim_Obj *dictObjPtr)
int opt;
const struct flag_name_map *p;
long l;
- int j;
+ size_t j;
if (Jim_GetEnum(interp, nameObj, tty_settings_names, &opt, "setting", JIM_ERRMSG | JIM_ENUM_ABBREV) != JIM_OK) {
return JIM_ERR;
diff --git a/jim.c b/jim.c
index 1270330..00b4242 100644
--- a/jim.c
+++ b/jim.c
@@ -5381,11 +5381,11 @@ int Jim_Collect(Jim_Interp *interp)
Jim_Obj *objPtr;
/* Avoid recursive calls */
- if (interp->lastCollectId == -1) {
+ if (interp->lastCollectId == (unsigned long)~0) {
/* Jim_Collect() already running. Return just now. */
return 0;
}
- interp->lastCollectId = -1;
+ interp->lastCollectId = ~0;
/* Mark all the references found into the 'mark' hash table.
* The references are searched in every live object that
diff --git a/jim.h b/jim.h
index 1dd0f0c..c2b8824 100644
--- a/jim.h
+++ b/jim.h
@@ -535,7 +535,7 @@ typedef struct Jim_Interp {
unsigned long referenceNextId; /* Next id for reference. */
struct Jim_HashTable references; /* References hash table. */
unsigned long lastCollectId; /* reference max Id of the last GC
- execution. It's set to -1 while the collection
+ execution. It's set to ~0 while the collection
is running as sentinel to avoid to recursive
calls via the [collect] command inside
finalizers. */
diff --git a/utf8.c b/utf8.c
index 56a036b..ffee89d 100644
--- a/utf8.c
+++ b/utf8.c
@@ -199,7 +199,7 @@ static int utf8_map_case(const struct casemap *mapping, int num, int ch)
static int cmp_range(const void *key, const void *cm)
{
const struct utf8range *range = (const struct utf8range *)cm;
- int ch = *(int *)key;
+ unsigned ch = *(unsigned *)key;
if (ch < range->lower) {
return -1;
}