From 510a3ee324d0d0e888a60511d60dd998910d9062 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Thu, 31 Aug 2023 10:14:48 +0100 Subject: [PATCH] Fix compilation with Apple Clang 13 - Add missing include - Remove unused lambda capture in FilterAlgo - Capture `object` explicitly by value in Collect, because we're not allowed to capture structured bindings directly. --- Changes.md | 5 +++++ include/Gaffer/Collect.h | 2 ++ src/Gaffer/Collect.cpp | 2 +- src/GafferImage/FilterAlgo.cpp | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changes.md b/Changes.md index 11cd49c2d32..6b7665170d1 100644 --- a/Changes.md +++ b/Changes.md @@ -7,6 +7,11 @@ API - ThreadState : Added `process()` method. - Process : Added const overload for `handleException()` method. The non-const version will be removed in future. +Build +----- + +- MacOS : Fixed compilation with Clang 13. + 1.3.2.0 (relative to 1.3.1.0) ======= diff --git a/include/Gaffer/Collect.h b/include/Gaffer/Collect.h index b51c5f0a646..2cf8b09f6cd 100644 --- a/include/Gaffer/Collect.h +++ b/include/Gaffer/Collect.h @@ -42,6 +42,8 @@ #include "Gaffer/TypedObjectPlug.h" #include "Gaffer/TypeIds.h" +#include + namespace Gaffer { diff --git a/src/Gaffer/Collect.cpp b/src/Gaffer/Collect.cpp index e8bcea2ab51..639d9b54b14 100644 --- a/src/Gaffer/Collect.cpp +++ b/src/Gaffer/Collect.cpp @@ -566,7 +566,7 @@ void Collect::compute( ValuePlug *output, const Context *context) const { dispatchPlugFunction( input, - [&] ( auto *plug ) { + [&, object=object] ( auto *plug ) { using OutputTraits = OutputTraits>>; auto typedObject = static_cast( object ); OutputTraits::container( *typedObject )[index] = OutputTraits::collect( plug ); diff --git a/src/GafferImage/FilterAlgo.cpp b/src/GafferImage/FilterAlgo.cpp index 33be4318151..d6ba34b884d 100644 --- a/src/GafferImage/FilterAlgo.cpp +++ b/src/GafferImage/FilterAlgo.cpp @@ -416,7 +416,7 @@ float GafferImage::FilterAlgo::sampleBox( Sampler &sampler, const V2f &p, float float yFilterWeight = filter->yfilt( ( y + 0.5f - p.y ) * yscale ); sampler.visitPixels( visitBounds, - [ &totalW, &v, &p, &pixelBounds, &scratchMemory, &yFilterWeight ] ( float value, int x, int y ) + [ &totalW, &v, &pixelBounds, &scratchMemory, &yFilterWeight ] ( float value, int x, int y ) { float w = scratchMemory[ x - pixelBounds.min.x ] * yFilterWeight;