Clean up more warnings with stricter warning levels

This commit is contained in:
Jason Turner
2015-01-15 14:24:39 -07:00
parent 41a45ce8b5
commit f95ca75aca
14 changed files with 71 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
#include <chaiscript/utility/utility.hpp>
double test_call(const std::function<double (int)> &f, int val)
int test_call(const std::function<int (int)> &f, int val)
{
return f(val);
}
@@ -9,15 +9,15 @@ int main()
{
chaiscript::ChaiScript chai;
chai.add(chaiscript::fun(&test_call), "test_call");
chai.eval("def func(i) { return i * 3.5; };");
double d = chai.eval<double>("test_call(func, 3)");
if (d == 3 * 3.5)
chai.eval("def func(i) { return i * 6; };");
int d = chai.eval<int>("test_call(func, 3)");
if (d == 3 * 6)
{
return EXIT_SUCCESS;
return EXIT_SUCCESS;
} else {
return EXIT_FAILURE;
}