Fix more Char/HChar mixups. Closing in...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index 133784a..e35af22 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -216,8 +216,8 @@
                                    /*OUT*/Addr*    avma,
                                    /*OUT*/Addr*    tocptr,
                                    /*OUT*/UInt*    size,
-                                   /*OUT*/UChar**  pri_name,
-                                   /*OUT*/UChar*** sec_names,
+                                   /*OUT*/HChar**  pri_name,
+                                   /*OUT*/HChar*** sec_names,
                                    /*OUT*/Bool*    isText,
                                    /*OUT*/Bool*    isIFunc );
 
diff --git a/include/pub_tool_errormgr.h b/include/pub_tool_errormgr.h
index 4d6af06..039115d 100644
--- a/include/pub_tool_errormgr.h
+++ b/include/pub_tool_errormgr.h
@@ -94,7 +94,7 @@
    the process).  (It will bomb out if the size gets ridiculous).  Skips
    leading spaces on the line.  Increments lineno with the number of lines
    read if lineno is non-NULL. Returns True if EOF was hit.  */
-extern Bool VG_(get_line) ( Int fd, Char** bufpp, SizeT* nBufp, Int* lineno );
+extern Bool VG_(get_line) ( Int fd, HChar** bufpp, SizeT* nBufp, Int* lineno );
 
 
 /* ------------------------------------------------------------------ */
@@ -119,13 +119,13 @@
 
 /* Useful in VG_(tdict).tool_error_matches_suppression() */
 SuppKind VG_(get_supp_kind)   ( Supp* su );
-Char*    VG_(get_supp_string) ( Supp* su );
+HChar*   VG_(get_supp_string) ( Supp* su );
 void*    VG_(get_supp_extra)  ( Supp* su );
 
 /* Must be used in VG_(recognised_suppression)() */
 void VG_(set_supp_kind)   ( Supp* su, SuppKind suppkind );
 /* May be used in VG_(read_extra_suppression_info)() */
-void VG_(set_supp_string) ( Supp* su, Char* string );
+void VG_(set_supp_string) ( Supp* su, HChar* string );
 void VG_(set_supp_extra)  ( Supp* su, void* extra );
 
 
diff --git a/include/pub_tool_gdbserver.h b/include/pub_tool_gdbserver.h
index 8ceba7b..03a43b4 100644
--- a/include/pub_tool_gdbserver.h
+++ b/include/pub_tool_gdbserver.h
@@ -170,7 +170,7 @@
    user problems via VG_(gdb_printf).  */
 extern void VG_(strtok_get_address_and_size) (Addr* address, 
                                               SizeT* szB, 
-                                              Char **ssaveptr);
+                                              HChar **ssaveptr);
 
 #endif   // __PUB_TOOL_GDBSERVER_H
 
diff --git a/include/pub_tool_libcbase.h b/include/pub_tool_libcbase.h
index 304aa0c..f1b47f5 100644
--- a/include/pub_tool_libcbase.h
+++ b/include/pub_tool_libcbase.h
@@ -35,9 +35,9 @@
    Char functions.
    ------------------------------------------------------------------ */
 
