From 5f46a69d4e7b418b97f2830bae1369d743ec32c1 Mon Sep 17 00:00:00 2001 From: emeric Date: Mon, 11 Jan 2021 12:08:31 +0100 Subject: [PATCH] Added missing GPL headers --- src/libs/utils/impl/ChildProcess.cpp | 19 +++++++++++++++ src/libs/utils/impl/ChildProcess.hpp | 23 ++++++++++++++++++ src/libs/utils/impl/ChildProcessManager.cpp | 18 ++++++++++++++ src/libs/utils/impl/ChildProcessManager.hpp | 19 +++++++++++++++ src/libs/utils/impl/NetAddress.cpp | 26 ++++++++++----------- 5 files changed, 91 insertions(+), 14 deletions(-) diff --git a/src/libs/utils/impl/ChildProcess.cpp b/src/libs/utils/impl/ChildProcess.cpp index 96e33ce9..c4eba387 100644 --- a/src/libs/utils/impl/ChildProcess.cpp +++ b/src/libs/utils/impl/ChildProcess.cpp @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2020 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + #include "ChildProcess.hpp" #include diff --git a/src/libs/utils/impl/ChildProcess.hpp b/src/libs/utils/impl/ChildProcess.hpp index f051eae7..e3c74f9a 100644 --- a/src/libs/utils/impl/ChildProcess.hpp +++ b/src/libs/utils/impl/ChildProcess.hpp @@ -1,3 +1,26 @@ +/* + * Copyright (C) 2020 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + +#pragma once + +#include +#include #pragma once #include diff --git a/src/libs/utils/impl/ChildProcessManager.cpp b/src/libs/utils/impl/ChildProcessManager.cpp index bad7ebfa..128fcd9f 100644 --- a/src/libs/utils/impl/ChildProcessManager.cpp +++ b/src/libs/utils/impl/ChildProcessManager.cpp @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2020 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ #include "ChildProcessManager.hpp" diff --git a/src/libs/utils/impl/ChildProcessManager.hpp b/src/libs/utils/impl/ChildProcessManager.hpp index 590a9079..eb8f0353 100644 --- a/src/libs/utils/impl/ChildProcessManager.hpp +++ b/src/libs/utils/impl/ChildProcessManager.hpp @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2020 Emeric Poupon + * + * This file is part of LMS. + * + * LMS is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * LMS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with LMS. If not, see . + */ + #pragma once #include diff --git a/src/libs/utils/impl/NetAddress.cpp b/src/libs/utils/impl/NetAddress.cpp index cede3029..732565f8 100644 --- a/src/libs/utils/impl/NetAddress.cpp +++ b/src/libs/utils/impl/NetAddress.cpp @@ -22,23 +22,21 @@ namespace std { std::size_t hash::operator()(const boost::asio::ip::address& ipAddr) const + { + if (ipAddr.is_v4()) + return ipAddr.to_v4().to_ulong(); + + if (ipAddr.is_v6()) { - if (ipAddr.is_v4()) - return ipAddr.to_v4().to_ulong(); + const auto& range {ipAddr.to_v6().to_bytes()}; + std::size_t res {}; - if (ipAddr.is_v6()) - { - const auto& range {ipAddr.to_v6().to_bytes()}; - std::size_t res {}; + for (auto b : range) + res ^= std::hash{}(static_cast(b)); - for (auto b : range) - res ^= std::hash{}(static_cast(b)); - - return res; - } - - return std::hash{}(ipAddr.to_string()); + return res; } + return std::hash{}(ipAddr.to_string()); + } } -