diff --git a/libr/bin/bfilter.c b/libr/bin/bfilter.c index 2797fa5af5404..45527107c1b5b 100644 --- a/libr/bin/bfilter.c +++ b/libr/bin/bfilter.c @@ -65,11 +65,9 @@ R_API char *r_bin_filter_name(RBinFile *bf, HtSU *db, ut64 vaddr, const char *na return resname; } -// R2_600 - return bool for success or not -R_API void r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym) { - R_RETURN_IF_FAIL (ht && sym && sym->name); +R_IPI bool r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym) { + R_RETURN_VAL_IF_FAIL (ht && sym && sym->name, false); const char *name = r_bin_name_tostring2 (sym->name, 'o'); -#if 1 if (bf && bf->bo && bf->bo->lang) { const char *lang = r_bin_lang_tostring (bf->bo->lang); char *dn = r_bin_demangle (bf, lang, name, sym->vaddr, false); @@ -92,11 +90,10 @@ R_API void r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym) } free (dn); } -#endif r_strf_var (uname, 256, "%" PFMT64x ".%c.%s", vaddr, sym->is_imported ? 'i' : 's', name); bool res = ht_pp_insert (ht, uname, sym); if (!res) { - return; + return false; } sym->dup_count = 0; @@ -105,12 +102,13 @@ R_API void r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym) if (!prev_sym) { if (!ht_pp_insert (ht, oname, sym)) { R_LOG_WARN ("Failed to insert dup_count in ht"); - return; + return false; } } else { sym->dup_count = prev_sym->dup_count + 1; ht_pp_update (ht, oname, sym); } + return true; } R_API void r_bin_filter_symbols(RBinFile *bf, RList *list) { diff --git a/libr/include/r_bin.h b/libr/include/r_bin.h index e06351154d135..eb7425740c4f6 100644 --- a/libr/include/r_bin.h +++ b/libr/include/r_bin.h @@ -729,9 +729,7 @@ typedef struct r_bin_bind_t { ut32 visibility; } RBinBind; -R_IPI RBinSection *r_bin_section_new(const char *name); R_API RBinSection *r_bin_section_clone(RBinSection *s); -R_IPI void r_bin_section_free(RBinSection *bs); R_API void r_bin_info_free(RBinInfo *rb); R_API void r_bin_import_free(RBinImport *imp); R_API void r_bin_symbol_free(void *sym); @@ -916,10 +914,14 @@ R_API void r_bin_load_filter(RBin *bin, ut64 rules); R_API void r_bin_filter_symbols(RBinFile *bf, RList *list); R_API void r_bin_filter_sections(RBinFile *bf, RList *list); R_API char *r_bin_filter_name(RBinFile *bf, HtSU *db, ut64 addr, const char *name); -R_API void r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym); R_API bool r_bin_strpurge(RBin *bin, const char *str, ut64 addr); R_API bool r_bin_string_filter(RBin *bin, const char *str, ut64 addr); +// internal apis +R_IPI bool r_bin_filter_sym(RBinFile *bf, HtPP *ht, ut64 vaddr, RBinSymbol *sym); +R_IPI RBinSection *r_bin_section_new(const char *name); +R_IPI void r_bin_section_free(RBinSection *bs); + /* plugin pointers */ extern RBinPlugin r_bin_plugin_any; extern RBinPlugin r_bin_plugin_fs; diff --git a/libr/include/r_core.h b/libr/include/r_core.h index 421060b034cb8..82081d65f9e41 100644 --- a/libr/include/r_core.h +++ b/libr/include/r_core.h @@ -582,6 +582,7 @@ R_API void r_core_list_io(RCore *core); R_API void r_core_list_lang(RCore *core, int mode); R_API void r_core_visual_slides(RCore *core, const char *file); + /* visual marks */ R_API void r_core_vmark(RCore *core, ut8 ch); R_API void r_core_vmark_set(RCore *core, ut8 ch, ut64 addr, int x, int y); diff --git a/libr/util/buf_bytes.c b/libr/util/buf_bytes.c index f29dee32ddead..047c124bd5027 100644 --- a/libr/util/buf_bytes.c +++ b/libr/util/buf_bytes.c @@ -103,7 +103,7 @@ static ut64 buf_bytes_get_size(RBuffer *b) { static st64 buf_bytes_seek(RBuffer *b, st64 addr, int whence) { r_warn_if_fail (b->rb_bytes); if (R_UNLIKELY (addr < 0)) { - if (addr > -UT48_MAX) { + if (addr > -(st64)UT48_MAX) { if (-addr > (st64)b->rb_bytes->offset) { return -1; } diff --git a/libr/util/buf_cache.c b/libr/util/buf_cache.c index b6dd7bd7e4e8e..3f7f8f192478f 100644 --- a/libr/util/buf_cache.c +++ b/libr/util/buf_cache.c @@ -216,7 +216,7 @@ static ut64 buf_cache_get_size(RBuffer *b) { static st64 buf_cache_seek(RBuffer *b, st64 addr, int whence) { r_warn_if_fail (b->rb_cache); if (addr < 0) { - if (addr > -UT48_MAX) { + if (addr > -(st64)UT48_MAX) { if (-addr > (st64)b->rb_cache->offset) { return -1; } diff --git a/libr/util/table.c b/libr/util/table.c index 70658f4d0b8b6..4d320e7bc791e 100644 --- a/libr/util/table.c +++ b/libr/util/table.c @@ -72,7 +72,7 @@ static int sortNumber(const void *a, const void *b) { static int sortFloat(const void *a, const void *b) { double fa = strtod ((const char *) a, NULL); double fb = strtod ((const char *) b, NULL); - return (fa * 100) - (fb * 100); + return (int)((fa * 100) - (fb * 100)); } // maybe just index by name instead of exposing those symbols as global