Commit Graph

37 Commits

Author SHA1 Message Date
Laurent Rineau a8fae00bf1 missing header 2023-09-07 10:35:03 +02:00
Laurent Rineau 2923eff641 Fix a warning `-Wnull-pointer-subtraction`
https://clang.llvm.org/docs/DiagnosticsReference.html#wnull-pointer-subtraction
2022-09-02 11:33:07 +02:00
Laurent Rineau 8fa0f55ac7
Merge branch 'master' into mt-glisse 2021-05-27 10:27:38 +02:00
Giles Bathgate 5ecd85248a Fix capitalisation of macro name. 2021-04-28 21:03:45 +01:00
Giles Bathgate 254f1bf6b9 Add conditional noexcept to Handle/Handle_for 2021-04-28 21:03:03 +01:00
Laurent Rineau d6e9bdd0c1 Merge pull request #5269 from GilesBathgate/move-assignment-operators
Move assignment operators
2021-03-24 15:05:39 +01:00
Marc Glisse 220d26da98 Merge remote-tracking branch 'cgal/master' into mt-glisse 2021-02-18 22:10:12 +01:00
Marc Glisse 52b07799b4 Bug fixing 2021-02-17 00:25:16 +01:00
Marc Glisse 9f0f7eb033 is_currently_single_threaded 2021-01-11 19:40:13 +01:00
Marc Glisse a513a4802a comment about __libc_single_threaded 2021-01-10 23:50:41 +01:00
Giles Bathgate 9aea175746 Add a move constructor to Handle.h 2020-12-13 13:52:52 +00:00
Giles Bathgate d29baab363 Add a move assignment operator to Handle.h 2020-12-13 13:50:19 +00:00
Marc Glisse 6338f89ae4 conditional code for TSAN 2020-11-13 19:39:24 +01:00
Marc Glisse bf0a42d740 lock-like protection for update_exact
The exact choice of memory_order_* is hard, and even for versions that
seem to work on x86_64 TSAN complains like crazy.

TODO: a version that, instead of blocking if another thread is updating,
also does the computation, with suitable protection to ensure that
pruning the tree cannot happen while anyone is computing on it.

