Fix Char/HChar mixups and constness in m_scheduler.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13103
This commit is contained in:
Florian Krohm 2012-11-03 19:32:28 +00:00
parent b906e8df12
commit 5de39dd72a
7 changed files with 16 additions and 16 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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";
}

View File

@ -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)();
}

View File

@ -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;

View File

@ -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;

View File

@ -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";
}