diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-03-29 07:34:01 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-03-29 07:34:01 +0100 |
commit | 561403f68198fc73e92acd5149eb876e4ffac9e3 (patch) | |
tree | 18e8578be72220803d5d90806a7ba317bfd2cf02 /crawl-ref/source/l_crawl.cc | |
parent | 4bdaa9d9e36921ca559b29fd517e7c49d4acb33d (diff) | |
download | crawl-ref-561403f68198fc73e92acd5149eb876e4ffac9e3.tar.gz crawl-ref-561403f68198fc73e92acd5149eb876e4ffac9e3.zip |
Hush an -Og warning.
It's non-obvious that dims will never be more than 4. Even if at higher
optimization numbers the compiler notices this, I as a human still failed
to do so after first two readings.
Diffstat (limited to 'crawl-ref/source/l_crawl.cc')
-rw-r--r-- | crawl-ref/source/l_crawl.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/l_crawl.cc b/crawl-ref/source/l_crawl.cc index 7412bb98a6..fd6e63ea63 100644 --- a/crawl-ref/source/l_crawl.cc +++ b/crawl-ref/source/l_crawl.cc @@ -724,8 +724,8 @@ static int crawl_simplex(lua_State *ls) } double result; - if (dims < 2) return 0; // TODO: Throw error? - switch (dims) { + switch (dims) + { case 2: result = perlin::noise(vals[0],vals[1]); break; @@ -735,6 +735,8 @@ static int crawl_simplex(lua_State *ls) case 4: result = perlin::noise(vals[0],vals[1],vals[2],vals[3]); break; + default: + return 0; // TODO: Throw error? } lua_pushnumber(ls, result); |