Date: Mon, 20 Jul 2015 16:15:57 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285720 - head/lib/libusb Message-ID: <201507201615.t6KGFv0l040151@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Mon Jul 20 16:15:56 2015 New Revision: 285720 URL: https://svnweb.freebsd.org/changeset/base/285720 Log: libusb: Fix minor cast-qual warning. Fix a warning triggered by the gcc + FORTIFY_SOURCE patches: In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141: warning: passing argument 1 of 'memcpy' discards qualifiers from pointer target type Submitted by: hselansky Modified: head/lib/libusb/libusb20_desc.c Modified: head/lib/libusb/libusb20_desc.c ============================================================================== --- head/lib/libusb/libusb20_desc.c Mon Jul 20 16:08:01 2015 (r285719) +++ head/lib/libusb/libusb20_desc.c Mon Jul 20 16:15:56 2015 (r285720) @@ -137,15 +137,13 @@ libusb20_parse_config_desc(const void *c * Make a copy of the config descriptor, so that the caller can free * the inital config descriptor pointer! */ - ptr = (void *)(lub_endpoint + nendpoint); - memcpy(LIBUSB20_ADD_BYTES(ptr, 0), config_desc, pcdesc.len); + memcpy((void *)(lub_endpoint + nendpoint), config_desc, pcdesc.len); + + ptr = (const void *)(lub_endpoint + nendpoint); pcdesc.ptr = LIBUSB20_ADD_BYTES(ptr, 0); - config_desc = LIBUSB20_ADD_BYTES(ptr, 0); /* init config structure */ - ptr = config_desc; - LIBUSB20_INIT(LIBUSB20_CONFIG_DESC, &lub_config->desc); if (libusb20_me_decode(ptr, ptr[0], &lub_config->desc)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507201615.t6KGFv0l040151>