From: Nicholas Nethercote Date: Fri, 13 May 2005 21:49:30 +0000 (+0000) Subject: Use HChar for format strings to printf-like functions. X-Git-Tag: svn/VALGRIND_3_0_0~622 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5d1db8fc78e975ccac4e4ff148ecec087172af5;p=thirdparty%2Fvalgrind.git Use HChar for format strings to printf-like functions. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3696 --- diff --git a/coregrind/vg_messages.c b/coregrind/vg_messages.c index 59825f5eb9..75c87a1e64 100644 --- a/coregrind/vg_messages.c +++ b/coregrind/vg_messages.c @@ -34,7 +34,7 @@ #include #include -UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs ) +UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs ) { UInt count = 0; Char c; @@ -79,7 +79,7 @@ UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs ) } /* Send a simple single-part message. */ -UInt VG_(message) ( VgMsgKind kind, const Char* format, ... ) +UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... ) { UInt count; va_list vargs; diff --git a/coregrind/vg_mylibc.c b/coregrind/vg_mylibc.c index f9cf01758c..7c5c518498 100644 --- a/coregrind/vg_mylibc.c +++ b/coregrind/vg_mylibc.c @@ -427,7 +427,7 @@ static void add_to_myprintf_buf ( HChar c, void *p ) myprintf_buf->buf[myprintf_buf->n] = 0; } -UInt VG_(vprintf) ( const char *format, va_list vargs ) +UInt VG_(vprintf) ( const HChar *format, va_list vargs ) { UInt ret = 0; printf_buf myprintf_buf = {"",0}; @@ -444,7 +444,7 @@ UInt VG_(vprintf) ( const char *format, va_list vargs ) return ret; } -UInt VG_(printf) ( const char *format, ... ) +UInt VG_(printf) ( const HChar *format, ... ) { UInt ret; va_list vargs; @@ -463,7 +463,7 @@ static void add_to_vg_sprintf_buf ( HChar c, void *p ) *(*vg_sprintf_ptr)++ = c; } -UInt VG_(vsprintf) ( Char* buf, const Char *format, va_list vargs ) +UInt VG_(vsprintf) ( Char* buf, const HChar *format, va_list vargs ) { Int ret; Char *vg_sprintf_ptr = buf; @@ -477,7 +477,7 @@ UInt VG_(vsprintf) ( Char* buf, const Char *format, va_list vargs ) return ret; } -UInt VG_(sprintf) ( Char* buf, const Char *format, ... ) +UInt VG_(sprintf) ( Char* buf, const HChar *format, ... ) { UInt ret; va_list vargs; @@ -954,7 +954,7 @@ static void report_and_quit ( const Char* report, StackTrace ips ) } void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file, - Int line, const Char* fn, const Char* format, ... ) + Int line, const Char* fn, const HChar* format, ... ) { va_list vargs; Char buf[256]; diff --git a/include/tool.h b/include/tool.h index 5f81193d31..93501e3ef6 100644 --- a/include/tool.h +++ b/include/tool.h @@ -139,8 +139,8 @@ typedef VgMsgKind; /* Send a single-part message. Appends a newline. */ -extern UInt VG_(message) ( VgMsgKind kind, const Char* format, ... ); -extern UInt VG_(vmessage) ( VgMsgKind kind, const Char* format, va_list vargs ); +extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... ); +extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs ); /*====================================================================*/ @@ -261,11 +261,11 @@ extern Addr VG_(get_IP) ( ThreadId tid ); * --log-fd/--log-file/--log-socket argument, which defaults to 2 (stderr). * Hence no need for VG_(fprintf)(). */ -extern UInt VG_(printf) ( const char *format, ... ); -extern UInt VG_(vprintf) ( const char *format, va_list vargs ); +extern UInt VG_(printf) ( const HChar *format, ... ); +extern UInt VG_(vprintf) ( const HChar *format, va_list vargs ); /* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */ -extern UInt VG_(sprintf) ( Char* buf, const Char* format, ... ); -extern UInt VG_(vsprintf)( Char* buf, const Char* format, va_list vargs ); +extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... ); +extern UInt VG_(vsprintf)( Char* buf, const HChar* format, va_list vargs ); extern Int VG_(rename) ( Char* old_name, Char* new_name ); @@ -408,7 +408,7 @@ extern Bool VG_(getcwd_alloc) ( Char** cwd ); __attribute__ ((__noreturn__)) extern void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file, Int line, const Char* fn, - const Char* format, ... ); + const HChar* format, ... ); /* ------------------------------------------------------------------ */ /* Get memory by anonymous mmap. */