Commit 397859dd authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hid: Fix printf format warnings with long types.

parent 3bb0e2e5
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = hid.dll MODULE = hid.dll
IMPORTLIB = hid IMPORTLIB = hid
......
...@@ -52,116 +52,116 @@ static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void ...@@ -52,116 +52,116 @@ static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void
return ret; return ret;
} }
BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData) BOOLEAN WINAPI HidD_FreePreparsedData( PHIDP_PREPARSED_DATA preparsed_data )
{ {
TRACE("(%p)\n", PreparsedData); TRACE( "preparsed_data %p.\n", preparsed_data );
HeapFree(GetProcessHeap(), 0, PreparsedData); HeapFree( GetProcessHeap(), 0, preparsed_data );
return TRUE; return TRUE;
} }
BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr) BOOLEAN WINAPI HidD_GetAttributes( HANDLE file, PHIDD_ATTRIBUTES attributes )
{ {
HID_COLLECTION_INFORMATION info; HID_COLLECTION_INFORMATION info;
BOOLEAN ret; BOOLEAN ret;
TRACE("(%p %p)\n", HidDeviceObject, Attr); TRACE( "file %p, attributes %p.\n", file, attributes );
ret = sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(HID_COLLECTION_INFORMATION)); ret = sync_ioctl( file, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(HID_COLLECTION_INFORMATION) );
if (ret) if (ret)
{ {
Attr->Size = sizeof(HIDD_ATTRIBUTES); attributes->Size = sizeof(HIDD_ATTRIBUTES);
Attr->VendorID = info.VendorID; attributes->VendorID = info.VendorID;
Attr->ProductID = info.ProductID; attributes->ProductID = info.ProductID;
Attr->VersionNumber = info.VersionNumber; attributes->VersionNumber = info.VersionNumber;
} }
return ret; return ret;
} }
BOOLEAN WINAPI HidD_GetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) BOOLEAN WINAPI HidD_GetFeature( HANDLE file, void *report_buf, ULONG report_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_FEATURE, NULL, 0, ReportBuffer, ReportBufferLength); return sync_ioctl( file, IOCTL_HID_GET_FEATURE, NULL, 0, report_buf, report_len );
} }
void WINAPI HidD_GetHidGuid(LPGUID guid) void WINAPI HidD_GetHidGuid(LPGUID guid)
{ {
TRACE("(%p)\n", guid); TRACE( "guid %s.\n", debugstr_guid( guid ) );
*guid = GUID_DEVINTERFACE_HID; *guid = GUID_DEVINTERFACE_HID;
} }
BOOLEAN WINAPI HidD_GetInputReport(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) BOOLEAN WINAPI HidD_GetInputReport( HANDLE file, void *report_buf, ULONG report_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_INPUT_REPORT, NULL, 0, ReportBuffer, ReportBufferLength); return sync_ioctl( file, IOCTL_HID_GET_INPUT_REPORT, NULL, 0, report_buf, report_len );
} }
BOOLEAN WINAPI HidD_GetManufacturerString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) BOOLEAN WINAPI HidD_GetManufacturerString( HANDLE file, void *buffer, ULONG buffer_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength); TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_MANUFACTURER_STRING, NULL, 0, Buffer, BufferLength); return sync_ioctl( file, IOCTL_HID_GET_MANUFACTURER_STRING, NULL, 0, buffer, buffer_len );
} }
BOOLEAN WINAPI HidD_GetNumInputBuffers(HANDLE HidDeviceObject, ULONG *NumberBuffers) BOOLEAN WINAPI HidD_GetNumInputBuffers( HANDLE file, ULONG *num_buffer )
{ {
TRACE("(%p %p)\n", HidDeviceObject, NumberBuffers); TRACE( "file %p, num_buffer %p.\n", file, num_buffer );
return sync_ioctl(HidDeviceObject, IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS, NULL, 0, NumberBuffers, sizeof(*NumberBuffers)); return sync_ioctl( file, IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS, NULL, 0, num_buffer, sizeof(*num_buffer) );
} }
BOOLEAN WINAPI HidD_SetFeature(HANDLE HidDeviceObject, PVOID ReportBuffer, ULONG ReportBufferLength) BOOLEAN WINAPI HidD_SetFeature( HANDLE file, void *report_buf, ULONG report_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_SET_FEATURE, ReportBuffer, ReportBufferLength, NULL, 0); return sync_ioctl( file, IOCTL_HID_SET_FEATURE, report_buf, report_len, NULL, 0 );
} }
BOOLEAN WINAPI HidD_SetNumInputBuffers(HANDLE HidDeviceObject, ULONG NumberBuffers) BOOLEAN WINAPI HidD_SetNumInputBuffers( HANDLE file, ULONG num_buffer )
{ {
TRACE("(%p %i)\n", HidDeviceObject, NumberBuffers); TRACE( "file %p, num_buffer %lu.\n", file, num_buffer );
return sync_ioctl(HidDeviceObject, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &NumberBuffers, sizeof(NumberBuffers), NULL, 0); return sync_ioctl( file, IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS, &num_buffer, sizeof(num_buffer), NULL, 0 );
} }
BOOLEAN WINAPI HidD_GetProductString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) BOOLEAN WINAPI HidD_GetProductString( HANDLE file, void *buffer, ULONG buffer_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength); TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, Buffer, BufferLength); return sync_ioctl( file, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, buffer, buffer_len );
} }
BOOLEAN WINAPI HidD_GetSerialNumberString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) BOOLEAN WINAPI HidD_GetSerialNumberString( HANDLE file, void *buffer, ULONG buffer_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength); TRACE( "file %p, buffer %p, buffer_len %lu.\n", file, buffer, buffer_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_GET_SERIALNUMBER_STRING, NULL, 0, Buffer, BufferLength); return sync_ioctl( file, IOCTL_HID_GET_SERIALNUMBER_STRING, NULL, 0, buffer, buffer_len );
} }
BOOLEAN WINAPI HidD_GetPreparsedData(HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData) BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE file, PHIDP_PREPARSED_DATA *preparsed_data )
{ {
HID_COLLECTION_INFORMATION info; HID_COLLECTION_INFORMATION info;
PHIDP_PREPARSED_DATA data; PHIDP_PREPARSED_DATA data;
TRACE("(%p %p)\n", HidDeviceObject, PreparsedData); TRACE( "file %p, preparsed_data %p.\n", file, preparsed_data );
if (!sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(info))) if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_INFORMATION, NULL, 0, &info, sizeof(info) ))
return FALSE; return FALSE;
if (!(data = HeapAlloc(GetProcessHeap(), 0, info.DescriptorSize))) return FALSE; if (!(data = HeapAlloc(GetProcessHeap(), 0, info.DescriptorSize))) return FALSE;
if (!sync_ioctl(HidDeviceObject, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, data, info.DescriptorSize)) if (!sync_ioctl( file, IOCTL_HID_GET_COLLECTION_DESCRIPTOR, NULL, 0, data, info.DescriptorSize ))
{ {
HeapFree( GetProcessHeap(), 0, data ); HeapFree( GetProcessHeap(), 0, data );
return FALSE; return FALSE;
} }
*PreparsedData = data; *preparsed_data = data;
return TRUE; return TRUE;
} }
BOOLEAN WINAPI HidD_SetOutputReport(HANDLE HidDeviceObject, void *ReportBuffer, ULONG ReportBufferLength) BOOLEAN WINAPI HidD_SetOutputReport( HANDLE file, void *report_buf, ULONG report_len )
{ {
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength); TRACE( "file %p, report_buf %p, report_len %lu.\n", file, report_buf, report_len );
return sync_ioctl(HidDeviceObject, IOCTL_HID_SET_OUTPUT_REPORT, ReportBuffer, ReportBufferLength, NULL, 0); return sync_ioctl( file, IOCTL_HID_SET_OUTPUT_REPORT, report_buf, report_len, NULL, 0 );
} }
BOOLEAN WINAPI HidD_GetIndexedString(HANDLE file, ULONG index, void *buffer, ULONG length) BOOLEAN WINAPI HidD_GetIndexedString(HANDLE file, ULONG index, void *buffer, ULONG length)
{ {
TRACE("file %p, index %u, buffer %p, length %u.\n", file, index, buffer, length); TRACE( "file %p, index %lu, buffer %p, length %lu.\n", file, index, buffer, length );
return sync_ioctl(file, IOCTL_HID_GET_INDEXED_STRING, &index, sizeof(index), buffer, length); return sync_ioctl(file, IOCTL_HID_GET_INDEXED_STRING, &index, sizeof(index), buffer, length);
} }
......
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = hidparse.sys MODULE = hidparse.sys
IMPORTLIB = hidparse IMPORTLIB = hidparse
IMPORTS = ntoskrnl IMPORTS = ntoskrnl
......
...@@ -103,7 +103,7 @@ static inline const char *debugstr_hid_value_caps( struct hid_value_caps *caps ) ...@@ -103,7 +103,7 @@ static inline const char *debugstr_hid_value_caps( struct hid_value_caps *caps )
{ {
if (!caps) return "(null)"; if (!caps) return "(null)";
return wine_dbg_sprintf( "RId %d, Usg %02x:%02x-%02x Dat %02x-%02x, Str %d-%d, Des %d-%d, " return wine_dbg_sprintf( "RId %d, Usg %02x:%02x-%02x Dat %02x-%02x, Str %d-%d, Des %d-%d, "
"Bits %02x Flags %#x, LCol %d LUsg %02x:%02x, BitSz %d, RCnt %d, Unit %x E%+d, Log %+d-%+d, Phy %+d-%+d", "Bits %02lx Flags %#lx, LCol %d LUsg %02x:%02x, BitSz %d, RCnt %d, Unit %lx E%+ld, Log %+ld-%+ld, Phy %+ld-%+ld",
caps->report_id, caps->usage_page, caps->usage_min, caps->usage_max, caps->data_index_min, caps->data_index_max, caps->report_id, caps->usage_page, caps->usage_min, caps->usage_max, caps->data_index_min, caps->data_index_max,
caps->string_min, caps->string_max, caps->designator_min, caps->designator_max, caps->bit_field, caps->flags, caps->string_min, caps->string_max, caps->designator_min, caps->designator_max, caps->bit_field, caps->flags,
caps->link_collection, caps->link_usage_page, caps->link_usage, caps->bit_size, caps->report_count, caps->link_collection, caps->link_usage_page, caps->link_usage, caps->bit_size, caps->report_count,
...@@ -113,7 +113,7 @@ static inline const char *debugstr_hid_value_caps( struct hid_value_caps *caps ) ...@@ -113,7 +113,7 @@ static inline const char *debugstr_hid_value_caps( struct hid_value_caps *caps )
static inline const char *debugstr_hid_collection_node( struct hid_collection_node *node ) static inline const char *debugstr_hid_collection_node( struct hid_collection_node *node )
{ {
if (!node) return "(null)"; if (!node) return "(null)";
return wine_dbg_sprintf( "Usg %02x:%02x, Parent %u, Next %u, NbChild %u, Child %u, Type %02x", return wine_dbg_sprintf( "Usg %02x:%02x, Parent %u, Next %u, NbChild %u, Child %u, Type %02lx",
node->usage_page, node->usage, node->parent, node->next_sibling, node->usage_page, node->usage, node->parent, node->next_sibling,
node->number_of_children, node->first_child, node->collection_type ); node->number_of_children, node->first_child, node->collection_type );
} }
...@@ -416,8 +416,8 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY ...@@ -416,8 +416,8 @@ static BOOL parse_new_value_caps( struct hid_parser_state *state, HIDP_REPORT_TY
static void free_parser_state( struct hid_parser_state *state ) static void free_parser_state( struct hid_parser_state *state )
{ {
if (state->global_idx) ERR( "%u unpopped device caps on the stack\n", state->global_idx ); if (state->global_idx) ERR( "%lu unpopped device caps on the stack\n", state->global_idx );
if (state->collection_idx) ERR( "%u unpopped device collection on the stack\n", state->collection_idx ); if (state->collection_idx) ERR( "%lu unpopped device collection on the stack\n", state->collection_idx );
free( state->stack ); free( state->stack );
free( state->collections ); free( state->collections );
free( state->values[HidP_Input] ); free( state->values[HidP_Input] );
...@@ -647,7 +647,7 @@ NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_de ...@@ -647,7 +647,7 @@ NTSTATUS WINAPI HidP_GetCollectionDescription( PHIDP_REPORT_DESCRIPTOR report_de
struct hid_value_caps *caps, *caps_end; struct hid_value_caps *caps, *caps_end;
struct hid_preparsed_data *preparsed; struct hid_preparsed_data *preparsed;
TRACE( "report_desc %p, report_desc_len %u, pool_type %u, device_desc %p.\n", TRACE( "report_desc %p, report_desc_len %lu, pool_type %u, device_desc %p.\n",
report_desc, report_desc_len, pool_type, device_desc ); report_desc, report_desc_len, pool_type, device_desc );
memset( device_desc, 0, sizeof(*device_desc) ); memset( device_desc, 0, sizeof(*device_desc) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment