Browse Source

up the default warning level, turn off rtti by default

master
Daniel Kolesa 4 months ago
parent
commit
2270d8e41f
  1. 5
      meson.build
  2. 2
      src/cs_bcode.cc
  3. 2
      src/cs_state.hh
  4. 2
      src/cs_strman.cc
  5. 6
      src/cs_vm.cc
  6. 2
      src/lib_str.cc
  7. 2
      tools/linenoise.cc
  8. 2
      tools/repl.cc

5
meson.build

@ -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'
)

2
src/cs_bcode.cc

@ -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;

2
src/cs_state.hh

@ -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);

2
src/cs_strman.cc

@ -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 */

6
src/cs_vm.cc

@ -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)
);
}

2
src/lib_str.cc

@ -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) {

2
tools/linenoise.cc

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

2
tools/repl.cc

@ -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);

Loading…
Cancel
Save