Skip to content

Commit 43bce40

Browse files
committed
Add patch from mtytel/helm#233
1 parent f19b1e2 commit 43bce40

File tree

2 files changed

+142
-1
lines changed

2 files changed

+142
-1
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
From cb611a80bd5a36d31bfc31212ebbf79aa86c6f08 Mon Sep 17 00:00:00 2001
2+
From: jikstra <jikstra@disroot.org>
3+
Date: Tue, 20 Aug 2019 03:00:51 +0200
4+
Subject: [PATCH] Backport
5+
https://github.com/WeAreROLI/JUCE/commit/4e0adb2af8b424c43d22bd431011c9a6c57d36b6
6+
to the bundled JUCE framework to make helm compile on gcc 9.1 again
7+
8+
---
9+
.../juce_graphics/colour/juce_PixelFormats.h | 25 +---------
10+
.../native/juce_RenderingHelpers.h | 48 +------------------
11+
2 files changed, 4 insertions(+), 69 deletions(-)
12+
13+
diff --git a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
14+
index 9be9ba09c..3535eab80 100644
15+
--- a/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
16+
+++ b/JUCE/modules/juce_graphics/colour/juce_PixelFormats.h
17+
@@ -105,23 +105,9 @@ class JUCE_API PixelARGB
18+
19+
//==============================================================================
20+
forcedinline uint8 getAlpha() const noexcept { return components.a; }
21+
- forcedinline uint8 getRed() const noexcept { return components.r; }
22+
+ forcedinline uint8 getRed() const noexcept { return components.r; }
23+
forcedinline uint8 getGreen() const noexcept { return components.g; }
24+
- forcedinline uint8 getBlue() const noexcept { return components.b; }
25+
-
26+
- #if JUCE_GCC
27+
- // NB these are here as a workaround because GCC refuses to bind to packed values.
28+
- forcedinline uint8& getAlpha() noexcept { return comps [indexA]; }
29+
- forcedinline uint8& getRed() noexcept { return comps [indexR]; }
30+
- forcedinline uint8& getGreen() noexcept { return comps [indexG]; }
31+
- forcedinline uint8& getBlue() noexcept { return comps [indexB]; }
32+
- #else
33+
- forcedinline uint8& getAlpha() noexcept { return components.a; }
34+
- forcedinline uint8& getRed() noexcept { return components.r; }
35+
- forcedinline uint8& getGreen() noexcept { return components.g; }
36+
- forcedinline uint8& getBlue() noexcept { return components.b; }
37+
- #endif
38+
-
39+
+ forcedinline uint8 getBlue() const noexcept { return components.b; }
40+
//==============================================================================
41+
/** Copies another pixel colour over this one.
42+
43+
@@ -340,9 +326,6 @@ class JUCE_API PixelARGB
44+
{
45+
uint32 internal;
46+
Components components;
47+
- #if JUCE_GCC
48+
- uint8 comps[4]; // helper struct needed because gcc does not allow references to packed union members
49+
- #endif
50+
};
51+
}
52+
#ifndef DOXYGEN
53+
@@ -429,10 +412,6 @@ class JUCE_API PixelRGB
54+
forcedinline uint8 getGreen() const noexcept { return g; }
55+
forcedinline uint8 getBlue() const noexcept { return b; }
56+
57+
- forcedinline uint8& getRed() noexcept { return r; }
58+
- forcedinline uint8& getGreen() noexcept { return g; }
59+
- forcedinline uint8& getBlue() noexcept { return b; }
60+
-
61+
//==============================================================================
62+
/** Copies another pixel colour over this one.
63+
64+
diff --git a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
65+
index 1c4cd31ef..29519cb5a 100644
66+
--- a/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
67+
+++ b/JUCE/modules/juce_graphics/native/juce_RenderingHelpers.h
68+
@@ -581,18 +581,10 @@ namespace EdgeTableFillers
69+
: destData (image), sourceColour (colour)
70+
{
71+
if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
72+
- {
73+
areRGBComponentsEqual = sourceColour.getRed() == sourceColour.getGreen()
74+
&& sourceColour.getGreen() == sourceColour.getBlue();
75+
- filler[0].set (sourceColour);
76+
- filler[1].set (sourceColour);
77+
- filler[2].set (sourceColour);
78+
- filler[3].set (sourceColour);
79+
- }
80+
else
81+
- {
82+
areRGBComponentsEqual = false;
83+
- }
84+
}
85+
86+
forcedinline void setEdgeTableYPos (const int y) noexcept
87+
@@ -643,7 +635,6 @@ namespace EdgeTableFillers
88+
const Image::BitmapData& destData;
89+
PixelType* linePixels;
90+
PixelARGB sourceColour;
91+
- PixelRGB filler [4];
92+
bool areRGBComponentsEqual;
93+
94+
forcedinline PixelType* getPixel (const int x) const noexcept
95+
@@ -658,43 +649,8 @@ namespace EdgeTableFillers
96+
97+
forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept
98+
{
99+
- if (destData.pixelStride == sizeof (*dest))
100+
- {
101+
- if (areRGBComponentsEqual) // if all the component values are the same, we can cheat..
102+
- {
103+
- memset (dest, colour.getRed(), (size_t) width * 3);
104+
- }
105+
- else
106+
- {
107+
- if (width >> 5)
108+
- {
109+
- const int* const intFiller = reinterpret_cast<const int*> (filler);
110+
-
111+
- while (width > 8 && (((pointer_sized_int) dest) & 7) != 0)
112+
- {
113+
- dest->set (colour);
114+
- ++dest;
115+
- --width;
116+
- }
117+
-
118+
- while (width > 4)
119+
- {
120+
- int* d = reinterpret_cast<int*> (dest);
121+
- *d++ = intFiller[0];
122+
- *d++ = intFiller[1];
123+
- *d++ = intFiller[2];
124+
- dest = reinterpret_cast<PixelRGB*> (d);
125+
- width -= 4;
126+
- }
127+
- }
128+
-
129+
- while (--width >= 0)
130+
- {
131+
- dest->set (colour);
132+
- ++dest;
133+
- }
134+
- }
135+
- }
136+
+ if ((size_t) destData.pixelStride == sizeof (*dest) && areRGBComponentsEqual)
137+
+ memset ((void*) dest, colour.getRed(), (size_t) width * 3); // if all the component values are the same, we can cheat..
138+
else
139+
{
140+
JUCE_PERFORM_PIXEL_OP_LOOP (set (colour))

SPECS/helm.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ License: GPL-3.0
77
URL: http://tytel.org/helm
88
Source0: https://github.com/mtytel/%{name}/archive/v%{version}.tar.gz
99
Source1: %{name}.appdata.xml
10+
Patch0: 00-gcc-9.1.compatibility-fixes.patch
1011

1112
BuildRequires: lv2-devel libX11-devel alsa-lib-devel libXext-devel libXinerama-devel freetype-devel libcurl-devel mesa-libGL-devel jack-audio-connection-kit-devel libXcursor-devel gcc-c++ libappstream-glib
1213
Requires: freetype libXext mesa-libGL
@@ -27,7 +28,7 @@ Mac, and Windows as a standalone program and as a LV2/VST/AU/AAX plugin.
2728
This package installs the LV2 plugin.
2829

2930
%prep
30-
%autosetup
31+
%autosetup -p1
3132

3233
%build
3334
%configure

0 commit comments

Comments
 (0)