Sync usb-darwin to upstream
@@ -359,6 +359,8 @@ print_device(const char *uri, /* I - Device URI */
(void)uri;
+ (void)argc;
+ (void)argv;
/*
* Catch SIGQUIT to determine who is sending it...
@@ -1512,12 +1514,11 @@ static kern_return_t load_printerdriver(CFStringRef *driverBundlePath)
SInt32 score;
kern_return_t kr;
printer_interface_t interface;
- HRESULT res;
kr = IOCreatePlugInInterfaceForService(g.printer_obj, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &iodev, &score);
if (kr == kIOReturnSuccess)
{
- if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &interface)) == noErr)
+ if ((*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &interface) == noErr)
{
*driverBundlePath = IORegistryEntryCreateCFProperty(g.printer_obj, kUSBClassDriverProperty, NULL, kNilOptions);
@@ -1615,14 +1616,14 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
if (actualLength > 2 && actualLength <= bufferLength - 2)
{
- ret = CFStringCreateWithBytes(NULL, (const UInt8 *) &request.pData[2], actualLength - 2, kCFStringEncodingUTF8, false);
+ ret = CFStringCreateWithBytes(NULL, (const UInt8 *)request.pData + 2, actualLength - 2, kCFStringEncodingUTF8, false);
}
else if (actualLength > 2) {
err = sendRequest(actualLength);
if (err == kIOReturnSuccess && request.wLenDone > 0)
{
actualLength = OSSwapBigToHostInt16(*((UInt16 *)request.pData));
- ret = CFStringCreateWithBytes(NULL, (const UInt8 *) &request.pData[2], actualLength - 2, kCFStringEncodingUTF8, false);
+ ret = CFStringCreateWithBytes(NULL, (const UInt8 *)request.pData + 2, actualLength - 2, kCFStringEncodingUTF8, false);
}
}
}
@@ -1703,15 +1704,10 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
{
CFStringAppend(extras, ret);
CFRelease(ret);
-
- ret = extras;
}
- else
- {
ret = extras;
}
}
- }
if (ret != NULL)
{
@@ -1816,7 +1812,7 @@ static CFStringRef copy_printer_interface_indexed_description(printer_interface_
if ((description[0] & 1) != 0)
description[0] &= 0xfe;
- char buffer[258] = {};
+ char buffer[258] = {0};
unsigned int maxLength = sizeof buffer;
if (description[0] > 1)
{
