diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 02:51:27 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-10-31 02:51:27 (GMT) |
commit | d011ae46c6f7e52b8e3bbe3e96dcdc7d6a6e0924 (patch) | |
tree | 615c138ba674db8fa0ae969fe6f025ae6df933f5 | |
parent | fb7ed8cf01bd359dd86acd007615980613ede07b (diff) |
coding style
git-svn-id: http://svn.clifford.at/openscad/trunk@575 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r-- | src/func.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/func.cc b/src/func.cc index 6f7ff1c..e8ff54a 100644 --- a/src/func.cc +++ b/src/func.cc @@ -136,11 +136,18 @@ double frand(double min, double max) Value builtin_rands(const Context *, const QVector<QString>&, const QVector<Value> &args) { - if (args.size() == 3 && args[0].type == Value::NUMBER && args[1].type == Value::NUMBER && args[2].type == Value::NUMBER) + if (args.size() == 3 && + args[0].type == Value::NUMBER && + args[1].type == Value::NUMBER && + args[2].type == Value::NUMBER) { srand((unsigned int)time(0)); } - else if (args.size() == 4 && args[0].type == Value::NUMBER && args[1].type == Value::NUMBER && args[2].type == Value::NUMBER && args[3].type == Value::NUMBER) + else if (args.size() == 4 && + args[0].type == Value::NUMBER && + args[1].type == Value::NUMBER && + args[2].type == Value::NUMBER && + args[3].type == Value::NUMBER) { srand((unsigned int)args[3].num); } @@ -148,16 +155,16 @@ Value builtin_rands(const Context *, const QVector<QString>&, const QVector<Valu { return Value(); } - + Value v; v.type = Value::VECTOR; - - for(int i=0; i<args[2].num; i++) + + for (int i=0; i<args[2].num; i++) { - Value * r = new Value(frand(args[0].num,args[1].num)); + Value * r = new Value(frand(args[0].num, args[1].num)); v.vec.append(r); } - + return v; } |