Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 1/6] zle.textobjects: Mark variables as const
- X-seq: zsh-workers 52440
- From: Jörg Sommer <joerg@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Cc: Jörg Sommer <joerg@xxxxxxxx>
- Subject: [PATCH 1/6] zle.textobjects: Mark variables as const
- Date: Mon, 1 Jan 2024 19:10:16 +0100
- Archived-at: <https://zsh.org/workers/52440>
- In-reply-to: <20240101182608.432886-1-joerg@jo-so.de>
- List-id: <zsh-workers.zsh.org>
- References: <20240101182608.432886-1-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/textobjects.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Src/Zle/textobjects.c b/Src/Zle/textobjects.c
index c93777b65..a68c5296e 100644
--- a/Src/Zle/textobjects.c
+++ b/Src/Zle/textobjects.c
@@ -283,9 +283,9 @@ selectargument(UNUSED(char **args))
free(linein);
if (IS_THINGY(bindk, selectinshellword)) {
- ZLE_CHAR_T *match = ZWS("`\'\"");
- ZLE_CHAR_T *lmatch = ZWS("\'({"), *rmatch = ZWS("\')}");
- ZLE_CHAR_T *ematch = match, *found;
+ const ZLE_CHAR_T *match = ZWS("`\'\"");
+ const ZLE_CHAR_T *lmatch = ZWS("\'({"), *rmatch = ZWS("\')}");
+ const ZLE_CHAR_T *ematch = match, *found;
int start, end = zlecs;
/* for 'in' widget, don't include initial blanks ... */
while (mark < zlecs && ZC_iblank(zleline[mark]))
--
2.43.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author