From owner-svn-src-head@FreeBSD.ORG Tue May 7 20:35:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B802544E; Tue, 7 May 2013 20:35:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90AEF8E; Tue, 7 May 2013 20:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47KZmn4064103; Tue, 7 May 2013 20:35:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47KZmbc064099; Tue, 7 May 2013 20:35:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305072035.r47KZmbc064099@svn.freebsd.org> From: Ed Maste Date: Tue, 7 May 2013 20:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250335 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 20:35:48 -0000 Author: emaste Date: Tue May 7 20:35:47 2013 New Revision: 250335 URL: http://svnweb.freebsd.org/changeset/base/250335 Log: 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@ Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10_io.c Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Tue May 7 18:45:34 2013 (r250334) +++ head/lib/libusb/libusb.h Tue May 7 20:35:47 2013 (r250335) @@ -441,7 +441,7 @@ int libusb_handle_events(libusb_context 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 */ Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Tue May 7 18:45:34 2013 (r250334) +++ head/lib/libusb/libusb10_io.c Tue May 7 20:35:47 2013 (r250335) @@ -397,7 +397,7 @@ libusb_set_pollfd_notifiers(libusb_conte 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); }