Skip to content

Commit

Permalink
Fix last pending warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Jul 11, 2017
1 parent 68cb265 commit abaf84d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 26 deletions.
15 changes: 8 additions & 7 deletions libr/asm/arch/hexagon/gnu/hexagon-opc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ hexagon_extend
if (hexagon_if_arch_kext ())
{
/* TODO: It would be better to use the insn table to figure out the number of bits. */
xvalue = *value & (~0L << 6);
*value = *value & ~(~0L << 6);
xvalue = *value & ((~0UL >> 6) << 6);
*value = *value & ~((~0UL >> 6) << 6);

/*
if (is_signed && *value > (1L << (bits - 1)))
Expand Down Expand Up @@ -1336,7 +1336,7 @@ hexagon_hash_icode
/* Configuration flags. */

/* Various HEXAGON_HAVE_XXX bits. */
#define HEXAGON_CPU_TYPE_UNINIT (~0 << sizeof (cpu_type))
#define HEXAGON_CPU_TYPE_UNINIT (~0UL << sizeof (cpu_type))
static int cpu_type;
static int cpu_flag;

Expand Down Expand Up @@ -1697,9 +1697,9 @@ hexagon_encode_operand
}

if (operand->flags & HEXAGON_OPERAND_IS_LO16)
value.s = HEXAGON_LO16 (value.s);
value.s = HEXAGON_LO16 (value.u);
else if (operand->flags & HEXAGON_OPERAND_IS_HI16)
value.s = HEXAGON_HI16 (value.s);
value.s = HEXAGON_HI16 (value.u);
else if (operand->flags & HEXAGON_OPERAND_IS_SUBSET)
value.s = HEXAGON_SUBREGS_TO (value.s, operand->flags & HEXAGON_OPERAND_IS_PAIR);

Expand Down Expand Up @@ -1837,6 +1837,7 @@ hexagon_reg_num
continue;

*input = regs + len - (*name? 1: 0);
// unused result . thank you gnu
return ((int) (aliasn? *aliasn = i: i), (int) regn);
}
}
Expand Down Expand Up @@ -2832,14 +2833,14 @@ hexagon_dis_operand
xed = FALSE;
value -= paddr;
value >>= operand->shift_count;
value &= ~(~0 << 6);
value &= ~(~0UL << 6);
value += xvalue + paddr;
}
else
{
xed = TRUE;
value >>= operand->shift_count;
value &= ~(~0 << 6);
value &= ~(~0UL << 6);
value += xvalue;
}
xer = xvalue = 0;
Expand Down
2 changes: 1 addition & 1 deletion libr/asm/arch/hexagon/gnu/opcode/hexagon.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#define HEXAGON_IS16INSN(num) 0 /* not yet implemented */

/* Extract the low 16 bits */
#define HEXAGON_LO16(num) ((num) & ~(-1 << 16))
#define HEXAGON_LO16(num) ((num) & ~(-1UL << 16))

/* Extract the high 16 bits */
#define HEXAGON_HI16(num) (HEXAGON_LO16 ((num) >> 16))
Expand Down
2 changes: 1 addition & 1 deletion libr/asm/code.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2016 - pancake */
/* radare - LGPL - Copyright 2009-2017 - pancake */

#include <stdio.h>
#include <r_asm.h>
Expand Down
2 changes: 1 addition & 1 deletion libr/bin/pdb/pdb_downloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int r_bin_pdb_download(RCore* core, int isradjson, int* actions_done, SPDBOption
opt.dbg_file, ret ? "success" : "failed");
}
if (actions_done) {
*actions_done++;
(*actions_done)++;
}
deinit_pdb_downloader (&pdb_downloader);

Expand Down
3 changes: 0 additions & 3 deletions libr/debug/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,7 @@ R_API int r_debug_step_over(RDebug *dbg, int steps) {

R_API int r_debug_step_back(RDebug *dbg) {
ut64 pc, prev = 0, end, cnt = 0;
ut8 buf[32];
RAnalOp op;
RDebugSession *before;
RListIter *tail;

if (r_debug_is_dead (dbg)) {
return 0;
Expand Down
21 changes: 10 additions & 11 deletions libr/debug/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ R_API void r_debug_session_save(RDebug *dbg, const char *file) {
snapentry.size = base->size;
snapentry.timestamp = base->timestamp;
snapentry.perm = base->perm;
r_file_dump (base_file, &snapentry, sizeof (RSnapEntry), 1);
r_file_dump (base_file, base->data, base->size, 1);
r_file_dump (base_file, (const ut8*)&snapentry, sizeof (RSnapEntry), 1);
r_file_dump (base_file, (const ut8*)base->data, base->size, 1);
/* dump all hases */
for (i = 0; i < base->page_num; i++) {
r_file_dump (base_file, base->hashes[i], 128, 1);
r_file_dump (base_file, (const ut8*)base->hashes[i], 128, 1);
}
}

Expand All @@ -227,14 +227,14 @@ R_API void r_debug_session_save(RDebug *dbg, const char *file) {
header.id = session->key.id;
header.addr = session->key.addr;
header.difflist_len = r_list_length (session->memlist);
r_file_dump (diff_file, &header, sizeof (RSessionHeader), 1);
r_file_dump (diff_file, (ut8*)&header, sizeof (RSessionHeader), 1);

/* dump registers */
r_debug_reg_sync (dbg, R_REG_TYPE_ALL, 0);
for (i = 0; i < R_REG_TYPE_LAST; i++) {
RRegArena *arena = session->reg[i]->data;
r_file_dump (diff_file, &arena->size, sizeof (int), 1);
r_file_dump (diff_file, arena->bytes, arena->size, 1);
r_file_dump (diff_file, (const ut8*)&arena->size, sizeof (int), 1);
r_file_dump (diff_file, (const ut8*)arena->bytes, arena->size, 1);
// eprintf ("arena[%d] size=%d\n", i, arena->size);
}
if (!header.difflist_len) {
Expand All @@ -248,13 +248,13 @@ R_API void r_debug_session_save(RDebug *dbg, const char *file) {
/* Dump diff header */
diffentry.pages_len = r_list_length (snapdiff->pages);
diffentry.base_idx = r_snap_to_idx (dbg, snapdiff->base);
r_file_dump (diff_file, &diffentry, sizeof (RDiffEntry), 1);
r_file_dump (diff_file, (const ut8*)&diffentry, sizeof (RDiffEntry), 1);

/* Dump page entries */
r_list_foreach (snapdiff->pages, iter3, page) {
r_file_dump (diff_file, &page->page_off, sizeof (ut32), 1);
r_file_dump (diff_file, page->data, SNAP_PAGE_SIZE, 1);
r_file_dump (diff_file, page->hash, 128, 1);
r_file_dump (diff_file, (const ut8*)&page->page_off, sizeof (ut32), 1);
r_file_dump (diff_file, (const ut8*)page->data, SNAP_PAGE_SIZE, 1);
r_file_dump (diff_file, (const ut8*)page->hash, 128, 1);
}
}
}
Expand All @@ -263,7 +263,6 @@ R_API void r_debug_session_save(RDebug *dbg, const char *file) {
}

R_API void r_debug_session_restore(RDebug *dbg, const char *file) {
RListIter *iter;
RDebugSession *session;
RDebugSnap *base;
RDebugSnapDiff *snapdiff;
Expand Down
1 change: 0 additions & 1 deletion libr/debug/snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ R_API RDebugSnap *r_debug_snap_new() {

R_API void r_debug_snap_free(void *p) {
RDebugSnap *snap = (RDebugSnap *) p;
ut32 i = 0;
r_list_free (snap->history);
free (snap->data);
free (snap->comment);
Expand Down
2 changes: 1 addition & 1 deletion libr/parse/code.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int typeload(void *p, const char *k, const char *v) {
} while (next);
free (members);
}
tcc_sym_push(typename, typesize, btype);
tcc_sym_push (typename, typesize, btype);
}
return 0;
}
Expand Down

0 comments on commit abaf84d

Please sign in to comment.