int8 and uint8 passed 3 parameters to the printf string,
but only 2 were used, leading to various problems (like bug #5596). I added another variation of print_type which handles that case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35911 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -98,6 +98,15 @@ print_type(const char *format, uint8 *pointer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Type>
|
||||||
|
static void
|
||||||
|
print_type3(const char *format, uint8 *pointer)
|
||||||
|
{
|
||||||
|
Type *item = (Type *)pointer;
|
||||||
|
printf(format, *item, *item, *item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
handle_reply(port_id replyPort, int32 *_code, bigtime_t timeout,
|
handle_reply(port_id replyPort, int32 *_code, bigtime_t timeout,
|
||||||
BMessage *reply)
|
BMessage *reply)
|
||||||
@@ -595,11 +604,12 @@ BMessage::_PrintToStream(const char* indent) const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case B_INT8_TYPE:
|
case B_INT8_TYPE:
|
||||||
print_type<int8>("int8(0x%hx or %d or '%.1s')\n", pointer);
|
print_type3<int8>("int8(0x%hx or %d or '%.1s')\n",
|
||||||
|
pointer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case B_UINT8_TYPE:
|
case B_UINT8_TYPE:
|
||||||
print_type<uint8>("uint8(0x%hx or %u or '%.1s')\n",
|
print_type3<uint8>("uint8(0x%hx or %u or '%.1s')\n",
|
||||||
pointer);
|
pointer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user