Author: pfg
Date: Wed Aug  5 18:55:26 2015
New Revision: 286334
URL: https://svnweb.freebsd.org/changeset/base/286334

Log:
  MFC   r285720:
  libusb: Fix minor 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:
  stable/9/lib/libusb/libusb20_desc.c
Directory Properties:
  stable/9/lib/libusb/   (props changed)

Modified: stable/9/lib/libusb/libusb20_desc.c
==============================================================================
--- stable/9/lib/libusb/libusb20_desc.c Wed Aug  5 18:52:40 2015        
(r286333)
+++ stable/9/lib/libusb/libusb20_desc.c Wed Aug  5 18:55:26 2015        
(r286334)
@@ -133,15 +133,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)) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"

Reply via email to