From 33c029dd77888ee5f9b1c7ce8884c982e0428adf Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 18 May 2016 06:33:03 +1000 Subject: rts: More const correct-ness fixes In addition to more const-correctness fixes this patch fixes an infelicity of the previous const-correctness patch (995cf0f356) which left `UNTAG_CLOSURE` taking a `const StgClosure` pointer parameter but returning a non-const pointer. Here we restore the original type signature of `UNTAG_CLOSURE` and add a new function `UNTAG_CONST_CLOSURE` which takes and returns a const `StgClosure` pointer and uses that wherever possible. Test Plan: Validate on Linux, OS X and Windows Reviewers: Phyx, hsyl20, bgamari, austin, simonmar, trofi Reviewed By: simonmar, trofi Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2231 --- rts/Printer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'rts/Printer.h') diff --git a/rts/Printer.h b/rts/Printer.h index 31185aaf34..bd2db35aeb 100644 --- a/rts/Printer.h +++ b/rts/Printer.h @@ -14,16 +14,16 @@ extern void printPtr ( StgPtr p ); extern void printObj ( StgClosure *obj ); -extern char * closure_type_names[]; +extern const char * closure_type_names[]; -void info_hdr_type ( StgClosure *closure, char *res ); -char * info_type ( StgClosure *closure ); -char * info_type_by_ip ( StgInfoTable *ip ); -char * info_update_frame ( StgClosure *closure ); +void info_hdr_type ( const StgClosure *closure, char *res ); +const char * info_type ( const StgClosure *closure ); +const char * info_type_by_ip ( const StgInfoTable *ip ); +const char * info_update_frame ( const StgClosure *closure ); #ifdef DEBUG -extern void prettyPrintClosure (StgClosure *obj); -extern void printClosure ( StgClosure *obj ); +extern void prettyPrintClosure (const StgClosure *obj); +extern void printClosure ( const StgClosure *obj ); extern void printStackChunk ( StgPtr sp, StgPtr spLim ); extern void printTSO ( StgTSO *tso ); @@ -31,7 +31,7 @@ extern void DEBUG_LoadSymbols( char *name ); extern const char *lookupGHCName( void *addr ); -extern char *what_next_strs[]; +extern const char *what_next_strs[]; #endif #include "EndPrivate.h" -- cgit v1.2.1