From a30921981e40f146bb4f68a99e1fbc71bf302e67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Mon, 11 Sep 2000 20:50:17 +0200
Subject: [PATCH] Fixed a few warnings.

Rev: src/docode.c:1.82
Rev: src/modules/Regexp/pike_regexp.c:1.18
Rev: src/modules/_Image_TTF/image_ttf.c:1.36
Rev: src/object.c:1.147
Rev: src/pike_memory.c:1.88
Rev: src/pike_memory.h:1.24
---
 src/docode.c                       | 15 ++++++++-------
 src/modules/Regexp/pike_regexp.c   |  4 ++--
 src/modules/_Image_TTF/image_ttf.c |  6 +++---
 src/object.c                       |  5 +++--
 src/pike_memory.c                  |  5 +++--
 src/pike_memory.h                  |  4 ++--
 6 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/docode.c b/src/docode.c
index f7223c7c50..8230f30201 100644
--- a/src/docode.c
+++ b/src/docode.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: docode.c,v 1.81 2000/09/08 16:32:59 grubba Exp $");
+RCSID("$Id: docode.c,v 1.82 2000/09/11 18:42:25 grubba Exp $");
 #include "las.h"
 #include "program.h"
 #include "pike_types.h"
@@ -95,7 +95,7 @@ static int is_efun(node *n, c_fun fun)
 
 static void code_expression(node *n, INT16 flags, char *err)
 {
-  switch(do_docode(check_node_hash(n), flags & ~ DO_POP))
+  switch(do_docode(check_node_hash(n), (INT16)(flags & ~DO_POP)))
   {
   case 0: my_yyerror("Void expression for %s",err);
   case 1: return;
@@ -147,7 +147,7 @@ void do_cond_jump(node *n, int label, int iftrue, int flags)
     return;
   }
 
-  code_expression(n, flags | DO_NOT_COPY, "condition");
+  code_expression(n, (INT16)(flags | DO_NOT_COPY), "condition");
   
   if(flags & DO_POP)
   {
@@ -890,7 +890,7 @@ static int do_docode2(node *n, INT16 flags)
 
   case F_ARG_LIST:
   case F_COMMA_EXPR:
-    tmp1=do_docode(CAR(n),flags & ~WANT_LVALUE);
+    tmp1 = do_docode(CAR(n), (INT16)(flags & ~WANT_LVALUE));
     tmp1+=do_docode(CDR(n),flags);
     return DO_NOT_WARN((INT32)tmp1);
 
@@ -1200,8 +1200,8 @@ static int do_docode2(node *n, INT16 flags)
     if(flags & WANT_LVALUE)
     {
       int mklval=CAR(n) && match_types(CAR(n)->type, string_type_string);
-      tmp1=do_docode(CAR(n),
-		     mklval ? DO_LVALUE_IF_POSSIBLE : 0);
+      tmp1 = do_docode(CAR(n),
+		       (INT16)(mklval ? DO_LVALUE_IF_POSSIBLE : 0));
       if(tmp1==2)
       {
 #ifdef PIKE_DEBUG
@@ -1354,7 +1354,8 @@ static int do_docode2(node *n, INT16 flags)
     return 1;
 
   case F_VAL_LVAL:
-    return do_docode(CAR(n),flags)+do_docode(CDR(n),flags | DO_LVALUE);
+    return do_docode(CAR(n),flags) +
+      do_docode(CDR(n), (INT16)(flags | DO_LVALUE));
     
   default:
     fatal("Infernal compiler error (unknown parse-tree-token).\n");
diff --git a/src/modules/Regexp/pike_regexp.c b/src/modules/Regexp/pike_regexp.c
index c85a79a2ac..343926be57 100644
--- a/src/modules/Regexp/pike_regexp.c
+++ b/src/modules/Regexp/pike_regexp.c
@@ -1,5 +1,5 @@
 /* 
- * $Id: pike_regexp.c,v 1.17 2000/09/08 16:02:29 grubba Exp $
+ * $Id: pike_regexp.c,v 1.18 2000/09/11 18:31:07 grubba Exp $
  *
  * regexp.c - regular expression matching
  *
@@ -421,7 +421,7 @@ static char *reg(int paren,int *flagp)
     }
 
     /* Make a closing node, and hook it on the end. */
-    ender = regnode((paren) ? (char)(CLOSE + parno) : END);
+    ender = regnode((char)((paren) ? (CLOSE + parno) : END));
     regtail(ret, ender);
 
     /* Hook the tails of the branches to the closing node. */
diff --git a/src/modules/_Image_TTF/image_ttf.c b/src/modules/_Image_TTF/image_ttf.c
index 80ca59129f..b9266b943f 100644
--- a/src/modules/_Image_TTF/image_ttf.c
+++ b/src/modules/_Image_TTF/image_ttf.c
@@ -1,12 +1,12 @@
 /*
- * $Id: image_ttf.c,v 1.35 2000/09/08 16:13:27 grubba Exp $
+ * $Id: image_ttf.c,v 1.36 2000/09/11 18:31:57 grubba Exp $
  */
 
 #include "config.h"
 
 
 #include "global.h"
-RCSID("$Id: image_ttf.c,v 1.35 2000/09/08 16:13:27 grubba Exp $");
+RCSID("$Id: image_ttf.c,v 1.36 2000/09/11 18:31:57 grubba Exp $");
 
 #ifdef HAVE_LIBTTF
 #if defined(HAVE_FREETYPE_FREETYPE_H) && defined(HAVE_FREETYPE_FTXKERN_H)
@@ -730,7 +730,7 @@ static void ttf_translate_8bit(TT_CharMap charMap,
 
    THREADS_ALLOW();
    for (i=0; i<len; i++)
-      dest[0][i]=TT_Char_Index(charMap, (TT_UShort)what[i]+base);
+      dest[0][i]=TT_Char_Index(charMap, (TT_UShort)(what[i]+base));
    THREADS_DISALLOW();
 }
 
diff --git a/src/object.c b/src/object.c
index d2674b91c7..05d52d8c6e 100644
--- a/src/object.c
+++ b/src/object.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: object.c,v 1.146 2000/08/24 17:09:41 grubba Exp $");
+RCSID("$Id: object.c,v 1.147 2000/09/11 18:50:17 grubba Exp $");
 #include "object.h"
 #include "dynamic_buffer.h"
 #include "interpret.h"
@@ -1264,7 +1264,8 @@ void gc_mark_object_as_referenced(struct object *o)
 	  gc_mark_svalues(s, 1);
 	}else{
 	  union anything *u;
-	  int rtt = pike_frame->context.prog->identifiers[d].run_time_type;
+	  TYPE_T rtt =
+	    (TYPE_T)pike_frame->context.prog->identifiers[d].run_time_type;
 	  u=(union anything *)(pike_frame->current_storage +
 			       pike_frame->context.prog->identifiers[d].func.offset);
 #ifdef DEBUG_MALLOC
diff --git a/src/pike_memory.c b/src/pike_memory.c
index 9405c7e955..645eb3a6be 100644
--- a/src/pike_memory.c
+++ b/src/pike_memory.c
@@ -10,7 +10,7 @@
 #include "pike_macros.h"
 #include "gc.h"
 
-RCSID("$Id: pike_memory.c,v 1.87 2000/09/10 19:45:19 grubba Exp $");
+RCSID("$Id: pike_memory.c,v 1.88 2000/09/11 18:47:02 grubba Exp $");
 
 /* strdup() is used by several modules, so let's provide it */
 #ifndef HAVE_STRDUP
@@ -40,7 +40,8 @@ long pcharp_strlen(PCHARP a)
   return len;
 }
 
-INLINE p_wchar1 *MEMCHR1(p_wchar1 *p, p_wchar1 c, ptrdiff_t e)
+/* NOTE: Second arg is a p_char2 to avoid warnings on some compilers. */
+INLINE p_wchar1 *MEMCHR1(p_wchar1 *p, p_wchar2 c, ptrdiff_t e)
 {
   while(--e >= 0) if(*(p++) == (p_wchar1)c) return p-1;
   return (p_wchar1 *)0;
diff --git a/src/pike_memory.h b/src/pike_memory.h
index b51c62f164..c90bd054ae 100644
--- a/src/pike_memory.h
+++ b/src/pike_memory.h
@@ -5,7 +5,7 @@
 \*/
 
 /*
- * $Id: pike_memory.h,v 1.23 2000/08/16 15:51:03 grubba Exp $
+ * $Id: pike_memory.h,v 1.24 2000/09/11 18:47:02 grubba Exp $
  */
 #ifndef MEMORY_H
 #define MEMORY_H
@@ -63,7 +63,7 @@ struct generic_mem_searcher
 /* Note to self: Prototypes must be updated manually /Hubbe */
 PMOD_EXPORT ptrdiff_t pcharp_memcmp(PCHARP a, PCHARP b, int sz);
 PMOD_EXPORT long pcharp_strlen(PCHARP a);
-PMOD_EXPORT INLINE p_wchar1 *MEMCHR1(p_wchar1 *p, p_wchar1 c, ptrdiff_t e);
+PMOD_EXPORT INLINE p_wchar1 *MEMCHR1(p_wchar1 *p, p_wchar2 c, ptrdiff_t e);
 PMOD_EXPORT INLINE p_wchar2 *MEMCHR2(p_wchar2 *p, p_wchar2 c, ptrdiff_t e);
 PMOD_EXPORT void swap(char *a, char *b, size_t size);
 PMOD_EXPORT void reverse(char *memory, size_t nitems, size_t size);
-- 
GitLab