Constify libusb_get_pollfds return

The correct return type, per our libusb(3) man page and the libusb.org
and libusbx projects (whose interface we intend to follow for our libusb),
is const struct libusb_pollfd **.

Unfortunately the doxygen-generated libusbx API documentation[1] omits[2]
the const for some reason.

[1] http://libusbx.sourceforge.net/api-1.0/group__poll.html#gab1a72869a926552b27a6c667695df3a2

[2] http://sourceforge.net/mailarchive/forum.php?thread_name=497D10BE.8090007%40n-dimensional.de&forum_name=libusb-devel

Reviewed by: hselasky@
This commit is contained in:
Ed Maste 2013-05-07 20:35:47 +00:00
parent bb0e1de4ab
commit 22a962c9fe
2 changed files with 3 additions and 3 deletions

View File

@ -441,7 +441,7 @@ int libusb_handle_events(libusb_context * ctx);
int libusb_handle_events_locked(libusb_context * ctx, struct timeval *tv);
int libusb_get_next_timeout(libusb_context * ctx, struct timeval *tv);
void libusb_set_pollfd_notifiers(libusb_context * ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data);
struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx);
const struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx);
/* Synchronous device I/O */

View File

@ -397,7 +397,7 @@ libusb_set_pollfd_notifiers(libusb_context *ctx,
ctx->fd_cb_user_data = user_data;
}
struct libusb_pollfd **
const struct libusb_pollfd **
libusb_get_pollfds(libusb_context *ctx)
{
struct libusb_super_pollfd *pollfd;
@ -423,7 +423,7 @@ libusb_get_pollfds(libusb_context *ctx)
done:
CTX_UNLOCK(ctx);
return (ret);
return ((const struct libusb_pollfd **)ret);
}