Merge branch 'dl/flex-str-cocci'

Code clean-up.

* dl/flex-str-cocci:
  cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STR
  midx.c: convert FLEX_ALLOC_MEM to FLEX_ALLOC_STR
This commit is contained in:
Junio C Hamano 2019-04-22 11:14:47 +09:00
commit 5f65d7d9bc
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,13 @@
@@
expression str;
identifier x, flexname;
@@
- FLEX_ALLOC_MEM(x, flexname, str, strlen(str));
+ FLEX_ALLOC_STR(x, flexname, str);
@@
expression str;
identifier x, ptrname;
@@
- FLEXPTR_ALLOC_MEM(x, ptrname, str, strlen(str));
+ FLEXPTR_ALLOC_STR(x, ptrname, str);

2
midx.c
View File

@ -71,7 +71,7 @@ struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local
midx_map = xmmap(NULL, midx_size, PROT_READ, MAP_PRIVATE, fd, 0);
FLEX_ALLOC_MEM(m, object_dir, object_dir, strlen(object_dir));
FLEX_ALLOC_STR(m, object_dir, object_dir);
m->fd = fd;
m->data = midx_map;
m->data_len = midx_size;