Clean up more warnings with stricter warning levels
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user