Re: [PATCH v1 02/12] rebase: don't translate trace strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phillip Wood <phillip.wood123@xxxxxxxxx> writes:

> From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
>
> commit b3a5d5a80c ("trace2:data: add subverb for rebase", 2019-02-22)
> mistakenly marked the subverb names for translation and unnecessarily
> NULL terminated the array.
>
> Signed-off-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
> ---
>  builtin/rebase.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index 52114cbf0d..239a54ecfe 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -1027,14 +1027,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
>  		ACTION_EDIT_TODO,
>  		ACTION_SHOW_CURRENT_PATCH,
>  	} action = NO_ACTION;
> -	static const char *action_names[] = { N_("undefined"),
> -					      N_("continue"),
> -					      N_("skip"),
> -					      N_("abort"),
> -					      N_("quit"),
> -					      N_("edit_todo"),
> -					      N_("show_current_patch"),
> -					      NULL };
> +	static const char *action_names[] = { "undefined",
> +					      "continue",
> +					      "skip",
> +					      "abort",
> +					      "quit",
> +					      "edit_todo",
> +					      "show_current_patch" };

That's an improvement independent from the rest of the patches.

Now we've had the C99 designated initialisers weather balloon
changes for some time in our codebase, perhaps we can ensure that
these entries match the intended & corresponding "enum action"
constants?  If we can also ensure that the array is large enough so
that the trace2 call done like so

	trace2_cmd_mode(action_names[action])

is safe, that would be good, but that is secondary.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux