X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/b3378a02d0a811be38e530933fb9a57a3012a823..aa926c8bd4e2bdc41f7370c3e6cf1f1d00aef8d9:/Console.cpp?ds=sidebyside diff --git a/Console.cpp b/Console.cpp index 6ecc251..b7a4533 100644 --- a/Console.cpp +++ b/Console.cpp @@ -264,7 +264,7 @@ static char **Complete(const char *word, int start, int end) { case CYDriver::AutoMessage: { CYDriver::Context &thing(driver.contexts_.back()); - expression = $M($M($ CYIndirect(thing.context_), $S("isa")), $S("messages")); + expression = $M($C1($V("object_getClass"), thing.context_), $S("messages")); for (CYDriver::Context::Words::const_iterator part(thing.words_.begin()); part != thing.words_.end(); ++part) prefix << (*part)->word_ << ':'; } break; @@ -313,7 +313,7 @@ static char **Complete(const char *word, int start, int end) { std::string common; bool rest(false); - for (CYElement *element(array->elements_); element != NULL; element = element->next_) { + CYForEach (element, array->elements_) { CYString *string(dynamic_cast(element->value_)); _assert(string != NULL); @@ -482,7 +482,7 @@ static void Console(CYOptions &options) { if (parser.parse() != 0 || !driver.errors_.empty()) { for (CYDriver::Errors::const_iterator error(driver.errors_.begin()); error != driver.errors_.end(); ++error) { cy::position begin(error->location_.begin); - if (begin.line != lines.size() || begin.column - 1 != lines.back().size() || error->warning_) { + if (begin.line != lines.size() || begin.column < lines.back().size() || error->warning_) { cy::position end(error->location_.end); if (begin.line != lines.size()) { @@ -491,7 +491,7 @@ static void Console(CYOptions &options) { } std::cerr << "...."; - for (size_t i(0); i != begin.column - 1; ++i) + for (size_t i(0); i != begin.column; ++i) std::cerr << '.'; if (begin.line != end.line || begin.column == end.column) std::cerr << '^'; @@ -573,7 +573,7 @@ int Main(int argc, char const * const argv[], char const * const envp[]) { bool compile(false); CYOptions options; - append_history$ = reinterpret_cast(dlsym(RTLD_DEFAULT, "append_history")); + append_history$ = (int (*)(int, const char *)) (dlsym(RTLD_DEFAULT, "append_history")); #ifdef CY_ATTACH pid_t pid(_not(pid_t));