Merge pull request #1194 from awulkiew/fix/centroid_average_warning

[strategies] Fix msvc conversion warning in centroid::average
This commit is contained in:
Vissarion Fisikopoulos 2023-09-08 13:18:51 +03:00 committed by GitHub
commit 5663d76db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland. // Copyright (c) 2017-2023 Adam Wulkiewicz, Lodz, Poland.
// This file was modified by Oracle on 2015-2021. // This file was modified by Oracle on 2015-2021.
// Modifications copyright (c) 2015-2021 Oracle and/or its affiliates. // Modifications copyright (c) 2015-2021 Oracle and/or its affiliates.
@ -89,7 +89,8 @@ public :
centroid = state.centroid; centroid = state.centroid;
if ( state.count > 0 ) if ( state.count > 0 )
{ {
divide_value(centroid, state.count); using coord_t = typename coordinate_type<ResultPoint>::type;
divide_value(centroid, static_cast<coord_t>(state.count));
return true; return true;
} }
return false; return false;