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 | b36acfd268c79cdfff1e06532f2ac0e9db9d8c2f (patch) | |
tree | 615c138ba674db8fa0ae969fe6f025ae6df933f5 /src/func.cc | |
parent | d479fca855688c92f4a9f72f4ec18d655c3b351d (diff) |
coding style
git-svn-id: http://svn.clifford.at/openscad/trunk@575 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'src/func.cc')
-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; } |