TODO: try having AT in Lazy instead of Lazy_rep (i.e. not shared) to
avoid the indirection. We can possibly choose one or the other depending
on the type.
2020-11-13 19:39:24 +01:00
Marc Glisse 0bd0e7e47d atomic count in Handle 2020-11-13 19:39:24 +01:00
Marc Glisse 29c9fd3f02 Refactor ++ and -- in Handle 2020-11-13 19:39:24 +01:00
Marc Glisse 695fe37394 Constructor for Rep 2020-11-13 19:39:24 +01:00
Andreas Fabri b101674749 Make the intersection point static; Move the normal construction higher up 2020-10-20 09:17:15 +02:00
Laurent Rineau 8b474ddf59 Re-add the use of Lazy objects in Compact_container 2020-05-20 10:32:03 +02:00
Laurent Rineau 319383c963 Revert "Merge pull request #4519 from lrineau/Kernel_23-Epeck_objects_in_Compact_container-lrineau_gdamiand"
This reverts commit bcab082f82, reversing
changes made to 2d3e126450.
2020-05-20 09:47:58 +02:00
Sébastien Loriot 97e46accad extra run of the script to remove tabs and trailing whitespaces 2020-03-26 19:26:37 +01:00
Guillaume Damiand 650a7dcbc2
Merge branch 'master' into Kernel_23-Epeck_objects_in_Compact_container-lrineau_gdamiand 2020-03-16 16:24:54 +01:00
Marc Glisse 3e4c0d28e5 More swaps. 2020-02-25 01:29:48 +01:00
Laurent Rineau 0f0a0ed82d Try to enable the use of Lazy objects in Compact_container 2020-02-12 09:59:51 +01:00
Marc Glisse 6c65f5d929 Some noexcept, swap, etc to help Handle* types 2020-02-12 09:42:51 +01:00
Sébastien Loriot 52164b1fba First pass on removing license notice in header for LGPL files 2019-10-19 15:40:30 +02:00
Sébastien Loriot 7356421d80 introduce Commercial license SPDX tag 2019-10-19 12:15:19 +02:00
Sébastien Loriot 9bd9c68b83 update LGPL[23]+ and GPL[23]+ SPDX tags
ack -l --no-svg "SPDX-License-Identifier: GPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-3.0+/SPDX-License-Identifier: GPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-3.0+/SPDX-License-Identifier: LGPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: GPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-2.0+/SPDX-License-Identifier: GPL-2.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-2.0+/SPDX-License-Identifier: LGPL-2.0-or-later/"
2019-10-18 21:57:54 +02:00
Sébastien Loriot 1496de2070 fix reset() function 2019-10-10 13:26:49 +02:00
Sébastien Loriot 153832fbba add a function to reset a Handle 2019-10-09 18:06:30 +02:00
Sébastien Loriot 0698f79aff add SPDX identifier for files under the LGPL-3+ license 2017-11-12 10:17:50 +01:00
Sébastien Loriot 91a5327fa8 change LGPLv2 -> LGPLv3 2011-10-10 13:48:25 +00:00
Sébastien Loriot dff6dda8b3 Remove from copyright holder
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
2011-09-21 19:46:31 +00:00
Sébastien Loriot 52317dd49f add python script (replace_CGAL_NAMESPACE.py) to replace CGAL_BEGIN_NAMESPACE and CGAL_END_NAMESPACE
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
2010-06-09 07:37:13 +00:00
Fernando Cacciola a12e6dc61c Fixed id() and identical() so they don't cast to 'long' 2010-03-25 13:17:21 +00:00
Laurent Rineau ac0017572a Fix a problem reported by a user and discussed on CGAL-develop:
Laurent Rineau (GeometryFactory) wrote:
> On Wednesday 29 July 2009 14:05:41 Sylvain Pion wrote:
>> Laurent Rineau (GeometryFactory) wrote:
>>> One GF customer reported the following issue:
>>>
>>> "For 64bit compilation, we get the disturbing warning
>>>
>>> ..\Third_Party_Libraries\CGAL\include\CGAL/Handle.h(90) : warning C4311:
>>> 'reinterpret_cast' : pointer truncation from 'CGAL::Rep *const ' to
>>> 'unsigned long'
>>>
>>> which looks like a real 64bit issue."
>>>
>>> and he is right. Here is the code:
>>>
>>> inline
>>> bool
>>> identical(const Handle &h1, const Handle &h2)
>>> { return reinterpret_cast<unsigned long>(h1.PTR) ==
>>>          reinterpret_cast<unsigned long>(h2.PTR); }
>>>
>>>
>>> "unsigned long" is not the right type! On 32 bits machine, that type is
>>> too long, and on x64 under Windows, that type is too short!
>> Indeed...
>>
>>> See http://en.wikipedia.org/wiki/LLP64#Specific_data_models
>>>
>>> We need uintptr_t from C99, because that type is defined as the fastest
>>> unsigned integral type that is convertible from void pointers and
>>> comvertible to void pointers, without truncation.
>>>
>>> However, that type is not yet in the C++ norm, and some platforms may not
>>> have it. We will probably need some macro stuff:
>>>   - use C++0x if possible,
>>>   - fallback to plain C99 headers,
>>>   - then fallback to platform specific typedefs.
>>>
>>> Is that the correct solution?
>> For the identical() function above, why don't we simply compare
>> the pointers without doing the casts to unsigned long at all ?
>>
>> Nevertheless, the problem exists in the id() function (and this
>> function is probably less useful...).
>> What about returning std::ptrdiff_t with {return h.PTR -
>> static_cast<Ref*>(0);} ?
> 
> Yes. That might be a good cross-platform solution for id(). I will commit that 
> in the trunk. And identical() will be a.id()==b.id().

Why not just h1.PTR == h2.PTR for identical() ?


So, let's go and break the trunk! ;-)
I have a least compiled and run test/Kernel_23/Lazy_kernel.cpp
2009-07-29 13:27:47 +00:00
Sylvain Pion 4416bee3de Move all Handle* classes to STL_Extension. There's no geometry in them,
so the kernel is not the most appropriate place for them.
2008-04-12 10:38:07 +00:00