Cleanup code

This commit is contained in:
Luc Tielen 2023-08-08 10:21:12 +02:00 committed by pancake
parent 74bf0557fa
commit 8a73fa94f5
4 changed files with 4 additions and 22 deletions

View File

@ -233,21 +233,6 @@ R_API char *r_anal_mnemonics(RAnal *anal, int id, bool json) {
R_API bool r_anal_use(RAnal *anal, const char *name) {
r_return_val_if_fail (anal, false);
#if 0
// R2_590
RListIter *it;
RAnalPlugin *h;
// r_anal plugins
r_list_foreach (anal->plugins, it, h) {
if (!h->meta.name || strcmp (h->meta.name, name)) {
continue;
}
anal->cur = h;
r_arch_config_use (anal->config, h->arch);
// R_LOG_DEBUG ("plugin found in analysis");
return true;
}
#endif
if (anal->arch) {
bool res = r_arch_use (anal->arch, anal->config, name);
if (res) {

View File

@ -2308,7 +2308,7 @@ struct MACH0_(obj_t) *MACH0_(mach0_new)(const char *file, struct MACH0_(opts_t)
#endif
struct MACH0_(obj_t) *MACH0_(new_buf)(RBuffer *buf, struct MACH0_(opts_t) *options) {
r_return_val_if_fail (buf, NULL);
r_return_val_if_fail (buf && options->bf->o, NULL);
struct MACH0_(obj_t) *mo = R_NEW0 (struct MACH0_(obj_t));
if (mo) {
mo->b = r_buf_ref (buf);
@ -2316,10 +2316,7 @@ struct MACH0_(obj_t) *MACH0_(new_buf)(RBuffer *buf, struct MACH0_(opts_t) *optio
mo->kv = sdb_new (NULL, "bin.mach0", 0);
// probably unnecessary indirection if we pass bf or bo to the apis instead of mo
// RVecRBinSymbol_init (&options->bf->o->symbols_vec);
if (!options->bf->o) {
R_LOG_WARN ("bf->bo is not initialized yet"); // R2_590 should not be a runtime chk
}
mo->symbols_vec = &(options->bf->o->symbols_vec); // R2_590 -> rename bf->o to bf->bo for consistency
mo->symbols_vec = &(options->bf->o->symbols_vec);
mo->options = *options;
mo->limit = options->bf->rbin->limit;
mo->nofuncstarts = r_sys_getenv_asbool ("RABIN2_MACHO_NOFUNCSTARTS");

View File

@ -349,7 +349,7 @@ typedef struct r_bin_file_t {
ut32 id;
RBuffer *buf;
ut64 offset; // XXX
RBinObject *o;
RBinObject *o; // R2_590 -> rename bf->o to bf->bo for consistency
void *xtr_obj;
ut64 user_baddr; // XXX
ut64 loadaddr; // XXX

View File

@ -27,7 +27,7 @@ R_API bool r_strbuf_append_n(RStrBuf *sb, const char *s, size_t l);
R_API bool r_strbuf_prepend(RStrBuf *sb, const char *s);
R_API bool r_strbuf_appendf(RStrBuf *sb, const char *fmt, ...) R_PRINTF_CHECK(2, 3);
R_API bool r_strbuf_vappendf(RStrBuf *sb, const char *fmt, va_list ap);
R_API char *r_strbuf_get(RStrBuf *sb); // R2_590 rename _tostring
R_API char *r_strbuf_get(RStrBuf *sb); // R2_590 rename _tostring, avoid clash on line 40
R_API char *r_strbuf_drain(RStrBuf *sb);
R_API char *r_strbuf_drain_nofree(RStrBuf *sb); // rename to _tostring() or asstring() ?
R_API bool r_strbuf_replace(RStrBuf *sb, const char *key, const char *val);