-extern Bool VG_(isspace) ( Char c );
-extern Bool VG_(isdigit) ( Char c );
-extern Char VG_(tolower) ( Char c );
+extern Bool  VG_(isspace) ( HChar c );
+extern Bool  VG_(isdigit) ( HChar c );
+extern HChar VG_(tolower) ( HChar c );
 
 /* ---------------------------------------------------------------------
    Converting strings to numbers
@@ -61,16 +61,16 @@
 // useless because they don't do any error checking and so accept malformed
 // numbers and non-numbers -- eg. "123xyz" gives 123, and "foo" gives 0!
 // If you really want that behaviour, you can use "VG_(strtoll10)(str, NULL)".
-extern Long  VG_(strtoll10) ( Char* str, Char** endptr );
-extern Long  VG_(strtoll16) ( Char* str, Char** endptr );
-extern ULong  VG_(strtoull10) ( Char* str, Char** endptr );
-extern ULong  VG_(strtoull16) ( Char* str, Char** endptr );
+extern Long  VG_(strtoll10) ( const HChar* str, HChar** endptr );
+extern Long  VG_(strtoll16) ( const HChar* str, HChar** endptr );
+extern ULong  VG_(strtoull10) ( const HChar* str, HChar** endptr );
+extern ULong  VG_(strtoull16) ( const HChar* str, HChar** endptr );
 
 // Convert a string to a double.  After leading whitespace is ignored, a
 // '+' or '-' is allowed, and then it accepts a non-empty sequence of
 // decimal digits possibly containing a '.'.  Hexadecimal floats are not
 // accepted, nor are "fancy" floats (eg. "3.4e-5", "NAN").
-extern double VG_(strtod)  ( Char* str, Char** endptr );
+extern double VG_(strtod)  ( const HChar* str, HChar** endptr );
 
 /* ---------------------------------------------------------------------
    String functions and macros
@@ -82,36 +82,36 @@
 #define VG_STREQN(n,s1,s2) ( (s1 != NULL && s2 != NULL \
                              && VG_(strncmp)((s1),(s2),(n))==0) ? True : False )
 
-extern SizeT VG_(strlen)         ( const Char* str );
-extern Char* VG_(strcat)         ( Char* dest, const Char* src );
-extern Char* VG_(strncat)        ( Char* dest, const Char* src, SizeT n );
-extern Char* VG_(strpbrk)        ( const Char* s, const Char* accpt );
-extern Char* VG_(strcpy)         ( Char* dest, const Char* src );
-extern Char* VG_(strncpy)        ( Char* dest, const Char* src, SizeT ndest );
-extern Int   VG_(strcmp)         ( const Char* s1, const Char* s2 );
-extern Int   VG_(strcasecmp)     ( const Char* s1, const Char* s2 );
-extern Int   VG_(strncmp)        ( const Char* s1, const Char* s2, SizeT nmax );
-extern Int   VG_(strncasecmp)    ( const Char* s1, const Char* s2, SizeT nmax );
-extern Char* VG_(strstr)         ( const Char* haystack, const Char* needle );
-extern Char* VG_(strcasestr)     ( const Char* haystack, const Char* needle );
-extern Char* VG_(strchr)         ( const Char* s, Char c );
-extern Char* VG_(strrchr)        ( const Char* s, Char c );
-extern SizeT VG_(strspn)         ( const Char* s, const Char* accpt );
-extern SizeT VG_(strcspn)        ( const Char* s, const Char* reject );
+extern SizeT  VG_(strlen)         ( const HChar* str );
+extern HChar* VG_(strcat)         ( HChar* dest, const HChar* src );
+extern HChar* VG_(strncat)        ( HChar* dest, const HChar* src, SizeT n );
+extern HChar* VG_(strpbrk)        ( const HChar* s, const HChar* accpt );
+extern HChar* VG_(strcpy)         ( HChar* dest, const HChar* src );
+extern HChar* VG_(strncpy)        ( HChar* dest, const HChar* src, SizeT ndest );
+extern Int    VG_(strcmp)         ( const HChar* s1, const HChar* s2 );
+extern Int    VG_(strcasecmp)     ( const HChar* s1, const HChar* s2 );
+extern Int    VG_(strncmp)        ( const HChar* s1, const HChar* s2, SizeT nmax );
+extern Int    VG_(strncasecmp)    ( const HChar* s1, const HChar* s2, SizeT nmax );
+extern HChar* VG_(strstr)         ( const HChar* haystack, const HChar* needle );
+extern HChar* VG_(strcasestr)     ( const HChar* haystack, const HChar* needle );
+extern HChar* VG_(strchr)         ( const HChar* s, HChar c );
+extern HChar* VG_(strrchr)        ( const HChar* s, HChar c );
+extern SizeT  VG_(strspn)         ( const HChar* s, const HChar* accpt );
+extern SizeT  VG_(strcspn)        ( const HChar* s, const HChar* reject );
 
 /* strtok* functions and some parsing utilities. */
-extern Char* VG_(strtok_r)       (Char* s, const Char* delim, Char** saveptr);
-extern Char* VG_(strtok)         (Char* s, const Char* delim);
+extern HChar* VG_(strtok_r)       (HChar* s, const HChar* delim, HChar** saveptr);
+extern HChar* VG_(strtok)         (HChar* s, const HChar* delim);
 
 /* Parse a 32- or 64-bit hex number, including leading 0x, from string
    starting at *ppc, putting result in *result, and return True.  Or
    fail, in which case *ppc and *result are undefined, and return
    False. */
-extern Bool VG_(parse_Addr) ( UChar** ppc, Addr* result );
+extern Bool VG_(parse_Addr) ( const HChar** ppc, Addr* result );
 
 /* Like strncpy(), but if 'src' is longer than 'ndest' inserts a '\0' as the
    last character. */
-extern void  VG_(strncpy_safely) ( Char* dest, const Char* src, SizeT ndest );
+extern void  VG_(strncpy_safely) ( HChar* dest, const HChar* src, SizeT ndest );
 
 /* ---------------------------------------------------------------------
    mem* functions
diff --git a/include/pub_tool_libcfile.h b/include/pub_tool_libcfile.h
index 9777a3d..b9acc1c 100644
--- a/include/pub_tool_libcfile.h
+++ b/include/pub_tool_libcfile.h
@@ -68,38 +68,38 @@
    ULong   ctime_nsec;
 };
 
-extern SysRes VG_(mknod)  ( const Char* pathname, Int mode, UWord dev );
-extern SysRes VG_(open)   ( const Char* pathname, Int flags, Int mode );
+extern SysRes VG_(mknod)  ( const HChar* pathname, Int mode, UWord dev );
+extern SysRes VG_(open)   ( const HChar* pathname, Int flags, Int mode );
 /* fd_open words like the open(2) system call: 
    returns fd if success, -1 otherwise */
-extern Int VG_(fd_open)  (const Char* pathname, Int flags, Int mode);
+extern Int VG_(fd_open)  (const HChar* pathname, Int flags, Int mode);
 extern void   VG_(close)  ( Int fd );
 extern Int    VG_(read)   ( Int fd, void* buf, Int count);
 extern Int    VG_(write)  ( Int fd, const void* buf, Int count);
 extern Int    VG_(pipe)   ( Int fd[2] );
 extern Off64T VG_(lseek)  ( Int fd, Off64T offset, Int whence );
 
-extern SysRes VG_(stat)   ( const Char* file_name, struct vg_stat* buf );
+extern SysRes VG_(stat)   ( const HChar* file_name, struct vg_stat* buf );
 extern Int    VG_(fstat)  ( Int   fd,        struct vg_stat* buf );
 extern SysRes VG_(dup)    ( Int oldfd );
 extern SysRes VG_(dup2)   ( Int oldfd, Int newfd );
-extern Int    VG_(rename) ( const Char* old_name, const Char* new_name );
-extern Int    VG_(unlink) ( const Char* file_name );
+extern Int    VG_(rename) ( const HChar* old_name, const HChar* new_name );
+extern Int    VG_(unlink) ( const HChar* file_name );
 
 extern Int    VG_(poll) (struct vki_pollfd *fds, Int nfds, Int timeout);
 
-extern Int    VG_(readlink)( const Char* path, Char* buf, UInt bufsize );
+extern Int    VG_(readlink)( const HChar* path, HChar* buf, UInt bufsize );
 extern Int    VG_(getdents)( Int fd, struct vki_dirent *dirp, UInt count );
 
-extern Char*  VG_(basename)( const Char* path );
-extern Char*  VG_(dirname) ( const Char* path );
+extern HChar* VG_(basename)( const HChar* path );
+extern HChar* VG_(dirname) ( const HChar* path );
 
 /* Return the name of a directory for temporary files. */
 extern const HChar* VG_(tmpdir)(void);
 
 /* Copy the working directory at startup into buf[0 .. size-1], or return
    False if buf is too small. */
-extern Bool VG_(get_startup_wd) ( Char* buf, SizeT size );
+extern Bool VG_(get_startup_wd) ( HChar* buf, SizeT size );
 
 #endif   // __PUB_TOOL_LIBCFILE_H
 
diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h
index c580f51..7432b82 100644
--- a/include/pub_tool_libcproc.h
+++ b/include/pub_tool_libcproc.h
@@ -36,26 +36,26 @@
    ------------------------------------------------------------------ */
 
 /* Client environment. */
-extern Char** VG_(client_envp);
+extern HChar** VG_(client_envp);
 
 /* Looks up VG_(client_envp) */
-extern Char* VG_(getenv) ( Char* name );
+extern HChar* VG_(getenv) ( const HChar* name );
 
 /* Path to all our library/aux files */
-extern const Char *VG_(libdir);
+extern const HChar *VG_(libdir);
 
 // The name of the LD_PRELOAD-equivalent variable.  It varies across
 // platforms.
-extern const Char* VG_(LD_PRELOAD_var_name);
+extern const HChar* VG_(LD_PRELOAD_var_name);
 
 /* ---------------------------------------------------------------------
    Important syscalls
    ------------------------------------------------------------------ */
 
 extern Int  VG_(waitpid)( Int pid, Int *status, Int options );
-extern Int  VG_(system) ( Char* cmd );
+extern Int  VG_(system) ( const HChar* cmd );
 extern Int  VG_(fork)   ( void);
-extern void VG_(execv)  ( Char* filename, Char** argv );
+extern void VG_(execv)  ( const HChar* filename, HChar** argv );
 
 /* ---------------------------------------------------------------------
    Resource limits and capabilities
diff --git a/include/pub_tool_mallocfree.h b/include/pub_tool_mallocfree.h
index 76167ed..ac5de77 100644
--- a/include/pub_tool_mallocfree.h
+++ b/include/pub_tool_mallocfree.h
@@ -40,8 +40,8 @@
 extern void* VG_(malloc)         ( const HChar* cc, SizeT nbytes );
 extern void  VG_(free)           ( void* p );
 extern void* VG_(calloc)         ( const HChar* cc, SizeT n, SizeT bytes_per_elem );
-extern void* VG_(realloc)        ( const HChar* cc, void* p, SizeT size );
-extern Char* VG_(strdup)         ( const HChar* cc, const Char* s );
+extern void*  VG_(realloc)       ( const HChar* cc, void* p, SizeT size );
+extern HChar* VG_(strdup)        ( const HChar* cc, const HChar* s );
 
 // Returns the usable size of a heap-block.  It's the asked-for size plus
 // possibly some more due to rounding up.
diff --git a/include/pub_tool_options.h b/include/pub_tool_options.h
index fd90f44..ef13712 100644
--- a/include/pub_tool_options.h
+++ b/include/pub_tool_options.h
@@ -51,7 +51,7 @@
 #define VG_BOOL_CLO(qq_arg, qq_option, qq_var) \
    (VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=") && \
     ({ \
-      Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
+      const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
       if      VG_STREQ(val, "yes") (qq_var) = True; \
       else if VG_STREQ(val, "no")  (qq_var) = False; \
       else VG_(fmsg_bad_option)(qq_arg, "Invalid boolean value '%s'" \
@@ -64,7 +64,7 @@
 #define VG_STR_CLO(qq_arg, qq_option, qq_var) \
    (VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=") && \
     ({ \
-      Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
+      const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
       (qq_var) = val; \
       True; \
     }) \
@@ -74,8 +74,8 @@
 #define VG_INT_CLO(qq_arg, qq_option, qq_var) \
    (VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=") && \
     ({ \
-      Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
-      Char* s; \
+      const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
+      HChar* s; \
       Long n = VG_(strtoll10)( val, &s ); \
       (qq_var) = n; \
       /* Check for non-numeralness, or overflow. */ \
