summaryrefslogtreecommitdiff
path: root/rts/Printer.h
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-05-18 06:33:03 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-05-18 06:33:03 +1000
commit33c029dd77888ee5f9b1c7ce8884c982e0428adf (patch)
tree6c38a3f4c4dcc2fb20a8ce4a1c9d1dc520ec6f9d /rts/Printer.h
parent5d80d14196ef048ffe037b2d92af2e9af0cb9e19 (diff)
downloadhaskell-33c029dd77888ee5f9b1c7ce8884c982e0428adf.tar.gz
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
Diffstat (limited to 'rts/Printer.h')
-rw-r--r--rts/Printer.h16
1 files changed, 8 insertions, 8 deletions
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"