start getting rid of null terminated strings

master
Daniel Kolesa 2015-08-09 00:14:56 +01:00
parent 285ad59995
commit eb2c3fa831
2 changed files with 3 additions and 3 deletions

View File

@ -2070,10 +2070,10 @@ void GenState::gen_main(const char *p, int ret_type) {
code.push(CODE_EXIT | ((ret_type < VAL_ANY) ? (ret_type << CODE_RET) : 0));
}
ostd::Uint32 *CsState::compile(const char *p) {
ostd::Uint32 *CsState::compile(ostd::ConstCharRange str) {
GenState gs(*this);
gs.code.reserve(64);
gs.gen_main(p);
gs.gen_main(str.data());
ostd::Uint32 *code = new ostd::Uint32[gs.code.size()];
memcpy(code, gs.code.data(), gs.code.size() * sizeof(ostd::Uint32));
code[0] += 0x100;

View File

@ -440,7 +440,7 @@ struct CsState {
void print_var_float(Ident *id, float f);
void print_var_str(Ident *id, ostd::ConstCharRange s);
ostd::Uint32 *compile(const char *code);
ostd::Uint32 *compile(ostd::ConstCharRange code);
private:
void debug_alias();