replace removed PointerRange

master
Daniel Kolesa 2017-02-14 17:41:15 +01:00
parent efe4ee523a
commit 9b4ea3e765
2 changed files with 6 additions and 6 deletions

View File

@ -11,9 +11,9 @@ namespace cscript {
struct cs_ident;
struct cs_value;
using cs_value_r = ostd::PointerRange<cs_value>;
using cs_ident_r = ostd::PointerRange<cs_ident *>;
using cs_const_ident_r = ostd::PointerRange<cs_ident const *>;
using cs_value_r = ostd::IteratorRange<cs_value *>;
using cs_ident_r = ostd::IteratorRange<cs_ident **>;
using cs_const_ident_r = ostd::IteratorRange<cs_ident const **>;
}
/* configurable section */

View File

@ -1645,14 +1645,14 @@ void cs_state::run(cs_ident *id, cs_value_r args, cs_value &ret) {
case cs_ident_type::Command:
if (nargs < static_cast<cs_command *>(id)->get_num_args()) {
cs_value buf[MaxArguments];
memcpy(buf, args.data(), args.size() * sizeof(cs_value));
memcpy(buf, &args[0], args.size() * sizeof(cs_value));
callcommand(
*this, static_cast<cs_command *>(id), buf, ret,
nargs, false
);
} else {
callcommand(
*this, static_cast<cs_command *>(id), args.data(),
*this, static_cast<cs_command *>(id), &args[0],
ret, nargs, false
);
}
@ -1694,7 +1694,7 @@ void cs_state::run(cs_ident *id, cs_value_r args, cs_value &ret) {
break;
}
cs_call_alias(
*this, a, args.data(), ret, nargs, nargs, 0, 0, CsRetNull
*this, a, &args[0], ret, nargs, nargs, 0, 0, CsRetNull
);
break;
}