Char/ HChar cleanup: The various panic and printf-like functions
all take const HChar * arguments.
__FILE__ and __func__ expand into string literals (or character
arrays initialised by them), as do strings created by the preprocessor
e.g. #stuff.
This change reduces the number of warnings from 17000+ to ~5500
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13039 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcassert.c b/coregrind/m_libcassert.c
index 3d9482b..93d333d 100644
--- a/coregrind/m_libcassert.c
+++ b/coregrind/m_libcassert.c
@@ -216,7 +216,7 @@
}
__attribute__ ((noreturn))
-static void report_and_quit ( const Char* report,
+static void report_and_quit ( const HChar* report,
UnwindStartRegs* startRegsIN )
{
Addr stacktop;
@@ -267,13 +267,13 @@
VG_(exit)(1);
}
-void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,
- Int line, const Char* fn, const HChar* format, ... )
+void VG_(assert_fail) ( Bool isCore, const HChar* expr, const HChar* file,
+ Int line, const HChar* fn, const HChar* format, ... )
{
va_list vargs;
Char buf[256];
- Char* component;
- Char* bugs_to;
+ const HChar* component;
+ const HChar* bugs_to;
static Bool entered = False;
if (entered)
@@ -310,7 +310,7 @@
}
__attribute__ ((noreturn))
-static void panic ( Char* name, Char* report, Char* str,
+static void panic ( const HChar* name, const HChar* report, const HChar* str,
UnwindStartRegs* startRegs )
{
if (VG_(clo_xml))
@@ -319,23 +319,23 @@
report_and_quit(report, startRegs);
}
-void VG_(core_panic_at) ( Char* str, UnwindStartRegs* startRegs )
+void VG_(core_panic_at) ( const HChar* str, UnwindStartRegs* startRegs )
{
panic("valgrind", VG_BUGS_TO, str, startRegs);
}
-void VG_(core_panic) ( Char* str )
+void VG_(core_panic) ( const HChar* str )
{
VG_(core_panic_at)(str, NULL);
}
-void VG_(tool_panic) ( Char* str )
+void VG_(tool_panic) ( const HChar* str )
{
panic(VG_(details).name, VG_(details).bug_reports_to, str, NULL);
}
/* Print some helpful-ish text about unimplemented things, and give up. */
-void VG_(unimplemented) ( Char* msg )
+void VG_(unimplemented) ( const HChar* msg )
{
if (VG_(clo_xml))
VG_(printf_xml)("</valgrindoutput>\n");
@@ -359,4 +359,3 @@
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
-