]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change a few prototypes to use SizeT.
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 29 Dec 2014 20:22:26 +0000 (20:22 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 29 Dec 2014 20:22:26 +0000 (20:22 +0000)
Also, offsetof returns a SizeT value.

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

VEX/priv/main_globals.c
VEX/priv/main_globals.h
VEX/priv/main_main.c
VEX/priv/main_util.c
VEX/priv/main_util.h
VEX/pub/libvex.h
VEX/pub/libvex_basictypes.h

index e3d79c6b95b21c1ed79260d94caabb9f01db2eb5..dbe63697df7b70afd9ffcd3e57340c67ee881e41 100644 (file)
@@ -50,7 +50,7 @@ __attribute__ ((noreturn))
 void (*vex_failure_exit) ( void ) = NULL;
 
 /* logging output function */
-void (*vex_log_bytes) ( HChar*, Int nbytes ) = NULL;
+void (*vex_log_bytes) ( const HChar*, SizeT nbytes ) = NULL;
 
 /* debug paranoia level */
 Int vex_debuglevel = 0;
index 3b16976341ec121c1f55b0d48750f87a7a9d2e4b..eb97ec19c3aed425d2e9c3e7edec6fbaa064e741 100644 (file)
@@ -51,7 +51,7 @@ __attribute__ ((noreturn))
 extern void (*vex_failure_exit) ( void );
 
 /* logging output function */
-extern void (*vex_log_bytes) ( HChar*, Int nbytes );
+extern void (*vex_log_bytes) ( const HChar*, SizeT nbytes );
 
 /* debug paranoia level */
 extern Int vex_debuglevel;
index b007fa1c8f06abc6454c3c98155c04cb7e3a5f2a..7dc538e293e50b13c9570e5302ffd8385a43ffb4 100644 (file)
@@ -111,7 +111,7 @@ void LibVEX_Init (
    __attribute__ ((noreturn))
    void (*failure_exit) ( void ),
    /* logging output function */
-   void (*log_bytes) ( HChar*, Int nbytes ),
+   void (*log_bytes) ( const HChar*, SizeT nbytes ),
    /* debug paranoia level */
    Int debuglevel,
    /* Control ... */
index 9edbe35f6bbb7019ab536eb97325bb29bfa4f4c3..459ddba0c70e8d38c232ab1b1e5a422862c86522 100644 (file)
@@ -203,7 +203,7 @@ void vexSetAllocModeTEMP_and_clear ( void )
    translation of the current basic block is complete.
  */
 
-void* LibVEX_Alloc ( Int nbytes )
+void* LibVEX_Alloc ( SizeT nbytes )
 {
    struct align {
       char c;
@@ -229,7 +229,7 @@ void* LibVEX_Alloc ( Int nbytes )
 #else
    HChar* curr;
    HChar* next;
-   Int    ALIGN;
+   SizeT  ALIGN;
    ALIGN  = offsetof(struct align,x) - 1;
    nbytes = (nbytes + ALIGN) & ~ALIGN;
    curr   = private_LibVEX_alloc_curr;
@@ -280,9 +280,9 @@ void vpanic ( const HChar* str )
    New code for vex_util.c should go above this point. */
 #include <stdarg.h>
 
-Int vex_strlen ( const HChar* str )
+SizeT vex_strlen ( const HChar* str )
 {
-   Int i = 0;
+   SizeT i = 0;
    while (str[i] != 0) i++;
    return i;
 }
@@ -299,9 +299,9 @@ Bool vex_streq ( const HChar* s1, const HChar* s2 )
    }
 }
 
-void vex_bzero ( void* sV, UInt n )
+void vex_bzero ( void* sV, SizeT n )
 {
-   UInt i;
+   SizeT i;
    UChar* s = (UChar*)sV;
    /* No laughing, please.  Just don't call this too often.  Thank you
       for your attention. */
@@ -379,7 +379,8 @@ UInt vprintf_wrk ( void(*sink)(HChar),
    const HChar* saved_format;
    Bool   longlong, ljustify, is_sizet;
    HChar  padchar;
-   Int    fwidth, nout, len1, len2, len3;
+   Int    fwidth, nout, len1, len3;
+   SizeT  len2;
    HChar  intbuf[100];  /* big enough for a 64-bit # in base 2 */
 
    nout = 0;
@@ -413,6 +414,7 @@ UInt vprintf_wrk ( void(*sink)(HChar),
       }
       if (*format == '*') {
          fwidth = va_arg(ap, Int);
+         vassert(fwidth >= 0);
          format++;
       } else {
          while (*format >= '0' && *format <= '9') {
index 85f13a420db2dc312808f3dfb4131d7368c64cb3..8904173814e460f657b652354965a6e79b08e2c3 100644 (file)
@@ -78,8 +78,8 @@ extern UInt vex_sprintf ( HChar* buf, const HChar *format, ... );
 /* String ops */
 
 extern Bool vex_streq ( const HChar* s1, const HChar* s2 );
-extern Int  vex_strlen ( const HChar* str );
-extern void vex_bzero ( void* s, UInt n );
+extern SizeT vex_strlen ( const HChar* str );
+extern void vex_bzero ( void* s, SizeT n );
 
 
 /* Storage management: clear the area, and allocate from it. */
index 1f09de5a0d942338598b1be288b4830f3a7b8a0b..bf8fad02845fb7d0dc8407c23734462b82097a15 100644 (file)
@@ -453,7 +453,7 @@ void LibVEX_default_VexControl ( /*OUT*/ VexControl* vcon );
    callback that you have previously specified in a call to
    LibVEX_Translate.  The storage allocated will only stay alive until
    translation of the current basic block is complete. */
-extern void* LibVEX_Alloc ( Int nbytes );
+extern void* LibVEX_Alloc ( SizeT nbytes );
 
 /* Show Vex allocation statistics. */
 extern void LibVEX_ShowAllocStats ( void );
@@ -532,7 +532,7 @@ extern void LibVEX_Init (
    void (*failure_exit) ( void ),
 
    /* logging output function */
-   void (*log_bytes) ( HChar*, Int nbytes ),
+   void (*log_bytes) ( const HChar*, SizeT nbytes ),
 
    /* debug paranoia level */
    Int debuglevel,
index 09205bb3af8da967fde516eeafc11480a0de180d..0bef9bb251cef72dbad9ea0a1bea189cdab4ec92 100644 (file)
@@ -141,7 +141,7 @@ typedef  unsigned long HWord;
 
 /* This is so useful it should be visible absolutely everywhere. */
 #if !defined(offsetof)
-#   define offsetof(type,memb) ((Int)(HWord)&((type*)0)->memb)
+#   define offsetof(type,memb) ((SizeT)(HWord)&((type*)0)->memb)
 #endif
 /* Our definition of offsetof is giving the same result as
    the standard/predefined offsetof. So, we use the same name.