include PtoAtomHashEntryAdjust to reduce casts

This commit is contained in:
Vitor Santos Costa 2008-09-18 17:59:16 +01:00
parent 20e8924bba
commit bcb6edfb8a
3 changed files with 11 additions and 2 deletions

View File

@ -134,6 +134,7 @@ AtomAdjust(Atom a)
#define BlobTermAdjust(P) (P)
#define CodeComposedTermAdjust(P) (P)
#define CellPtoHeapAdjust(P) (P)
#define PtoAtomHashEntryAdjust(P) (P)
#define CellPtoHeapCellAdjust(P) (P)
#define CellPtoTRAdjust(P) (P)
#define CodeAddrAdjust(P) (P)

View File

@ -1065,9 +1065,9 @@ restore_codes(void)
Yap_heap_regs->logdb_erased_marker->ClPred =
PtoPredAdjust(Yap_heap_regs->logdb_erased_marker->ClPred);
Yap_heap_regs->hash_chain =
(AtomHashEntry *)PtoHeapCellAdjust((CELL *)(Yap_heap_regs->hash_chain));
PtoAtomHashEntryAdjust(Yap_heap_regs->hash_chain);
Yap_heap_regs->wide_hash_chain =
(AtomHashEntry *)PtoHeapCellAdjust((CELL *)(Yap_heap_regs->wide_hash_chain));
PtoAtomHashEntryAdjust(Yap_heap_regs->wide_hash_chain);
}

View File

@ -593,6 +593,14 @@ PtoHeapCellAdjust (CELL * ptr)
return (CELL *) (((CELL *) (CharP (ptr) + HDiff)));
}
inline EXTERN AtomHashEntry *PtoAtomHashEntryAdjust (AtomHashEntry *);
inline EXTERN AtomHashEntry *
PtoAtomHashEntryAdjust (AtomHashEntry * ptr)
{
return (AtomHashEntry *) (((AtomHashEntry *) (CharP (ptr) + HDiff)));
}
inline EXTERN PredEntry *PtoPredAdjust (PredEntry *);