From 47ff06307547e20eff37477a9bc9be80a460917a Mon Sep 17 00:00:00 2001 From: panne Date: Sun, 22 Aug 2004 15:50:42 +0000 Subject: [PATCH] [project @ 2004-08-22 15:50:39 by panne] Removed a few "use of cast expressions as lvalues is deprecated" warnings. Note that gcc is really pedantic nowadays, so we have to go via a temporary to avoid "cast does not match function type" warnings. --- ghc/rts/Linker.c | 8 ++++++-- ghc/rts/Stable.c | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 12fd913..dbf560e 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -2682,6 +2682,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, Elf_Word* pP = (Elf_Word*)P; Elf_Addr A = *pP; Elf_Addr S; + void* S_tmp; Elf_Addr value; IF_DEBUG(linker,belch( "Rel entry %3d is raw(%6p %6p)", @@ -2703,7 +2704,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, } else { /* No, so look up the name in our global table. */ symbol = strtab + sym.st_name; - (void*)S = lookupSymbol( symbol ); + S_tmp = lookupSymbol( symbol ); + S = (Elf_Addr)S_tmp; } if (!S) { belch("%s: unknown symbol `%s'", oc->fileName, symbol); @@ -2762,6 +2764,7 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, Elf_Addr info = rtab[j].r_info; Elf_Addr A = rtab[j].r_addend; Elf_Addr S; + void* S_tmp; Elf_Addr value; # if defined(sparc_TARGET_ARCH) Elf_Word* pP = (Elf_Word*)P; @@ -2797,7 +2800,8 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, } else { /* No, so look up the name in our global table. */ symbol = strtab + sym.st_name; - (void*)S = lookupSymbol( symbol ); + S_tmp = lookupSymbol( symbol ); + S = (Elf_Addr)S_tmp; #ifdef ELF_FUNCTION_DESC /* If a function, already a function descriptor - we would diff --git a/ghc/rts/Stable.c b/ghc/rts/Stable.c index c0520da..815bac7 100644 --- a/ghc/rts/Stable.c +++ b/ghc/rts/Stable.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Stable.c,v 1.28 2004/08/13 13:10:45 simonmar Exp $ + * $Id: Stable.c,v 1.29 2004/08/22 15:50:42 panne Exp $ * * (c) The GHC Team, 1998-2002 * @@ -164,6 +164,7 @@ StgWord lookupStableName(StgPtr p) { StgWord sn; + void* sn_tmp; if (stable_ptr_free == NULL) { enlargeStablePtrTable(); @@ -174,7 +175,8 @@ lookupStableName(StgPtr p) */ p = (StgPtr)removeIndirections((StgClosure*)p); - (void *)sn = lookupHashTable(addrToStableHash,(W_)p); + sn_tmp = lookupHashTable(addrToStableHash,(W_)p); + sn = (StgWord)sn_tmp; if (sn != 0) { ASSERT(stable_ptr_table[sn].addr == p); @@ -182,7 +184,7 @@ lookupStableName(StgPtr p) return sn; } else { sn = stable_ptr_free - stable_ptr_table; - (P_)stable_ptr_free = stable_ptr_free->addr; + stable_ptr_free = (snEntry*)(stable_ptr_free->addr); stable_ptr_table[sn].ref = 0; stable_ptr_table[sn].addr = p; stable_ptr_table[sn].sn_obj = NULL; @@ -377,7 +379,7 @@ gcStablePtrTable( void ) continue; } else { - (StgClosure *)p->addr = isAlive((StgClosure *)p->addr); + p->addr = (StgPtr)isAlive((StgClosure *)p->addr); IF_DEBUG(stable, fprintf(stderr,"Stable name %d still alive at %p, ref %d\n", p - stable_ptr_table, p->addr, p->ref)); } } -- 1.7.10.4