don't need the this

master
Daniel Kolesa 2015-12-07 22:37:38 +00:00
parent ea8c0ff002
commit 946aa50b58
1 changed files with 15 additions and 15 deletions

30
main.cc
View File

@ -347,18 +347,18 @@ struct ObState: CsState {
if ((!ret && (act || ob_check_exec(tname, subdeps))) && func) { if ((!ret && (act || ob_check_exec(tname, subdeps))) && func) {
StackedValue targetv, sourcev, sourcesv; StackedValue targetv, sourcev, sourcesv;
targetv.id = this->new_ident("target"); targetv.id = new_ident("target");
if (!cscript::check_alias(targetv.id)) if (!cscript::check_alias(targetv.id))
return 1; return 1;
targetv.set_cstr(tname); targetv.set_cstr(tname);
targetv.push(); targetv.push();
if (subdeps.size() > 0) { if (subdeps.size() > 0) {
sourcev.id = this->new_ident("source"); sourcev.id = new_ident("source");
if (!cscript::check_alias(sourcev.id)) if (!cscript::check_alias(sourcev.id))
return 1; return 1;
sourcesv.id = this->new_ident("sources"); sourcesv.id = new_ident("sources");
if (!cscript::check_alias(sourcesv.id)) if (!cscript::check_alias(sourcesv.id))
return 1; return 1;
@ -371,13 +371,13 @@ struct ObState: CsState {
sourcesv.push(); sourcesv.push();
} }
return this->run_int(func); return run_int(func);
} }
return ret; return ret;
} }
int exec_action(Rule *rule) { int exec_action(Rule *rule) {
return this->run_int(rule->func); return run_int(rule->func);
} }
int find_rules(ConstCharRange target, Vector<SubRule> &rlist) { int find_rules(ConstCharRange target, Vector<SubRule> &rlist) {
@ -476,25 +476,25 @@ struct ObState: CsState {
} }
void register_rulecmds() { void register_rulecmds() {
this->add_command("rule", "sseN", [](CsState &cs, const char *tgt, add_command("rule", "sseN", [](CsState &cs, const char *tgt,
const char *dep, ostd::Uint32 *body, const char *dep, ostd::Uint32 *body,
int *numargs) { int *numargs) {
((ObState &)cs).rule_add(tgt, dep, (*numargs > 2) ? body : nullptr); ((ObState &)cs).rule_add(tgt, dep, (*numargs > 2) ? body : nullptr);
}); });
this->add_command("action", "se", [](CsState &cs, const char *an, add_command("action", "se", [](CsState &cs, const char *an,
ostd::Uint32 *body) { ostd::Uint32 *body) {
((ObState &)cs).rule_add(an, nullptr, body, true); ((ObState &)cs).rule_add(an, nullptr, body, true);
}); });
this->add_command("depend", "ss", [](CsState &cs, const char *file, add_command("depend", "ss", [](CsState &cs, const char *file,
const char *deps) { const char *deps) {
((ObState &)cs).rule_add(file, deps, nullptr); ((ObState &)cs).rule_add(file, deps, nullptr);
}); });
this->add_command("duprule", "sssN", [](CsState &cs, const char *tgt, add_command("duprule", "sssN", [](CsState &cs, const char *tgt,
const char *ptgt, const char *dep, const char *ptgt, const char *dep,
int *numargs) { int *numargs) {
((ObState &)cs).rule_dup(tgt, ptgt, dep, *numargs <= 2); ((ObState &)cs).rule_dup(tgt, ptgt, dep, *numargs <= 2);
}); });
} }