Fixed sign-compare warnings

This commit is contained in:
Armin Novak
2019-02-07 14:32:38 +01:00
parent e72d9fd484
commit 4430187e8d
3 changed files with 14 additions and 11 deletions

View File

@@ -213,7 +213,8 @@ static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* da
UINT32 usbd_status = USBD_STATUS_SUCCESS;
BYTE* OutputBuffer;
BYTE* out_data;
int i, offset, success = 0;
UINT32 i;
int offset, success = 0;
WLog_DBG(TAG, "urbdrc_process__io_control");
@@ -427,7 +428,7 @@ static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, B
static void func_select_all_interface_for_msconfig(IUDEVICE* pdev, MSUSB_CONFIG_DESCRIPTOR* MsConfig)
{
int inum;
UINT32 inum;
MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces = MsConfig->MsInterfaces;
BYTE InterfaceNumber, AlternateSetting;
UINT32 NumInterfaces = MsConfig->NumInterfaces;

View File

@@ -171,8 +171,8 @@ static void func_iso_callback(struct libusb_transfer* transfer)
BYTE* data = iso_user_data->IsoPacket;
int* completed = &iso_user_data->completed;
UINT32 offset = 0;
UINT32 index = 0;
UINT32 i, act_len;
INT32 index = 0;
INT32 i, act_len;
BYTE* b;
*completed = 1;
@@ -234,7 +234,7 @@ static const LIBUSB_ENDPOINT_DESCEIPTOR* func_get_ep_desc(LIBUSB_CONFIG_DESCRIPT
MSUSB_CONFIG_DESCRIPTOR* MsConfig, UINT32 EndpointAddress)
{
BYTE alt;
int inum, pnum;
UINT32 inum, pnum;
MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces;
const LIBUSB_INTERFACE* interface;
const LIBUSB_ENDPOINT_DESCEIPTOR* endpoint;
@@ -359,7 +359,8 @@ static void func_iso_data_init(ISO_USER_DATA* iso_user_data, UINT32 numPacket, U
static int func_config_release_all_interface(LIBUSB_DEVICE_HANDLE* libusb_handle,
UINT32 NumInterfaces)
{
int i, ret;
UINT32 i;
int ret;
for (i = 0; i < NumInterfaces; i++)
{
@@ -630,7 +631,7 @@ static int udev_get_hub_handle(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_numb
}
while (p1 != NULL);
if ((p2 - sysfs_path) < (strlen(sysfs_path) - 2))
if ((p2 - sysfs_path) < (strlen(sysfs_path) - 2U))
{
p1 = (char*) sysfs_path;
@@ -761,7 +762,7 @@ static MSUSB_CONFIG_DESCRIPTOR* libusb_udev_complete_msconfig_setup(IUDEVICE* id
const LIBUSB_INTERFACE_DESCRIPTOR* LibusbAltsetting;
const LIBUSB_ENDPOINT_DESCEIPTOR* LibusbEndpoint;
BYTE LibusbNumEndpoint;
int inum = 0, pnum = 0, MsOutSize = 0;
UINT32 inum = 0, pnum = 0, MsOutSize = 0;
LibusbConfig = pdev->LibusbConfig;
if (LibusbConfig->bNumInterfaces != MsConfig->NumInterfaces)
@@ -994,7 +995,8 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType
char deviceLocation[25];
BYTE bus_number;
BYTE device_address;
int ret = 0, i = 0;
int ret = 0;
size_t i = 0;
switch (TextType)
{
@@ -1005,7 +1007,7 @@ static int libusb_udev_control_query_device_text(IUDEVICE* idev, UINT32 TextType
Buffer,
*BufferSize);
for (i = 0; i < ret; i++)
for (i = 0; (ret > 0) && (i < (size_t)ret); i++)
{
Buffer[i] = Buffer[i + 2];
}

View File

@@ -1153,7 +1153,7 @@ void* urbdrc_new_device_create(void* arg)
static UINT urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer,
UINT32 cbSize)
{
int i;
UINT32 i;
UINT32 MessageId;
UINT32 FunctionId;
UINT error = CHANNEL_RC_OK;