intptr should be unsigned

This commit is contained in:
Sergei Golubchik 2011-10-19 22:48:48 +02:00
parent a468337924
commit 533d274c03
2 changed files with 4 additions and 4 deletions

View File

@ -972,11 +972,11 @@ typedef unsigned long long my_ulonglong;
#endif #endif
#if SIZEOF_CHARP == SIZEOF_INT #if SIZEOF_CHARP == SIZEOF_INT
typedef int intptr; typedef unsigned int intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG #elif SIZEOF_CHARP == SIZEOF_LONG
typedef long intptr; typedef unsigned long intptr;
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG #elif SIZEOF_CHARP == SIZEOF_LONG_LONG
typedef long long intptr; typedef unsigned long long intptr;
#else #else
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long) #error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
#endif #endif

View File

@ -9038,7 +9038,7 @@ static uchar *dump_chunk(uchar *buffer, uchar *ptr)
} }
{ {
intptr offset= ptr - buffer; intptr offset= ptr - buffer;
DBUG_ASSERT(offset >= 0 && offset <= UINT_MAX16); DBUG_ASSERT(offset <= UINT_MAX16);
length= translog_get_total_chunk_length(buffer, (uint16)offset); length= translog_get_total_chunk_length(buffer, (uint16)offset);
} }
printf(" Length %u\n", length); printf(" Length %u\n", length);