From 5de39dd72a73495f7f3f9121e10f0ca883974fee Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Sat, 3 Nov 2012 19:32:28 +0000 Subject: [PATCH] Fix Char/HChar mixups and constness in m_scheduler. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13103 --- coregrind/m_scheduler/priv_sched-lock-impl.h | 2 +- coregrind/m_scheduler/priv_sched-lock.h | 2 +- coregrind/m_scheduler/sched-lock-generic.c | 2 +- coregrind/m_scheduler/sched-lock.c | 2 +- coregrind/m_scheduler/scheduler.c | 12 ++++++------ coregrind/m_scheduler/sema.c | 10 +++++----- coregrind/m_scheduler/ticket-lock-linux.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/coregrind/m_scheduler/priv_sched-lock-impl.h b/coregrind/m_scheduler/priv_sched-lock-impl.h index 2eb1b8980..efff82e22 100644 --- a/coregrind/m_scheduler/priv_sched-lock-impl.h +++ b/coregrind/m_scheduler/priv_sched-lock-impl.h @@ -33,7 +33,7 @@ #define __PRIV_SCHED_LOCK_IMPL_H struct sched_lock_ops { - const Char *(*get_sched_lock_name)(void); + const HChar *(*get_sched_lock_name)(void); struct sched_lock *(*create_sched_lock)(void); void (*destroy_sched_lock)(struct sched_lock *p); int (*get_sched_lock_owner)(struct sched_lock *p); diff --git a/coregrind/m_scheduler/priv_sched-lock.h b/coregrind/m_scheduler/priv_sched-lock.h index c41173534..a0b348801 100644 --- a/coregrind/m_scheduler/priv_sched-lock.h +++ b/coregrind/m_scheduler/priv_sched-lock.h @@ -37,7 +37,7 @@ struct sched_lock; enum SchedLockType { sched_lock_generic, sched_lock_ticket }; Bool ML_(set_sched_lock_impl)(const enum SchedLockType t); -const Char *ML_(get_sched_lock_name)(void); +const HChar *ML_(get_sched_lock_name)(void); struct sched_lock *ML_(create_sched_lock)(void); void ML_(destroy_sched_lock)(struct sched_lock *p); int ML_(get_sched_lock_owner)(struct sched_lock *p); diff --git a/coregrind/m_scheduler/sched-lock-generic.c b/coregrind/m_scheduler/sched-lock-generic.c index be01fff5f..8fcdd7fae 100644 --- a/coregrind/m_scheduler/sched-lock-generic.c +++ b/coregrind/m_scheduler/sched-lock-generic.c @@ -41,7 +41,7 @@ struct sched_lock { vg_sema_t sema; }; -static const Char *get_sched_lock_name(void) +static const HChar *get_sched_lock_name(void) { return "generic"; } diff --git a/coregrind/m_scheduler/sched-lock.c b/coregrind/m_scheduler/sched-lock.c index f6fdb4dfc..71bc55973 100644 --- a/coregrind/m_scheduler/sched-lock.c +++ b/coregrind/m_scheduler/sched-lock.c @@ -65,7 +65,7 @@ Bool ML_(set_sched_lock_impl)(const enum SchedLockType t) return !!p; } -const Char *ML_(get_sched_lock_name)(void) +const HChar *ML_(get_sched_lock_name)(void) { return (sched_lock_ops->get_sched_lock_name)(); } diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 24ff106ca..ef41c64c4 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -193,7 +193,7 @@ void maybe_show_sb_counts ( void ) } static -HChar* name_of_sched_event ( UInt event ) +const HChar* name_of_sched_event ( UInt event ) { switch (event) { case VEX_TRC_JMP_TINVAL: return "TINVAL"; @@ -1711,7 +1711,7 @@ void do_client_request ( ThreadId tid ) } u; u.uw = (unsigned long)arg[2]; Int count = - VG_(vmessage)( Vg_ClientMsg, (char *)arg[1], u.vargs ); + VG_(vmessage)( Vg_ClientMsg, (HChar *)arg[1], u.vargs ); VG_(message_flush)(); SET_CLREQ_RETVAL( tid, count ); break; @@ -1728,7 +1728,7 @@ void do_client_request ( ThreadId tid ) } u; u.uw = (unsigned long)arg[2]; Int count = - VG_(vmessage)( Vg_ClientMsg, (char *)arg[1], u.vargs ); + VG_(vmessage)( Vg_ClientMsg, (HChar *)arg[1], u.vargs ); VG_(message_flush)(); VG_(get_and_pp_StackTrace)( tid, VG_(clo_backtrace_size) ); SET_CLREQ_RETVAL( tid, count ); @@ -1738,7 +1738,7 @@ void do_client_request ( ThreadId tid ) case VG_USERREQ__PRINTF_VALIST_BY_REF: { va_list* vargsp = (va_list*)arg[2]; Int count = - VG_(vmessage)( Vg_ClientMsg, (char *)arg[1], *vargsp ); + VG_(vmessage)( Vg_ClientMsg, (HChar *)arg[1], *vargsp ); VG_(message_flush)(); SET_CLREQ_RETVAL( tid, count ); break; @@ -1747,7 +1747,7 @@ void do_client_request ( ThreadId tid ) case VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF: { va_list* vargsp = (va_list*)arg[2]; Int count = - VG_(vmessage)( Vg_ClientMsg, (char *)arg[1], *vargsp ); + VG_(vmessage)( Vg_ClientMsg, (HChar *)arg[1], *vargsp ); VG_(message_flush)(); VG_(get_and_pp_StackTrace)( tid, VG_(clo_backtrace_size) ); SET_CLREQ_RETVAL( tid, count ); @@ -1757,7 +1757,7 @@ void do_client_request ( ThreadId tid ) case VG_USERREQ__INTERNAL_PRINTF_VALIST_BY_REF: { va_list* vargsp = (va_list*)arg[2]; Int count = - VG_(vmessage)( Vg_DebugMsg, (char *)arg[1], *vargsp ); + VG_(vmessage)( Vg_DebugMsg, (HChar *)arg[1], *vargsp ); VG_(message_flush)(); SET_CLREQ_RETVAL( tid, count ); break; diff --git a/coregrind/m_scheduler/sema.c b/coregrind/m_scheduler/sema.c index bbdcf1928..2cb51d9df 100644 --- a/coregrind/m_scheduler/sema.c +++ b/coregrind/m_scheduler/sema.c @@ -49,12 +49,12 @@ it easier to make sense of strace/truss output - makes it possible to see more clearly the change of ownership of the lock. Need to be careful to reinitialise it at fork() time. */ -static Char sema_char = '!'; /* will cause assertion failures if used - before sema_init */ +static HChar sema_char = '!'; /* will cause assertion failures if used + before sema_init */ void ML_(sema_init)(vg_sema_t *sema) { - Char buf[2]; + HChar buf[2]; Int res, r; r = VG_(pipe)(sema->pipe); vg_assert(r == 0); @@ -97,7 +97,7 @@ void ML_(sema_deinit)(vg_sema_t *sema) /* get a token */ void ML_(sema_down)( vg_sema_t *sema, Bool as_LL ) { - Char buf[2]; + HChar buf[2]; Int ret; Int lwpid = VG_(gettid)(); @@ -130,7 +130,7 @@ void ML_(sema_down)( vg_sema_t *sema, Bool as_LL ) void ML_(sema_up)( vg_sema_t *sema, Bool as_LL ) { Int ret; - Char buf[2]; + HChar buf[2]; vg_assert(as_LL == sema->held_as_LL); buf[0] = sema_char; buf[1] = 0; diff --git a/coregrind/m_scheduler/ticket-lock-linux.c b/coregrind/m_scheduler/ticket-lock-linux.c index e28841cc8..477b6a885 100644 --- a/coregrind/m_scheduler/ticket-lock-linux.c +++ b/coregrind/m_scheduler/ticket-lock-linux.c @@ -68,7 +68,7 @@ static Bool s_debug; static Bool s_debug = True; #endif -static const Char *get_sched_lock_name(void) +static const HChar *get_sched_lock_name(void) { return "ticket lock"; }