Also, offsetof returns a SizeT value.
git-svn-id: svn://svn.valgrind.org/vex/trunk@3047
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;
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;
__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 ... */
translation of the current basic block is complete.
*/
-void* LibVEX_Alloc ( Int nbytes )
+void* LibVEX_Alloc ( SizeT nbytes )
{
struct align {
char c;
#else
HChar* curr;
HChar* next;
- Int ALIGN;
+ SizeT ALIGN;
ALIGN = offsetof(struct align,x) - 1;
nbytes = (nbytes + ALIGN) & ~ALIGN;
curr = private_LibVEX_alloc_curr;
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;
}
}
}
-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. */
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;
}
if (*format == '*') {
fwidth = va_arg(ap, Int);
+ vassert(fwidth >= 0);
format++;
} else {
while (*format >= '0' && *format <= '9') {
/* 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. */
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 );
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,
/* 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.