From 0bad2e28cf8eced81e6cbd54c2bea2112213d677 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 11 Jan 2013 15:12:56 +0300 Subject: [PATCH] estate: rename is_whole_range() to estate_is_whole() Also I moved the function from smatch_extra.c to smatch_estate.c. Signed-off-by: Dan Carpenter --- check_overflow.c | 2 +- smatch_estate.c | 5 +++++ smatch_extra.c | 9 ++------- smatch_extra.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/check_overflow.c b/check_overflow.c index b75eabd5..4cbb7c15 100644 --- a/check_overflow.c +++ b/check_overflow.c @@ -115,7 +115,7 @@ static void array_check(struct expression *expr) struct smatch_state *state; state = get_state_expr(SMATCH_EXTRA, offset); - if (state && is_whole_range(state)) + if (state && estate_is_whole(state)) return; } diff --git a/smatch_estate.c b/smatch_estate.c index 14cac1ea..4bc01523 100644 --- a/smatch_estate.c +++ b/smatch_estate.c @@ -138,6 +138,11 @@ int estates_equiv(struct smatch_state *one, struct smatch_state *two) return 0; } +int estate_is_whole(struct smatch_state *state) +{ + return is_whole_rl(estate_ranges(state)); +} + int estate_get_single_value(struct smatch_state *state, sval_t *sval) { sval_t min, max; diff --git a/smatch_extra.c b/smatch_extra.c index d341ed8e..194b545f 100644 --- a/smatch_extra.c +++ b/smatch_extra.c @@ -974,14 +974,9 @@ int implied_not_equal(struct expression *expr, long long val) return !possibly_false(expr, SPECIAL_NOTEQUAL, value_expr(val)); } -int is_whole_range(struct smatch_state *state) -{ - return is_whole_rl(estate_ranges(state)); -} - static void struct_member_callback(char *fn, char *global_static, int param, char *printed_name, struct smatch_state *state) { - if (is_whole_range(state)) + if (estate_is_whole(state)) return; sm_msg("info: passes param_value '%s' %d '%s' %s %s", fn, param, printed_name, state->name, global_static); } @@ -1209,7 +1204,7 @@ free: static void returned_member_callback(int return_id, char *return_ranges, char *printed_name, struct smatch_state *state) { - if (is_whole_range(state)) + if (estate_is_whole(state)) return; sm_msg("info: return_value %d '%s' '%s' '%s' %s", return_id, return_ranges, printed_name, state->name, global_static()); diff --git a/smatch_extra.h b/smatch_extra.h index 2e4d04e5..32ce9150 100644 --- a/smatch_extra.h +++ b/smatch_extra.h @@ -96,7 +96,7 @@ struct smatch_state *clone_estate(struct smatch_state *state); struct smatch_state *merge_estates(struct smatch_state *s1, struct smatch_state *s2); int estates_equiv(struct smatch_state *one, struct smatch_state *two); -int is_whole_range(struct smatch_state *state); +int estate_is_whole(struct smatch_state *state); struct range_list *estate_ranges(struct smatch_state *state); struct related_list *estate_related(struct smatch_state *state); -- 2.11.4.GIT