summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/model/Document.cpp4
-rw-r--r--src/core/model/Domain.cpp8
-rw-r--r--src/core/model/Domain.hpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/core/model/Document.cpp b/src/core/model/Document.cpp
index 4579383..bcff41b 100644
--- a/src/core/model/Document.cpp
+++ b/src/core/model/Document.cpp
@@ -274,7 +274,7 @@ void DocumentEntity::setAttributes(const Variant &a)
static int enforceGetFieldDescriptorIndex(Handle<Descriptor> desc,
const std::string &fieldName)
{
- int idx = desc->getFieldDescriptorIndex(fieldName);
+ ssize_t idx = desc->getFieldDescriptorIndex(fieldName);
if (idx == -1) {
throw OusiaException(
std::string("Descriptor \"") + desc->getName() +
@@ -286,7 +286,7 @@ static int enforceGetFieldDescriptorIndex(Handle<Descriptor> desc,
static int enforceGetFieldDescriptorIndex(
Handle<Descriptor> desc, Handle<FieldDescriptor> fieldDescriptor)
{
- int idx = desc->getFieldDescriptorIndex(fieldDescriptor);
+ ssize_t idx = desc->getFieldDescriptorIndex(fieldDescriptor);
if (idx == -1) {
throw OusiaException(std::string("Descriptor \"") +
desc->getName() +
diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp
index f45bd27..62ee65d 100644
--- a/src/core/model/Domain.cpp
+++ b/src/core/model/Domain.cpp
@@ -228,9 +228,9 @@ bool Descriptor::continuePath(Handle<StructuredClass> target,
return found;
}
-int Descriptor::getFieldDescriptorIndex(const std::string &name) const
+ssize_t Descriptor::getFieldDescriptorIndex(const std::string &name) const
{
- int f = 0;
+ size_t f = 0;
for (auto &fd : getFieldDescriptors()) {
if (fd->getName() == name) {
return f;
@@ -240,9 +240,9 @@ int Descriptor::getFieldDescriptorIndex(const std::string &name) const
return -1;
}
-int Descriptor::getFieldDescriptorIndex(Handle<FieldDescriptor> fd) const
+ssize_t Descriptor::getFieldDescriptorIndex(Handle<FieldDescriptor> fd) const
{
- int f = 0;
+ size_t f = 0;
for (auto &fd2 : getFieldDescriptors()) {
if (fd == fd2) {
return f;
diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp
index 63f4c5d..db3b9e6 100644
--- a/src/core/model/Domain.hpp
+++ b/src/core/model/Domain.hpp
@@ -503,7 +503,7 @@ public:
* @return the index of the FieldDescriptor with the given name or -1 if
* no such FieldDescriptor was found.
*/
- int getFieldDescriptorIndex(
+ ssize_t getFieldDescriptorIndex(
const std::string &name = DEFAULT_FIELD_NAME) const;
/**
* Returns the index of the given FieldDescriptor or -1 of the given
@@ -514,7 +514,7 @@ public:
* @return the index of the given FieldDescriptor or -1 of the given
* FieldDescriptor is not registered at this Descriptor.
*/
- int getFieldDescriptorIndex(Handle<FieldDescriptor> fd) const;
+ ssize_t getFieldDescriptorIndex(Handle<FieldDescriptor> fd) const;
/**
* This returns true if this Descriptor has a FieldDescriptor with the