summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-server/linux/USBGetDevices.cpp
diff options
context:
space:
mode:
authorRitesh Raj Sarraf <rrs@debian.org>2013-11-19 03:24:56 -0500
committerRitesh Raj Sarraf <rrs@debian.org>2013-12-03 12:33:38 +0530
commit6efaaad77695d94c0a51e717f0bc5eccbc5092ea (patch)
tree4a0e39cf6af4b9db9625814335dbdbe5b7637679 /src/VBox/Main/src-server/linux/USBGetDevices.cpp
parent668830cfe133a3a652325266a03dead61a50117b (diff)
downloadvirtualbox-6efaaad77695d94c0a51e717f0bc5eccbc5092ea.tar.gz
Imported Upstream version 4.3.2-dfsg
Diffstat (limited to 'src/VBox/Main/src-server/linux/USBGetDevices.cpp')
-rw-r--r--src/VBox/Main/src-server/linux/USBGetDevices.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/VBox/Main/src-server/linux/USBGetDevices.cpp b/src/VBox/Main/src-server/linux/USBGetDevices.cpp
index 964d86cc8..b4ef0df7c 100644
--- a/src/VBox/Main/src-server/linux/USBGetDevices.cpp
+++ b/src/VBox/Main/src-server/linux/USBGetDevices.cpp
@@ -357,11 +357,11 @@ static int usbReadSpeed(const char *pszValue, USBDEVICESPEED *pSpd, char **ppszN
{
pszValue = RTStrStripL(pszValue);
/* verified with Linux 2.4.0 ... Linux 2.6.25 */
- if (!strncmp(pszValue, "1.5", 3))
+ if (!strncmp(pszValue, RT_STR_TUPLE("1.5")))
*pSpd = USBDEVICESPEED_LOW;
- else if (!strncmp(pszValue, "12 ", 3))
+ else if (!strncmp(pszValue, RT_STR_TUPLE("12 ")))
*pSpd = USBDEVICESPEED_FULL;
- else if (!strncmp(pszValue, "480", 3))
+ else if (!strncmp(pszValue, RT_STR_TUPLE("480")))
*pSpd = USBDEVICESPEED_HIGH;
else
*pSpd = USBDEVICESPEED_UNKNOWN;
@@ -593,7 +593,7 @@ static PUSBDEVICE getDevicesFromUsbfs(const char *pcszUsbfsRoot, bool testfs)
deviceFreeMembers(&Dev);
/* Reset device state */
- memset(&Dev, 0, sizeof (Dev));
+ RT_ZERO(Dev);
Dev.enmState = USBDEVICESTATE_UNUSED;
cHits = 1;
@@ -1122,7 +1122,7 @@ static int usbGetPortFromSysfsPath(const char *pszPath, uint8_t *pu8Port)
if (!pchDash && !pchDot)
{
/* No -/. so it must be a root hub. Check that it's usb<something>. */
- if (strncmp(pszLastComp, "usb", sizeof("usb") - 1) != 0)
+ if (strncmp(pszLastComp, RT_STR_TUPLE("usb")) != 0)
{
Log(("usbGetPortFromSysfsPath(%s): failed [2]\n", pszPath));
return VERR_INVALID_PARAMETER;
@@ -1430,7 +1430,7 @@ void TestUSBSetInotifyAvailable(bool fHaveInotifyLibC, bool fHaveInotifyKernel)
s_fHaveInotifyKernel = fHaveInotifyKernel;
}
# define dlsym testDLSym
-# define close(a) do {} while(0)
+# define close(a) do {} while (0)
#endif
/** Is inotify available and working on this system? This is a requirement
@@ -1586,7 +1586,7 @@ void TestUSBSetEnv(const char *pcszEnvUsb, const char *pcszEnvUsbRoot)
* what is available on the host and what if anything the user has specified
* in the environment.
* @returns iprt status value
- * @param pfUsingUsbfsDevices on success this will be set to true if
+ * @param pfUsingUsbfsDevices on success this will be set to true if
* the prefered access method is USBFS-like and to
* false if it is sysfs/device node-like
* @param ppcszDevicesRoot on success the root of the tree of USBFS-like