[gtk/gtk-3-24: 1/2] Hoist iterator variable definition outside of for loop




commit fa68804a5bd8d6a72028e4a82099dbdb8ef75cb1
Author: Mosè Giordano <mose gnu org>
Date:   Fri May 7 12:11:08 2021 +0100

    Hoist iterator variable definition outside of for loop
    
    This is compliant with pre-C99 standard.

 modules/input/imwayland.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/modules/input/imwayland.c b/modules/input/imwayland.c
index cf0b1e2144..9a12b21f6b 100644
--- a/modules/input/imwayland.c
+++ b/modules/input/imwayland.c
@@ -494,12 +494,13 @@ tweak_preedit (const char *text)
 {
   GString *s;
   guint len;
+  const char *p;
 
   s = g_string_new ("");
 
   len = g_utf8_strlen (text, -1);
 
-  for (const char *p = text; *p; p = g_utf8_next_char (p))
+  for (p = text; *p; p = g_utf8_next_char (p))
     {
       gunichar ch = g_utf8_get_char (p);
 


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