summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Paul <Torsten.Paul@gmx.de>2013-11-15 18:41:37 (GMT)
committerTorsten Paul <Torsten.Paul@gmx.de>2013-11-15 18:41:37 (GMT)
commitf46bd3788f75e691b65aaf0e4ffb1db1029ef717 (patch)
tree118843f04ff826255387e7886fe38573dbae7d8e /src
parent1fcad169e623d776eb297c324304fb6836ec1e62 (diff)
Change nbsteps() to uint32_t to make it independent from 32/64-bit platform.
Diffstat (limited to 'src')
-rw-r--r--src/control.cc4
-rw-r--r--src/value.cc4
-rw-r--r--src/value.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/control.cc b/src/control.cc
index 6b10a28..d5f664e 100644
--- a/src/control.cc
+++ b/src/control.cc
@@ -78,7 +78,7 @@ void ControlModule::for_eval(AbstractNode &node, const ModuleInstantiation &inst
Context c(ctx);
if (it_values.type() == Value::RANGE) {
Value::RangeType range = it_values.toRange();
- unsigned long steps = range.nbsteps();
+ uint32_t steps = range.nbsteps();
if (steps >= 10000) {
PRINTB("WARNING: Bad range parameter in for statement: too many elements (%lu).", steps);
} else {
@@ -229,7 +229,7 @@ AbstractNode *ControlModule::instantiate(const Context* /*ctx*/, const ModuleIns
else if (value.type() == Value::RANGE) {
AbstractNode* node = new AbstractNode(inst);
Value::RangeType range = value.toRange();
- unsigned long steps = range.nbsteps();
+ uint32_t steps = range.nbsteps();
if (steps >= 10000) {
PRINTB("WARNING: Bad range parameter for children: too many elements (%lu).", steps);
return NULL;
diff --git a/src/value.cc b/src/value.cc
index 931c616..5afb650 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -625,13 +625,13 @@ void Value::RangeType::normalize() {
}
}
-unsigned long Value::RangeType::nbsteps() const {
+uint32_t Value::RangeType::nbsteps() const {
if (begin_val == end_val) {
return 0;
}
if (step_val == 0) {
- return std::numeric_limits<unsigned long>::max();
+ return std::numeric_limits<uint32_t>::max();
}
double steps;
diff --git a/src/value.h b/src/value.h
index 4671cdc..8197806 100644
--- a/src/value.h
+++ b/src/value.h
@@ -84,8 +84,8 @@ public:
iterator begin() { return iterator(*this, RANGE_TYPE_BEGIN); }
iterator end() { return iterator(*this, RANGE_TYPE_END); }
- /// return number of steps, max int value if step is null
- unsigned long nbsteps() const;
+ /// return number of steps, max uint32_ value if step is 0
+ uint32_t nbsteps() const;
friend class tostring_visitor;
friend class bracket_visitor;
contact: Jan Huwald // Impressum