74 Commits

Author SHA1 Message Date
Donovan Watteau 7f19a83f13 COMMON: Replace STATIC_ASSERT uses with static_assert
The current C++11 requirement means that all targets already support
static_assert().
2025-10-12 14:11:24 +03:00
Miro Kropacek 757ae0f58d JANITORIAL: Clarify DisposablePtr::reset() 2025-06-25 23:50:34 +02:00
Filippos Karapetis 7f872286fb COMMON: Remove unused member of the DisposablePtr class 2025-06-03 03:49:19 +03:00
Hubert Maier 39f3b632d5 JANITORIAL: Fix refering typo in ptr.h 2024-05-18 13:52:31 +02:00
Le Philousophe 5964c36ab4 COMMON: Don't use a pointer to T in UnalignedPtr
This lets the compiler think the pointer value could be aligned.
2023-07-14 11:10:28 +02:00
elasota e280186a8c ALL: VS warning cleanup 2022-12-25 16:31:57 +01:00
grisenti 3c0dfdf49f COMMON: fix move assignment operator in ScopedPtr 2022-12-23 14:03:30 +01:00
Vladimir Serbinenko 1d15e2a66e COMMON: Fix DisposablePtr move constructor in presence of a deleter 2022-12-01 01:52:46 +01:00
Vladimir Serbinenko 93efb9b8c5 COMMON: Allow DisposablePtr to be backed by SharedPtr
Currently DisposablePtr allows to transparently switch between raw
pointer and ScopedPtr semantics. Add a possibility to have SharedPtr
semantics as well.
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko 68452ef2e7 COMMON: Kill disownPtr and getDispose from DisposablePtr
They unnecessarily expose internal details

