fix MSVC warnings
This commit is contained in:
@@ -120,36 +120,36 @@ template<typename F>
|
||||
inline const KiwiErr* wrap_err(F&& f) {
|
||||
try {
|
||||
f();
|
||||
} catch (const UnsatisfiableConstraint& ex) {
|
||||
} catch (const UnsatisfiableConstraint&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrUnsatisfiableConstraint,
|
||||
"The constraint cannot be satisfied."};
|
||||
return &err;
|
||||
} catch (const UnknownConstraint& ex) {
|
||||
} catch (const UnknownConstraint&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrUnknownConstraint,
|
||||
"The constraint has not been added to the solver."};
|
||||
return &err;
|
||||
|
||||
} catch (const DuplicateConstraint& ex) {
|
||||
} catch (const DuplicateConstraint&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrDuplicateConstraint,
|
||||
"The constraint has already been added to the solver."};
|
||||
return &err;
|
||||
|
||||
} catch (const UnknownEditVariable& ex) {
|
||||
} catch (const UnknownEditVariable&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrUnknownEditVariable,
|
||||
"The edit variable has not been added to the solver."};
|
||||
return &err;
|
||||
|
||||
} catch (const DuplicateEditVariable& ex) {
|
||||
} catch (const DuplicateEditVariable&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrDuplicateEditVariable,
|
||||
"The edit variable has already been added to the solver."};
|
||||
return &err;
|
||||
|
||||
} catch (const BadRequiredStrength& ex) {
|
||||
} catch (const BadRequiredStrength&) {
|
||||
static const constexpr KiwiErr err {
|
||||
KiwiErrBadRequiredStrength,
|
||||
"A required strength cannot be used in this context."};
|
||||
|
||||
@@ -1340,7 +1340,7 @@ static int lkiwi_add_remove_tab(lua_State* L, add_remove_fn_t fn, void* d) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const KiwiErr* add_constraint_fn(lua_State* L, KiwiSolver* s, void* d) {
|
||||
static const KiwiErr* add_constraint_fn(lua_State* L, KiwiSolver* s, void*) {
|
||||
return kiwi_solver_add_constraint(s->solver, *get_constraint(L, -1));
|
||||
}
|
||||
|
||||
@@ -1348,7 +1348,7 @@ static int lkiwi_solver_add_constraints(lua_State* L) {
|
||||
return lkiwi_add_remove_tab(L, add_constraint_fn, 0);
|
||||
}
|
||||
|
||||
static const KiwiErr* remove_constraint_fn(lua_State* L, KiwiSolver* s, void* d) {
|
||||
static const KiwiErr* remove_constraint_fn(lua_State* L, KiwiSolver* s, void*) {
|
||||
return kiwi_solver_remove_constraint(s->solver, *get_constraint(L, -1));
|
||||
}
|
||||
|
||||
@@ -1365,7 +1365,7 @@ static int lkiwi_solver_add_edit_vars(lua_State* L) {
|
||||
return lkiwi_add_remove_tab(L, add_edit_var_fn, &strength);
|
||||
}
|
||||
|
||||
static const KiwiErr* remove_edit_var_fn(lua_State* L, KiwiSolver* s, void* d) {
|
||||
static const KiwiErr* remove_edit_var_fn(lua_State* L, KiwiSolver* s, void*) {
|
||||
return kiwi_solver_remove_edit_var(s->solver, *get_var(L, -1));
|
||||
}
|
||||
|
||||
@@ -1610,7 +1610,7 @@ static void compat_init(lua_State* L, int context_absi) {
|
||||
lua_rawseti(L, context_absi, VAR_SUB_FN);
|
||||
}
|
||||
#else
|
||||
static void compat_init(lua_State* L, int i) {}
|
||||
static void compat_init(lua_State*, int) {}
|
||||
#endif /* Lua 5.1 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user