]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Constify the format string in a few printf-like functions.
authorFlorian Krohm <florian@eich-krohm.de>
Thu, 13 Sep 2012 20:21:42 +0000 (20:21 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Thu, 13 Sep 2012 20:21:42 +0000 (20:21 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2530

VEX/priv/host_s390_disasm.c
VEX/priv/main_util.c
VEX/priv/main_util.h

index a23009e539a93e069e0e27fb8f8a50eee7bab212..ccccddee9ff75565a8cf88e7193212eb63b569ca 100644 (file)
 #include "main_globals.h"     // vex_traceflags
 #include "host_s390_disasm.h"
 
-/* The format that is used to write out a mnemonic.
-   These should be declared as 'const HChar' but vex_printf needs
-   to be changed for that first */
-static HChar s390_mnm_fmt[] = "%-8s";
+/* The format that is used to write out a mnemonic. */
+static const HChar s390_mnm_fmt[] = "%-8s";
 
 
 /* Return the name of a general purpose register for dis-assembly purposes. */
index b4ca7beac68cb7b89fe725a4eb1d5ca6e68e9337..6f5fc1c09bd7ce92a72881f2299a77cd3bbef56e 100644 (file)
@@ -220,7 +220,7 @@ void vex_assert_fail ( const HChar* expr,
 }
 
 __attribute__ ((noreturn))
-void vpanic ( HChar* str )
+void vpanic ( const HChar* str )
 {
    vex_printf("\nvex: the `impossible' happened:\n   %s\n", str);
    (*vex_failure_exit)();
@@ -316,7 +316,7 @@ void convert_int ( /*OUT*/HChar* buf, Long n0,
    printf. */
 static
 UInt vprintf_wrk ( void(*sink)(HChar),
-                   HChar* format,
+                   const HChar* format,
                    va_list ap )
 {
 #  define PUT(_ch)  \
@@ -331,7 +331,7 @@ UInt vprintf_wrk ( void(*sink)(HChar),
       do { HChar* _qq = _str; for (; *_qq; _qq++) PUT(*_qq); } \
       while (0)
 
-   HChar* saved_format;
+   const HChar* saved_format;
    Bool   longlong, ljustify;
    HChar  padchar;
    Int    fwidth, nout, len1, len2, len3;
@@ -494,7 +494,7 @@ static void add_to_myprintf_buf ( HChar c )
    }
 }
 
-UInt vex_printf ( HChar* format, ... )
+UInt vex_printf ( const HChar* format, ... )
 {
    UInt ret;
    va_list vargs;
@@ -523,7 +523,7 @@ static void add_to_vg_sprintf_buf ( HChar c )
    *vg_sprintf_ptr++ = c;
 }
 
-UInt vex_sprintf ( HChar* buf, HChar *format, ... )
+UInt vex_sprintf ( HChar* buf, const HChar *format, ... )
 {
    Int ret;
    va_list vargs;
index bee66492572445a07932bcae18ea05976d99346a..ce5aa005c08966c23dcaf08b8db4b852e774933e 100644 (file)
@@ -60,16 +60,16 @@ __attribute__ ((__noreturn__))
 extern void vex_assert_fail ( const HChar* expr, const HChar* file,
                               Int line, const HChar* fn );
 __attribute__ ((__noreturn__))
-extern void vpanic ( HChar* str );
+extern void vpanic ( const HChar* str );
 
 
 /* Printing */
 
 __attribute__ ((format (printf, 1, 2)))
-extern UInt vex_printf ( HChar *format, ... );
+extern UInt vex_printf ( const HChar *format, ... );
 
 __attribute__ ((format (printf, 2, 3)))
-extern UInt vex_sprintf ( HChar* buf, HChar *format, ... );
+extern UInt vex_sprintf ( HChar* buf, const HChar *format, ... );
 
 
 /* String ops */