From 1c68815010c7b64275bd1bd27a40ebe0106de146 Mon Sep 17 00:00:00 2001 From: Kerstin Keller Date: Thu, 9 Jan 2025 18:07:26 +0100 Subject: [PATCH 1/3] [hdf5] Change the type of the hdf5 topic ID to unsigned int. --- contrib/ecalhdf5/src/hdf5_helper.h | 3 +-- .../measurement/base/include/ecal/measurement/base/types.h | 4 ++-- tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/contrib/ecalhdf5/src/hdf5_helper.h b/contrib/ecalhdf5/src/hdf5_helper.h index 6df5544800..2785e2acbd 100644 --- a/contrib/ecalhdf5/src/hdf5_helper.h +++ b/contrib/ecalhdf5/src/hdf5_helper.h @@ -54,8 +54,7 @@ inline std::string printHex(eCAL::experimental::measurement::base::Channel::id_t inline eCAL::experimental::measurement::base::Channel::id_t parseHexID(std::string string_id) { - auto unsigned_value = std::stoull(string_id, 0, 16); - return static_cast(unsigned_value); + return std::stoull(string_id, 0, 16); } namespace v6 diff --git a/contrib/measurement/base/include/ecal/measurement/base/types.h b/contrib/measurement/base/include/ecal/measurement/base/types.h index 43a3b5dad7..eccfa171cb 100644 --- a/contrib/measurement/base/include/ecal/measurement/base/types.h +++ b/contrib/measurement/base/include/ecal/measurement/base/types.h @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,7 +68,7 @@ namespace eCAL struct Channel { - using id_t = std::int64_t; + using id_t = std::uint64_t; std::string name = ""; id_t id = 0; diff --git a/tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp b/tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp index c8b775fb33..e124558ab3 100644 --- a/tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp +++ b/tests/contrib/ecalhdf5/hdf5_test/src/hdf5_test.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2024 Continental Corporation + * Copyright (C) 2016 - 2025 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1032,7 +1032,6 @@ TEST(HDF5, PrintParseHex) std::vector numeric_values = { 0, - -1, 1, std::numeric_limits::min(), std::numeric_limits::max() From 6a7cebbf2989efff85aa1ecfdec7b40d7ddc014c Mon Sep 17 00:00:00 2001 From: Kerstin Keller Date: Thu, 9 Jan 2025 18:11:49 +0100 Subject: [PATCH 2/3] Add missing license headers. --- contrib/ecalhdf5/src/hdf5_helper.cpp | 19 +++++++++++++++++++ contrib/ecalhdf5/src/hdf5_helper.h | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/contrib/ecalhdf5/src/hdf5_helper.cpp b/contrib/ecalhdf5/src/hdf5_helper.cpp index e752aefc74..2e09a92a56 100644 --- a/contrib/ecalhdf5/src/hdf5_helper.cpp +++ b/contrib/ecalhdf5/src/hdf5_helper.cpp @@ -1,3 +1,22 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2024 - 2025 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + #include "hdf5_helper.h" bool CreateStringEntryInRoot(hid_t root, const std::string& url, const std::string& dataset_content) diff --git a/contrib/ecalhdf5/src/hdf5_helper.h b/contrib/ecalhdf5/src/hdf5_helper.h index 2785e2acbd..b994550e79 100644 --- a/contrib/ecalhdf5/src/hdf5_helper.h +++ b/contrib/ecalhdf5/src/hdf5_helper.h @@ -1,3 +1,22 @@ +/* ========================= eCAL LICENSE ================================= + * + * Copyright (C) 2024 - 2025 Continental Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ========================= eCAL LICENSE ================================= +*/ + #pragma once #include From a60ac1024c8780ea95885fdf29446c5b7190a8b6 Mon Sep 17 00:00:00 2001 From: Kerstin Keller Date: Thu, 9 Jan 2025 19:13:16 +0100 Subject: [PATCH 3/3] clang-tidy remarks. --- contrib/ecalhdf5/src/hdf5_helper.h | 2 +- contrib/measurement/base/include/ecal/measurement/base/types.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/ecalhdf5/src/hdf5_helper.h b/contrib/ecalhdf5/src/hdf5_helper.h index b994550e79..d8e4a56ebc 100644 --- a/contrib/ecalhdf5/src/hdf5_helper.h +++ b/contrib/ecalhdf5/src/hdf5_helper.h @@ -73,7 +73,7 @@ inline std::string printHex(eCAL::experimental::measurement::base::Channel::id_t inline eCAL::experimental::measurement::base::Channel::id_t parseHexID(std::string string_id) { - return std::stoull(string_id, 0, 16); + return std::stoull(string_id, nullptr, 16); } namespace v6 diff --git a/contrib/measurement/base/include/ecal/measurement/base/types.h b/contrib/measurement/base/include/ecal/measurement/base/types.h index eccfa171cb..821f30bce1 100644 --- a/contrib/measurement/base/include/ecal/measurement/base/types.h +++ b/contrib/measurement/base/include/ecal/measurement/base/types.h @@ -26,6 +26,7 @@ #include #include +#include #include #include