Re: [hackers] [dwm][PATCH] config.def.h: make keys and buttons const

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri, 19 Aug 2022 11:55:59 +0200

On Thu, Aug 18, 2022 at 10:13:08PM +0600, NRK wrote:
> pretty much all other variables are declared as const when they're not
> modified.
> ---
> config.def.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/config.def.h b/config.def.h
> index f4cd153..ecf2bc2 100644
> --- a/config.def.h
> +++ b/config.def.h
> _AT_@ -64,7 +64,7 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
> static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
> static const char *termcmd[] = { "st", NULL };
>
> -static Key keys[] = {
> +static const Key keys[] = {
> /* modifier key function argument */
> { MODKEY, XK_p, spawn, {.v = dmenucmd } },
> { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
> _AT_@ -103,7 +103,7 @@ static Key keys[] = {
>
> /* button definitions */
> /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
> -static Button buttons[] = {
> +static const Button buttons[] = {
> /* click event mask button function argument */
> { ClkLtSymbol, 0, Button1, setlayout, {0} },
> { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
> --
> 2.35.1
>
>

Applied, thank you :)

-- 
Kind regards,
Hiltjo
Received on Fri Aug 19 2022 - 11:55:59 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 19 2022 - 12:00:38 CEST