Fix Char/HChar mixups and constness in m_scheduler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13103 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_scheduler/priv_sched-lock-impl.h b/coregrind/m_scheduler/priv_sched-lock-impl.h
index 2eb1b89..efff82e 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 c411735..a0b3488 100644
--- a/coregrind/m_scheduler/priv_sched-lock.h
+++ b/coregrind/m_scheduler/priv_sched-lock.h
@@ -37,7 +37,7 @@
 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 be01fff..8fcdd7f 100644
--- a/coregrind/m_scheduler/sched-lock-generic.c
+++ b/coregrind/m_scheduler/sched-lock-generic.c
@@ -41,7 +41,7 @@
    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 f6fdb4d..71bc559 100644
--- a/coregrind/m_scheduler/sched-lock.c
+++ b/coregrind/m_scheduler/sched-lock.c
@@ -65,7 +65,7 @@
    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 24ff106..ef41c64 100644
--- a/coregrind/m_scheduler/scheduler.c
+++ b/coregrind/m_scheduler/scheduler.c
@@ -193,7 +193,7 @@
 }
 
 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 @@
          } 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 @@
          } 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 @@
       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 @@
       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 @@
       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 bbdcf19..2cb51d9 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 @@
 /* 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_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 e28841c..477b6a8 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 = True;
 #endif
 
-static const Char *get_sched_lock_name(void)
+static const HChar *get_sched_lock_name(void)
 {
    return "ticket lock";
 }