[project @ 2000-05-09 10:00:35 by sewardj]
authorsewardj <unknown>
Tue, 9 May 2000 10:00:36 +0000 (10:00 +0000)
committersewardj <unknown>
Tue, 9 May 2000 10:00:36 +0000 (10:00 +0000)
Fix various compile-time warnings in the assembler and evaluator.

ghc/includes/Assembler.h
ghc/rts/Assembler.c
ghc/rts/Evaluator.c

index 7ac7d9c..017cf67 100644 (file)
@@ -1,6 +1,6 @@
 
 /* -----------------------------------------------------------------------------
- * $Id: Assembler.h,v 1.13 2000/04/27 16:35:29 sewardj Exp $
+ * $Id: Assembler.h,v 1.14 2000/05/09 10:00:35 sewardj Exp $
  *
  * (c) The GHC Team 1994-1998.
  *
@@ -280,6 +280,7 @@ extern AsmVar asmPushRefNoOp   ( AsmBCO bco, StgPtr p );
 
 extern void   asmAddRefObject  ( AsmObject obj, AsmObject p );
 extern void   asmAddRefNoOp    ( AsmObject obj, StgPtr p );
+extern void   asmAddRefHugs    ( AsmObject obj,int /*Name*/ n );
 
 extern AsmVar asmAllocCONSTR   ( AsmBCO bco, AsmInfo info );
 
index 2418d84..76878e9 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (c) 1994-1998.
  *
  * $RCSfile: Assembler.c,v $
- * $Revision: 1.27 $
- * $Date: 2000/04/27 16:35:30 $
+ * $Revision: 1.28 $
+ * $Date: 2000/05/09 10:00:35 $
  *
  * This module provides functions to construct BCOs and other closures
  * required by the bytecode compiler.
@@ -62,6 +62,12 @@ static StgClosure* asmAlloc ( nat size );
 extern void* getNameOrTupleClosureCPtr ( int /*Cell*/ c );
 
 
+/* Defined in this file ... */
+AsmObject    asmNewObject      ( void );
+void         asmAddEntity      ( AsmObject, Asm_Kind, StgWord );
+int          asmCalcHeapSizeW  ( AsmObject );
+StgClosure*  asmDerefEntity    ( Asm_Entity );
+
 /* --------------------------------------------------------------------------
  * Initialising and managing objects and entities
  * ------------------------------------------------------------------------*/
@@ -306,7 +312,7 @@ void asmCopyAndLink ( void )
                }
             }
 
-            ASSERT(k == bco->n_instrs);
+            ASSERT((unsigned int)k == bco->n_instrs);
             break;
          }
 
@@ -415,7 +421,7 @@ AsmCon asmBeginCon( AsmInfo info )
    return con;
 }
 
-void asmEndCon( AsmCon con )
+void asmEndCon( AsmCon con __attribute__ ((unused)) )
 {
 }
 
@@ -426,7 +432,7 @@ AsmCAF asmBeginCAF( void )
    return caf;
 }
 
-void asmEndCAF( AsmCAF caf )
+void asmEndCAF( AsmCAF caf __attribute__ ((unused)) )
 {
 }
 
@@ -441,7 +447,7 @@ AsmBCO asmBeginBCO( int /*StgExpr*/ e )
    return bco;
 }
 
-void asmEndBCO( AsmBCO bco )
+void asmEndBCO( AsmBCO bco __attribute__ ((unused)) )
 {
 }
 
@@ -1080,7 +1086,7 @@ AsmSp asmBeginCase( AsmBCO bco )
     return bco->sp;
 }
 
-void asmEndCase( AsmBCO bco )
+void asmEndCase( AsmBCO bco __attribute__ ((unused)) )
 {
 }
 
@@ -1690,7 +1696,7 @@ void asmEndPack( AsmBCO bco, AsmVar v, AsmSp start, AsmInfo info )
     setSp(bco, start);
 }
 
