• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/audiofile/0002-cast-to-unsigned-gcc6.patch
Bernd KuhlsBernd Kuhls committed 0b69faf716b04 Jun 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From 28cfdbbcb96a69087c3d21faf69b5eae7bcf6d69 Mon Sep 17 00:00:00 2001
2
From: Hodorgasm <nsane457@gmail.com>
3
Date: Wed, 11 May 2016 21:42:07 -0400
4
Subject: [PATCH] Cast to unsigned while left bit-shifting
5
​
6
GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting.
7
​
8
Downloaded from upstream PR:
9
https://github.com/mpruett/audiofile/pull/28
10
​
11
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
12
---
13
 libaudiofile/modules/SimpleModule.h | 2 +-
14
 1 file changed, 1 insertion(+), 1 deletion(-)
15
​
16
diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h
17
index 03c6c69..4014fb2 100644
18
--- a/libaudiofile/modules/SimpleModule.h
19
+++ b/libaudiofile/modules/SimpleModule.h
20
@@ -123,7 +123,7 @@ struct signConverter
21
    typedef typename IntTypes<Format>::UnsignedType UnsignedType;
22
 
23
    static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
24
-   static const int kMinSignedValue = -1 << kScaleBits;
25
+   static const int kMinSignedValue = static_cast<signed>(static_cast<unsigned>(-1) << kScaleBits);;
26
 
27
    struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
28
    {
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.