Their only user has been eliminated in the previous commit
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko 02f1759f73 COMMON: Add functions to dynamically cast DisposablePtr 2022-11-28 18:41:30 +01:00
Vladimir Serbinenko 8d722dc3c1 COMMON: Add DisposablePtr constructor with move semantics
This allows easy move from one DisposablePtr to another
2022-11-28 18:41:30 +01:00
Vladimir Serbinenko a48b8dab49 COMMON: Add deleter for arrays 2022-11-14 00:13:54 +02:00
Hubert Maier 54e833d16b COMMON: Correct spelling mistake
refrence -> reference
2022-10-27 15:56:05 +02:00
elasota 19c3f539a7 COMMON: Add comparison to nullptr to SharedPtr 2022-06-02 18:39:54 -07:00
Le Philousophe 5e3d0029b3 COMMON: Implement move constructor of ScopedPtr
This helps when passing ScopedPtr as function arguments
2022-05-08 11:07:40 +02:00
Le Philousophe 3e406ed5af COMMON: Fix nullptr_t usage 2022-05-08 10:27:59 +02:00
Paul Gilbert 509504d16f COMMON: Support nullptr assignments to ScopedPtr 2022-05-07 20:16:31 -07:00
Paul Gilbert edca3fcdea COMMON: Added move assignment operator to ScopedPtr 2022-05-05 22:41:05 -07:00
elasota 6bdb93bcce COMMON: Add cast methods and to SharedPtr and WeakPtr, and add owner_before to WeakPtr 2022-05-02 21:03:55 -07:00
elasota 5cb75fdaec COMMON: Remove implicit bool conversion from WeakPtr 2022-04-25 18:20:19 -07:00
elasota a1f2121bb8 COMMON: Remove empty BasePtrTrackerDeletionImpl destructor 2022-04-25 18:20:19 -07:00
elasota 2432c67426 COMMON: Fix double destruction when using a deleter. 2022-04-25 18:20:19 -07:00
elasota 22b72dba52 COMMON: Remove BasePtr base class from SharedPtr and WeakPtr. Fix missing refCount method in SharedPtr. 2022-04-25 18:20:19 -07:00
elasota c8d0186752 COMMON: Fix WeakPtr missing copy constructor 2022-04-25 18:20:19 -07:00
elasota be5a7cb8e7 COMMON: Fix up WeakPtr logic 2022-04-25 18:20:19 -07:00
elasota 9fa32ac47d COMMON: Fix WeakPtr preventing object deletion 2022-04-25 18:20:19 -07:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko c544e5119b COMMON: Remove USE_CXX11 checks, it is now always present 2021-10-31 11:52:29 +02:00
djsrv 9c6fa32c82 COMMON: Create DisposablePtr::getDispose() 2021-08-12 13:18:27 -04:00
djsrv b40233ffe7 COMMON: Create DisposablePtr::disownPtr() 2021-08-12 13:18:27 -04:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Le Philousophe f8ff774b8d COMMON: Fix clang build
In C++11 standard, nullptr_t is defined in std and not in global space
2021-02-07 11:38:46 +01:00
Le Philousophe c49f338a0b COMMON: Fix GCC deprecated-copy warning in SharedPtr 2021-02-07 10:53:38 +01:00
Paul Gilbert 1b11fe993c COMMON: Refactor c++11 using keyword from SharedPtr 2021-02-06 21:14:30 -08:00
Paul Gilbert 53656e0338 COMMON: Wrap ptr initializers using nullptr_t in USE_CXX11 2021-02-06 17:11:07 -08:00
Paul Gilbert 8f6391bb5b COMMON: Added WeakPtr class, refactored SharedPtr 2021-02-06 16:37:31 -08:00
BeWorld cdc0ad802d MORPHOS : Fixes clashing D in ptr.h with system defines and casting glGetString (#2531)
MORPHOS : Fixes clashing D in ptr.h with system defines and casting glGetString
2020-10-16 21:26:42 +02:00
Bartosz Gentkowski ec24687ce4 DOXYGEN: Add doxygen groups to header files in the common folder
Adding @defgroup and @ingroup doxygen tags into all headers
in the common folder that contain doxygen blocks.

This improves the structure, readability, and findability
of information in the resulting output.

This commit targets purely structure and does not deal with
the content of the currently existing doxygen documentation.
2020-10-04 18:25:50 +02:00
David Fioramonti 2fcc429498 COMMON: More nullptr usage in common/ptr
Replaces some more ptr=0 with ptr=nullptr.
2018-06-04 03:36:27 -07:00
Bastien Bouclet 955e18c648 COMMON: Use nullptr instead of NULL or 0 where appropriate 2018-05-10 08:35:46 +02:00
Bastien Bouclet 2c8afb2bd2 COMMON: Add a reset method to DisposablePtr 2017-12-28 21:18:51 +01:00
Colin Snover 076667dc00 COMMON: Add limited support for custom deleters to ScopedPtr
Custom deleters of ScopedPtr are not currently fully conforming to
C++11's support for custom deleters in std::unique_ptr for the
sake of simplicity of implementation. Unlike in the standard
library, plain functions and lvalue references are not supported,
nor may custom deleters be passed to the constructor at runtime.
This can be improved in the future, if necessary, by doing what
standard library implementations usually do and creating a Pair
class that uses the Empty Base Optimization idiom to avoid extra
storage overhead of the deleter instance when it is not needed, as
in typical standard library implementations, plus some additional
type traits to support the necessary metaprogramming for the
different type overloads.
2017-11-18 22:35:12 +01:00
Colin Snover 79dd02373c COMMON: Prevent implicit conversion of smart pointers to non-bools 2017-10-06 22:10:49 -05:00
Johannes Schickel 854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Johannes Schickel 223794fb38 ALL: Make use of defined() for the preprocessor consistent.
This does not change the use of defined for some NDS source files, since they
seem to be (based on?) third party code.
2012-03-17 22:02:44 +01:00
Christoph Mallon a64b5e2a77 ALL: Use GCC_ATLEAST(). 2012-03-17 20:09:49 +01:00
Christoph Mallon a5a8833c05 COMMON: Add DisposablePtr<T>, which replaces many repeated implementations of a dispose flag. 2011-08-07 15:19:08 +02:00
Christoph Mallon 2f23ff72c1 COMMON: Remove implicit conversion from ScopedPtr<T> to T*. 2011-08-07 15:19:08 +02:00
Christoph Mallon 84220d2ca0 COMMON: Remove superfluous Common:: qualifiers. 2011-08-07 15:19:07 +02:00