# HG changeset patch # User Paper # Date 1699997481 18000 # Node ID 54744a48a7d7854bac202844c32a2336f81b7227 # Parent ffa535b6d630e6efa360ea466b6e9a2622bd2a92 last commit part 2: struct init with {} is valid syntax, actually diff -r ffa535b6d630 -r 54744a48a7d7 dep/animia/src/fd/bsd.cc --- a/dep/animia/src/fd/bsd.cc Tue Nov 14 16:27:33 2023 -0500 +++ b/dep/animia/src/fd/bsd.cc Tue Nov 14 16:31:21 2023 -0500 @@ -109,11 +109,7 @@ continue; */ - OpenFile file; - file.pid = pid; - file.path = vnodeInfo.pvip.vip_path; - - files.push_back(file); + files.push_back({pid, vnodeInfo.pvip.vip_path}); } } } diff -r ffa535b6d630 -r 54744a48a7d7 dep/animia/src/fd/linux.cc --- a/dep/animia/src/fd/linux.cc Tue Nov 14 16:27:33 2023 -0500 +++ b/dep/animia/src/fd/linux.cc Tue Nov 14 16:31:21 2023 -0500 @@ -137,11 +137,7 @@ if (!IsRegularFile(name)) continue; - OpenFile file; - file.pid = pid; - file.path = name; - - files.push_back(file); + files.push_back({pid, name}); } } return true; diff -r ffa535b6d630 -r 54744a48a7d7 dep/animia/src/fd/win32.cc --- a/dep/animia/src/fd/win32.cc Tue Nov 14 16:27:33 2023 -0500 +++ b/dep/animia/src/fd/win32.cc Tue Nov 14 16:31:21 2023 -0500 @@ -279,11 +279,7 @@ if (!IsFilePathOk(path)) continue; - OpenFile file; - file.pid = pid; - file.path = path; - - files.push_back(file); + files.push_back({pid, path}); } return true; diff -r ffa535b6d630 -r 54744a48a7d7 dep/animia/src/strategist.cc --- a/dep/animia/src/strategist.cc Tue Nov 14 16:27:33 2023 -0500 +++ b/dep/animia/src/strategist.cc Tue Nov 14 16:31:21 2023 -0500 @@ -54,8 +54,8 @@ fd.EnumerateOpenFiles(pids, files); - for (const auto& file : files) { - success |= AddMedia({MediaInfoType::File, file.path}); + for (const auto& [pid, path] : files) { + success |= AddMedia({MediaInfoType::File, path}); } return success; diff -r ffa535b6d630 -r 54744a48a7d7 src/core/config.cc --- a/src/core/config.cc Tue Nov 14 16:27:33 2023 -0500 +++ b/src/core/config.cc Tue Nov 14 16:31:21 2023 -0500 @@ -65,12 +65,7 @@ recognition.players.reserve(players.size()); for (const auto& player : players) { - MediaPlayer mediaplayer; - - mediaplayer.enabled = true; - mediaplayer.player = player; - - recognition.players.push_back(mediaplayer); + recognition.players.push_back({true, player}); } }