Skip to content

Commit

Permalink
Renaming r_num_get_float to r_num_get_double ##refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
MewtR authored and trufae committed Dec 30, 2023
1 parent f588d52 commit 7fddeb9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libr/anal/sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -3271,8 +3271,8 @@ R_API RSignOptions *r_sign_options_new(const char *bytes_thresh, const char *gra
return NULL;
}

options->bytes_diff_threshold = r_num_get_float (NULL, bytes_thresh);
options->graph_diff_threshold = r_num_get_float (NULL, graph_thresh);
options->bytes_diff_threshold = r_num_get_double (NULL, bytes_thresh);
options->graph_diff_threshold = r_num_get_double (NULL, graph_thresh);

if (options->bytes_diff_threshold > 1.0) {
options->bytes_diff_threshold = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion libr/arch/p/pickle/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ static inline int assemble_float(const char *str, ut8 *outbuf, int outsz) {
}
RNum *num = r_num_new (NULL, NULL, NULL);
if (num) {
*((double *)outbuf) = r_num_get_float (num, str);
*((double *)outbuf) = r_num_get_double (num, str);
r_mem_swap (outbuf, sizeof (double));
r_num_free (num);
return sizeof (double);
Expand Down
2 changes: 1 addition & 1 deletion libr/core/cmd_zign.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ static RSignItem *item_frm_signame(RAnal *a, const char *signame) {

static double get_zb_threshold(RCore *core) {
const char *th = r_config_get (core->config, "zign.threshold");
double thresh = r_num_get_float (NULL, th);
double thresh = r_num_get_double (NULL, th);
if (thresh < 0.0 || thresh > 1.0) {
R_LOG_ERROR ("Invalid zign.threshold %s, using 0.0", th);
thresh = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion libr/core/dmh_glibc.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static bool GH(is_tcache)(RCore *core) {
}
fp = strstr (map->name, "libc.");
if (fp) {
v = r_num_get_float (core->num, fp + 5);
v = r_num_get_double (core->num, fp + 5);
core->dbg->glibc_version = (int) round((v * 100));
return (v > 2.25);
}
Expand Down
2 changes: 1 addition & 1 deletion libr/include/r_util/r_num.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ R_API size_t r_num_bit_clz32(ut32 val);
R_API size_t r_num_bit_clz64(ut64 val);
R_API size_t r_num_bit_ctz32(ut32 val);
R_API size_t r_num_bit_ctz64(ut64 val);
R_API double r_num_get_float(RNum *num, const char *str);
R_API double r_num_get_double(RNum *num, const char *str);

static inline st64 r_num_abs(st64 num) {
return num < 0 ? -num : num;
Expand Down
2 changes: 1 addition & 1 deletion libr/util/unum.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ R_API int r_num_is_float(RNum *num, const char *str) {
return (IS_DIGIT (*str) && (strchr (str, '.') || str[strlen (str) - 1] == 'f'));
}

R_API double r_num_get_float(RNum *num, const char *str) {
R_API double r_num_get_double(RNum *num, const char *str) {
double d = 0.0f;
(void) sscanf (str, "%lf", &d);
return d;
Expand Down

0 comments on commit 7fddeb9

Please sign in to comment.