Fix some warnings

This commit is contained in:
pancake 2016-06-01 12:23:10 +02:00
parent 2740e74e49
commit 95b2e511f5
8 changed files with 19 additions and 21 deletions

View File

@ -419,7 +419,7 @@ static int esil_internal_read(RAnalEsil *esil, const char *str, ut64 *num) {
// - Set rax to 100 without side-effects. ("$100,rax,=")
char *endptr = NULL;
ut64 imm = strtoull (str + 1, &endptr, 10);
if (*endptr == NULL) {
if (endptr == NULL) {
*num = imm;
return true;
}

View File

@ -140,7 +140,7 @@ static char *getarg(struct Getarg* gop, int n, int set, char *setop) {
if (scale > 1) {
snprintf (buf_, sizeof (buf), "%s%s,%d,*,", buf, index, scale);
} else {
snprintf (buf_, sizeof (buf), "%s%s,", buf, index, scale);
snprintf (buf_, sizeof (buf), "%s%s,", buf, index);
}
strncpy (buf, buf_, sizeof (buf));
component_count++;
@ -1859,8 +1859,6 @@ static void anop(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, csh
if (INSOP(0).mem.base == X86_REG_RIP) {
op->ptr += addr + insn->size;
op->refptr = 8;
} else {
cs_x86_op in = INSOP(0);
}
break;
default:
@ -1884,8 +1882,6 @@ static void anop(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len, csh
if (INSOP(0).mem.base == X86_REG_RIP) {
op->ptr += addr + insn->size;
op->refptr = 8;
} else {
cs_x86_op in = INSOP(0);
}
break;
case X86_OP_REG:

View File

@ -20,6 +20,7 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include <r_types.h>
#include "sysdep.h"
#include <stdio.h>
#include <string.h>
@ -2088,7 +2089,7 @@ print_insn_coprocessor (bfd_vma pc,
/* Is ``imm'' a negative number? */
if (imm & 0x40)
imm |= (-1 << 7);
imm |= (UT64_MAX << 7);
func (stream, "%d", imm);
}

View File

@ -26,6 +26,7 @@
#include "libhppa.h"
#include "opcode/hppa.h"
#include <string.h>
#include <r_types.h>
/* Integer register names, indexed by the numbers which appear in the
opcodes. */
@ -1103,7 +1104,7 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
int disp;
if (sign)
disp = (-1 << 10) | imm10;
disp = (UT64_MAX << 10) | imm10;
else
disp = imm10;
@ -1119,7 +1120,7 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
int disp;
if (sign)
disp = (-1 << 11) | imm11;
disp = (UT64_MAX << 11) | imm11;
else
disp = imm11;

View File

@ -1098,7 +1098,7 @@ SETNP/SETPO - Set if No Parity / Set if Parity Odd (386+)
} else if (!strcmp (op, "mov")) {
ut64 dst;
ut8 *ptr;
int pfx, arg0;
int pfx;
int N;
char *delta = NULL;
char *sib = NULL;

View File

@ -184,7 +184,8 @@ R_API RDebug *r_debug_free(RDebug *dbg) {
sdb_free (dbg->tracenodes);
//r_debug_plugin_free();
free (dbg->btalgo);
r_debug_trace_free (dbg);
r_debug_trace_free (dbg->trace);
dbg->trace = NULL;
free (dbg->arch);
free (dbg->glob_libs);
free (dbg->glob_unlibs);

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2008-2015 - pancake */
/* radare - LGPL - Copyright 2008-2016 - pancake */
#include <r_debug.h>
@ -26,14 +26,13 @@ R_API RDebugTrace *r_debug_trace_new () {
return t;
}
R_API void r_debug_trace_free (RDebug *dbg) {
if (dbg->trace == NULL)
return;
r_list_purge (dbg->trace->traces);
free (dbg->trace->traces);
sdb_free (dbg->trace->db);
free (dbg->trace);
dbg->trace = NULL;
R_API void r_debug_trace_free (RDebugTrace *trace) {
if (!trace) return;
r_list_purge (trace->traces);
free (trace->traces);
sdb_free (trace->db);
free (trace);
trace = NULL;
}
// TODO: added overlap/mask support here... wtf?

View File

@ -409,7 +409,7 @@ R_API RDebugTracepoint *r_debug_trace_get(RDebug *dbg, ut64 addr);
R_API void r_debug_trace_list(RDebug *dbg, int mode);
R_API RDebugTracepoint *r_debug_trace_add(RDebug *dbg, ut64 addr, int size);
R_API RDebugTrace *r_debug_trace_new(void);
R_API void r_debug_trace_free(RDebug *dbg);
R_API void r_debug_trace_free(RDebugTrace *dbg);
R_API int r_debug_trace_tag(RDebug *dbg, int tag);
R_API int r_debug_child_fork(RDebug *dbg);
R_API int r_debug_child_clone(RDebug *dbg);