diff --git a/src/las.c b/src/las.c
index 03125a85f0a4659a84c6e852ba1901b184fe9632..895c3aca8aebbaae102fa6e052ffb9e1b499d664 100644
--- a/src/las.c
+++ b/src/las.c
@@ -166,7 +166,7 @@ node *mknode(short token,node *a,node *b)
   case F_APPLY:
     if(a && a->token == F_CONSTANT &&
        a->u.sval.type == T_FUNCTION &&
-       a->u.sval.subtype == -1)
+       (short)a->u.sval.subtype == -1)
     {
       res->node_info |= a->u.sval.u.efun->flags;
     }else{
@@ -414,7 +414,7 @@ node *mksvaluenode(struct svalue *s)
 
   case T_FUNCTION:
   {
-    if(s->subtype != -1)
+    if((short)s->subtype != -1)
     {
       if(s->u.object == &fake_object)
 	return mkidentifiernode(s->subtype);
@@ -1167,7 +1167,7 @@ static void optimize(node *n)
     case F_APPLY:
       if(CAR(n)->token == F_CONSTANT &&
 	 CAR(n)->u.sval.type == T_FUNCTION &&
-	 CAR(n)->u.sval.subtype == -1 && /* driver fun? */
+	 (short)CAR(n)->u.sval.subtype == -1 && /* driver fun? */
 	 CAR(n)->u.sval.u.efun->optimize)
       {
 	if(tmp1=CAR(n)->u.sval.u.efun->optimize(n))
@@ -1372,7 +1372,7 @@ static void optimize(node *n)
 	   CAR(opnode) &&
 	   CAR(opnode)->token == F_CONSTANT &&
 	   CAR(opnode)->u.sval.type == T_FUNCTION &&
-	   CAR(opnode)->u.sval.subtype == -1)
+	   (short)CAR(opnode)->u.sval.subtype == -1)
 	{
 	  if(CAR(opnode)->u.sval.u.efun->function == f_gt)
 	    oper=F_GT;
diff --git a/src/lex.c b/src/lex.c
index 901a03d3513b42c28086129e25b9660c09868a22..c1494c0235b91fc8fa157643b40d88f153513edb 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -343,7 +343,7 @@ char *get_f_name(int n)
     if(fp && fp->context.prog &&
        (int)fp->context.prog->num_constants > (int)(n-F_MAX_OPCODE) &&
        fp->context.prog->constants[n-F_MAX_OPCODE].type==T_FUNCTION &&
-       fp->context.prog->constants[n-F_MAX_OPCODE].subtype == -1 &&
+       (short)fp->context.prog->constants[n-F_MAX_OPCODE].subtype == -1 &&
        fp->context.prog->constants[n-F_MAX_OPCODE].u.efun)
     {
       return fp->context.prog->constants[n-F_MAX_OPCODE].u.efun->name->str;