-void asmBeginUnpack( AsmBCO bco )
+void asmBeginUnpack( AsmBCO bco __attribute__ ((unused)) )
 {
     /* dummy to make it look prettier */
 }
index e0a6558..7043e27 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (c) 1994-1998.
  *
  * $RCSfile: Evaluator.c,v $
- * $Revision: 1.50 $
- * $Date: 2000/04/27 16:35:30 $
+ * $Revision: 1.51 $
+ * $Date: 2000/05/09 10:00:36 $
  * ---------------------------------------------------------------------------*/
 
 #include "Rts.h"
@@ -1197,7 +1197,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 )
                     StgClosure* o;
                     SSS; o = (StgClosure*)grabHpNonUpd(Stablezh_sizeW); LLL;
                     SET_HDR(o,StablePtr_con_info,??);
-                    payloadWord(o,0) = xPopTaggedStable();
+                    payloadWord(o,0) = (W_)xPopTaggedStable();
                     IF_DEBUG(evaluator,
                              fprintf(stderr,"\tBuilt "); 
                              SSS;
@@ -1628,7 +1628,7 @@ static inline void            PushTaggedRealWorld( void            )
        inline void            PushTaggedDouble   ( StgDouble     x ) 
    { gSp -= sizeofW(StgDouble);     ASSIGN_DBL(gSp,x); PushTag(DOUBLE_TAG); }
        inline void            PushTaggedStablePtr   ( StgStablePtr  x ) 
-   { gSp -= sizeofW(StgStablePtr);  *gSp = x;          PushTag(STABLE_TAG); }
+   { gSp -= sizeofW(StgStablePtr);  *gSp = (W_)x;      PushTag(STABLE_TAG); }
 static inline void            PushTaggedBool     ( int           x ) 
    { PushTaggedInt(x); }
 
@@ -1655,7 +1655,7 @@ static inline void            PopTaggedRealWorld ( void )
    { StgDouble r; PopTag(DOUBLE_TAG);  r = PK_DBL(gSp);                  
      gSp += sizeofW(StgDouble);     return r;}
        inline StgStablePtr    PopTaggedStablePtr    ( void ) 
-   { StgInt    r; PopTag(STABLE_TAG);  r = *stgCast(StgStablePtr*, gSp); 
+   { StgStablePtr r; PopTag(STABLE_TAG);  r = *stgCast(StgStablePtr*, gSp); 
      gSp += sizeofW(StgStablePtr);  return r;}
 
 
@@ -2266,6 +2266,7 @@ void SloppifyIntegerEnd ( StgPtr arr0 )
 }
 
 
+__attribute__ ((unused))
 static void myStackCheck ( Capability* cap )
 {
    /* fprintf(stderr, "myStackCheck\n"); */
@@ -2455,8 +2456,8 @@ static void* enterBCO_primop1 ( int primop1code )
         case i_intToAddr:       OP_I_A((StgAddr)x);  break;  /*  ToDo */
         case i_addrToInt:       OP_A_I((StgInt)x);   break;  /* ToDo */
 
-        case i_intToStable:     OP_I_s(x);           break;
-        case i_stableToInt:     OP_s_I(x);           break;
+        case i_intToStable:     OP_I_s((StgStablePtr)x); break;
+        case i_stableToInt:     OP_s_I((W_)x);           break;
 
         case i_indexCharOffAddr:   OP_AI_C(indexCharOffAddrzh(r,x,y));      break;
         case i_readCharOffAddr:    OP_AI_C(indexCharOffAddrzh(r,x,y));      break;
@@ -3106,7 +3107,7 @@ static void* enterBCO_primop2 ( int primop2code,
                 deleteThread(tso);
                 if (tso == cap->rCurrentTSO) { /* suicide */
                     *return2 = ThreadFinished;
-                    return (void*)(1+(NULL));
+                    return (void*)(1+(char*)(NULL));
                 }
                 break;
             }