env: Drop the ACTION typedef

Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to
both the enum and its members to make it clear that these are related to
the environment.

Add an ENV prefix to these two flags so that it is clear what they relate
to. Also move them to env.h since they are part of the public API. Use an
enum rather than a #define to tie them together.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2019-08-01 09:47:09 -06:00
committed by Tom Rini
parent d3716dd64b
commit 3f0d680745
8 changed files with 31 additions and 31 deletions

View File

@@ -28,7 +28,7 @@ static int htab_fill(struct unit_test_state *uts,
item.data = key;
item.flags = 0;
item.key = key;
ut_asserteq(1, hsearch_r(item, ENTER, &ritem, htab, 0));
ut_asserteq(1, hsearch_r(item, ENV_ENTER, &ritem, htab, 0));
}
return 0;
@@ -48,7 +48,7 @@ static int htab_check_fill(struct unit_test_state *uts,
item.flags = 0;
item.data = key;
item.key = key;
hsearch_r(item, FIND, &ritem, htab, 0);
hsearch_r(item, ENV_FIND, &ritem, htab, 0);
ut_assert(ritem);
ut_asserteq_str(key, ritem->key);
ut_asserteq_str(key, ritem->data);
@@ -71,10 +71,10 @@ static int htab_create_delete(struct unit_test_state *uts,
item.flags = 0;
item.data = key;
item.key = key;
hsearch_r(item, ENTER, &ritem, htab, 0);
hsearch_r(item, ENV_ENTER, &ritem, htab, 0);
ritem = NULL;
hsearch_r(item, FIND, &ritem, htab, 0);
hsearch_r(item, ENV_FIND, &ritem, htab, 0);
ut_assert(ritem);
ut_asserteq_str(key, ritem->key);
ut_asserteq_str(key, ritem->data);