Accept @xtraeme's massive warning cleanup

This commit is contained in:
Juan RP 2013-07-23 17:11:51 +02:00 committed by pancake
parent 2bfd8792e4
commit 9101835c58
11 changed files with 38 additions and 23 deletions

23
.gitignore vendored
View File

@ -1,12 +1,29 @@
*.d
*.o
*._d
*._o
*.[ado]
*.so
*.pc
*.sdb
*.dylib
supported.*
config.mk
plugins.cfg
langs.cfg
.*.swp
*.un~
binr/r2agent/r2agent
binr/rabin2/rabin2
binr/radare2/radare2
binr/radiff2/radiff2
binr/rafind2/rafind2
binr/ragg2/ragg2
binr/rahash2/rahash2
binr/rarun2/rarun2
binr/rasm2/rasm2
binr/rax2/rax2
config-user.mk
libr/config.h
libr/include/r_userconf.h
shlr/java/out
shlr/sdb/sdb
shlr/sdb/src/sdb

View File

@ -20,8 +20,8 @@ static int arc_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len)
case 0x05: /* Branch with Link */
case 0x06: /* Loop */
op->type = R_ANAL_OP_TYPE_CJMP;
op->jump = addr + 4 + ((b[1] << 1) | (b[2] << 8) |
((b[3] & 7) << 16) | ((b[0] & 0x80) >> 7)) << 2;
op->jump = addr + 4 + (((b[1] << 1) | (b[2] << 8) |
((b[3] & 7) << 16) | ((b[0] & 0x80) >> 7)) << 2);
break;
case 0x07: /* Conditional Jump and Jump with Link */
op->type = R_ANAL_OP_TYPE_CJMP;

View File

@ -65,8 +65,8 @@ R_API int r_anal_ref_add(RAnal *anal, ut64 addr, ut64 at, int type) {
ref->addr = addr;
ref->at = at;
ref->type = type;
return R_TRUE;
#endif
return R_TRUE;
}
R_API int r_anal_ref_del(RAnal *anal, ut64 at, ut64 addr) {
@ -96,12 +96,12 @@ R_API RList *r_anal_xref_get(RAnal *anal, ut64 addr) {
return r_anal_xrefs_get (anal, addr);
}
#if 0
/*
RAnalFunction *fcni;
RAnalRef *refi, *ref, *refr;
RListIter *iter, *iter2, *iter3;
RList *ret;
#if 0
for (list = sdb_list_begin (DB); list; list = sdb_list_next (list)) {
char *str = astring();
eprintf ("--> %s\n", str);
@ -189,4 +189,4 @@ while (list) {
}
return ret;
}
#endif
*/

View File

@ -234,9 +234,11 @@ R_AII char *do8051disasm(Op8051 op, ut32 addr, char *str, int len) {
return out;
}
#if 0
R_AII Op8051 do8051assemble(const char *str) {
return _{"TODO"};
}
#endif
#if MAIN

View File

@ -52,8 +52,6 @@ struct state {
int s_ff_quirk;
};
static int arch_csr_disasm(char *str, const unsigned char *b, ut64 seek);
#define MODE_MASK 3
#define REG_SHIFT 2
#define REG_MASK 3

View File

@ -256,7 +256,8 @@ static UBYTE OpcodeLen(ULONG p, const ut8 *Opcodes) {
}
return(len);
}
#if MAIN_DIS
R_API_I ULONG ParseOpcodes(ULONG adr, ut8 *Opcodes, int len) {
int i;
ULONG next;
@ -349,7 +350,8 @@ R_API_I ULONG ParseOpcodes(ULONG adr, ut8 *Opcodes, int len) {
}
return next;
}
#endif
// Disassemblieren
static int Disassemble(UWORD adr, const unsigned char *Opcodes, STR s, int olen) {
UBYTE a = Opcodes[0];

View File

@ -207,13 +207,12 @@ static char *get_string (struct r_bin_dex_obj_t *bin, int idx) {
/* TODO: check boundaries */
static char *dex_method_name (RBinDexObj *bin, int idx) {
int tid, sid;
int tid;
if (idx<0 || idx>bin->header.method_size)
return NULL;
tid = bin->methods[idx].name_id;
if (tid<0 || tid>bin->header.strings_size)
return NULL;
sid = bin->strings[tid];
return get_string (bin, tid);
}

View File

@ -208,7 +208,7 @@ static int bin_info (RCore *r, int mode) {
r_str_bool (R_BIN_DBG_RELOCS (info->dbg_info)),
info->rpath);
for (i=0; info->sum[i].type; i++) {
int len, hashchk = 1;
int len;
//ut8 *sum = &info; // XXX
RBinHash *h = &info->sum[i];
ut64 hash = r_hash_name_to_bits (h->type);
@ -216,7 +216,6 @@ static int bin_info (RCore *r, int mode) {
len = r_hash_calculate (rh, hash, (const ut8*)r->bin->cur.buf+h->from, h->to);
//ut8 *p = r->bin->cur.buf+h->addr;
if (len<1) eprintf ("Invaild wtf\n");
hashchk = (!memcmp (rh->digest, h->buf, h->len));
r_hash_free (rh);
r_cons_printf ("%s\t%d-%dc\t", h->type, h->from, h->to+h->from);
@ -457,8 +456,6 @@ static int bin_relocs (RCore *r, int mode, ut64 baddr, int va) {
}
static int bin_imports (RCore *r, int mode, ut64 baddr, int va, const char *name) {
char *dname, *mn, *p, str[R_FLAG_NAME_SIZE];
const char *iname;
RBinImport *import;
RListIter *iter;
RList *imports;

View File

@ -760,6 +760,7 @@ R_API int r_anal_fcn_count (RAnal *a, ut64 from, ut64 to);
R_API RList* r_anal_fcn_get_refs (RAnalFunction *anal);
R_API RList* r_anal_fcn_get_xrefs (RAnalFunction *anal);
R_API RList *r_anal_xrefs_set (RAnal *anal, const char *type, ut64 from, ut64 to);
R_API RList *r_anal_xrefs_deln (RAnal *anal, const char *type, ut64 from, ut64 to);
R_API void r_anal_xrefs_save(RAnal *anal, const char *prjfile);
R_API RList* r_anal_fcn_get_vars (RAnalFunction *anal);
R_API RList* r_anal_fcn_get_bbs (RAnalFunction *anal);

View File

@ -103,7 +103,7 @@ static int filter(RParse *p, RFlag *f, char *data, char *str, int len) {
ptr2 = NULL;
while ((ptr = strstr (ptr, "0x"))) {
if (x86) for (ptr2 = ptr; *ptr2 && !isx86separator (*ptr2); ptr2++);
else for (ptr2 = ptr; *ptr2 && (*ptr2=='\x1b')||!isseparator (*ptr2); ptr2++);
else for (ptr2 = ptr; *ptr2 && ((*ptr2=='\x1b')||!isseparator (*ptr2)); ptr2++);
off = r_num_math (NULL, ptr);
if (!off) {
ptr = ptr2;

View File

@ -1,5 +1,4 @@
#if 0
/*
mov r0, #33
.-- select 3 bit opcode mode
@ -20,7 +19,7 @@ memr 01 0 x3
memi 01 11 11 x32
memri 01 10 r3 11 x32
imm 0011 x32
#endif
*/
static int assemble_arg(Bitbuf *b, char *a) {
printf ("A = (%s)\n", a);
int r = getreg (a);