pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel/libusb
Module Name: pkgsrc
Committed By: maya
Date: Tue Aug 6 09:12:10 UTC 2019
Modified Files:
pkgsrc/devel/libusb: Makefile distinfo
Added Files:
pkgsrc/devel/libusb/patches: patch-descriptors.c
Log Message:
libusb: avoid unaligned access. Improve code consistency.
XXX does this package also need -O1 -fno-strict-aliasing on clang?
Noted by Shingo Nishioka in PR pkg/54441
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 pkgsrc/devel/libusb/Makefile
cvs rdiff -u -r1.27 -r1.28 pkgsrc/devel/libusb/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/libusb/patches/patch-descriptors.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/libusb/Makefile
diff -u pkgsrc/devel/libusb/Makefile:1.43 pkgsrc/devel/libusb/Makefile:1.44
--- pkgsrc/devel/libusb/Makefile:1.43 Thu May 16 16:17:52 2019
+++ pkgsrc/devel/libusb/Makefile Tue Aug 6 09:12:10 2019
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.43 2019/05/16 16:17:52 pgoyette Exp $
+# $NetBSD: Makefile,v 1.44 2019/08/06 09:12:10 maya Exp $
DISTNAME= libusb-0.1.12
-PKGREVISION= 5
+PKGREVISION= 6
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libusb/}
Index: pkgsrc/devel/libusb/distinfo
diff -u pkgsrc/devel/libusb/distinfo:1.27 pkgsrc/devel/libusb/distinfo:1.28
--- pkgsrc/devel/libusb/distinfo:1.27 Mon Feb 19 17:59:23 2018
+++ pkgsrc/devel/libusb/distinfo Tue Aug 6 09:12:10 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.27 2018/02/19 17:59:23 mrg Exp $
+$NetBSD: distinfo,v 1.28 2019/08/06 09:12:10 maya Exp $
SHA1 (libusb-0.1.12.tar.gz) = 599a5168590f66bc6f1f9a299579fd8500614807
RMD160 (libusb-0.1.12.tar.gz) = 63848df717e00fff67ab30ba86a85466370d4e8e
@@ -11,3 +11,4 @@ SHA1 (patch-ad) = 8ea70b0501ccd725d19a73
SHA1 (patch-ae) = 49a01ebe66de4965f3611cf42db09703aa68c415
SHA1 (patch-af) = e46e576a589fb65488011a41df95f744230c0c6c
SHA1 (patch-darwin.c) = 20df5d5970bf86f6f4ada002ca16a3bccf5bb4ff
+SHA1 (patch-descriptors.c) = 14cc1b46f094585fcfbb2ba046b89c3eb5cf49f9
Added files:
Index: pkgsrc/devel/libusb/patches/patch-descriptors.c
diff -u /dev/null pkgsrc/devel/libusb/patches/patch-descriptors.c:1.1
--- /dev/null Tue Aug 6 09:12:10 2019
+++ pkgsrc/devel/libusb/patches/patch-descriptors.c Tue Aug 6 09:12:10 2019
@@ -0,0 +1,30 @@
+$NetBSD: patch-descriptors.c,v 1.1 2019/08/06 09:12:10 maya Exp $
+
+Avoid unaligned access. This breaks clang.
+Improve consistency.
+
+--- descriptors.c.orig 2006-03-04 02:52:46.000000000 +0000
++++ descriptors.c
+@@ -39,17 +39,17 @@ int usb_parse_descriptor(unsigned char *
+ for (cp = description; *cp; cp++) {
+ switch (*cp) {
+ case 'b': /* 8-bit byte */
+- *dp++ = *sp++;
++ memcpy(dp, sp, 1); sp += 1; dp += 1;
+ break;
+ case 'w': /* 16-bit word, convert from little endian to CPU */
+- w = (sp[1] << 8) | sp[0]; sp += 2;
++ w = (sp[1] << 8) | sp[0];
+ dp += ((unsigned long)dp & 1); /* Align to word boundary */
+- *((uint16_t *)dp) = w; dp += 2;
++ memcpy(dp, &w, 2); sp += 2; dp += 2;
+ break;
+ case 'd': /* 32-bit dword, convert from little endian to CPU */
+- d = (sp[3] << 24) | (sp[2] << 16) | (sp[1] << 8) | sp[0]; sp += 4;
++ d = (sp[3] << 24) | (sp[2] << 16) | (sp[1] << 8) | sp[0];
+ dp += ((unsigned long)dp & 2); /* Align to dword boundary */
+- *((uint32_t *)dp) = d; dp += 4;
++ memcpy(dp, &d, 4); sp += 4; dp += 4;
+ break;
+ /* These two characters are undocumented and just a hack for Linux */
+ case 'W': /* 16-bit word, keep CPU endianess */
Home |
Main Index |
Thread Index |
Old Index