Fix compiler issues introduced in recent commit.

{73af762e9cd595ea708647c02c7e74752d844e80}
This commit is contained in:
2021-03-03 13:42:28 +01:00
parent dcf7313e73
commit 87da26404f

View File

@@ -27,18 +27,15 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "node_composite_util.h" #include "node_composite_util.h"
#include <optional>
extern "C" { extern "C" {
static std::optional<CryptomatteEntry *> cryptomatte_find(const NodeCryptomatte &n, static CryptomatteEntry *cryptomatte_find(const NodeCryptomatte &n, float encoded_hash)
float encoded_hash)
{ {
LISTBASE_FOREACH (CryptomatteEntry *, entry, &n.entries) { LISTBASE_FOREACH (CryptomatteEntry *, entry, &n.entries) {
if (entry->encoded_hash == encoded_hash) { if (entry->encoded_hash == encoded_hash) {
return std::make_optional(entry); return entry;
} }
} }
return std::nullopt; return nullptr;
} }
static void cryptomatte_add(NodeCryptomatte &n, float f) static void cryptomatte_add(NodeCryptomatte &n, float f)
@@ -55,12 +52,12 @@ static void cryptomatte_add(NodeCryptomatte &n, float f)
static void cryptomatte_remove(NodeCryptomatte &n, float f) static void cryptomatte_remove(NodeCryptomatte &n, float f)
{ {
std::optional<CryptomatteEntry *> entry = cryptomatte_find(n, f); CryptomatteEntry *entry = cryptomatte_find(n, f);
if (!entry) { if (!entry) {
return; return;
} }
BLI_remlink(&n.entries, entry.value()); BLI_remlink(&n.entries, entry);
MEM_freeN(entry.value()); MEM_freeN(entry);
} }
static bNodeSocketTemplate outputs[] = { static bNodeSocketTemplate outputs[] = {