sequencer: remove the 'arg' field from todo_item
authorAlban Gruin <alban.gruin@gmail.com>
Tue, 29 Jan 2019 15:01:46 +0000 (16:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Jan 2019 20:09:24 +0000 (12:09 -0800)
commit6ad656db9b2d2426a0a884b431e8adc9877101bc
tree380e995210735a71810703f59fbe88f3872c4d47
parent5d94d54564fb0dea1f3caf2f1dacb7701f4be25c
sequencer: remove the 'arg' field from todo_item

The 'arg' field of todo_item used to store the address of the first byte
of the parameter of a command in a todo list.  It was associated with
the length of the parameter (the 'arg_len' field).

This replaces the 'arg' field by 'arg_offset'.  This new field does not
store the address of the parameter, but the position of the first
character of the parameter in the buffer.  todo_item_get_arg() is added
to return the address of the parameter of an item.

This will prevent todo_list_add_exec_commands() from having to do awful
pointer arithmetics when growing the todo list buffer.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
sequencer.h