mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix of Linux compile errors and warnings
This commit is contained in:
parent
7e3b8c87dd
commit
47819812bf
@ -159,7 +159,7 @@ void CmdFeatureManager::refreshStates(const QStringList& commandIdList)
|
||||
{
|
||||
if (commandIdList.size() == 0)
|
||||
{
|
||||
for (int i = 0; i < m_commandFeatures.size(); i++)
|
||||
for (size_t i = 0; i < m_commandFeatures.size(); i++)
|
||||
{
|
||||
CmdFeature* cmdFeature = m_commandFeatures[i];
|
||||
|
||||
@ -192,7 +192,7 @@ void CmdFeatureManager::refreshEnabledState(const QStringList& commandIdList)
|
||||
{
|
||||
if (commandIdList.size() == 0)
|
||||
{
|
||||
for (int i = 0; i < m_commandFeatures.size(); i++)
|
||||
for (size_t i = 0; i < m_commandFeatures.size(); i++)
|
||||
{
|
||||
m_commandFeatures[i]->refreshEnabledState();
|
||||
}
|
||||
@ -218,7 +218,7 @@ void CmdFeatureManager::refreshCheckedState(const QStringList& commandIdList)
|
||||
{
|
||||
if (commandIdList.size() == 0)
|
||||
{
|
||||
for (int i = 0; i < m_commandFeatures.size(); i++)
|
||||
for (size_t i = 0; i < m_commandFeatures.size(); i++)
|
||||
{
|
||||
m_commandFeatures[i]->refreshCheckedState();
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void CmdUiCommandSystemImpl::fieldChangedCommand(PdmFieldHandle* editorField, co
|
||||
std::vector<PdmUiItem*> items;
|
||||
SelectionManager::instance()->selectedItems(items, SelectionManager::CURRENT);
|
||||
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
for (size_t i = 0; i < items.size(); i++)
|
||||
{
|
||||
PdmObjectHandle* objectHandle = dynamic_cast<PdmObjectHandle*>(items[i]);
|
||||
if (objectHandle)
|
||||
@ -106,7 +106,7 @@ void CmdUiCommandSystemImpl::fieldChangedCommand(PdmFieldHandle* editorField, co
|
||||
|
||||
std::vector<CmdExecuteCommand*> commands;
|
||||
|
||||
for (int i = 0; i < fieldsToUpdate.size(); i++)
|
||||
for (size_t i = 0; i < fieldsToUpdate.size(); i++)
|
||||
{
|
||||
PdmFieldHandle* field = fieldsToUpdate[i];
|
||||
PdmUiFieldHandle* uiFieldHandle = field->uiCapability();
|
||||
|
@ -11,30 +11,39 @@ include_directories(
|
||||
${cafProjectDataModel_SOURCE_DIR}
|
||||
${cafUserInterface_SOURCE_DIR}
|
||||
|
||||
${cafPdmCore_SOURCE_DIR}
|
||||
${cafPdmUiCore_SOURCE_DIR}
|
||||
${cafPdmCore_SOURCE_DIR}
|
||||
${cafPdmUiCore_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
add_library( ${PROJECT_NAME}
|
||||
cafPdmCoreColor3f.h
|
||||
cafPdmUiCoreColor3f.cpp
|
||||
cafPdmUiCoreColor3f.h
|
||||
cafPdmXmlColor3f.cpp
|
||||
cafPdmXmlColor3f.h
|
||||
cafPdmFieldCvfColor.h
|
||||
|
||||
cafPdmCoreVec3d.h
|
||||
cafPdmUiCoreVec3d.cpp
|
||||
cafPdmUiCoreVec3d.h
|
||||
cafPdmXmlVec3d.cpp
|
||||
cafPdmXmlVec3d.h
|
||||
cafPdmFieldCvfVec3d.h
|
||||
cafPdmCoreColor3f.h
|
||||
cafPdmUiCoreColor3f.cpp
|
||||
cafPdmUiCoreColor3f.h
|
||||
cafPdmXmlColor3f.cpp
|
||||
cafPdmXmlColor3f.h
|
||||
cafPdmFieldCvfColor.h
|
||||
|
||||
cafPdmCoreMat4d.h
|
||||
# cafPdmUiCoreVec3d.cpp no special editor for matrix is created yet
|
||||
cafPdmUiCoreMat4d.h
|
||||
cafPdmXmlMat4d.cpp
|
||||
cafPdmXmlMat4d.h
|
||||
cafPdmFieldCvfMat4d.h
|
||||
cafPdmCoreVec3d.h
|
||||
cafPdmUiCoreVec3d.cpp
|
||||
cafPdmUiCoreVec3d.h
|
||||
cafPdmXmlVec3d.cpp
|
||||
cafPdmXmlVec3d.h
|
||||
cafPdmFieldCvfVec3d.h
|
||||
|
||||
cafPdmCoreMat4d.h
|
||||
# cafPdmUiCoreVec3d.cpp no special editor for matrix is created yet
|
||||
cafPdmUiCoreMat4d.h
|
||||
cafPdmXmlMat4d.cpp
|
||||
cafPdmXmlMat4d.h
|
||||
cafPdmFieldCvfMat4d.h
|
||||
)
|
||||
|
||||
target_link_libraries ( ${PROJECT_NAME}
|
||||
cafPdmCore
|
||||
cafPdmUiCore
|
||||
cafUserInterface
|
||||
cafProjectDataModel
|
||||
LibCore
|
||||
${QT_LIBRARIES}
|
||||
)
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
virtual size_t size() const = 0;
|
||||
virtual bool empty() const = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void insertAt(size_t indexAfter, PdmObjectHandle* obj) = 0;
|
||||
virtual void insertAt(int indexAfter, PdmObjectHandle* obj) = 0;
|
||||
virtual void erase(size_t index) = 0;
|
||||
virtual void deleteAllChildObjects() = 0;
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
virtual bool empty() const { return m_pointers.empty(); }
|
||||
virtual void clear();
|
||||
virtual void deleteAllChildObjects();
|
||||
virtual void insertAt(size_t indexAfter, PdmObjectHandle* obj);
|
||||
virtual void insertAt(int indexAfter, PdmObjectHandle* obj);
|
||||
|
||||
// std::vector-like access
|
||||
|
||||
|
@ -148,8 +148,15 @@ void PdmChildArrayField<DataType*>::erase(size_t index)
|
||||
template<typename DataType>
|
||||
size_t PdmChildArrayField<DataType*>::index(DataType* pointer)
|
||||
{
|
||||
typename std::vector< PdmPointer<DataType> >::iterator it = std::find(m_pointers.begin(), m_pointers.end(), pointer);
|
||||
return it - m_pointers.begin();
|
||||
for (size_t i = 0; i < m_pointers.size(); ++i)
|
||||
{
|
||||
if (pointer == m_pointers[i].p())
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return (size_t)(-1); // Undefined size_t > m_pointers.size();
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +205,7 @@ void PdmChildArrayField<DataType*>::childObjects(std::vector<PdmObjectHandle*>*
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
template<typename DataType>
|
||||
void PdmChildArrayField<DataType*>::insertAt(size_t indexAfter, PdmObjectHandle* obj)
|
||||
void PdmChildArrayField<DataType*>::insertAt(int indexAfter, PdmObjectHandle* obj)
|
||||
{
|
||||
// This method should assert if obj to insert is not castable to the container type, but since this
|
||||
// is a virtual method, its implementation is always created and that makes a dyn_cast add the need for
|
||||
|
@ -91,7 +91,12 @@ private:
|
||||
friend class PdmPointerImpl;
|
||||
std::set<PdmObjectHandle**> m_pointersReferencingMe;
|
||||
};
|
||||
}
|
||||
|
||||
#include "cafPdmFieldHandle.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -174,7 +174,7 @@ void SelectionManager::setSelectionFromReferences(const std::vector<QString>& re
|
||||
{
|
||||
std::vector<PdmUiItem*> uiItems;
|
||||
|
||||
for (int i = 0; i < referenceList.size(); i++)
|
||||
for (size_t i = 0; i < referenceList.size(); i++)
|
||||
{
|
||||
QString reference = referenceList[i];
|
||||
|
||||
@ -197,7 +197,7 @@ void SelectionManager::setSelectionFromReferences(const std::vector<QString>& re
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void SelectionManager::clearAll()
|
||||
{
|
||||
for (int i = 0; i < m_selectionForRole.size(); i++)
|
||||
for (size_t i = 0; i < m_selectionForRole.size(); i++)
|
||||
{
|
||||
m_selectionForRole[i].clear();
|
||||
}
|
||||
@ -250,7 +250,7 @@ void SelectionManager::removeObjectFromAllSelections(PdmObjectHandle* pdmObject)
|
||||
{
|
||||
bool doNotifySelectionChanged = false;
|
||||
|
||||
for (int role = 0; role < m_selectionForRole.size(); role++)
|
||||
for (size_t role = 0; role < m_selectionForRole.size(); role++)
|
||||
{
|
||||
std::vector< std::pair<PdmPointer<PdmObjectHandle>, PdmUiItem*> >& selection = m_selectionForRole[role];
|
||||
|
||||
|
@ -29,7 +29,6 @@ set( QOBJECT_HEADERS
|
||||
cafPdmUiListView.h
|
||||
cafPdmUiListViewEditor.h
|
||||
cafPdmUiPropertyView.h
|
||||
cafPdmUiPropertyViewDialog.h
|
||||
cafPdmUiPushButtonEditor.h
|
||||
cafPdmUiSliderEditor.h
|
||||
cafPdmUiTableView.h
|
||||
@ -37,7 +36,7 @@ set( QOBJECT_HEADERS
|
||||
cafPdmUiTableViewEditor.h
|
||||
cafPdmUiTableViewModel.h
|
||||
cafPdmUiTextEditor.h
|
||||
cafPdmUiToolButtonEditor.h
|
||||
cafPdmUiToolButtonEditor.h
|
||||
cafPdmUiTreeView.h
|
||||
cafPdmUiTreeViewModel.h
|
||||
cafPdmUiTreeViewEditor.h
|
||||
|
@ -290,7 +290,7 @@ bool PdmUiLineEditor::isMultipleFieldsWithSameKeywordSelected(PdmFieldHandle* ed
|
||||
std::vector<PdmUiItem*> items;
|
||||
SelectionManager::instance()->selectedItems(items, SelectionManager::CURRENT);
|
||||
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
for (size_t i = 0; i < items.size(); i++)
|
||||
{
|
||||
PdmUiFieldHandle* uiField = dynamic_cast<PdmUiFieldHandle*>(items[i]);
|
||||
if (!uiField) continue;
|
||||
|
@ -412,7 +412,7 @@ PdmFieldHandle* PdmUiTableViewModel::getField(const QModelIndex &index) const
|
||||
m_pdmList->childObjects(&listObjects);
|
||||
}
|
||||
|
||||
if (index.row() < listObjects.size())
|
||||
if (index.row() < static_cast<int>(listObjects.size()))
|
||||
{
|
||||
PdmObjectHandle* pdmObject = listObjects[index.row()];
|
||||
if (pdmObject)
|
||||
@ -421,7 +421,7 @@ PdmFieldHandle* PdmUiTableViewModel::getField(const QModelIndex &index) const
|
||||
pdmObject->fields(fields);
|
||||
|
||||
int fieldIndex = m_modelColumnIndexToFieldIndex[index.column()];
|
||||
if (fieldIndex < fields.size())
|
||||
if (fieldIndex < static_cast<int>(fields.size()))
|
||||
{
|
||||
return fields[fieldIndex];
|
||||
}
|
||||
@ -530,7 +530,7 @@ PdmObjectHandle* PdmUiTableViewModel::pdmObjectForRow(int row) const
|
||||
m_pdmList->childObjects(&listObjects);
|
||||
}
|
||||
|
||||
if (row < listObjects.size())
|
||||
if (row < static_cast<int>(listObjects.size()))
|
||||
{
|
||||
return listObjects[row];
|
||||
}
|
||||
|
@ -170,9 +170,9 @@ void PdmUiToolBarEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
|
||||
assert(m_fields.size() == m_fieldViews.size());
|
||||
assert(m_fields.size() == m_actions.size());
|
||||
assert(static_cast<int>(m_fields.size()) == m_actions.size());
|
||||
|
||||
for (int i = 0; i < m_fields.size(); i++)
|
||||
for (size_t i = 0; i < m_fields.size(); i++)
|
||||
{
|
||||
caf::PdmFieldHandle* field = m_fields[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user