Skip to content

Fix some compiler warnings #1777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions arcane/src/arcane/core/Dom.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* Dom.h (C) 2000-2018 */
/* Dom.h (C) 2000-2024 */
/* */
/* Implémentation d'un DOM1+DOM2+DOM3(core). */
/*---------------------------------------------------------------------------*/
Expand All @@ -20,13 +20,14 @@
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

ARCANE_BEGIN_NAMESPACE
namespace Arcane
{
class IStringImpl;
class IXmlDocumentHolder;
ARCANE_END_NAMESPACE
}

ARCANE_BEGIN_NAMESPACE
ARCANE_BEGIN_NAMESPACE_DOM
namespace Arcane::dom
{

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -642,10 +643,8 @@ class ARCANE_CORE_EXPORT Attr
friend class IDOM_Node;
friend class Element;
public:
Attr();
Attr() = default;
Attr(const Node&);
Attr(const Attr&);
~Attr();
Attr(AttrPrv*);
private:
AttrPrv* _impl() const;
Expand Down Expand Up @@ -1244,8 +1243,7 @@ class XPathNamespace
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

ARCANE_END_NAMESPACE_DOM
ARCANE_END_NAMESPACE
}

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Expand Down
16 changes: 2 additions & 14 deletions arcane/src/arcane/core/DomLibXml2V2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1555,21 +1555,12 @@ replaceData(ULong offset,ULong count,const DOMString& arg) const
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

Attr::
Attr()
: Node()
{
}
Attr::
Attr(AttrPrv* p)
: Node(cvt((xmlNodePtr)impl(p)))
{
}
Attr::
Attr(const Attr& f)
: Node((const Node&)f)
{
}

Attr::
Attr(const Node& node)
: Node()
Expand All @@ -1580,10 +1571,7 @@ Attr(const Node& node)
//if (ni && impl(ni)->getNodeType()==ATTRIBUTE_NODE)
//_assign(node);
}
Attr::
~Attr()
{
}

