up the default warning level, turn off rtti by default
parent
13d46881e8
commit
2270d8e41f
|
@ -1,6 +1,9 @@
|
||||||
project('libcubescript', ['cpp'],
|
project('libcubescript', ['cpp'],
|
||||||
version: '0.1.0',
|
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'
|
meson_version: '>=0.50'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ empty_block *bcode_init_empty(internal_state *cs) {
|
||||||
|
|
||||||
void bcode_free_empty(internal_state *cs, empty_block *empty) {
|
void bcode_free_empty(internal_state *cs, empty_block *empty) {
|
||||||
std_allocator<empty_block>{cs}.deallocate(empty, VAL_ANY);
|
std_allocator<empty_block>{cs}.deallocate(empty, VAL_ANY);
|
||||||
};
|
}
|
||||||
|
|
||||||
bcode *bcode_get_empty(empty_block *empty, std::size_t val) {
|
bcode *bcode_get_empty(empty_block *empty, std::size_t val) {
|
||||||
return &empty[val].init + 1;
|
return &empty[val].init + 1;
|
||||||
|
|
|
@ -20,7 +20,7 @@ struct std_allocator {
|
||||||
inline std_allocator(internal_state *s);
|
inline std_allocator(internal_state *s);
|
||||||
|
|
||||||
template<typename U>
|
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 T *allocate(std::size_t n);
|
||||||
inline void deallocate(T *p, std::size_t n);
|
inline void deallocate(T *p, std::size_t n);
|
||||||
|
|
|
@ -107,7 +107,7 @@ char *string_pool::alloc_buf(std::size_t len) const {
|
||||||
strp[len] = '\0';
|
strp[len] = '\0';
|
||||||
/* now the user can fill it */
|
/* now the user can fill it */
|
||||||
return strp;
|
return strp;
|
||||||
};
|
}
|
||||||
|
|
||||||
/* strref implementation */
|
/* strref implementation */
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
namespace cubescript {
|
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)) {
|
if (id->is_alias() && !(id->get_flags() & IDENT_FLAG_ARG)) {
|
||||||
static_cast<alias_impl *>(id)->push_arg(st);
|
static_cast<alias_impl *>(id)->push_arg(st);
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ std::uint32_t *vm_exec(
|
||||||
std::size_t idstsz = ts.idstack.size();
|
std::size_t idstsz = ts.idstack.size();
|
||||||
for (std::size_t i = 0; i < numlocals; ++i) {
|
for (std::size_t i = 0; i < numlocals; ++i) {
|
||||||
push_alias(
|
push_alias(
|
||||||
cs, args[offset + i].get_ident(),
|
args[offset + i].get_ident(),
|
||||||
ts.idstack.emplace_back(*ts.pstate)
|
ts.idstack.emplace_back(*ts.pstate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1144,7 +1144,7 @@ noid:
|
||||||
std::size_t idstsz = ts.idstack.size();
|
std::size_t idstsz = ts.idstack.size();
|
||||||
for (size_t j = 0; j < size_t(callargs); ++j) {
|
for (size_t j = 0; j < size_t(callargs); ++j) {
|
||||||
push_alias(
|
push_alias(
|
||||||
cs, args[offset + j].force_ident(cs),
|
args[offset + j].force_ident(cs),
|
||||||
ts.idstack.emplace_back(*ts.pstate)
|
ts.idstack.emplace_back(*ts.pstate)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ static inline void str_cmp_by(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
res.set_int(integer_type(val));
|
res.set_int(integer_type(val));
|
||||||
};
|
}
|
||||||
|
|
||||||
void init_lib_string(state &cs) {
|
void init_lib_string(state &cs) {
|
||||||
cs.new_command("strstr", "ss", [](auto &, auto args, auto &res) {
|
cs.new_command("strstr", "ss", [](auto &, auto args, auto &res) {
|
||||||
|
|
|
@ -193,7 +193,7 @@ FILE *lndebug_fp = NULL;
|
||||||
fflush(lndebug_fp); \
|
fflush(lndebug_fp); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#define lndebug(fmt, ...)
|
#define lndebug(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ======================= Low level terminal handling ====================== */
|
/* ======================= Low level terminal handling ====================== */
|
||||||
|
|
|
@ -196,7 +196,7 @@ static void do_sigint(int n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* an example of what var printer would look like in real usage */
|
/* 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()) {
|
switch (var.get_type()) {
|
||||||
case cs::ident_type::IVAR: {
|
case cs::ident_type::IVAR: {
|
||||||
auto &iv = static_cast<cs::integer_var const &>(var);
|
auto &iv = static_cast<cs::integer_var const &>(var);
|
||||||
|
|
Loading…
Reference in New Issue