[project @ 2000-08-15 11:48:06 by simonmar]
authorsimonmar <unknown>
Tue, 15 Aug 2000 11:48:06 +0000 (11:48 +0000)
committersimonmar <unknown>
Tue, 15 Aug 2000 11:48:06 +0000 (11:48 +0000)
Minor cleanups to a few closure types: we don't use StgPtr in
Closures.h anymore.

ghc/includes/Closures.h
ghc/rts/Printer.c
ghc/rts/RtsAPI.c
ghc/rts/Schedule.c

index 5f4eada..ae3eadd 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: Closures.h,v 1.17 2000/03/31 03:09:35 hwloidl Exp $
+ * $Id: Closures.h,v 1.18 2000/08/15 11:48:06 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -150,7 +150,7 @@ typedef struct StgClosure_ {
 
 typedef struct StgMutClosure_ {
     StgHeader   header;
-    StgPtr     *padding;
+    StgWord     padding;
     struct StgMutClosure_ *mut_link;
     struct StgClosure_ *payload[0];
 } StgMutClosure;
@@ -164,23 +164,23 @@ typedef struct {
     StgHeader   header;
     StgWord     n_args;
     StgClosure *fun;
-    StgPtr      payload[0];
+    StgClosure *payload[0];
 } StgPAP;
 
 typedef struct {
     StgHeader   header;
     StgWord     n_args;
     StgClosure *fun;
-    StgPtr      payload[0];
+    StgClosure *payload[0];
 } StgAP_UPD;
 
 typedef struct {
-    StgHeader  header;
-    StgWord    n_ptrs;
-    StgWord    n_words;
-    StgWord    n_instrs;
-    StgWord    stgexpr;
-    StgPtr     payload[0];
+    StgHeader   header;
+    StgWord     n_ptrs;
+    StgWord     n_words;
+    StgWord     n_instrs;
+    StgWord     stgexpr;
+    StgClosure *payload[0];
 } StgBCO;
 
 typedef struct {
@@ -347,7 +347,7 @@ typedef struct StgBlockingQueue_ {
 /* this closure is hanging at the end of a blocking queue in (see RBH.c) */
 typedef struct StgRBHSave_ {
   StgHeader    header;
-  StgPtr       payload[0];     /* 2 words ripped out of the guts of the */
+  StgClosure  *payload[0];     /* 2 words ripped out of the guts of the */
 } StgRBHSave;                  /*  closure holding the blocking queue */
  
 typedef struct StgRBH_ {
index 32e0bc6..a024518 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.27 2000/06/15 13:23:52 daan Exp $
+ * $Id: Printer.c,v 1.28 2000/08/15 11:48:06 simonmar Exp $
  *
  * (c) The GHC Team, 1994-2000.
  *
@@ -107,7 +107,7 @@ void printClosure( StgClosure *obj )
             fprintf(stderr,"AP_UPD("); printPtr((StgPtr)ap->fun);
             for (i = 0; i < ap->n_args; ++i) {
                 fprintf(stderr,", ");
-                printPtr(ap->payload[i]);
+                printPtr((P_)ap->payload[i]);
             }
             fprintf(stderr,")\n");
             break;
@@ -196,8 +196,7 @@ void printClosure( StgClosure *obj )
 
     case TSO:
       fprintf(stderr,"TSO("); 
-      fprintf(stderr,"%d (%x)", 
-              stgCast(StgTSO*,obj)->id, stgCast(StgTSO*,obj));
+      fprintf(stderr,"%d (%p)",((StgTSO*)obj)->id, (StgTSO*)obj);
       fprintf(stderr,")\n"); 
       break;
 
@@ -938,6 +937,8 @@ extern void DEBUG_LoadSymbols( char *name STG_UNUSED )
 
 #include "StoragePriv.h"
 
+void findPtr(P_ p);            /* keep gcc -Wall happy */
+
 void
 findPtr(P_ p)
 {
index f22ec7e..5bc4008 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.18 2000/08/07 23:37:23 qrczak Exp $
+ * $Id: RtsAPI.c,v 1.19 2000/08/15 11:48:06 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -199,7 +199,7 @@ rts_apply (HaskellObj f, HaskellObj arg)
   SET_HDR(ap, &AP_UPD_info, CCS_SYSTEM);
   ap->n_args = 1;
   ap->fun    = f;
-  ap->payload[0] = (P_)arg;
+  ap->payload[0] = arg;
   return (StgClosure *)ap;
 }
 
index ed0389f..32c9ca4 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.74 2000/08/03 11:28:35 simonmar Exp $
+ * $Id: Schedule.c,v 1.75 2000/08/15 11:48:06 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -2724,7 +2724,7 @@ raiseAsync(StgTSO *tso, StgClosure *exception)
              
       ap->n_args = 2;
       ap->fun = cf->handler;   /* :: Exception -> IO a */
-      ap->payload[0] = (P_)exception;
+      ap->payload[0] = exception;
       ap->payload[1] = ARG_TAG(0); /* realworld token */
 
       /* throw away the stack from Sp up to and including the
@@ -2772,7 +2772,7 @@ raiseAsync(StgTSO *tso, StgClosure *exception)
     ap->fun    = (StgClosure *)sp[0];
     sp++;
     for(i=0; i < (nat)words; ++i) {
-      ap->payload[i] = (P_)*sp++;
+      ap->payload[i] = (StgClosure *)*sp++;
     }
     
     switch (get_itbl(su)->type) {