|
From: <sv...@va...> - 2012-10-27 18:39:21
|
florian 2012-10-27 19:39:11 +0100 (Sat, 27 Oct 2012)
New Revision: 13088
Log:
More Char/HChar fixes and constification.
Modified files:
trunk/cachegrind/cg_main.c
trunk/cachegrind/cg_sim.c
trunk/callgrind/dump.c
trunk/callgrind/events.c
trunk/callgrind/events.h
trunk/callgrind/fn.c
trunk/callgrind/global.h
trunk/callgrind/main.c
trunk/callgrind/sim.c
trunk/coregrind/m_aspacemgr/aspacemgr-common.c
trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
trunk/coregrind/m_aspacemgr/priv_aspacemgr.h
trunk/coregrind/m_coredump/coredump-elf.c
trunk/coregrind/m_debugger.c
trunk/coregrind/m_debuglog.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_gdbserver/server.c
trunk/coregrind/m_hashtable.c
trunk/coregrind/m_libcassert.c
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_main.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_tooliface.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_vkiscnums.c
trunk/coregrind/pub_core_aspacemgr.h
trunk/coregrind/pub_core_debuglog.h
trunk/coregrind/pub_core_libcfile.h
trunk/coregrind/pub_core_scheduler.h
trunk/coregrind/pub_core_tooliface.h
trunk/drd/drd_error.c
trunk/drd/tests/unit_vc.c
trunk/exp-bbv/bbv_main.c
trunk/exp-sgcheck/pc_common.c
trunk/exp-sgcheck/pc_common.h
trunk/helgrind/hg_errors.c
trunk/helgrind/hg_errors.h
trunk/include/pub_tool_hashtable.h
trunk/include/pub_tool_libcprint.h
trunk/include/pub_tool_tooliface.h
trunk/include/pub_tool_vkiscnums.h
trunk/massif/ms_main.c
trunk/memcheck/mc_errors.c
trunk/memcheck/mc_include.h
trunk/memcheck/mc_main.c
Modified: trunk/coregrind/m_debuglog.c (+26 -26)
===================================================================
--- trunk/coregrind/m_debuglog.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_debuglog.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -71,7 +71,7 @@
#if defined(VGP_x86_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
Int result;
@@ -104,7 +104,7 @@
#elif defined(VGP_amd64_linux)
__attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
volatile Long block[2];
block[0] = (Long)buf;
@@ -147,7 +147,7 @@
#elif defined(VGP_ppc32_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
volatile Int block[2];
block[0] = (Int)buf;
@@ -190,7 +190,7 @@
#elif defined(VGP_ppc64_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
volatile Long block[2];
block[0] = (Long)buf;
@@ -233,7 +233,7 @@
#elif defined(VGP_arm_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
volatile Int block[2];
block[0] = (Int)buf;
@@ -274,7 +274,7 @@
asm code. Both macros give the same results for Unix-class syscalls (which
these all are, as identified by the use of 'int 0x80'). */
__attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
UInt __res;
__asm__ volatile (
@@ -316,7 +316,7 @@
#elif defined(VGP_amd64_darwin)
__attribute__((noinline))
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
UInt __res;
__asm__ volatile (
@@ -350,12 +350,12 @@
}
#elif defined(VGP_s390x_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
- register Int r2 asm("2") = 2; /* file descriptor STDERR */
- register HChar* r3 asm("3") = buf;
- register ULong r4 asm("4") = n;
- register ULong r2_res asm("2");
+ register Int r2 asm("2") = 2; /* file descriptor STDERR */
+ register const HChar* r3 asm("3") = buf;
+ register ULong r4 asm("4") = n;
+ register ULong r2_res asm("2");
ULong __res;
__asm__ __volatile__ (
@@ -391,7 +391,7 @@
}
#elif defined(VGP_mips32_linux)
-static UInt local_sys_write_stderr ( HChar* buf, Int n )
+static UInt local_sys_write_stderr ( const HChar* buf, Int n )
{
volatile Int block[2];
block[0] = (Int)buf;
@@ -453,7 +453,7 @@
/* Emit buf[0 .. n-1] to stderr. Unfortunately platform-specific.
*/
-static void emit ( HChar* buf, Int n )
+static void emit ( const HChar* buf, Int n )
{
if (n >= 1)
(void)local_sys_write_stderr(buf, n);
@@ -489,7 +489,7 @@
void* send_arg2,
Int flags,
Int width,
- HChar* str,
+ const HChar* str,
Bool capitalise )
{
# define MAYBE_TOUPPER(ch) (capitalise ? local_toupper(ch) : (ch))
@@ -535,12 +535,12 @@
static
UInt myvprintf_str_XML_simplistic ( void(*send)(HChar,void*),
void* send_arg2,
- HChar* str )
+ const HChar* str )
{
UInt ret = 0;
Int i;
Int len = local_strlen(str);
- HChar* alt;
+ const HChar* alt;
for (i = 0; i < len; i++) {
switch (str[i]) {
@@ -585,7 +585,7 @@
Int ind = 0;
Int i, nc = 0;
Bool neg = False;
- HChar* digits = capitalised ? "0123456789ABCDEF" : "0123456789abcdef";
+ const HChar* digits = capitalised ? "0123456789ABCDEF" : "0123456789abcdef";
UInt ret = 0;
if (base < 2 || base > 16)
@@ -762,15 +762,15 @@
i++;
/* %pS, like %s but escaping chars for XML safety */
/* Note: simplistic; ignores field width and flags */
- char *str = va_arg (vargs, char *);
- if (str == (char*) 0)
+ HChar *str = va_arg (vargs, HChar *);
+ if (str == NULL)
str = "(null)";
ret += myvprintf_str_XML_simplistic(send, send_arg2, str);
} else if (format[i+1] == 's') {
i++;
/* %ps, synonym for %s with --xml=no / %pS with --xml=yes */
- char *str = va_arg (vargs, char *);
- if (str == (char*) 0)
+ HChar *str = va_arg (vargs, HChar *);
+ if (str == NULL)
str = "(null)";
if (clo_xml)
ret += myvprintf_str_XML_simplistic(send, send_arg2, str);
@@ -806,8 +806,8 @@
send(va_arg (vargs, int), send_arg2);
break;
case 's': case 'S': { /* %s */
- char *str = va_arg (vargs, char *);
- if (str == (char*) 0) str = "(null)";
+ HChar *str = va_arg (vargs, HChar *);
+ if (str == NULL) str = "(null)";
ret += myvprintf_str(send, send_arg2,
flags, width, str, format[i]=='S');
break;
@@ -849,7 +849,7 @@
/* Module startup. */
/* EXPORTED */
-void VG_(debugLog_startup) ( Int level, HChar* who )
+void VG_(debugLog_startup) ( Int level, const HChar* who )
{
if (level < 0) level = 0;
if (level > 10) level = 10;
@@ -925,7 +925,7 @@
(void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
(void)myvprintf_int64 ( add_to_buf, &buf, 0, 10, 1, False, (ULong)level );
(void)myvprintf_str ( add_to_buf, &buf, 0, 1, ":", False );
- (void)myvprintf_str ( add_to_buf, &buf, 0, 8, (HChar*)modulename, False );
+ (void)myvprintf_str ( add_to_buf, &buf, 0, 8, modulename, False );
(void)myvprintf_str ( add_to_buf, &buf, 0, indent, "", False );
va_start(vargs,format);
Modified: trunk/cachegrind/cg_main.c (+3 -2)
===================================================================
--- trunk/cachegrind/cg_main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/cachegrind/cg_main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -1259,7 +1259,8 @@
{
Int i, fd;
SysRes sres;
- Char buf[512], *currFile = NULL, *currFn = NULL;
+ HChar buf[512];
+ Char *currFile = NULL, *currFn = NULL;
LineCC* lineCC;
// Setup output filename. Nb: it's important to do this now, ie. as late
@@ -1464,7 +1465,7 @@
static void cg_fini(Int exitcode)
{
- static Char buf1[128], buf2[128], buf3[128], buf4[123];
+ static HChar buf1[128], buf2[128], buf3[128], buf4[123];
static HChar fmt[128];
CacheCC D_total;
Modified: trunk/coregrind/pub_core_libcfile.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_libcfile.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/pub_core_libcfile.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -65,7 +65,7 @@
extern Int VG_(socket) ( Int domain, Int type, Int protocol );
-extern Int VG_(write_socket)( Int sd, void *msg, Int count );
+extern Int VG_(write_socket)( Int sd, const void *msg, Int count );
extern Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen );
extern Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen );
extern Int VG_(getsockopt) ( Int sd, Int level, Int optname,
Modified: trunk/coregrind/m_libcfile.c (+1 -1)
===================================================================
--- trunk/coregrind/m_libcfile.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_libcfile.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -919,7 +919,7 @@
# endif
}
-Int VG_(write_socket)( Int sd, void *msg, Int count )
+Int VG_(write_socket)( Int sd, const void *msg, Int count )
{
/* This is actually send(). */
Modified: trunk/coregrind/m_libcassert.c (+1 -1)
===================================================================
--- trunk/coregrind/m_libcassert.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_libcassert.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -271,7 +271,7 @@
Int line, const HChar* fn, const HChar* format, ... )
{
va_list vargs;
- Char buf[256];
+ HChar buf[256];
const HChar* component;
const HChar* bugs_to;
Modified: trunk/callgrind/events.h (+4 -4)
===================================================================
--- trunk/callgrind/events.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/events.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -79,7 +79,7 @@
EventSet* CLG_(add_event_group2)(EventSet*, Int id1, Int id2);
EventSet* CLG_(add_event_set)(EventSet*, EventSet*);
/* Writes event names into buf. Returns number of characters written */
-Int CLG_(sprint_eventset)(Char* buf, EventSet*);
+Int CLG_(sprint_eventset)(HChar* buf, EventSet*);
/* Operations on costs. A cost pointer of 0 means zero cost.
@@ -106,7 +106,7 @@
Bool CLG_(add_diff_cost)(EventSet*,ULong* dst, ULong* old, ULong* new_cost);
Bool CLG_(add_diff_cost_lz)(EventSet*,ULong** pdst, ULong* old, ULong* new_cost);
/* Returns number of characters written */
-Int CLG_(sprint_cost)(Char* buf, EventSet*, ULong*);
+Int CLG_(sprint_cost)(HChar* buf, EventSet*, ULong*);
/* EventMapping: An ordered subset of events from an event set.
* This is used to print out part of an EventSet, or in another order.
@@ -128,8 +128,8 @@
EventMapping* CLG_(get_eventmapping)(EventSet*);
void CLG_(append_event)(EventMapping*, const HChar*);
/* Returns number of characters written */
-Int CLG_(sprint_eventmapping)(Char* buf, EventMapping*);
+Int CLG_(sprint_eventmapping)(HChar* buf, EventMapping*);
/* Returns number of characters written */
-Int CLG_(sprint_mappingcost)(Char* buf, EventMapping*, ULong*);
+Int CLG_(sprint_mappingcost)(HChar* buf, EventMapping*, ULong*);
#endif /* CLG_EVENTS */
Modified: trunk/callgrind/events.c (+4 -4)
===================================================================
--- trunk/callgrind/events.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/events.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -192,7 +192,7 @@
return eventset_from_mask(es1->mask | es2->mask);
}
-Int CLG_(sprint_eventset)(Char* buf, EventSet* es)
+Int CLG_(sprint_eventset)(HChar* buf, EventSet* es)
{
Int i, j, pos;
UInt mask;
@@ -446,7 +446,7 @@
/* Returns number of characters written */
-Int CLG_(sprint_cost)(Char* buf, EventSet* es, ULong* c)
+Int CLG_(sprint_cost)(HChar* buf, EventSet* es, ULong* c)
{
Int i, pos, skipped = 0;
@@ -518,7 +518,7 @@
/* Returns number of characters written */
-Int CLG_(sprint_eventmapping)(Char* buf, EventMapping* em)
+Int CLG_(sprint_eventmapping)(HChar* buf, EventMapping* em)
{
Int i, pos = 0;
EventGroup* eg;
@@ -537,7 +537,7 @@
}
/* Returns number of characters written */
-Int CLG_(sprint_mappingcost)(Char* buf, EventMapping* em, ULong* c)
+Int CLG_(sprint_mappingcost)(HChar* buf, EventMapping* em, ULong* c)
{
Int i, pos, skipped = 0;
Modified: trunk/cachegrind/cg_sim.c (+1 -1)
===================================================================
--- trunk/cachegrind/cg_sim.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/cachegrind/cg_sim.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -46,7 +46,7 @@
Int sets_min_1;
Int line_size_bits;
Int tag_shift;
- Char desc_line[128];
+ HChar desc_line[128];
UWord* tags;
} cache_t2;
Modified: trunk/memcheck/mc_main.c (+1 -1)
===================================================================
--- trunk/memcheck/mc_main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/memcheck/mc_main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -966,7 +966,7 @@
secVBitTable = secVBitTable2;
if (VG_(clo_verbosity) > 1) {
- Char percbuf[7];
+ HChar percbuf[7];
VG_(percentify)(n_survivors, n_nodes, 1, 6, percbuf);
VG_(message)(Vg_DebugMsg, "memcheck GC: %d nodes, %d survivors (%s)\n",
n_nodes, n_survivors, percbuf);
Modified: trunk/coregrind/pub_core_tooliface.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_tooliface.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/pub_core_tooliface.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -125,7 +125,7 @@
Bool (*tool_read_extra_suppression_info) (Int, Char**, SizeT*, Supp*);
Bool (*tool_error_matches_suppression) (Error*, Supp*);
const HChar* (*tool_get_error_name) (Error*);
- Bool (*tool_get_extra_suppression_info) (Error*,/*OUT*/Char*,Int);
+ Bool (*tool_get_extra_suppression_info) (Error*,/*OUT*/HChar*,Int);
// VG_(needs).superblock_discards
void (*tool_discard_superblock_info)(Addr64, VexGuestExtents);
Modified: trunk/coregrind/pub_core_scheduler.h (+4 -4)
===================================================================
--- trunk/coregrind/pub_core_scheduler.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/pub_core_scheduler.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -57,12 +57,12 @@
thread state to VgTs_Runnable, and the thread will attempt to take
the CPU lock. By the time it returns, tid will be the running
thread. */
-extern void VG_(acquire_BigLock) ( ThreadId tid, HChar* who );
+extern void VG_(acquire_BigLock) ( ThreadId tid, const HChar* who );
/* Simple version, which simply acquires the lock, but does not mess
with the guest state in the same way as the non _LL version
does. */
-extern void VG_(acquire_BigLock_LL) ( HChar* who );
+extern void VG_(acquire_BigLock_LL) ( const HChar* who );
/* Set a thread into a sleeping state. Before the call, the thread
must be runnable, and holding the CPU lock. When this call
@@ -73,10 +73,10 @@
the caller's responsibility to actually block until the thread is
ready to run again. */
extern void VG_(release_BigLock) ( ThreadId tid,
- ThreadStatus state, HChar* who );
+ ThreadStatus state, const HChar* who );
/* Matching function to acquire_BigLock_LL. */
-extern void VG_(release_BigLock_LL) ( HChar* who );
+extern void VG_(release_BigLock_LL) ( const HChar* who );
/* Whether the specified thread owns the big lock. */
extern Bool VG_(owns_BigLock_LL) ( ThreadId tid );
Modified: trunk/coregrind/m_vkiscnums.c (+5 -5)
===================================================================
--- trunk/coregrind/m_vkiscnums.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_vkiscnums.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -46,13 +46,13 @@
#if defined(VGO_linux)
//---------------------------------------------------------------------------
-Char* VG_(sysnum_string)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string)(Word sysnum, SizeT n_buf, HChar* buf)
{
VG_(snprintf)(buf, n_buf, "%3ld", sysnum);
return buf;
}
-Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf)
{
return VG_(sysnum_string)(sysnum, n_buf, buf);
}
@@ -61,9 +61,9 @@
#elif defined(VGO_darwin)
//---------------------------------------------------------------------------
-Char* VG_(sysnum_string)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string)(Word sysnum, SizeT n_buf, HChar* buf)
{
- Char* classname = NULL;
+ const HChar* classname = NULL;
switch (VG_DARWIN_SYSNO_CLASS(sysnum)) {
case VG_DARWIN_SYSCALL_CLASS_MACH: classname = "mach"; break;
case VG_DARWIN_SYSCALL_CLASS_UNIX: classname = "unix"; break;
@@ -76,7 +76,7 @@
return buf;
}
-Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf)
+HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf)
{
return VG_(sysnum_string)(sysnum, n_buf, buf);
}
Modified: trunk/coregrind/m_libcprint.c (+7 -7)
===================================================================
--- trunk/coregrind/m_libcprint.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_libcprint.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -57,7 +57,7 @@
/* Do the low-level send of a message to the logging sink. */
static
-void send_bytes_to_logging_sink ( OutputSink* sink, Char* msg, Int nbytes )
+void send_bytes_to_logging_sink ( OutputSink* sink, const HChar* msg, Int nbytes )
{
if (sink->is_socket) {
Int rc = VG_(write_socket)( sink->fd, msg, nbytes );
@@ -179,7 +179,7 @@
*(*b)++ = c;
}
-UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs )
+UInt VG_(vsprintf) ( HChar* buf, const HChar *format, va_list vargs )
{
Int ret;
HChar* sprintf_ptr = buf;
@@ -193,7 +193,7 @@
return ret;
}
-UInt VG_(sprintf) ( Char* buf, const HChar *format, ... )
+UInt VG_(sprintf) ( HChar* buf, const HChar *format, ... )
{
UInt ret;
va_list vargs;
@@ -226,7 +226,7 @@
}
}
-UInt VG_(vsnprintf) ( Char* buf, Int size, const HChar *format, va_list vargs )
+UInt VG_(vsnprintf) ( HChar* buf, Int size, const HChar *format, va_list vargs )
{
snprintf_buf_t b;
b.buf = buf;
@@ -239,7 +239,7 @@
return b.buf_used;
}
-UInt VG_(snprintf) ( Char* buf, Int size, const HChar *format, ... )
+UInt VG_(snprintf) ( HChar* buf, Int size, const HChar *format, ... )
{
UInt ret;
va_list vargs;
@@ -267,11 +267,11 @@
// Percentify n/m with d decimal places. Includes the '%' symbol at the end.
// Right justifies in 'buf'.
-void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[])
+void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, HChar buf[])
{
Int i, len, space;
ULong p1;
- Char fmt[32];
+ HChar fmt[32];
if (m == 0) {
// Have to generate the format string in order to be flexible about
Modified: trunk/coregrind/m_errormgr.c (+1 -1)
===================================================================
--- trunk/coregrind/m_errormgr.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_errormgr.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -348,7 +348,7 @@
{
Char xtra[256]; /* assumed big enough (is overrun-safe) */
Bool anyXtra;
- Char* name;
+ const HChar* name;
ExeContext* ec;
XArray* /* HChar */ text;
Modified: trunk/coregrind/m_debugger.c (+5 -5)
===================================================================
--- trunk/coregrind/m_debugger.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_debugger.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -379,11 +379,11 @@
VG_(kill)(pid, VKI_SIGSTOP) == 0 &&
VG_(ptrace)(VKI_PTRACE_DETACH, pid, NULL, 0) == 0)
{
- Char pidbuf[15];
- Char file[50];
- Char buf[N_BUF];
- Char *bufptr;
- Char *cmdptr;
+ HChar pidbuf[15];
+ HChar file[50];
+ HChar buf[N_BUF];
+ HChar *bufptr;
+ HChar *cmdptr;
VG_(sprintf)(pidbuf, "%d", pid);
VG_(sprintf)(file, "/proc/%d/fd/%d", pid, VG_(cl_exec_fd));
Modified: trunk/include/pub_tool_vkiscnums.h (+4 -4)
===================================================================
--- trunk/include/pub_tool_vkiscnums.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/include/pub_tool_vkiscnums.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -39,18 +39,18 @@
// This converts a syscall number into a string, suitable for printing. It is
// needed because some platforms (Darwin) munge sysnums in various ways.
// It is used in places where the sycall name will be printed alongside.
-extern Char* VG_(sysnum_string) (Word sysnum, SizeT n_buf, Char* buf);
+extern HChar* VG_(sysnum_string) (Word sysnum, SizeT n_buf, HChar* buf);
// This is like VG_(sysnum_string), but prints extra info if needed. It is
// called in places where the syscall name will *not* be printed alongside.
-extern Char* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, Char* buf);
+extern HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf);
// Macros that make the above functions easier to use by declaring a local
// buffer.
#define VG_SYSNUM_STRING(sysnum) \
- ({ Char qq_zz_buf[32]; VG_(sysnum_string)(sysnum, 32, qq_zz_buf); })
+ ({ HChar qq_zz_buf[32]; VG_(sysnum_string)(sysnum, 32, qq_zz_buf); })
#define VG_SYSNUM_STRING_EXTRA(sysnum) \
- ({ Char qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
+ ({ HChar qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
#endif // __PUB_TOOL_VKISCNUMS_H
Modified: trunk/include/pub_tool_libcprint.h (+5 -5)
===================================================================
--- trunk/include/pub_tool_libcprint.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/include/pub_tool_libcprint.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -35,23 +35,23 @@
Formatting functions
------------------------------------------------------------------ */
-extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... )
+extern UInt VG_(sprintf) ( HChar* buf, const HChar* format, ... )
PRINTF_CHECK(2, 3);
-extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs )
+extern UInt VG_(vsprintf) ( HChar* buf, const HChar* format, va_list vargs )
PRINTF_CHECK(2, 0);
-extern UInt VG_(snprintf) ( Char* buf, Int size,
+extern UInt VG_(snprintf) ( HChar* buf, Int size,
const HChar *format, ... )
PRINTF_CHECK(3, 4);
-extern UInt VG_(vsnprintf)( Char* buf, Int size,
+extern UInt VG_(vsnprintf)( HChar* buf, Int size,
const HChar *format, va_list vargs )
PRINTF_CHECK(3, 0);
// Percentify n/m with d decimal places. Includes the '%' symbol at the end.
// Right justifies in 'buf'.
-extern void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[]);
+extern void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, HChar buf[]);
/* ---------------------------------------------------------------------
Modified: trunk/drd/drd_error.c (+1 -1)
===================================================================
--- trunk/drd/drd_error.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/drd/drd_error.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -602,7 +602,7 @@
*/
static
Bool drd_get_extra_suppression_info(Error* e,
- /*OUT*/Char* buf, Int nBuf)
+ /*OUT*/HChar* buf, Int nBuf)
{
return False;
}
Modified: trunk/coregrind/m_translate.c (+1 -1)
===================================================================
--- trunk/coregrind/m_translate.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_translate.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -73,7 +73,7 @@
void VG_(print_translation_stats) ( void )
{
- Char buf[7];
+ HChar buf[7];
UInt n_SP_updates = n_SP_updates_fast + n_SP_updates_generic_known
+ n_SP_updates_generic_unknown;
VG_(percentify)(n_SP_updates_fast, n_SP_updates, 1, 6, buf);
Modified: trunk/coregrind/m_main.c (+1 -1)
===================================================================
--- trunk/coregrind/m_main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -1415,7 +1415,7 @@
void show_BB_profile ( BBProfEntry tops[], UInt n_tops, ULong score_total )
{
ULong score_cumul, score_here;
- Char buf_cumul[10], buf_here[10];
+ HChar buf_cumul[10], buf_here[10];
Char name[64];
Int r;
Modified: trunk/coregrind/m_gdbserver/server.c (+1 -0)
===================================================================
--- trunk/coregrind/m_gdbserver/server.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_gdbserver/server.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -27,6 +27,7 @@
#include "pub_core_translate.h"
#include "pub_core_mallocfree.h"
#include "pub_core_initimg.h"
+#include "pub_core_syswrap.h" // VG_(show_open_fds)
unsigned long cont_thread;
unsigned long general_thread;
Modified: trunk/callgrind/main.c (+3 -3)
===================================================================
--- trunk/callgrind/main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -1403,7 +1403,7 @@
/* helper for dump_state_togdb */
static void dump_state_of_thread_togdb(thread_info* ti)
{
- static Char buf[512];
+ static HChar buf[512];
static FullCost sum = 0, tmp = 0;
Int t, p, i;
BBCC *from, *to;
@@ -1449,7 +1449,7 @@
/* Dump current state */
static void dump_state_togdb(void)
{
- static Char buf[512];
+ static HChar buf[512];
thread_info** th;
int t, p;
Int orig_tid = CLG_(current_tid);
@@ -1700,7 +1700,7 @@
static
void branchsim_printstat(int l1, int l2, int l3)
{
- static Char buf1[128], buf2[128], buf3[128];
+ static HChar buf1[128], buf2[128], buf3[128];
static HChar fmt[128];
FullCost total;
ULong Bc_total_b, Bc_total_mp, Bi_total_b, Bi_total_mp;
Modified: trunk/memcheck/mc_errors.c (+12 -12)
===================================================================
--- trunk/memcheck/mc_errors.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/memcheck/mc_errors.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -270,7 +270,7 @@
/* Do a printf-style operation on either the XML or normal output
channel, depending on the setting of VG_(clo_xml).
*/
-static void emit_WRK ( HChar* format, va_list vargs )
+static void emit_WRK ( const HChar* format, va_list vargs )
{
if (VG_(clo_xml)) {
VG_(vprintf_xml)(format, vargs);
@@ -278,15 +278,15 @@
VG_(vmessage)(Vg_UserMsg, format, vargs);
}
}
-static void emit ( HChar* format, ... ) PRINTF_CHECK(1, 2);
-static void emit ( HChar* format, ... )
+static void emit ( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+static void emit ( const HChar* format, ... )
{
va_list vargs;
va_start(vargs, format);
emit_WRK(format, vargs);
va_end(vargs);
}
-static void emiN ( HChar* format, ... ) /* NO FORMAT CHECK */
+static void emiN ( const HChar* format, ... ) /* NO FORMAT CHECK */
{
va_list vargs;
va_start(vargs, format);
@@ -433,9 +433,9 @@
}
}
-char * MC_(snprintf_delta) (char * buf, Int size,
- SizeT current_val, SizeT old_val,
- LeakCheckDeltaMode delta_mode)
+HChar * MC_(snprintf_delta) (HChar * buf, Int size,
+ SizeT current_val, SizeT old_val,
+ LeakCheckDeltaMode delta_mode)
{
if (delta_mode == LCD_Any)
buf[0] = '\0';
@@ -452,10 +452,10 @@
{
// char arrays to produce the indication of increase/decrease in case
// of delta_mode != LCD_Any
- char d_bytes[20];
- char d_direct_bytes[20];
- char d_indirect_bytes[20];
- char d_num_blocks[20];
+ HChar d_bytes[20];
+ HChar d_direct_bytes[20];
+ HChar d_indirect_bytes[20];
+ HChar d_num_blocks[20];
MC_(snprintf_delta) (d_bytes, 20,
lr->szB + lr->indirect_szB,
@@ -1559,7 +1559,7 @@
}
Bool MC_(get_extra_suppression_info) ( Error* err,
- /*OUT*/Char* buf, Int nBuf )
+ /*OUT*/HChar* buf, Int nBuf )
{
ErrorKind ekind = VG_(get_error_kind )(err);
tl_assert(buf);
Modified: trunk/include/pub_tool_hashtable.h (+1 -1)
===================================================================
--- trunk/include/pub_tool_hashtable.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/include/pub_tool_hashtable.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -53,7 +53,7 @@
be freed with VG_(free)(). The table starts small but will
periodically be expanded. This is transparent to the users of this
module. */
-extern VgHashTable VG_(HT_construct) ( HChar* name );
+extern VgHashTable VG_(HT_construct) ( const HChar* name );
/* Count the number of nodes in a table. */
extern Int VG_(HT_count_nodes) ( VgHashTable table );
Modified: trunk/callgrind/global.h (+1 -1)
===================================================================
--- trunk/callgrind/global.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/global.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -660,7 +660,7 @@
Bool (*parse_opt)(Char* arg);
void (*post_clo_init)(void);
void (*clear)(void);
- void (*getdesc)(Char* buf);
+ void (*getdesc)(HChar* buf);
void (*printstat)(Int,Int,Int);
void (*add_icost)(SimCost, BBCC*, InstrInfo*, ULong);
void (*finish)(void);
Modified: trunk/exp-bbv/bbv_main.c (+2 -2)
===================================================================
--- trunk/exp-bbv/bbv_main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/exp-bbv/bbv_main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -66,7 +66,7 @@
static Bool generate_pc_file=False;
/* write buffer */
-static UChar buf[1024];
+static HChar buf[1024];
/* Global values */
static OSet* instr_info_table; /* table that holds the basic block info */
@@ -137,7 +137,7 @@
static Int open_tracefile(Int thread_num)
{
SysRes sres;
- UChar temp_string[2048];
+ HChar temp_string[2048];
/* For thread 1, don't append any thread number */
/* This lets the single-thread case not have any */
Modified: trunk/coregrind/pub_core_debuglog.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_debuglog.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/pub_core_debuglog.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -56,7 +56,7 @@
/* Module startup. */
extern
-void VG_(debugLog_startup) ( Int level, HChar* who );
+void VG_(debugLog_startup) ( Int level, const HChar* who );
/* Whether %ps should escape XML metacharacters. */
Modified: trunk/coregrind/pub_core_aspacemgr.h (+1 -1)
===================================================================
--- trunk/coregrind/pub_core_aspacemgr.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/pub_core_aspacemgr.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -98,7 +98,7 @@
extern ULong VG_(am_get_anonsize_total)( void );
/* Show the segment array on the debug log, at given loglevel. */
-extern void VG_(am_show_nsegments) ( Int logLevel, HChar* who );
+extern void VG_(am_show_nsegments) ( Int logLevel, const HChar* who );
/* Get the filename corresponding to this segment, if known and if it
has one. The returned name's storage cannot be assumed to be
Modified: trunk/coregrind/m_hashtable.c (+2 -2)
===================================================================
--- trunk/coregrind/m_hashtable.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_hashtable.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -47,7 +47,7 @@
UInt iterChain; // next chain to be traversed by the iterator
VgHashNode** chains; // expanding array of hash chains
Bool iterOK; // table safe to iterate over?
- HChar* name; // name of table (for debugging only)
+ const HChar* name; // name of table (for debugging only)
};
#define N_HASH_PRIMES 20
@@ -64,7 +64,7 @@
/*--- Functions ---*/
/*--------------------------------------------------------------------*/
-VgHashTable VG_(HT_construct) ( HChar* name )
+VgHashTable VG_(HT_construct) ( const HChar* name )
{
/* Initialises to zero, ie. all entries NULL */
SizeT n_chains = primes[0];
Modified: trunk/coregrind/m_aspacemgr/aspacemgr-common.c (+6 -6)
===================================================================
--- trunk/coregrind/m_aspacemgr/aspacemgr-common.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_aspacemgr/aspacemgr-common.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -64,14 +64,14 @@
aspacem_assert(2+2 == 5);
}
-void ML_(am_barf) ( HChar* what )
+void ML_(am_barf) ( const HChar* what )
{
VG_(debugLog)(0, "aspacem", "Valgrind: FATAL: %s\n", what);
VG_(debugLog)(0, "aspacem", "Exiting now.\n");
ML_(am_exit)(1);
}
-void ML_(am_barf_toolow) ( HChar* what )
+void ML_(am_barf_toolow) ( const HChar* what )
{
VG_(debugLog)(0, "aspacem",
"Valgrind: FATAL: %s is too low.\n", what);
@@ -81,9 +81,9 @@
}
void ML_(am_assert_fail)( const HChar* expr,
- const Char* file,
+ const HChar* file,
Int line,
- const Char* fn )
+ const HChar* fn )
{
VG_(debugLog)(0, "aspacem",
"Valgrind: FATAL: aspacem assertion failed:\n");
@@ -115,7 +115,7 @@
UInt local_vsprintf ( HChar* buf, const HChar *format, va_list vargs )
{
Int ret;
- Char *aspacem_sprintf_ptr = buf;
+ HChar *aspacem_sprintf_ptr = buf;
ret = VG_(debugLog_vprintf)
( local_add_to_aspacem_sprintf_buf,
@@ -240,7 +240,7 @@
/* --- Pertaining to files --- */
-SysRes ML_(am_open) ( const Char* pathname, Int flags, Int mode )
+SysRes ML_(am_open) ( const HChar* pathname, Int flags, Int mode )
{
SysRes res = VG_(do_syscall3)(__NR_open, (UWord)pathname, flags, mode);
return res;
Modified: trunk/callgrind/sim.c (+5 -6)
===================================================================
--- trunk/callgrind/sim.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/sim.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -66,7 +66,7 @@
/* Cache state */
typedef struct {
- char* name;
+ const HChar* name;
int size; /* bytes */
int assoc;
int line_size; /* bytes */
@@ -76,7 +76,7 @@
int line_size_bits;
int tag_shift;
UWord tag_mask;
- char desc_line[128];
+ HChar desc_line[128];
UWord* tags;
/* for cache use */
@@ -1418,7 +1418,7 @@
}
-static void cachesim_getdesc(Char* buf)
+static void cachesim_getdesc(HChar* buf)
{
Int p;
p = VG_(sprintf)(buf, "\ndesc: I1 cache: %s\n", I1.desc_line);
@@ -1472,7 +1472,7 @@
/* Adds commas to ULong, right justifying in a field field_width wide, returns
* the string in buf. */
static
-Int commify(ULong n, int field_width, char* buf)
+Int commify(ULong n, int field_width, HChar* buf)
{
int len, n_commas, i, j, new_len, space;
@@ -1502,7 +1502,7 @@
}
static
-void percentify(Int n, Int ex, Int field_width, char buf[])
+void percentify(Int n, Int ex, Int field_width, HChar buf[])
{
int i, len, space;
@@ -1796,4 +1796,3 @@
/*--------------------------------------------------------------------*/
/*--- end ct_sim.c ---*/
/*--------------------------------------------------------------------*/
-
Modified: trunk/massif/ms_main.c (+3 -3)
===================================================================
--- trunk/massif/ms_main.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/massif/ms_main.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -2139,7 +2139,7 @@
//--- Writing snapshots ---//
//------------------------------------------------------------//
-Char FP_buf[BUF_LEN];
+HChar FP_buf[BUF_LEN];
// XXX: implement f{,n}printf in m_libcprint.c eventually, and use it here.
// Then change Cachegrind to use it too.
@@ -2150,9 +2150,9 @@
})
// Nb: uses a static buffer, each call trashes the last string returned.
-static Char* make_perc(double x)
+static HChar* make_perc(double x)
{
- static Char mbuf[32];
+ static HChar mbuf[32];
VG_(percentify)((ULong)(x * 100), 10000, 2, 6, mbuf);
// XXX: this is bogus if the denominator was zero -- resulting string is
Modified: trunk/coregrind/m_aspacemgr/priv_aspacemgr.h (+5 -5)
===================================================================
--- trunk/coregrind/m_aspacemgr/priv_aspacemgr.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_aspacemgr/priv_aspacemgr.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -65,14 +65,14 @@
__attribute__ ((noreturn))
extern void ML_(am_exit) ( Int status );
-extern void ML_(am_barf) ( HChar* what );
-extern void ML_(am_barf_toolow) ( HChar* what );
+extern void ML_(am_barf) ( const HChar* what );
+extern void ML_(am_barf_toolow) ( const HChar* what );
__attribute__ ((noreturn))
extern void ML_(am_assert_fail) ( const HChar* expr,
- const Char* file,
+ const HChar* file,
Int line,
- const Char* fn );
+ const HChar* fn );
#define aspacem_assert(expr) \
((void) ((expr) ? 0 : \
@@ -105,7 +105,7 @@
/* There is also VG_(do_mmap_NO_NOTIFY), but that's not declared
here (obviously). */
-extern SysRes ML_(am_open) ( const Char* pathname, Int flags, Int mode );
+extern SysRes ML_(am_open) ( const HChar* pathname, Int flags, Int mode );
extern void ML_(am_close) ( Int fd );
extern Int ML_(am_read) ( Int fd, void* buf, Int count);
extern Int ML_(am_readlink) ( HChar* path, HChar* buf, UInt bufsiz );
Modified: trunk/callgrind/fn.c (+1 -1)
===================================================================
--- trunk/callgrind/fn.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/fn.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -488,7 +488,7 @@
*/
fn_node* CLG_(get_fn_node)(BB* bb)
{
- Char filename[FILENAME_LEN], fnname[FN_NAME_LEN];
+ HChar filename[FILENAME_LEN], fnname[FN_NAME_LEN];
DebugInfo* di;
UInt line_num;
fn_node* fn;
Modified: trunk/memcheck/mc_include.h (+4 -4)
===================================================================
--- trunk/memcheck/mc_include.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/memcheck/mc_include.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -342,9 +342,9 @@
// if delta_mode == LCD_Any, prints in buf an empty string
// otherwise prints a delta in the layout " (+%'lu)" or " (-%'lu)"
-extern char * MC_(snprintf_delta) (char * buf, Int size,
- SizeT current_val, SizeT old_val,
- LeakCheckDeltaMode delta_mode);
+extern HChar * MC_(snprintf_delta) (HChar * buf, Int size,
+ SizeT current_val, SizeT old_val,
+ LeakCheckDeltaMode delta_mode);
Bool MC_(is_valid_aligned_word) ( Addr a );
@@ -380,7 +380,7 @@
Bool MC_(error_matches_suppression) ( Error* err, Supp* su );
Bool MC_(get_extra_suppression_info) ( Error* err,
- /*OUT*/Char* buf, Int nBuf );
+ /*OUT*/HChar* buf, Int nBuf );
const HChar* MC_(get_error_name) ( Error* err );
Modified: trunk/helgrind/hg_errors.h (+1 -1)
===================================================================
--- trunk/helgrind/hg_errors.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/helgrind/hg_errors.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -45,7 +45,7 @@
Bool HG_(error_matches_suppression) ( Error* err, Supp* su );
const HChar* HG_(get_error_name) ( Error* err );
Bool HG_(get_extra_suppression_info) ( Error* err,
- /*OUT*/Char* buf, Int nBuf );
+ /*OUT*/HChar* buf, Int nBuf );
/* Functions for recording various kinds of errors. */
void HG_(record_error_Race) ( Thread* thr,
Modified: trunk/helgrind/hg_errors.c (+1 -1)
===================================================================
--- trunk/helgrind/hg_errors.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/helgrind/hg_errors.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -1390,7 +1390,7 @@
}
Bool HG_(get_extra_suppression_info) ( Error* err,
- /*OUT*/Char* buf, Int nBuf )
+ /*OUT*/HChar* buf, Int nBuf )
{
/* Do nothing */
return False;
Modified: trunk/exp-sgcheck/pc_common.h (+1 -1)
===================================================================
--- trunk/exp-sgcheck/pc_common.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/exp-sgcheck/pc_common.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -57,7 +57,7 @@
Bool pc_error_matches_suppression (Error* err, Supp* su);
const HChar* pc_get_error_name ( Error* err );
Bool pc_get_extra_suppression_info ( Error* err,
- /*OUT*/Char* buf, Int nBuf );
+ /*OUT*/HChar* buf, Int nBuf );
extern Bool h_clo_partial_loads_ok;
/* extern Bool h_clo_lossage_check; */
Modified: trunk/exp-sgcheck/pc_common.c (+9 -9)
===================================================================
--- trunk/exp-sgcheck/pc_common.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/exp-sgcheck/pc_common.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -268,7 +268,7 @@
/* Do a printf-style operation on either the XML or normal output
channel, depending on the setting of VG_(clo_xml).
*/
-static void emit_WRK ( HChar* format, va_list vargs )
+static void emit_WRK ( const HChar* format, va_list vargs )
{
if (VG_(clo_xml)) {
VG_(vprintf_xml)(format, vargs);
@@ -276,15 +276,15 @@
VG_(vmessage)(Vg_UserMsg, format, vargs);
}
}
-static void emit ( HChar* format, ... ) PRINTF_CHECK(1, 2);
-static void emit ( HChar* format, ... )
+static void emit ( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+static void emit ( const HChar* format, ... )
{
va_list vargs;
va_start(vargs, format);
emit_WRK(format, vargs);
va_end(vargs);
}
-static void emiN ( HChar* format, ... ) /* With NO FORMAT CHECK */
+static void emiN ( const HChar* format, ... ) /* With NO FORMAT CHECK */
{
va_list vargs;
va_start(vargs, format);
@@ -293,7 +293,7 @@
}
-static HChar* readwrite(SSizeT sszB)
+static const HChar* readwrite(SSizeT sszB)
{
return ( sszB < 0 ? "write" : "read" );
}
@@ -348,7 +348,7 @@
//----------------------------------------------------------
case XE_Heap: {
- HChar *place, *legit, *how_invalid;
+ const HChar *place, *legit, *how_invalid;
Addr a = xe->XE.Heap.addr;
Seg* vseg = xe->XE.Heap.vseg;
@@ -468,7 +468,7 @@
case XE_Arith: {
Seg* seg1 = xe->XE.Arith.seg1;
Seg* seg2 = xe->XE.Arith.seg2;
- HChar* which;
+ const HChar* which;
tl_assert(BOTTOM != seg1);
tl_assert(BOTTOM != seg2 && UNKNOWN != seg2);
@@ -545,7 +545,7 @@
Seg* seglo = xe->XE.SysParam.seglo;
Seg* seghi = xe->XE.SysParam.seghi;
const HChar* s = VG_(get_error_string) (err);
- HChar* what;
+ const HChar* what;
tl_assert(BOTTOM != seglo && BOTTOM != seghi);
@@ -778,7 +778,7 @@
}
Bool pc_get_extra_suppression_info ( Error* err,
- /*OUT*/Char* buf, Int nBuf )
+ /*OUT*/HChar* buf, Int nBuf )
{
ErrorKind ekind = VG_(get_error_kind )(err);
tl_assert(buf);
Modified: trunk/callgrind/dump.c (+56 -56)
===================================================================
--- trunk/callgrind/dump.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/callgrind/dump.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -41,7 +41,7 @@
static Bool dumps_initialized = False;
/* Command */
-static Char cmdbuf[BUF_LEN];
+static HChar cmdbuf[BUF_LEN];
/* Total reads/writes/misses sum over all dumps and threads.
* Updated during CC traversal at dump time.
@@ -55,7 +55,7 @@
* print_fn_pos, fprint_apos, fprint_fcost, fprint_jcc,
* fprint_fcc_ln, dump_run_info, dump_state_info
*/
-static Char outbuf[FILENAME_LEN + FN_NAME_LEN + OBJ_NAME_LEN + COSTS_LEN];
+static HChar outbuf[FILENAME_LEN + FN_NAME_LEN + OBJ_NAME_LEN + COSTS_LEN];
Int CLG_(get_dump_counter)(void)
{
@@ -145,15 +145,15 @@
#if 0
static __inline__
-static void my_fwrite(Int fd, Char* buf, Int len)
+static void my_fwrite(Int fd, HChar* buf, Int len)
{
- VG_(write)(fd, (void*)buf, len);
+ VG_(write)(fd, buf, len);
}
#else
#define FWRITE_BUFSIZE 32000
#define FWRITE_THROUGH 10000
-static Char fwrite_buf[FWRITE_BUFSIZE];
+static HChar fwrite_buf[FWRITE_BUFSIZE];
static Int fwrite_pos;
static Int fwrite_fd = -1;
@@ -161,11 +161,11 @@
void fwrite_flush(void)
{
if ((fwrite_fd>=0) && (fwrite_pos>0))
- VG_(write)(fwrite_fd, (void*)fwrite_buf, fwrite_pos);
+ VG_(write)(fwrite_fd, fwrite_buf, fwrite_pos);
fwrite_pos = 0;
}
-static void my_fwrite(Int fd, Char* buf, Int len)
+static void my_fwrite(Int fd, HChar* buf, Int len)
{
if (fwrite_fd != fd) {
fwrite_flush();
@@ -173,7 +173,7 @@
}
if (len > FWRITE_THROUGH) {
fwrite_flush();
- VG_(write)(fd, (void*)buf, len);
+ VG_(write)(fd, buf, len);
return;
}
if (FWRITE_BUFSIZE - fwrite_pos <= len) fwrite_flush();
@@ -183,7 +183,7 @@
#endif
-static void print_obj(Char* buf, obj_node* obj)
+static void print_obj(HChar* buf, obj_node* obj)
{
//int n;
@@ -212,7 +212,7 @@
#endif
}
-static void print_file(Char* buf, file_node* file)
+static void print_file(HChar* buf, file_node* file)
{
if (CLG_(clo).compress_strings) {
CLG_ASSERT(file_dumped != 0);
@@ -231,7 +231,7 @@
/*
* tag can be "fn", "cfn", "jfn"
*/
-static void print_fn(Int fd, Char* buf, const HChar* tag, fn_node* fn)
+static void print_fn(Int fd, HChar* buf, const HChar* tag, fn_node* fn)
{
int p;
p = VG_(sprintf)(buf, "%s=",tag);
@@ -251,7 +251,7 @@
my_fwrite(fd, buf, p);
}
-static void print_mangled_fn(Int fd, Char* buf, const HChar* tag,
+static void print_mangled_fn(Int fd, HChar* buf, const HChar* tag,
Context* cxt, int rec_index)
{
int p, i;
@@ -346,7 +346,7 @@
if (!CLG_(clo).mangle_names) {
if (last->rec_index != bbcc->rec_index) {
VG_(sprintf)(outbuf, "rec=%d\n\n", bbcc->rec_index);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
last->rec_index = bbcc->rec_index;
last->cxt = 0; /* reprint context */
res = True;
@@ -361,7 +361,7 @@
if (last_from != 0) {
/* switch back to no context */
VG_(sprintf)(outbuf, "frfn=(spontaneous)\n");
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
res = True;
}
}
@@ -376,7 +376,7 @@
if (last->obj != bbcc->cxt->fn[0]->file->obj) {
VG_(sprintf)(outbuf, "ob=");
print_obj(outbuf+3, bbcc->cxt->fn[0]->file->obj);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
last->obj = bbcc->cxt->fn[0]->file->obj;
res = True;
}
@@ -384,7 +384,7 @@
if (last->file != bbcc->cxt->fn[0]->file) {
VG_(sprintf)(outbuf, "fl=");
print_file(outbuf+3, bbcc->cxt->fn[0]->file);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
last->file = bbcc->cxt->fn[0]->file;
res = True;
}
@@ -534,13 +534,13 @@
else
VG_(sprintf)(outbuf, "fi=");
print_file(outbuf+3, curr->file);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
if (CLG_(clo).dump_bbs) {
if (curr->line != last->line) {
VG_(sprintf)(outbuf, "ln=%d\n", curr->line);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
}
}
@@ -606,7 +606,7 @@
VG_(sprintf)(outbuf+p, "%u ", curr->line);
}
}
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
@@ -619,7 +619,7 @@
{
int p = CLG_(sprint_mappingcost)(outbuf, es, cost);
VG_(sprintf)(outbuf+p, "\n");
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
return;
}
@@ -692,7 +692,7 @@
if (last->file != target.file) {
VG_(sprintf)(outbuf, "jfi=");
print_file(outbuf+4, target.file);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
if (jcc->from->cxt != jcc->to->cxt) {
@@ -713,7 +713,7 @@
VG_(sprintf)(outbuf, "jump=%llu ",
jcc->call_counter);
}
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
fprint_pos(fd, &target, last);
my_fwrite(fd, "\n", 1);
@@ -731,14 +731,14 @@
if (jcc->from->cxt->fn[0]->file->obj != obj) {
VG_(sprintf)(outbuf, "cob=");
print_obj(outbuf+4, obj);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
/* file of called position different to current file? */
if (last->file != file) {
VG_(sprintf)(outbuf, "cfi=");
print_file(outbuf+4, file);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
if (CLG_(clo).mangle_names)
@@ -749,7 +749,7 @@
if (!CLG_(is_zero_cost)( CLG_(sets).full, jcc->cost)) {
VG_(sprintf)(outbuf, "calls=%llu ",
jcc->call_counter);
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
fprint_pos(fd, &target, last);
my_fwrite(fd, "\n", 1);
@@ -893,7 +893,7 @@
currCost->cost, bbcc->skipped );
#if 0
VG_(sprintf)(outbuf, "# Skipped\n");
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
#endif
fprint_fcost(fd, currCost, last);
}
@@ -915,7 +915,7 @@
fprint_apos(fd, &(currCost->p), last, bbcc->cxt->fn[0]->file);
fprint_fcost(fd, currCost, last);
}
- if (CLG_(clo).dump_bbs) my_fwrite(fd, (void*)"\n", 1);
+ if (CLG_(clo).dump_bbs) my_fwrite(fd, "\n", 1);
/* when every cost was immediatly written, we must have done so,
* as this function is only called when there's cost in a BBCC
@@ -1259,11 +1259,11 @@
p = VG_(sprintf)(outbuf, "%s", prefix);
p += CLG_(sprint_mappingcost)(outbuf + p, em, cost);
VG_(sprintf)(outbuf + p, "\n");
- my_fwrite(fd, (void*)outbuf, VG_(strlen)(outbuf));
+ my_fwrite(fd, outbuf, VG_(strlen)(outbuf));
}
static ULong bbs_done = 0;
-static Char* filename = 0;
+static HChar* filename = 0;
static
void file_err(void)
@@ -1283,7 +1283,7 @@
*
* Returns the file descriptor, and -1 on error (no write permission)
*/
-static int new_dumpfile(Char buf[BUF_LEN], int tid, const HChar* trigger)
+static int new_dumpfile(HChar buf[BUF_LEN], int tid, const HChar* trigger)
{
Bool appending = False;
int i, fd;
@@ -1331,27 +1331,27 @@
if (!appending) {
/* version */
VG_(sprintf)(buf, "version: 1\n");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
/* creator */
VG_(sprintf)(buf, "creator: callgrind-" VERSION "\n");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
/* "pid:" line */
VG_(sprintf)(buf, "pid: %d\n", VG_(getpid)());
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
/* "cmd:" line */
VG_(strcpy)(buf, "cmd: ");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
- my_fwrite(fd, (void*)cmdbuf, VG_(strlen)(cmdbuf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
+ my_fwrite(fd, cmdbuf, VG_(strlen)(cmdbuf));
}
VG_(sprintf)(buf, "\npart: %d\n", out_counter);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
if (CLG_(clo).separate_threads) {
VG_(sprintf)(buf, "thread: %d\n", tid);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
/* "desc:" lines */
@@ -1362,36 +1362,36 @@
/* Global options changing the tracing behaviour */
VG_(sprintf)(buf, "\ndesc: Option: --skip-plt=%s\n",
CLG_(clo).skip_plt ? "yes" : "no");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Option: --collect-jumps=%s\n",
CLG_(clo).collect_jumps ? "yes" : "no");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Option: --separate-recs=%d\n",
CLG_(clo).separate_recursions);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Option: --separate-callers=%d\n",
CLG_(clo).separate_callers);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Option: --dump-bbs=%s\n",
CLG_(clo).dump_bbs ? "yes" : "no");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Option: --separate-threads=%s\n",
CLG_(clo).separate_threads ? "yes" : "no");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
#endif
(*CLG_(cachesim).getdesc)(buf);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
VG_(sprintf)(buf, "\ndesc: Timerange: Basic block %llu - %llu\n",
bbs_done, CLG_(stat).bb_executions);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
VG_(sprintf)(buf, "desc: Trigger: %s\n",
trigger ? trigger : "Program termination");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
#if 0
/* Output function specific config
@@ -1401,27 +1401,27 @@
while (fnc) {
if (fnc->skip) {
VG_(sprintf)(buf, "desc: Option: --fn-skip=%s\n", fnc->name);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
if (fnc->dump_at_enter) {
VG_(sprintf)(buf, "desc: Option: --fn-dump-at-enter=%s\n",
fnc->name);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
if (fnc->dump_at_leave) {
VG_(sprintf)(buf, "desc: Option: --fn-dump-at-leave=%s\n",
fnc->name);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
if (fnc->separate_callers != CLG_(clo).separate_callers) {
VG_(sprintf)(buf, "desc: Option: --separate-callers%d=%s\n",
fnc->separate_callers, fnc->name);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
if (fnc->separate_recursions != CLG_(clo).separate_recursions) {
VG_(sprintf)(buf, "desc: Option: --separate-recs%d=%s\n",
fnc->separate_recursions, fnc->name);
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
}
fnc = fnc->next;
}
@@ -1433,12 +1433,12 @@
CLG_(clo).dump_instr ? " instr" : "",
CLG_(clo).dump_bb ? " bb" : "",
CLG_(clo).dump_line ? " line" : "");
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
/* "events:" line */
i = VG_(sprintf)(buf, "events: ");
CLG_(sprint_eventmapping)(buf+i, CLG_(dumpmap));
- my_fwrite(fd, (void*)buf, VG_(strlen)(buf));
+ my_fwrite(fd, buf, VG_(strlen)(buf));
my_fwrite(fd, "\n", 1);
/* summary lines */
@@ -1504,7 +1504,7 @@
static Int print_fd;
static const HChar* print_trigger;
-static Char print_buf[BUF_LEN];
+static HChar print_buf[BUF_LEN];
static void print_bbccs_of_thread(thread_info* ti)
{
@@ -1541,7 +1541,7 @@
/* switch back to file of function */
VG_(sprintf)(print_buf, "fe=");
print_file(print_buf+3, lastFnPos.cxt->fn[0]->file);
- my_fwrite(print_fd, (void*)print_buf, VG_(strlen)(print_buf));
+ my_fwrite(print_fd, print_buf, VG_(strlen)(print_buf));
}
my_fwrite(print_fd, "\n", 1);
}
@@ -1571,7 +1571,7 @@
VG_(sprintf)(print_buf+pos, "%d %llu\n",
(*p)->bb->instr_count,
ecounter);
- my_fwrite(print_fd, (void*)print_buf, VG_(strlen)(print_buf));
+ my_fwrite(print_fd, print_buf, VG_(strlen)(print_buf));
}
fprint_bbcc(print_fd, *p, &lastAPos);
Modified: trunk/coregrind/m_tooliface.c (+1 -1)
===================================================================
--- trunk/coregrind/m_tooliface.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/coregrind/m_tooliface.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -234,7 +234,7 @@
Bool (*read_extra) (Int, Char**, SizeT*, Supp*),
Bool (*matches) (Error*, Supp*),
const HChar* (*name) (Error*),
- Bool (*get_xtra_si)(Error*,/*OUT*/Char*,Int)
+ Bool (*get_xtra_si)(Error*,/*OUT*/HChar*,Int)
)
{
VG_(needs).tool_errors = True;
Modified: trunk/include/pub_tool_tooliface.h (+1 -1)
===================================================================
--- trunk/include/pub_tool_tooliface.h 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/include/pub_tool_tooliface.h 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -343,7 +343,7 @@
// do nothing, and return False. This function is the inverse of
// VG_(tdict).tool_read_extra_suppression_info().
Bool (*print_extra_suppression_info)(Error* err,
- /*OUT*/Char* buf, Int nBuf)
+ /*OUT*/HChar* buf, Int nBuf)
);
/* Is information kept by the tool about specific instructions or
Modified: trunk/drd/tests/unit_vc.c (+1 -1)
===================================================================
--- trunk/drd/tests/unit_vc.c 2012-10-27 18:46:44 +01:00 (rev 13087)
+++ trunk/drd/tests/unit_vc.c 2012-10-27 19:39:11 +01:00 (rev 13088)
@@ -40,7 +40,7 @@
{ return memcmp(s1, s2, n); }
UInt VG_(printf)(const HChar *format, ...)
{ UInt ret; va_list vargs; va_start(vargs, format); ret = vprintf(format, vargs); va_end(vargs); return ret; }
-UInt VG_...
[truncated message content] |