cocci: apply "pending" index-compatibility to "t/helper/*.c"

Apply the "index-compatibility.pending.cocci" rule to the "t/helper/*"
directory, a subsequent commit will extend cache.h to further narrow
down the use of "USE_THE_INDEX_COMPATIBILITY_MACROS" in this area.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2022-11-19 14:07:35 +01:00
committed by Junio C Hamano
parent dc594180d9
commit 0ea414a14d
8 changed files with 21 additions and 20 deletions

View File

@ -32,7 +32,7 @@ static void dump_run(void)
struct dir_entry *dir;
struct cache_entry *ce;
read_cache();
repo_read_index(the_repository);
if (single) {
test_lazy_init_name_hash(&the_index, 0);
} else {
@ -49,7 +49,7 @@ static void dump_run(void)
ent /* member name */)
printf("name %08x %s\n", ce->ent.hash, ce->name);
discard_cache();
discard_index(&the_index);
}
/*
@ -66,7 +66,7 @@ static uint64_t time_runs(int try_threaded)
for (i = 0; i < count; i++) {
t0 = getnanotime();
read_cache();
repo_read_index(the_repository);
t1 = getnanotime();
nr_threads_used = test_lazy_init_name_hash(&the_index, try_threaded);
t2 = getnanotime();
@ -89,7 +89,7 @@ static uint64_t time_runs(int try_threaded)
the_index.cache_nr);
fflush(stdout);
discard_cache();
discard_index(&the_index);
}
avg = sum / count;
@ -113,9 +113,9 @@ static void analyze_run(void)
int i;
int nr;
read_cache();
repo_read_index(the_repository);
cache_nr_limit = the_index.cache_nr;
discard_cache();
discard_index(&the_index);
nr = analyze;
while (1) {
@ -128,23 +128,23 @@ static void analyze_run(void)
nr = cache_nr_limit;
for (i = 0; i < count; i++) {
read_cache();
repo_read_index(the_repository);
the_index.cache_nr = nr; /* cheap truncate of index */
t1s = getnanotime();
test_lazy_init_name_hash(&the_index, 0);
t2s = getnanotime();
sum_single += (t2s - t1s);
the_index.cache_nr = cache_nr_limit;
discard_cache();
discard_index(&the_index);
read_cache();
repo_read_index(the_repository);
the_index.cache_nr = nr; /* cheap truncate of index */
t1m = getnanotime();
nr_threads_used = test_lazy_init_name_hash(&the_index, 1);
t2m = getnanotime();
sum_multi += (t2m - t1m);
the_index.cache_nr = cache_nr_limit;
discard_cache();
discard_index(&the_index);
if (!nr_threads_used)
printf(" [size %8d] [single %f] non-threaded code path used\n",