]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make VEX's "Char" type always be signed, so as to bring it into line
authorJulian Seward <jseward@acm.org>
Mon, 22 Nov 2004 12:55:45 +0000 (12:55 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 22 Nov 2004 12:55:45 +0000 (12:55 +0000)
with Valgrind conventions.

git-svn-id: svn://svn.valgrind.org/vex/trunk@578

VEX/priv/guest-x86/ghelpers.c
VEX/priv/host-x86/hdefs.c
VEX/priv/host-x86/hdefs.h
VEX/priv/main/vex_util.c
VEX/priv/main/vex_util.h
VEX/pub/libvex_basictypes.h

index df50144749c999d0e2453fdbc3369be9846c60dc..5ea6410f19d3a2731a6cd2bd1a700426bde76b54 100644 (file)
@@ -1731,12 +1731,12 @@ static inline Short qadd16S ( Short xx, Short yy )
    return (Short)t;
 }
 
-static inline SChar qadd8S ( SChar xx, SChar yy )
+static inline Char qadd8S ( Char xx, Char yy )
 {
    Int t = ((Int)xx) + ((Int)yy);
    if (t < -128) t = -128;
    if (t > 127)  t = 127;
-   return (SChar)t;
+   return (Char)t;
 }
 
 static inline UShort qadd16U ( UShort xx, UShort yy )
@@ -1761,12 +1761,12 @@ static inline Short qsub16S ( Short xx, Short yy )
    return (Short)t;
 }
 
-static inline SChar qsub8S ( SChar xx, SChar yy )
+static inline Char qsub8S ( Char xx, Char yy )
 {
    Int t = ((Int)xx) - ((Int)yy);
    if (t < -128) t = -128;
    if (t > 127)  t = 127;
-   return (SChar)t;
+   return (Char)t;
 }
 
 static inline UShort qsub16U ( UShort xx, UShort yy )
@@ -1823,7 +1823,7 @@ static inline UShort cmpge16S ( Short xx, Short yy )
    return xx>yy ? 0xFFFF : 0;
 }
 
-static inline UChar cmpge8S ( SChar xx, SChar yy )
+static inline UChar cmpge8S ( Char xx, Char yy )
 {
    return xx>yy ? 0xFF : 0;
 }
@@ -1836,12 +1836,12 @@ static inline Short qnarrow32Sto16 ( UInt xx0 )
    return (Short)xx;
 }
 
-static inline SChar qnarrow16Sto8 ( UShort xx0 )
+static inline Char qnarrow16Sto8 ( UShort xx0 )
 {
    Short xx = (Short)xx0;
    if (xx < -128) xx = -128;
    if (xx > 127)  xx = 127;
-   return (SChar)xx;
+   return (Char)xx;
 }
 
 static inline UChar qnarrow16Uto8 ( UShort xx0 )
index 98e924ccda01470803c274b13b55b59a822e540e..d5476feff349b6fa6655c74778f0587eaf2d54d5 100644 (file)
@@ -109,7 +109,7 @@ void getAllocableRegs_X86 ( Int* nregs, HReg** arr )
 
 /* --------- Condition codes, Intel encoding. --------- */
 
-Char* showX86CondCode ( X86CondCode cond )
+HChar* showX86CondCode ( X86CondCode cond )
 {
    switch (cond) {
       case Xcc_O:      return "o";
index 6e5870147929a4d901352f3ad38a67585b0ca78e..09dea16116104a9d1ae4ec256341e38b91b705e4 100644 (file)
@@ -87,7 +87,7 @@ typedef
    }
    X86CondCode;
 
-extern Char* showX86CondCode ( X86CondCode );
+extern HChar* showX86CondCode ( X86CondCode );
 
 
 /* --------- Memory address expressions (amodes). --------- */
index 86f228f40d712bfa19f6ef23b75126574b3114fd..d45b11cf8ee19b64c254bfd71b09d7b0948f5d69 100644 (file)
@@ -504,7 +504,7 @@ static void add_to_vg_sprintf_buf ( Char c )
    *vg_sprintf_ptr++ = c;
 }
 
-UInt vex_sprintf ( Char* buf, const Char *format, ... )
+UInt vex_sprintf ( Char* buf, const HChar *format, ... )
 {
    Int ret;
    va_list vargs;
index cb5a734416622e3444217cf5730c21cd9172c25d..021e4e0703a33e731c256750a96da3eba33e71e6 100644 (file)
@@ -64,10 +64,10 @@ extern void vpanic ( Char* str );
 /* Printing */
 
 __attribute__ ((format (printf, 1, 2)))
-extern UInt vex_printf ( const Char *format, ... );
+extern UInt vex_printf ( const HChar *format, ... );
 
 __attribute__ ((format (printf, 2, 3)))
-extern UInt vex_sprintf ( Char* buf, const Char *format, ... );
+extern UInt vex_sprintf ( Char* buf, const HChar *format, ... );
 
 
 /* String ops */
index 7fe91579398259e353270cc7db8692c45b7c7706..cf800c6e88e36cf0924201e27c740361708f6cf8 100644 (file)
 
 /* Always 8 bits. */
 typedef  unsigned char   UChar;
-typedef    signed char   SChar;
-typedef           char   Char;        /* platform-dependent signfulness */
+typedef    signed char   Char;
+typedef           char   HChar; /* signfulness depends on host */
+                                /* Only to be used for printf etc 
+                                   format strings */
 
 /* Always 16 bits. */
 typedef  unsigned short  UShort;