Remove DPL::Atomic 26/319826/6
authorKrzysztof Malysa <k.malysa@samsung.com>
Mon, 17 Feb 2025 13:42:38 +0000 (14:42 +0100)
committerKrzysztof Malysa <k.malysa@samsung.com>
Wed, 19 Feb 2025 17:09:31 +0000 (18:09 +0100)
Change-Id: I9c7a3afc4cd9ff1cd314b91f5309e0faaea24357

src/framework/config.cmake
src/framework/include/dpl/atomic.h [deleted file]
src/framework/include/dpl/test/test_runner.h
src/framework/src/atomic.cpp [deleted file]
src/framework/src/test_runner.cpp
src/yaca/yaca-test-key.cpp

index 374d3233c432c68e815fbc9af4f6c59fc279604f..337ed233e5416e24931d2cff81cf9aa1fe9f7493 100644 (file)
@@ -21,7 +21,6 @@
 
 SET(DPL_FRAMEWORK_TEST_SOURCES
     ${PROJECT_SOURCE_DIR}/src/framework/src/assert.cpp
-    ${PROJECT_SOURCE_DIR}/src/framework/src/atomic.cpp
     ${PROJECT_SOURCE_DIR}/src/framework/src/binary_queue.cpp
     ${PROJECT_SOURCE_DIR}/src/framework/src/colors.cpp
     ${PROJECT_SOURCE_DIR}/src/framework/src/exception.cpp
diff --git a/src/framework/include/dpl/atomic.h b/src/framework/include/dpl/atomic.h
deleted file mode 100644 (file)
index 50c4a1a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    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.
- */
-/*
- * @file        atomic.h
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the header file of atomic
- */
-#ifndef DPL_ATOMIC_H
-#define DPL_ATOMIC_H
-
-#pragma GCC system_header
-#include <glib.h>
-
-namespace DPL {
-class Atomic
-{
-  public:
-    typedef gint ValueType;
-
-  private:
-    volatile ValueType m_value;
-
-  public:
-    Atomic(ValueType value = static_cast<ValueType>(0));
-
-    ValueType ExchangeAndAdd(ValueType value);
-    bool CompareAndExchange(ValueType oldValue, ValueType newValue);
-    bool operator--();
-    void operator++();
-
-    operator ValueType() const;
-};
-} // namespace DPL
-
-#endif // DPL_ATOMIC_H
index e96d88bd301075448cc4cd9a050a268a219a6f0a..6f9de4fabb2dc44a2a479ee3fa2f9eb01598c3c9 100644 (file)
@@ -40,7 +40,6 @@
 #include <vector>
 #include <memory>
 
-#include <dpl/atomic.h>
 #include <dpl/availability.h>
 #include <dpl/colors.h>
 #include <dpl/gdbbacktrace.h>
diff --git a/src/framework/src/atomic.cpp b/src/framework/src/atomic.cpp
deleted file mode 100644 (file)
index 2f50074..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    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.
- */
-/*
- * @file        atomic.cpp
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of atomic
- */
-#include <stddef.h>
-#include <dpl/atomic.h>
-
-namespace DPL {
-Atomic::Atomic(ValueType value) :
-    m_value(value)
-{}
-
-Atomic::ValueType Atomic::ExchangeAndAdd(ValueType value)
-{
-    return g_atomic_int_add(const_cast<gint* >(&m_value), value);
-}
-
-bool Atomic::CompareAndExchange(ValueType oldValue, ValueType newValue)
-{
-    return g_atomic_int_compare_and_exchange(const_cast<gint* >(&m_value),
-                                             oldValue,
-                                             newValue);
-}
-
-bool Atomic::operator--()
-{
-    return g_atomic_int_dec_and_test(const_cast<gint* >(&m_value)) != TRUE;
-}
-
-void Atomic::operator++()
-{
-    g_atomic_int_inc(const_cast<gint* >(&m_value));
-}
-
-Atomic::operator ValueType() const
-{
-    return g_atomic_int_get(const_cast<gint* >(&m_value));
-}
-} // namespace DPL
index b1f18616413cd87b05a7ee02b28815e39e1c818d..c3ecbbbce11ee358b2c2c56d17898b95958a99b5 100644 (file)
@@ -37,6 +37,7 @@
 #include <functional>
 #include <memory>
 #include <string>
+#include <unistd.h>
 
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
index efb101790f1170d651cc7fb0fa2d57483820a26a..1784852aa698ae807c00311f4c6a9fac42d56aba 100644 (file)
@@ -23,7 +23,8 @@
 
 #include "dpl/test/test_runner.h"
 
-#include <stdint.h>
+#include <climits>
+#include <cstdint>
 
 #include <yaca_key.h>
 #include <yaca_types.h>