summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2021-08-30 16:11:08 -0400
committerGitHub <noreply@github.com>2021-08-30 16:11:08 -0400
commitaebec23082fbe84234df9f2efbc1f78f6ef3f76c (patch)
tree410b244372db4cdf318b6bebe8f4b045774e9288
parenta75195039cda045f2500141dd23e336f138e4a5c (diff)
parent3356b83fc76f0a6cfbe7a7737988dcd4704fe634 (diff)
downloadcups-aebec23082fbe84234df9f2efbc1f78f6ef3f76c.tar.gz
Merge pull request #5948 from AtariDreams/clion
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)
{