AttrPrv* Attr::
_impl() const
{
Expand Down
2 changes: 1 addition & 1 deletion arcane/src/arcane/core/MeshUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@
{
ofile << "<child count='" << cell.nbHChildren() << "'>";
for (Integer j = 0; j < cell.nbHChildren(); ++j) {
ofile << ' ' << cell.hChild(j)->uniqueId();
ofile << ' ' << cell.hChild(j).uniqueId();

Check warning on line 941 in arcane/src/arcane/core/MeshUtils.cc

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/core/MeshUtils.cc#L941

Added line #L941 was not covered by tests
}
ofile << "</child>";
}
Expand Down
7 changes: 3 additions & 4 deletions arcane/src/arcane/hdf5/Hdf5Utils.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* Hdf5Utils.h (C) 2000-2023 */
/* Hdf5Utils.h (C) 2000-2024 */
/* */
/* Fonctions utilitaires pour hdf5. */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -577,8 +577,7 @@ class ARCANE_HDF5_EXPORT StandardTypes

~StandardTypes();

ARCANE_DEPRECATED_REASON("Y2023: Copy operator is deprecated. This class has unique ownership")
StandardTypes& operator=(const StandardTypes& rhs) = default;
StandardTypes& operator=(const StandardTypes& rhs) = delete;

public:

Expand Down
4 changes: 1 addition & 3 deletions arcane/src/arcane/impl/VariableSynchronizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ class VariableSynchronizer::SyncMessage

SyncMessage(const DataSynchronizeDispatcherBuildInfo& bi, VariableSynchronizer* var_syncer,
IMemoryAllocator* allocator)
: m_variable_synchronizer(var_syncer)
, m_variable_synchronizer_mng(var_syncer->synchronizeMng())
: m_variable_synchronizer_mng(var_syncer->synchronizeMng())
, m_dispatcher(IDataSynchronizeDispatcher::create(bi))
, m_multi_dispatcher(IDataSynchronizeMultiDispatcher::create(bi))
, m_event_args(var_syncer)
Expand Down Expand Up @@ -167,7 +166,6 @@ class VariableSynchronizer::SyncMessage

private:

IVariableSynchronizer* m_variable_synchronizer = nullptr;
IVariableSynchronizerMng* m_variable_synchronizer_mng = nullptr;
Ref<IDataSynchronizeDispatcher> m_dispatcher;
IDataSynchronizeMultiDispatcher* m_multi_dispatcher = nullptr;
Expand Down
52 changes: 23 additions & 29 deletions arcane/src/arcane/std/MeshPartitionerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,27 @@
/* */
/* Classe de base d'un partitionneur de maillage. */
/*---------------------------------------------------------------------------*/
#ifndef ARCANE_MESHPARTITIONERBASE_H
#define ARCANE_MESHPARTITIONERBASE_H
#ifndef ARCANE_STD_MESHPARTITIONERBASE_H
#define ARCANE_STD_MESHPARTITIONERBASE_H
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

#include <set>
#include "arcane/utils/Array.h"
#include "arcane/utils/HashTableMap.h"
#include "arcane/utils/ScopedPtr.h"

#include "arcane/core/IMeshPartitioner.h"
#include "arcane/core/AbstractService.h"
#include "arcane/core/ILoadBalanceMng.h"

#include "arcane/utils/Array.h"
#include "arcane/utils/HashTableMap.h"
#include "arcane/utils/ScopedPtr.h"
#include <set>

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

namespace Arcane
{

/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/

class ISubDomain;


/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/*!
Expand All @@ -54,33 +48,33 @@
public:

ISubDomain* subDomain() const { return m_sub_domain; }
IMesh* mesh() const { return m_mesh; }
IMesh* mesh() const override { return m_mesh; }

// DEPRECATED
void setMaximumComputationTime(Real v) override { m_maximum_computation_time = v; }
virtual Real maximumComputationTime() const { return m_maximum_computation_time; }
Real maximumComputationTime() const override { return m_maximum_computation_time; }

virtual void setImbalance(Real v){ m_imbalance = v; }
virtual Real imbalance() const { return m_imbalance; }
void setImbalance(Real v) override { m_imbalance = v; }
Real imbalance() const override { return m_imbalance; }

virtual void setMaxImbalance(Real v){ m_max_imbalance = v; }
virtual Real maxImbalance() const { return m_max_imbalance; }
void setMaxImbalance(Real v) override { m_max_imbalance = v; }
Real maxImbalance() const override { return m_max_imbalance; }

virtual void setComputationTimes(RealConstArrayView v) { m_computation_times.copy(v); }
virtual RealConstArrayView computationTimes() const { return m_computation_times; }
void setComputationTimes(RealConstArrayView v) override { m_computation_times.copy(v); }
RealConstArrayView computationTimes() const override { return m_computation_times; }

virtual void setCellsWeight(ArrayView<float> weights,Integer nb_weight);
virtual ArrayView<float> cellsWeight() const;
void setCellsWeight(ArrayView<float> weights,Integer nb_weight) override;
ArrayView<float> cellsWeight() const override;

// CORRECT
virtual Integer nbCellWeight() const;
virtual void setILoadBalanceMng(ILoadBalanceMng* mng) { m_lbMng = mng; }
virtual ILoadBalanceMng* loadBalanceMng() const { return m_lbMng; }
Integer nbCellWeight() const;
void setILoadBalanceMng(ILoadBalanceMng* mng) override { m_lbMng = mng; }

Check warning on line 71 in arcane/src/arcane/std/MeshPartitionerBase.h

View check run for this annotation

Codecov / codecov/patch

arcane/src/arcane/std/MeshPartitionerBase.h#L71

Added line #L71 was not covered by tests
ILoadBalanceMng* loadBalanceMng() const override { return m_lbMng; }


public:

virtual void notifyEndPartition() { loadBalanceMng()->notifyEndPartition(); }
void notifyEndPartition() override { loadBalanceMng()->notifyEndPartition(); }

public:

Expand Down Expand Up @@ -152,11 +146,10 @@

virtual void* getCommunicator() const;
virtual Parallel::Communicator communicator() const;


virtual bool cellComm() {return true; }

protected:
protected:

virtual void _initArrayCellsWithConstraints();
virtual void _initFilterLidCells();
virtual void _initUidRef();
Expand All @@ -166,6 +159,7 @@
virtual void _clearCellWgt();

private:

Real _addNgb(const Cell& cell, const Face& face, Int64Array& neighbourcells, Array<bool>& contrib,
HashTableMapT<Int64,Int32>& map, Array<float> *ptrcommWeights, Int32 offset,
HashTableMapT<Int32,Int32>& lids, bool special=false);
Expand Down
4 changes: 2 additions & 2 deletions arcane/src/arcane/utils/HashTableMap2.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ template <typename KeyT, typename ValueT,
class HashTableMap2
: public HashTableMap2Base
{
constexpr static double EMH_DEFAULT_LOAD_FACTOR = 0.80f;
constexpr static double EMH_MIN_LOAD_FACTOR = 0.25f; //< 0.5
constexpr static float EMH_DEFAULT_LOAD_FACTOR = 0.80f;
constexpr static float EMH_MIN_LOAD_FACTOR = 0.25f; //< 0.5
constexpr static uint32_t EMH_CACHE_LINE_SIZE = 64; //debug only

public:
Expand Down
Loading