@@ -89,8 +89,8 @@
 #define VG_BINTN_CLO(qq_base, qq_arg, qq_option, qq_var, qq_lo, qq_hi) \
    (VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=") && \
     ({ \
-      Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
-      Char* s; \
+      const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
+      HChar* s; \
       Long n = VG_(strtoll##qq_base)( val, &s ); \
       (qq_var) = n; \
       /* MMM: separate the two cases, and explain the problem;  likewise */ \
@@ -122,8 +122,8 @@
 #define VG_DBL_CLO(qq_arg, qq_option, qq_var) \
    (VG_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=") && \
     ({ \
-      Char* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
-      Char* s; \
+      const HChar* val = &(qq_arg)[ VG_(strlen)(qq_option)+1 ]; \
+      HChar* s; \
       double n = VG_(strtod)( val, &s ); \
       (qq_var) = n; \
       /* Check for non-numeralness */ \
@@ -161,7 +161,7 @@
 
 /* An arbitrary user-supplied string which is copied into the
    XML output, in between <usercomment> tags. */
-extern HChar* VG_(clo_xml_user_comment);
+extern const HChar* VG_(clo_xml_user_comment);
 
 /* Vex iropt control.  Tool-visible so tools can make Vex optimise
    less aggressively if that is needed (callgrind needs this). */
@@ -192,7 +192,8 @@
    merely used in printing error messages, if an error message needs
    to be printed due to malformedness of the "format" argument.
 */
-extern Char* VG_(expand_file_name)(Char* option_name, Char* format);
+extern HChar* VG_(expand_file_name)(const HChar* option_name,
+                                    const HChar* format);
 
 #endif   // __PUB_TOOL_OPTIONS_H
 
diff --git a/include/pub_tool_replacemalloc.h b/include/pub_tool_replacemalloc.h
index 3b6b927..97a9667 100644
--- a/include/pub_tool_replacemalloc.h
+++ b/include/pub_tool_replacemalloc.h
@@ -63,7 +63,7 @@
    default: VG_MIN_MALLOC_SZB */
 extern UInt VG_(clo_alignment);
 
-extern Bool VG_(replacement_malloc_process_cmd_line_option) ( Char* arg );
+extern Bool VG_(replacement_malloc_process_cmd_line_option) ( const HChar* arg );
 
 #endif   // __PUB_TOOL_REPLACEMALLOC_H
 
diff --git a/include/pub_tool_seqmatch.h b/include/pub_tool_seqmatch.h
index c095599..a62a18f 100644
--- a/include/pub_tool_seqmatch.h
+++ b/include/pub_tool_seqmatch.h
@@ -89,7 +89,7 @@
 /* Mini-regexp function.  Searches for 'pat' in 'str'.  Supports
    meta-symbols '*' and '?'.  There is no way to escape meta-symbols
    in the pattern. */
-Bool VG_(string_match) ( const Char* pat, const Char* str );
+Bool VG_(string_match) ( const HChar* pat, const HChar* str );
 
 #endif   // __PUB_TOOL_SEQMATCH_H
 
diff --git a/include/pub_tool_tooliface.h b/include/pub_tool_tooliface.h
index cdd70a4..2dd38f3 100644
--- a/include/pub_tool_tooliface.h
+++ b/include/pub_tool_tooliface.h
@@ -313,14 +313,14 @@
 
    // Return value indicates recognition.  If recognised, must set skind using
    // VG_(set_supp_kind)().
-   Bool (*recognised_suppression)(Char* name, Supp* su),
+   Bool (*recognised_suppression)(const HChar* name, Supp* su),
 
    // Read any extra info for this suppression kind.  Most likely for filling
    // in the `extra' and `string' parts (with VG_(set_supp_{extra, string})())
    // of a suppression if necessary.  Should return False if a syntax error
    // occurred, True otherwise.  bufpp and nBufp are the same as for
    // VG_(get_line).
-   Bool (*read_extra_suppression_info)(Int fd, Char** bufpp, SizeT* nBufp,
+   Bool (*read_extra_suppression_info)(Int fd, HChar** bufpp, SizeT* nBufp,
                                        Supp* su),
 
    // This should just check the kinds match and maybe some stuff in the
@@ -386,7 +386,7 @@
    // if possible rather than in post_clo_init(), and if they are bad then
    // VG_(fmsg_bad_option)() should be called.  This ensures that the
    // messaging is consistent with command line option errors from the core.
-   Bool (*process_cmd_line_option)(Char* argv),
+   Bool (*process_cmd_line_option)(const HChar* argv),
 
    // Print out command line usage for options for normal tool operation.
    void (*print_usage)(void),