Attachments you submit will be routed for moderation. If you have an account, please
log in first.
Ticket #28: 0001-fixed-clang-analyzer-warnings.patch
| File 0001-fixed-clang-analyzer-warnings.patch,
2.2 KB
(added by rogueresearch, 2 years ago) |
|
patch in .patch format
|
-
From d407c12a6ba7d2e5e020d280e313eea5bf6b9d69 Mon Sep 17 00:00:00 2001
From: Sean McBride <sean@rogue-research.com>
Date: Fri, 5 Feb 2010 11:50:34 -0500
Subject: [PATCH] fixed clang analyzer warnings
---
libusb/io.c | 2 ++
libusb/os/darwin_usb.c | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/libusb/io.c b/libusb/io.c
index 387be4c..5aa4b60 100644
|
a
|
b
|
API_EXPORTED int libusb_submit_transfer(struct libusb_transfer *transfer) |
| 1243 | 1243 | if (r < 0) |
| 1244 | 1244 | r = LIBUSB_ERROR_OTHER; |
| 1245 | 1245 | } |
| | 1246 | #else |
| | 1247 | (void)first; |
| 1246 | 1248 | #endif |
| 1247 | 1249 | |
| 1248 | 1250 | out: |
-
diff --git a/libusb/os/darwin_usb.c b/libusb/os/darwin_usb.c
index dfae564..46b79c2 100644
|
a
|
b
|
static void darwin_clear_iterator (io_iterator_t iter) { |
| 255 | 255 | static void *event_thread_main (void *arg0) { |
| 256 | 256 | IOReturn kresult; |
| 257 | 257 | struct libusb_context *ctx = (struct libusb_context *)arg0; |
| | 258 | CFRunLoopRef runloop; |
| 258 | 259 | |
| 259 | 260 | /* hotplug (device removal) source */ |
| 260 | 261 | CFRunLoopSourceRef libusb_notification_cfsource; |
| … |
… |
static void *event_thread_main (void *arg0) { |
| 263 | 264 | |
| 264 | 265 | _usbi_log (ctx, LOG_LEVEL_INFO, "creating hotplug event source"); |
| 265 | 266 | |
| 266 | | CFRetain (CFRunLoopGetCurrent ()); |
| | 267 | runloop = CFRunLoopGetCurrent (); |
| | 268 | CFRetain (runloop); |
| 267 | 269 | |
| 268 | 270 | /* add the notification port to the run loop */ |
| 269 | 271 | libusb_notification_port = IONotificationPortCreate (libusb_darwin_mp); |
| … |
… |
static void *event_thread_main (void *arg0) { |
| 299 | 301 | CFRunLoopSourceInvalidate (libusb_notification_cfsource); |
| 300 | 302 | IONotificationPortDestroy (libusb_notification_port); |
| 301 | 303 | |
| 302 | | CFRelease (CFRunLoopGetCurrent ()); |
| | 304 | CFRelease (runloop); |
| 303 | 305 | |
| 304 | 306 | libusb_darwin_acfl = NULL; |
| 305 | 307 | |
| … |
… |
static int darwin_open (struct libusb_device_handle *dev_handle) { |
| 597 | 599 | |
| 598 | 600 | /* create async event source */ |
| 599 | 601 | kresult = (*(dpriv->device))->CreateDeviceAsyncEventSource (dpriv->device, &priv->cfSource); |
| | 602 | if (kresult != kIOReturnSuccess) { |
| | 603 | _usbi_log (HANDLE_CTX (dev_handle), LOG_LEVEL_ERROR, "CreateDeviceAsyncEventSource failed: %s", darwin_error_str(kresult)); |
| | 604 | } |
| 600 | 605 | |
| 601 | 606 | CFRetain (libusb_darwin_acfl); |
| 602 | 607 | |
Download in other formats: