|
From: Gisle V. <gis...@gm...> - 2013-08-30 16:21:32
|
Good job, but there are some warnings from MSVC v16 when I'm
using '-Wp64' in my CFLAGS. "enable 64 bit porting warnings".
I'm on a 32-bit WIndows:
libusb/core.c(692) : warning C4267: '=' : conversion from 'size_t' to 'ssize_t', possible loss of data
libusb/os/windows_usb.c(173) : warning C4267: '=' : conversion from 'size_t' to 'ssize_t', possible loss of data
I'm not sure these matters.
Also (maybe more serious). If I build a debug-version with '-RTCc'
("Convert to smaller type checks"), line 1117 in libusb/os/windows_usb.c
triggers a runtime-check since the line:
priv->depth = parent_priv->depth + 1
could possibly overflow (acording to the compiler at least).
This patch fixed it. But again, I'm not sure it matters:
--- Git-latest/libusb/os/windows_usb.c 2013-08-28 19:13:58 +0000
+++ libusb/os/windows_usb.c 2013-08-30 16:14:29 +0000
@@ -1114,7 +1114,7 @@
dev->bus_number = parent_dev->bus_number;
priv->port = port_number;
dev->port_number = port_number;
- priv->depth = parent_priv->depth + 1;
+ priv->depth = 0xff & (parent_priv->depth + 1);
priv->parent_dev = parent_dev;
dev->parent_dev = libusb_ref_device(parent_dev);
--gv
|