zsh-workers
 help / color / mirror / code / Atom feed
From: "Jörg Sommer" <joerg@jo-so.de>
To: zsh-workers@zsh.org
Cc: "Jörg Sommer" <joerg@jo-so.de>
Subject: [PATCH 3/6] zle_vi: Mark variables with const init as const
Date: Mon,  1 Jan 2024 19:10:18 +0100	[thread overview]
Message-ID: <7dab35d424523f5749e78edd48fa6297680ae778.1704132620.git.joerg@jo-so.de> (raw)
In-Reply-To: <8a1e39c6b8f061ce6d2e37c86e6d889309250f13.1704132620.git.joerg@jo-so.de>

Because these variables are initialized with as constant string, they should
be marked as *const* to make the compiler running with `-Wwrite-strings`
more happy.
---
 Src/Zle/zle_vi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 24d9de6ea..6692df830 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -1014,7 +1014,7 @@ int
 visetbuffer(char **args)
 {
     ZLE_INT_T ch;
-    ZLE_CHAR_T *match = ZWS("_*+");
+    const ZLE_CHAR_T *match = ZWS("_*+");
     int registermod[] = { MOD_NULL, MOD_PRI, MOD_CLIP };
     ZLE_CHAR_T *found;
 
-- 
2.43.0



  parent reply	other threads:[~2024-01-01 18:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-01 18:10 Extend usage of const char* Jörg Sommer
2024-01-01 18:10 ` [PATCH 1/6] zle.textobjects: Mark variables as const Jörg Sommer
2024-01-01 18:10   ` [PATCH 2/6] lex: Mark variables with const init " Jörg Sommer
2024-01-26  7:39     ` Oliver Kiddle
2024-01-27  6:41       ` Jörg Sommer
2024-01-28  0:18         ` Oliver Kiddle
2024-01-01 18:10   ` Jörg Sommer [this message]
2024-01-01 18:10   ` [PATCH 4/6] zle_main: mark statusline " Jörg Sommer
2024-01-01 18:10   ` [PATCH 5/6] module: Mark name argument of some functions const Jörg Sommer
2024-01-01 18:10   ` [PATCH 6/6] zsh: mark hookdef.name as const Jörg Sommer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7dab35d424523f5749e78edd48fa6297680ae778.1704132620.git.joerg@jo-so.de \
    --to=joerg@jo-so.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).