* [PATCH] main: remove static from const strlen
@ 2024-07-12 0:33 dangling .
2024-07-12 16:09 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: dangling . @ 2024-07-12 0:33 UTC (permalink / raw)
To: iwd@lists.linux.dev
From bc0f427f81b5b25f1c706c66e455dc9ea5686266 Mon Sep 17 00:00:00 2001
From: kasper <kasperkantz@outlook.com>
Date: Fri, 12 Jul 2024 00:23:56 +0000
Subject: [PATCH] main: remove static from const strlen To fix this error:
src/p2putil.c: In function 'p2p_get_random_string': src/p2putil.c:2641:37:
error: initializer element is not constant 2641 | static const int
set_size = strlen(CHARSET); |
^~~~~~
---
src/p2putil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/p2putil.c b/src/p2putil.c
index d1f114d0..ef0f988c 100644
--- a/src/p2putil.c
+++ b/src/p2putil.c
@@ -2638,7 +2638,7 @@ void p2p_get_random_string(char *buf, size_t len)
{
#define CHARSET "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" \
"0123456789"
- static const int set_size = strlen(CHARSET);
+ const int set_size = strlen(CHARSET);
l_getrandom(buf, len);
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] main: remove static from const strlen
2024-07-12 0:33 dangling .
@ 2024-07-12 16:09 ` Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2024-07-12 16:09 UTC (permalink / raw)
To: dangling ., iwd@lists.linux.dev
Hi,
On 7/11/24 7:33 PM, dangling . wrote:
> From bc0f427f81b5b25f1c706c66e455dc9ea5686266 Mon Sep 17 00:00:00 2001
> From: kasper <kasperkantz@outlook.com>
I need a full name in order to accept this patch.
> Date: Fri, 12 Jul 2024 00:23:56 +0000
> Subject: [PATCH] main: remove static from const strlen To fix this error:
> src/p2putil.c: In function 'p2p_get_random_string': src/p2putil.c:2641:37:
> error: initializer element is not constant 2641 | static const int
> set_size = strlen(CHARSET); |
> ^~~~~~
>
> ---
> src/p2putil.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Why did you send 3 of the same one?
> diff --git a/src/p2putil.c b/src/p2putil.c
> index d1f114d0..ef0f988c 100644
> --- a/src/p2putil.c
> +++ b/src/p2putil.c
> @@ -2638,7 +2638,7 @@ void p2p_get_random_string(char *buf, size_t len)
> {
> #define CHARSET "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" \
> "0123456789"
> - static const int set_size = strlen(CHARSET);
> + const int set_size = strlen(CHARSET);
>
> l_getrandom(buf, len);
>
> --
> 2.45.2
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] main: remove static from const strlen
@ 2024-07-12 19:32 Kasper Kantz
2024-07-12 21:25 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Kasper Kantz @ 2024-07-12 19:32 UTC (permalink / raw)
To: iwd; +Cc: Kasper Kantz
src/p2putil.c: In function 'p2p_get_random_string':
src/p2putil.c:2641:37: error: initializer element is not constant 2641 |
static const int set_size = strlen(CHARSET); |
^~~~~~
---
src/p2putil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/p2putil.c b/src/p2putil.c
index d1f114d0..ef0f988c 100644
--- a/src/p2putil.c
+++ b/src/p2putil.c
@@ -2638,7 +2638,7 @@ void p2p_get_random_string(char *buf, size_t len)
{
#define CHARSET "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" \
"0123456789"
- static const int set_size = strlen(CHARSET);
+ const int set_size = strlen(CHARSET);
l_getrandom(buf, len);
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] main: remove static from const strlen
2024-07-12 19:32 [PATCH] main: remove static from const strlen Kasper Kantz
@ 2024-07-12 21:25 ` Denis Kenzior
0 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2024-07-12 21:25 UTC (permalink / raw)
To: Kasper Kantz, iwd
Hi Kasper,
On 7/12/24 2:32 PM, Kasper Kantz wrote:
> src/p2putil.c: In function 'p2p_get_random_string':
> src/p2putil.c:2641:37: error: initializer element is not constant 2641 |
> static const int set_size = strlen(CHARSET); |
> ^~~~~~
> ---
> src/p2putil.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
I modified the prefix to read: p2putil: (s/main/p2putil)
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-12 21:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12 19:32 [PATCH] main: remove static from const strlen Kasper Kantz
2024-07-12 21:25 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2024-07-12 0:33 dangling .
2024-07-12 16:09 ` Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox