mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 23:20:40 +00:00
Fix warnings
This commit is contained in:
parent
53ab84a7fc
commit
dfb4f2b06e
@ -945,8 +945,8 @@ static bool __rebase_flags(RFlagItem *flag, void *user) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool __rebase_refs_i(void *user, KEY_TYPE k, VALUE_TYPE v) {
|
||||
struct __rebase_struct *reb = user;
|
||||
static bool __rebase_refs_i(void *user, const ut64 k, const void *v) {
|
||||
struct __rebase_struct *reb = (void*)user;
|
||||
RAnalRef *ref = (RAnalRef *)v;
|
||||
ref->addr += reb->diff;
|
||||
ref->at += reb->diff;
|
||||
@ -958,7 +958,7 @@ static bool __rebase_refs_i(void *user, KEY_TYPE k, VALUE_TYPE v) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool __rebase_refs(void *user, KEY_TYPE k, VALUE_TYPE v) {
|
||||
static bool __rebase_refs(void *user, const ut64 k, const void *v) {
|
||||
HtUP *ht = (HtUP *)v;
|
||||
ht_up_foreach (ht, __rebase_refs_i, user);
|
||||
return true;
|
||||
@ -998,8 +998,8 @@ static void __rebase_everything(RCore *core, RList *old_sections, ut64 old_base)
|
||||
if (fcn->meta.min) {
|
||||
fcn->meta.min += diff;
|
||||
}
|
||||
int j = 0;
|
||||
for (int j = 0; j < fcn->bbr.pairs * 2; j++) {
|
||||
int j;
|
||||
for (j = 0; j < fcn->bbr.pairs * 2; j++) {
|
||||
fcn->bbr.ranges[j] += diff;
|
||||
}
|
||||
r_anal_fcn_tree_insert (core->anal, fcn);
|
||||
|
@ -1,5 +1,3 @@
|
||||
/* radare - BSD 3 Clause License - Copyright 2017 - MaskRay */
|
||||
|
||||
#ifndef R2_RBTREE_H
|
||||
#define R2_RBTREE_H
|
||||
|
||||
@ -34,7 +32,7 @@ typedef struct r_rb_iter_t {
|
||||
RBNode *path[R_RBTREE_MAX_HEIGHT];
|
||||
} RBIter;
|
||||
|
||||
typedef int (*RContRBCmp)(void *incoming, void *in, void *user);
|
||||
typedef int (*RContRBCmp)(const void *incoming, void *in, void *user);
|
||||
typedef void (*RContRBFree)(void *);
|
||||
typedef struct r_containing_rb_node_t {
|
||||
RBNode node;
|
||||
|
@ -386,8 +386,7 @@ R_API void r_rbtree_iter_prev(RBIter *it) {
|
||||
}
|
||||
|
||||
R_API RContRBTree *r_rbtree_cont_new() {
|
||||
RContRBTree *tree = R_NEW0 (RContRBTree);
|
||||
return tree;
|
||||
return R_NEW0 (RContRBTree);
|
||||
}
|
||||
|
||||
R_API RContRBTree *r_rbtree_cont_newf(RContRBFree f) {
|
||||
@ -427,7 +426,7 @@ static int cont_rbtree_free_cmp_wrapper(const void *data, const RBNode *in_tree,
|
||||
memcpy (&dat, &data, sizeof (void *));
|
||||
const int ret = cont_rbtree_cmp_wrapper (dat, in_tree, user);
|
||||
if (!ret && cmp_wrap->free) { //this is for deleting
|
||||
RContRBNode *in_tree_node = container_of (in_tree, RContRBNode, node);
|
||||
RContRBNode *in_tree_node = container_of ((void*)in_tree, RContRBNode, node);
|
||||
cmp_wrap->free (in_tree_node->data);
|
||||
}
|
||||
return ret;
|
||||
@ -487,7 +486,7 @@ R_API bool r_rbtree_cont_delete(RContRBTree *tree, void *data, RContRBCmp cmp, v
|
||||
R_API void *r_rbtree_cont_find(RContRBTree *tree, void *data, RContRBCmp cmp, void *user) {
|
||||
r_return_val_if_fail (tree && cmp && tree->root, NULL);
|
||||
RCRBCmpWrap cmp_wrap = { cmp, NULL, user };
|
||||
RBNode search_node = tree->root->node;
|
||||
// RBNode search_node = tree->root->node;
|
||||
RBNode *result_node = r_rbtree_find (&tree->root->node, data, cont_rbtree_search_cmp_wrapper, &cmp_wrap);
|
||||
if (result_node) {
|
||||
return (container_of (result_node, RContRBNode, node))->data;
|
||||
|
Loading…
Reference in New Issue
Block a user