|
From: <sv...@va...> - 2013-01-15 03:21:29
|
florian 2013-01-15 03:19:54 +0000 (Tue, 15 Jan 2013)
New Revision: 13231
Log:
Fix a few compiler warnings on Darwin.
Patch Guy Harris (gu...@al...). Part of fixing BZ 312980.
Modified files:
trunk/coregrind/m_debuginfo/readmacho.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_ume/macho.c
trunk/coregrind/pub_core_initimg.h
trunk/coregrind/vg_preloaded.c
Modified: trunk/coregrind/vg_preloaded.c (+1 -1)
===================================================================
--- trunk/coregrind/vg_preloaded.c 2013-01-15 03:09:16 +00:00 (rev 13230)
+++ trunk/coregrind/vg_preloaded.c 2013-01-15 03:19:54 +00:00 (rev 13231)
@@ -100,7 +100,7 @@
/* This string will be inserted into crash logs, so crashes while
running under Valgrind can be distinguished from other crashes. */
-__private_extern__ char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION;
+__private_extern__ const char *__crashreporter_info__ = "Instrumented by Valgrind " VERSION;
/* ---------------------------------------------------------------------
Darwin environment cleanup
Modified: trunk/coregrind/pub_core_initimg.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_initimg.h 2013-01-15 03:09:16 +00:00 (rev 13230)
+++ trunk/coregrind/pub_core_initimg.h 2013-01-15 03:19:54 +00:00 (rev 13231)
@@ -93,7 +93,7 @@
struct _IICreateImageInfo {
/* ------ Mandatory fields ------ */
- HChar* toolname;
+ const HChar* toolname;
Addr sp_at_startup;
Addr clstack_top;
/* ------ Per-OS fields ------ */
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c (+9 -9)
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c 2013-01-15 03:09:16 +00:00 (rev 13230)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c 2013-01-15 03:19:54 +00:00 (rev 13231)
@@ -652,7 +652,7 @@
// Now add/remove them.
for (i = 0; i < css_used; i++) {
ChangedSeg* cs = &css[i];
- Char* action;
+ const Char* action;
if (cs->is_added) {
ML_(notify_core_and_tool_of_mmap)(
cs->start, cs->end - cs->start + 1,
@@ -2715,7 +2715,7 @@
/* Largely copied from PRE(sys_execve) in syswrap-generic.c, and from
the simpler AIX equivalent (syswrap-aix5.c). */
// Pre_read a char** argument.
-static void pre_argv_envp(Addr a, ThreadId tid, Char* s1, Char* s2)
+static void pre_argv_envp(Addr a, ThreadId tid, const Char* s1, const Char* s2)
{
while (True) {
Addr a_deref;
@@ -2757,9 +2757,9 @@
PRE(posix_spawn)
{
Char* path = NULL; /* path to executable */
- Char** envp = NULL;
- Char** argv = NULL;
- Char** arg2copy;
+ HChar** envp = NULL;
+ HChar** argv = NULL;
+ HChar** arg2copy;
Char* launcher_basename = NULL;
Int i, j, tot_args;
SysRes res;
@@ -2870,7 +2870,7 @@
if (ARG5 == 0) {
envp = NULL;
} else {
- envp = VG_(env_clone)( (Char**)ARG5 );
+ envp = VG_(env_clone)( (HChar**)ARG5 );
vg_assert(envp);
VG_(env_remove_valgrind_env_stuff)( envp );
}
@@ -2889,7 +2889,7 @@
// are omitted.
//
if (!trace_this_child) {
- argv = (Char**)ARG4;
+ argv = (HChar**)ARG4;
} else {
vg_assert( VG_(args_for_valgrind) );
vg_assert( VG_(args_for_valgrind_noexecpass) >= 0 );
@@ -2904,7 +2904,7 @@
// name of client exe
tot_args++;
// args for client exe, skipping [0]
- arg2copy = (Char**)ARG4;
+ arg2copy = (HChar**)ARG4;
if (arg2copy && arg2copy[0]) {
for (i = 1; arg2copy[i]; i++)
tot_args++;
@@ -2934,7 +2934,7 @@
state does the child inherit from the parent? */
if (0) {
- Char **cpp;
+ HChar **cpp;
VG_(printf)("posix_spawn: %s\n", path);
for (cpp = argv; cpp && *cpp; cpp++)
VG_(printf)("argv: %s\n", *cpp);
Modified: trunk/coregrind/m_ume/macho.c (+2 -2)
===================================================================
--- trunk/coregrind/m_ume/macho.c 2013-01-15 03:09:16 +00:00 (rev 13230)
+++ trunk/coregrind/m_ume/macho.c 2013-01-15 03:19:54 +00:00 (rev 13231)
@@ -73,7 +73,7 @@
VG_(printf)("%s", str);
}
-static void check_mmap(SysRes res, Addr base, SizeT len, HChar* who)
+static void check_mmap(SysRes res, Addr base, SizeT len, const HChar* who)
{
if (sr_isError(res)) {
VG_(printf)("valgrind: mmap-FIXED(0x%llx, %lld) failed in UME (%s).\n",
@@ -83,7 +83,7 @@
}
#if DARWIN_VERS == DARWIN_10_8
-static void check_mmap_float(SysRes res, SizeT len, HChar* who)
+static void check_mmap_float(SysRes res, SizeT len, const HChar* who)
{
if (sr_isError(res)) {
VG_(printf)("valgrind: mmap-FLOAT(size=%lld) failed in UME (%s).\n",
Modified: trunk/coregrind/m_debuginfo/readmacho.c (+6 -6)
===================================================================
--- trunk/coregrind/m_debuginfo/readmacho.c 2013-01-15 03:09:16 +00:00 (rev 13230)
+++ trunk/coregrind/m_debuginfo/readmacho.c 2013-01-15 03:19:54 +00:00 (rev 13231)
@@ -395,10 +395,10 @@
/* Compare DiSyms by their start address, and for equal addresses, use
the primary name as a secondary sort key. */
-static Int cmp_DiSym_by_start_then_name ( void* v1, void* v2 )
+static Int cmp_DiSym_by_start_then_name ( const void* v1, const void* v2 )
{
- DiSym* s1 = (DiSym*)v1;
- DiSym* s2 = (DiSym*)v2;
+ const DiSym* s1 = (DiSym*)v1;
+ const DiSym* s2 = (DiSym*)v2;
if (s1->addr < s2->addr) return -1;
if (s1->addr > s2->addr) return 1;
return VG_(strcmp)(s1->pri_name, s2->pri_name);
@@ -509,7 +509,7 @@
static Char *
find_separate_debug_file (const Char *executable_name)
{
- Char *basename_str;
+ const Char *basename_str;
Char *dot_ptr;
Char *slash_ptr;
Char *dsymfile;
@@ -594,7 +594,7 @@
static UChar *getsectdata(UChar* base, SizeT size,
- Char *segname, Char *sectname,
+ const Char *segname, const Char *sectname,
/*OUT*/Word *sect_size)
{
struct MACH_HEADER *mh = (struct MACH_HEADER *)base;
@@ -972,7 +972,7 @@
/* Run dsymutil */
{ Int r;
- HChar* dsymutil = "/usr/bin/dsymutil ";
+ const HChar* dsymutil = "/usr/bin/dsymutil ";
HChar* cmd = ML_(dinfo_zalloc)( "di.readmacho.tmp1",
VG_(strlen)(dsymutil)
+ VG_(strlen)(di->fsm.filename)
|