estate: rename is_whole_range() to estate_is_whole()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 11 Jan 2013 12:12:56 +0000 (11 15:12 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 11 Jan 2013 12:12:56 +0000 (11 15:12 +0300)
Also I moved the function from smatch_extra.c to smatch_estate.c.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_overflow.c
smatch_estate.c
smatch_extra.c
smatch_extra.h

index b75eabd..4cbb7c1 100644 (file)
@@ -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;
                }
 
index 14cac1e..4bc0152 100644 (file)
@@ -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;
index d341ed8..194b545 100644 (file)
@@ -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());
index 2e4d04e..32ce915 100644 (file)
@@ -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);