Based on (hunk for changelog removed) From b62c902dd258125cac86cd2df21fc898035a43d3 Mon Sep 17 00:00:00 2001 From: Michael Pruett Date: Mon, 29 Aug 2016 23:08:26 -0500 Subject: [PATCH] Fix undefined behavior in sign conversion. --- ChangeLog | 5 +++++ libaudiofile/modules/SimpleModule.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h index 03c6c69..bad85ad 100644 --- a/libaudiofile/modules/SimpleModule.h +++ b/libaudiofile/modules/SimpleModule.h @@ -123,7 +123,8 @@ struct signConverter typedef typename IntTypes::UnsignedType UnsignedType; static const int kScaleBits = (Format + 1) * CHAR_BIT - 1; - static const int kMinSignedValue = -1 << kScaleBits; + static const int kMaxSignedValue = (((1 << (kScaleBits - 1)) - 1) << 1) + 1; + static const int kMinSignedValue = -kMaxSignedValue - 1; struct signedToUnsigned : public std::unary_function { href='/guix/'>summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2021-04-05gnu: chez-scheme: simplify packaging...Take advantage of patches that have been accepted upstream. These changes lay a foundation for reusing more of Chez's build process for Racket. * gnu/packages/patches/chez-scheme-build-util-paths-backport.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez.scm (chez-scheme)[source](patches): Use it. [source](snippet): Remove bundled libraries here, not in configure phase. [inputs]: Organize. Move "nanopass", "stex", and "xorg-rgb" to ... [native-inputs]: ... this field. [arguments]: Add (ice-9 ftw) to #:modules. Remove unneeded 'patch-processor-detection' phase. Add 'unpack-nanopass+stex' phase (refactored from 'configure'). Simplify 'configure' phase by removing patches that have been upstreamed. Add "--nogzip-man-pages" flag so we can remove 'make-manpages-writable' phase. Stop ignoring #:configure-flags, move "--threads" there, and remove unneeded workaround. Add 'prepare-stex' phase (refactored from 'install-doc'). Use it to streamline 'install-doc' phase, installing all of the right files into the right places. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath
2021-04-05gnu: chez-scheme: Update stex....Get a patch from upstream that will help us simplify the build process for the Chez Scheme documentation. * gnu/packages/chez.scm (chez-stex): Update to commit 5405149. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath
2021-04-05gnu: chez-scheme: Update nanopass to 1.9.2....* gnu/packages/chez.scm (nanopass): Update nanopass to 1.9.2. Signed-off-by: Leo Prikler <leo.prikler@student.tugraz.at> Philip McGrath
2020-12-18gnu: chez-scheme: Patch more hard-coded paths....* gnu/packages/chez.scm (chez-scheme): Patch out some /bin/rm and /bin/echo references. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brendan Tildesley
2020-12-18gnu: chez-scheme: Update to 9.5.4....* gnu/packages/chez.scm (nanopass): Update to 1.9.1. (stex): Update to 1.2.2. (chez-scheme): Update to 9.5.4. [inputs]: Add newly required lz4 and lz4:static. [arguments]: - Remove unused zlib symbol. - Since we are using ZLIB=, it looks like the substitution of libz.a path in .c/Mf-... files is no longer needed. - add lz4-static symbol and use new LZ4= and ZLIB= configure options to point to their static binaries. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Brendan Tildesley
2020-09-02gnu: chez-scheme: Install libraries to 'lib/csvX.Y.Z-site'...* gnu/packages/chez.scm (chez-make-flags): Add 'chezversion'. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Martin Becze
2020-08-28gnu: chez-srfi: Fix tests....* gnu/packages/chez.scm (chez-srfi)[arguments]: Add 'CHEZ' and 'chezversion' to #:make-flags. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Martin Becze