summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfonso Gregory <83477269+AtariDreams@users.noreply.github.com>2021-08-30 14:52:36 -0400
committerAlfonso Gregory <83477269+AtariDreams@users.noreply.github.com>2021-08-30 14:52:36 -0400
commit3356b83fc76f0a6cfbe7a7737988dcd4704fe634 (patch)
tree80c99a9f3ff28f6700562a0cf55955e9f908aaa8
parent67654f6346ec8b510cc7889a19409983dbfc6b7d (diff)
downloadcups-3356b83fc76f0a6cfbe7a7737988dcd4704fe634.tar.gz
Sync usb-darwin to upstream
-rw-r--r--backend/usb-darwin.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c
index ee75b9e0d..f0d04ab42 100644
--- a/backend/usb-darwin.c
+++ b/backend/usb-darwin.c
@@ -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,13 +1704,8 @@ static CFStringRef copy_printer_interface_deviceid(printer_interface_t printer,
{
CFStringAppend(extras, ret);
CFRelease(ret);
-
- ret = extras;
- }
- else
- {
- ret = extras;
}
+ ret = extras;
}
}
@@ -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)
{