up the default warning level, turn off rtti by default

master
Daniel Kolesa 2021-03-31 01:35:02 +02:00
parent 13d46881e8
commit 2270d8e41f
8 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,9 @@
project('libcubescript', ['cpp'],
version: '0.1.0',
default_options: ['buildtype=debugoptimized', 'cpp_std=c++2a'],
default_options: [
'buildtype=debugoptimized', 'cpp_std=c++2a',
'warning_level=3', 'cpp_rtti=false'
],
meson_version: '>=0.50'
)

View File

@ -127,7 +127,7 @@ empty_block *bcode_init_empty(internal_state *cs) {
void bcode_free_empty(internal_state *cs, empty_block *empty) {
std_allocator<empty_block>{cs}.deallocate(empty, VAL_ANY);
};
}
bcode *bcode_get_empty(empty_block *empty, std::size_t val) {
return &empty[val].init + 1;

View File

@ -20,7 +20,7 @@ struct std_allocator {
inline std_allocator(internal_state *s);
template<typename U>
std_allocator(std_allocator<U> const &a): istate{a.istate} {};
std_allocator(std_allocator<U> const &a): istate{a.istate} {}
inline T *allocate(std::size_t n);
inline void deallocate(T *p, std::size_t n);

View File

@ -107,7 +107,7 @@ char *string_pool::alloc_buf(std::size_t len) const {
strp[len] = '\0';
/* now the user can fill it */
return strp;
};
}
/* strref implementation */

View File

@ -8,7 +8,7 @@
namespace cubescript {
static inline void push_alias(state &cs, ident *id, ident_stack &st) {
static inline void push_alias(ident *id, ident_stack &st) {
if (id->is_alias() && !(id->get_flags() & IDENT_FLAG_ARG)) {
static_cast<alias_impl *>(id)->push_arg(st);
}
@ -521,7 +521,7 @@ std::uint32_t *vm_exec(
std::size_t idstsz = ts.idstack.size();
for (std::size_t i = 0; i < numlocals; ++i) {
push_alias(
cs, args[offset + i].get_ident(),
args[offset + i].get_ident(),
ts.idstack.emplace_back(*ts.pstate)
);
}
@ -1144,7 +1144,7 @@ noid:
std::size_t idstsz = ts.idstack.size();
for (size_t j = 0; j < size_t(callargs); ++j) {
push_alias(
cs, args[offset + j].force_ident(cs),
args[offset + j].force_ident(cs),
ts.idstack.emplace_back(*ts.pstate)
);
}

View File

@ -26,7 +26,7 @@ static inline void str_cmp_by(
);
}
res.set_int(integer_type(val));
};
}
void init_lib_string(state &cs) {
cs.new_command("strstr", "ss", [](auto &, auto args, auto &res) {

View File

@ -193,7 +193,7 @@ FILE *lndebug_fp = NULL;
fflush(lndebug_fp); \
} while (0)
#else
#define lndebug(fmt, ...)
#define lndebug(...)
#endif
/* ======================= Low level terminal handling ====================== */

View File

@ -196,7 +196,7 @@ static void do_sigint(int n) {
}
/* an example of what var printer would look like in real usage */
static void repl_print_var(cs::state const &cs, cs::global_var const &var) {
static void repl_print_var(cs::state const &, cs::global_var const &var) {
switch (var.get_type()) {
case cs::ident_type::IVAR: {
auto &iv = static_cast<cs::integer_var const &>(var);