Commit efc8d296 authored by Jacob Becker's avatar Jacob Becker

fix some window 64bit warnings

parent 1c958adc
......@@ -376,8 +376,7 @@ void qtAssociationWidget::processDefUniqueness(
{
return;
}
int numAtts = theEntiy->numberOfAssociatedAttributes();
if( numAtts == 0)
if( theEntiy->numberOfAssociatedAttributes() == 0)
{
return;
}
......
......@@ -148,7 +148,7 @@ void qtAttribute::updateItemsData()
std::size_t i, n = att->numberOfItems();
for (i = 0; i < n; i++)
{
qItem = this->createItem(att->item(i), this->Widget);
qItem = this->createItem(att->item(static_cast<int>(i)), this->Widget);
if(qItem)
{
layout->addWidget(qItem->widget());
......
......@@ -418,7 +418,7 @@ void qtAttributeView::updateChildWidgetsEnableState(
smtk::attribute::GroupItemPtr grpItem = dynamic_pointer_cast<GroupItem>(attItem);
if(grpItem)
{
int numItems = grpItem->numberOfItemsPerGroup();
int numItems = static_cast<int>(grpItem->numberOfItemsPerGroup());
for (int j = 0; j < numItems; j++) // expecting one item for each column
{
this->updateItemWidgetsEnableState(
......@@ -571,7 +571,7 @@ void qtAttributeView::addAttributePropertyItems(
std::size_t i, n = childData->numberOfItems();
for (i = 0; i < n; i++)
{
smtk::attribute::ItemPtr attItem = childData->item(i);
smtk::attribute::ItemPtr attItem = childData->item(static_cast<int>(i));
if(qtUIManager::instance()->passItemCategoryCheck(
attItem->definition()) &&
qtUIManager::instance()->passAdvancedCheck(
......@@ -753,7 +753,7 @@ void qtAttributeView::updateTableWithAttribute(
std::size_t i, n = att->numberOfItems();
for (i = 0; i < n; i++)
{
smtk::attribute::ItemPtr attItem = att->item(i);
smtk::attribute::ItemPtr attItem = att->item(static_cast<int>(i));
const ItemDefinition* itemDef =
dynamic_cast<const ItemDefinition*>(attItem->definition().get());
if(!qtUIManager::instance()->passAdvancedCheck(
......@@ -816,7 +816,7 @@ void qtAttributeView::updateTableWithProperty(
std::size_t i, n = (*it)->numberOfItems();
for (i = 0; i < n; i++)// for each property
{
smtk::attribute::ItemPtr attItem = (*it)->item(i);
smtk::attribute::ItemPtr attItem = (*it)->item(static_cast<int>(i));
const ItemDefinition* itemDef =
dynamic_cast<const ItemDefinition*>(attItem->definition().get());
if(!qtUIManager::instance()->passAdvancedCheck(
......@@ -869,7 +869,7 @@ void qtAttributeView::addTableGroupItems(
const char* attLabel = strAttLabel.empty() ? NULL : strAttLabel.c_str();
int advanced = gItemDef->advanceLevel();
// expecting one subgroup
int numItems = attItem->numberOfItemsPerGroup();
int numItems = static_cast<int>(attItem->numberOfItemsPerGroup());
if(numItems > 0)
{
if(dynamic_pointer_cast<ValueItem>(attItem->item(0)))
......@@ -1085,7 +1085,7 @@ void qtAttributeView::getAllDefinitions()
std::size_t i, n = aview->numberOfDefinitions();
for (i = 0; i < n; i++)
{
attribute::DefinitionPtr attDef = aview->definition(i);
attribute::DefinitionPtr attDef = aview->definition(static_cast<int>(i));
this->qtBaseView::getDefinitions(attDef, this->Internals->AllDefs);
}
......
......@@ -127,7 +127,7 @@ void qtComboItem::updateItemData()
QList<QString> discreteVals;
for (i = 0; i < itemDef->numberOfDiscreteValues(); i++)
{
discreteVals.push_back(itemDef->discreteEnum(i).c_str());
discreteVals.push_back(itemDef->discreteEnum(static_cast<int>(i)).c_str());
}
foreach(QComboBox* combo, this->Internals->comboBoxes)
......
......@@ -105,7 +105,7 @@ void qtGroupItem::updateItemData()
{
for (j = 0; j < m; j++)
{
qtItem* childItem = qtAttribute::createItem(item->item(i,j), this->Widget);
qtItem* childItem = qtAttribute::createItem(item->item(static_cast<int>(i), static_cast<int>(j)), this->Widget);
if(childItem)
{
this->Widget->layout()->addWidget(childItem->widget());
......
......@@ -454,7 +454,7 @@ void qtSimpleExpressionView::onCreateNew()
QStringList strVals;
int numRows = this->Internals->NumberBox->value();
int numberOfComponents = itemDefinition->numberOfItemDefinitions();
int numberOfComponents = static_cast<int>(itemDefinition->numberOfItemDefinitions());
for(int i=0; i < numRows; i++)
{
for(int c=0; c<numberOfComponents-1; c++)
......@@ -576,7 +576,7 @@ void qtSimpleExpressionView::onCopySelected()
QString funcExp = expressionItem ?
expressionItem->valueAsString().c_str() : "";
this->buildSimpleExpression(funcExp, valuesText,
groupItem->numberOfItemsPerGroup());
static_cast<int>(groupItem->numberOfItemsPerGroup()));
}
}
}
......
......@@ -279,7 +279,7 @@ void qtUIManager::processGroupView(qtGroupView* pQtGroup)
qtBaseView* qtView = NULL;
for (i = 0; i < n; i++)
{
v = group->subView(i);
v = group->subView(static_cast<int>(i));
switch(v->type())
{
case smtk::view::Base::ATTRIBUTE:
......@@ -462,7 +462,7 @@ bool qtUIManager::getExpressionArrayString(
{
return false;
}
int numberOfComponents = dataItem->numberOfItemsPerGroup();
int numberOfComponents = static_cast<int>(dataItem->numberOfItemsPerGroup());
int nVals = static_cast<int>(item->numberOfValues());
QStringList strVals;
smtk::attribute::ValueItemPtr valueitem;
......@@ -659,7 +659,7 @@ QWidget* qtUIManager::createComboBox(
QString tooltip;
for (size_t i = 0; i < itemDef->numberOfDiscreteValues(); i++)
{
std::string enumText = itemDef->discreteEnum(i);
std::string enumText = itemDef->discreteEnum(static_cast<int>(i));
if(itemDef->hasDefault() &&
static_cast<size_t>(itemDef->defaultDiscreteIndex()) == i)
{
......
......@@ -228,7 +228,7 @@ namespace smtk
//This method resets the definition item offset - this is used by the
// manager when a definition is modified
void resetItemOffset();
int itemOffset() const
std::size_t itemOffset() const
{return this->m_baseItemOffset;}
// Return the public pointer for this definition.
......@@ -272,7 +272,7 @@ namespace smtk
std::string m_detailedDescription;
std::string m_briefDescription;
// Used by the find method to calculate an item's position
int m_baseItemOffset;
std::size_t m_baseItemOffset;
private:
// These colors are returned for base definitions w/o set colors
......@@ -311,7 +311,7 @@ namespace smtk
return -1; // named item doesn't exist
}
}
return it->second + this->m_baseItemOffset;
return it->second + static_cast<int>(this->m_baseItemOffset);
}
//----------------------------------------------------------------------------
inline const double * Definition::notApplicableColor() const
......
......@@ -62,7 +62,7 @@ setDefinition(smtk::attribute::ConstItemDefinitionPtr adef)
}
// Find out how many values this item is suppose to have
// if the size is 0 then its unbounded
int n = def->numberOfRequiredValues();
size_t n = def->numberOfRequiredValues();
if (n)
{
this->m_isSet.resize(n, false);
......@@ -82,7 +82,7 @@ Item::Type DirectoryItem::type() const
}
//----------------------------------------------------------------------------
int DirectoryItem::numberOfRequiredValues() const
std::size_t DirectoryItem::numberOfRequiredValues() const
{
const DirectoryItemDefinition *def =
static_cast<const DirectoryItemDefinition*>(this->m_definition.get());
......@@ -151,8 +151,7 @@ DirectoryItem::appendValue(const std::string &val)
//First - are we allowed to change the number of values?
const DirectoryItemDefinition *def =
static_cast<const DirectoryItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -172,8 +171,7 @@ DirectoryItem::removeValue(int element)
//First - are we allowed to change the number of values?
const DirectoryItemDefinition *def =
static_cast<const DirectoryItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -193,8 +191,7 @@ bool DirectoryItem::setNumberOfValues(std::size_t newSize)
//Next - are we allowed to change the number of values?
const DirectoryItemDefinition *def =
static_cast<const DirectoryItemDefinition *>(this->definition().get());
std::size_t n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -209,7 +206,7 @@ DirectoryItem::reset()
const DirectoryItemDefinition *def
= static_cast<const DirectoryItemDefinition *>(this->definition().get());
// Was the initial size 0?
int i, n = def->numberOfRequiredValues();
std::size_t i, n = def->numberOfRequiredValues();
if (!n)
{
this->m_values.clear();
......
......@@ -49,7 +49,7 @@ namespace smtk
std::size_t numberOfValues() const
{return this->m_values.size();}
bool setNumberOfValues(std::size_t newSize);
int numberOfRequiredValues() const;
std::size_t numberOfRequiredValues() const;
std::string value(int element=0) const
{return this->m_values[element];}
bool setValue(const std::string &val)
......
......@@ -62,7 +62,7 @@ setDefinition(smtk::attribute::ConstItemDefinitionPtr adef)
}
// Find out how many values this item is suppose to have
// if the size is 0 then its unbounded
int n = def->numberOfRequiredValues();
std::size_t n = def->numberOfRequiredValues();
if (n)
{
this->m_isSet.resize(n, false);
......@@ -82,7 +82,7 @@ Item::Type FileItem::type() const
}
//----------------------------------------------------------------------------
int FileItem::numberOfRequiredValues() const
std::size_t FileItem::numberOfRequiredValues() const
{
const FileItemDefinition *def =
static_cast<const FileItemDefinition*>(this->m_definition.get());
......@@ -151,8 +151,7 @@ FileItem::appendValue(const std::string &val)
//First - are we allowed to change the number of values?
const FileItemDefinition *def =
static_cast<const FileItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -172,8 +171,7 @@ FileItem::removeValue(int element)
//First - are we allowed to change the number of values?
const FileItemDefinition *def =
static_cast<const FileItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if ( def->numberOfRequiredValues() != 0 )
{
return false; // The number of values is fixed
}
......@@ -194,7 +192,7 @@ bool FileItem::setNumberOfValues(std::size_t newSize)
const FileItemDefinition *def =
static_cast<const FileItemDefinition *>(this->definition().get());
std::size_t n = def->numberOfRequiredValues();
if (n)
if (n != 0)
{
return false; // The number of values is fixed
}
......@@ -209,8 +207,8 @@ FileItem::reset()
const FileItemDefinition *def
= static_cast<const FileItemDefinition *>(this->definition().get());
// Was the initial size 0?
int i, n = def->numberOfRequiredValues();
if (!n)
std::size_t i, n = def->numberOfRequiredValues();
if (n == 0)
{
this->m_values.clear();
this->m_isSet.clear();
......
......@@ -49,7 +49,7 @@ namespace smtk
std::size_t numberOfValues() const
{return this->m_values.size();}
bool setNumberOfValues(std::size_t newSize);
int numberOfRequiredValues() const;
std::size_t numberOfRequiredValues() const;
std::string value(int element=0) const
{return this->m_values[element];}
bool setValue(const std::string &val)
......
......@@ -60,8 +60,8 @@ setDefinition(smtk::attribute::ConstItemDefinitionPtr adef)
{
return false;
}
int n = def->numberOfRequiredValues();
if (n)
std::size_t n = def->numberOfRequiredValues();
if (n != 0)
{
this->m_values.resize(n);
}
......@@ -94,7 +94,7 @@ Item::Type RefItem::type() const
}
//----------------------------------------------------------------------------
int RefItem::numberOfRequiredValues() const
std::size_t RefItem::numberOfRequiredValues() const
{
const RefItemDefinition *def =
static_cast<const RefItemDefinition*>(this->m_definition.get());
......@@ -146,8 +146,7 @@ RefItem::appendValue(smtk::attribute::AttributePtr val)
//First - are we allowed to change the number of values?
const RefItemDefinition *def =
static_cast<const RefItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -167,8 +166,7 @@ RefItem::removeValue(int element)
//First - are we allowed to change the number of values?
const RefItemDefinition *def =
static_cast<const RefItemDefinition *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -238,7 +236,7 @@ RefItem::reset()
const RefItemDefinition *def
= static_cast<const RefItemDefinition *>(this->definition().get());
// Was the initial size 0?
int i, n = def->numberOfRequiredValues();
size_t i, n = def->numberOfRequiredValues();
if (!n)
{
this->clearAllReferences();
......
......@@ -49,7 +49,7 @@ namespace smtk
std::size_t numberOfValues() const
{return this->m_values.size();}
bool setNumberOfValues(std::size_t newSize);
int numberOfRequiredValues() const;
std::size_t numberOfRequiredValues() const;
smtk::attribute::AttributePtr value(int element=0) const
{return this->m_values[element].lock();}
bool setValue( smtk::attribute::AttributePtr val)
......
......@@ -58,7 +58,7 @@ bool ValueItem::setDefinition(smtk::attribute::ConstItemDefinitionPtr vdef)
}
// Find out how many values this item is suppose to have
// if the size is 0 then its unbounded
int n = def->numberOfRequiredValues();
std::size_t n = def->numberOfRequiredValues();
if (n)
{
if (def->hasDefault())
......@@ -96,7 +96,7 @@ ValueItem::~ValueItem()
}
}
//----------------------------------------------------------------------------
int ValueItem::numberOfRequiredValues() const
std::size_t ValueItem::numberOfRequiredValues() const
{
const ValueItemDefinition *def =
static_cast<const ValueItemDefinition*>(this->m_definition.get());
......@@ -162,8 +162,7 @@ bool ValueItem::appendExpression(smtk::attribute::AttributePtr exp)
{
return false;
}
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -171,7 +170,7 @@ bool ValueItem::appendExpression(smtk::attribute::AttributePtr exp)
{
return false; // Attribute is of the proper type
}
n = static_cast<int>(m_expressions.size());
int n = static_cast<int>(m_expressions.size());
this->m_expressions.resize(n+1);
def->buildExpressionItem(this, n);
this->m_expressions[n]->setValue(exp);
......
......@@ -46,7 +46,7 @@ namespace smtk
virtual ~ValueItem();
virtual std::size_t numberOfValues() const
{return this->m_isSet.size();}
int numberOfRequiredValues() const;
std::size_t numberOfRequiredValues() const;
bool allowsExpressions() const;
bool isExpression(int elementIndex=0) const
......@@ -82,9 +82,9 @@ namespace smtk
{ return this->valueAsString(0);}
virtual std::string valueAsString(int elementIndex) const = 0;
virtual bool isSet(int elementIndex = 0) const
virtual bool isSet(std::size_t elementIndex = 0) const
{return this->m_isSet[elementIndex];}
virtual void unset(int elementIndex=0)
virtual void unset(std::size_t elementIndex=0)
{this->m_isSet[elementIndex] = false;}
smtk::attribute::RefItemPtr expressionReference(int elementIndex=0) const
{return this->m_expressions[elementIndex];}
......
......@@ -104,7 +104,7 @@ namespace smtk
{
return false;
}
int n = def->numberOfRequiredValues();
size_t n = def->numberOfRequiredValues();
if (n)
{
if (def->hasDefault())
......@@ -184,8 +184,7 @@ namespace smtk
{
//First - are we allowed to change the number of values?
const DefType *def = static_cast<const DefType *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -292,8 +291,7 @@ namespace smtk
{
//First - are we allowed to change the number of values?
const DefType *def = static_cast<const DefType *>(this->definition().get());
int n = def->numberOfRequiredValues();
if (n)
if (def->numberOfRequiredValues() != 0)
{
return false; // The number of values is fixed
}
......@@ -373,7 +371,7 @@ namespace smtk
{
const DefType *def = static_cast<const DefType *>(this->definition().get());
// Was the initial size 0?
int i, n = def->numberOfRequiredValues();
std::size_t i, n = def->numberOfRequiredValues();
if (!n)
{
this->m_values.clear();
......
......@@ -44,7 +44,7 @@ int main()
smtk::util::Logger::Record r;
for (i = 0; i < n; i++)
{
r = logger.record(i);
r = logger.record(static_cast<int>(i));
std::cerr << " Record " << i << ": \n\tSeverity = "
<< smtk::util::Logger::severityAsString(r.severity)
<< "\n\tMessage = " << r.message
......
......@@ -488,7 +488,7 @@ void XmlV1StringWriter::processValueDef(pugi::xml_node &node,
}
else
{
int i, n = idef->numberOfRequiredValues();
size_t i, n = idef->numberOfRequiredValues();
xml_node ln;
for (i = 0; i < n; i++)
{
......@@ -536,7 +536,7 @@ void XmlV1StringWriter::processRefDef(pugi::xml_node &node,
}
else
{
int i, n = idef->numberOfRequiredValues();
size_t i, n = idef->numberOfRequiredValues();
xml_node ln;
for (i = 0; i < n; i++)
{
......@@ -570,7 +570,7 @@ void XmlV1StringWriter::processDirectoryDef(pugi::xml_node &node,
}
else
{
int i, n = idef->numberOfRequiredValues();
size_t i, n = idef->numberOfRequiredValues();
xml_node ln;
for (i = 0; i < n; i++)
{
......@@ -604,7 +604,7 @@ void XmlV1StringWriter::processFileDef(pugi::xml_node &node,
}
else
{
int i, n = idef->numberOfRequiredValues();
size_t i, n = idef->numberOfRequiredValues();
xml_node ln;
for (i = 0; i < n; i++)
{
......@@ -631,7 +631,7 @@ void XmlV1StringWriter::processGroupDef(pugi::xml_node &node,
}
else
{
int i, n = idef->numberOfRequiredGroups();
size_t i, n = idef->numberOfRequiredGroups();
xml_node ln;
for (i = 0; i < n; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment