This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 191e24408 graphics/pdcurs34: Fixes for wide char build
191e24408 is described below

commit 191e244082c50730063d53ab8ff53cf3802a08ab
Author: 000exploit <[email protected]>
AuthorDate: Sun Aug 16 21:46:23 2026 +0200

    graphics/pdcurs34: Fixes for wide char build
    
    Signed-off-by: 000exploit <[email protected]>
---
 graphics/pdcurs34/pdcurses/pdc_getstr.c  |  5 ++---
 graphics/pdcurs34/pdcurses/pdc_keyname.c |  4 ++--
 graphics/pdcurs34/pdcurses/pdc_slk.c     |  4 ++--
 graphics/pdcurs34/pdcurses/pdc_util.c    | 14 ++++++++++----
 4 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/graphics/pdcurs34/pdcurses/pdc_getstr.c 
b/graphics/pdcurs34/pdcurses/pdc_getstr.c
index 17bed774b..ea7cf11fe 100644
--- a/graphics/pdcurs34/pdcurses/pdc_getstr.c
+++ b/graphics/pdcurs34/pdcurses/pdc_getstr.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/graphics/pdcurses/pdc_getstr.c
+ * apps/graphics/pdcurs34/pdcurses/pdc_getstr.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -273,7 +273,6 @@ int wgetnstr(WINDOW *win, char *str, int n)
             }
 
           break;
-
         }
 
       wrefresh(win);
@@ -378,7 +377,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n)
   int num;
   int x;
   int chars;
-  char *p;
+  wint_t *p;
   bool stop;
   bool oldecho;
   bool oldcbreak;
diff --git a/graphics/pdcurs34/pdcurses/pdc_keyname.c 
b/graphics/pdcurs34/pdcurses/pdc_keyname.c
index 8a23ddb46..209fb358a 100644
--- a/graphics/pdcurs34/pdcurses/pdc_keyname.c
+++ b/graphics/pdcurs34/pdcurses/pdc_keyname.c
@@ -61,7 +61,7 @@
  * Private Data
  ****************************************************************************/
 
-static const char *key_name[] =
+static const char *names[] =
 {
   "KEY_BREAK", "KEY_DOWN", "KEY_UP", "KEY_LEFT", "KEY_RIGHT",
   "KEY_HOME", "KEY_BACKSPACE", "KEY_F0", "KEY_F(1)", "KEY_F(2)",
@@ -138,7 +138,7 @@ const char *keyname(int key)
       return unctrl((chtype) key);
     }
 
-  return has_key(key) ? key_name[key - KEY_MIN] : "UNKNOWN KEY";
+  return has_key(key) ? names[key - KEY_MIN] : "UNKNOWN KEY";
 }
 
 bool has_key(int key)
diff --git a/graphics/pdcurs34/pdcurses/pdc_slk.c 
b/graphics/pdcurs34/pdcurses/pdc_slk.c
index b53d530e1..ef5132d00 100644
--- a/graphics/pdcurs34/pdcurses/pdc_slk.c
+++ b/graphics/pdcurs34/pdcurses/pdc_slk.c
@@ -55,7 +55,7 @@
  *       These functions manipulate a window that contain Soft Label Keys
  *       (SLK). To use the SLK functions, a call to slk_init() must be
  *       made BEFORE initscr() or newterm(). slk_init() removes 1 or 2
- *       lines from the useable screen, depending on the format selected.
+ *       lines from the usable screen, depending on the format selected.
  *
  *       The line(s) removed from the screen are used as a separate
  *       window, in which SLKs are displayed.
@@ -362,7 +362,7 @@ char *slk_label(int labnum)
 #ifdef CONFIG_PDCURSES_WIDE
   wchar_t *wtemp = slk_wlabel(labnum);
 
-  PDC_wcstombs(temp, wtemp, 32);
+  PDC_wcstombs(slk_temp2, wtemp, 32);
 #else
   chtype *p;
   int i;
diff --git a/graphics/pdcurs34/pdcurses/pdc_util.c 
b/graphics/pdcurs34/pdcurses/pdc_util.c
index 979543efd..9fd466bcf 100644
--- a/graphics/pdcurs34/pdcurses/pdc_util.c
+++ b/graphics/pdcurs34/pdcurses/pdc_util.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/graphics/pdcurses/util.c
+ * apps/graphics/pdcurs34/pdcurses/pdc_util.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
@@ -114,7 +114,10 @@ char *unctrl(chtype c)
 #ifdef CONFIG_PDCURSES_MULTITHREAD
   FAR struct pdc_context_s *ctx = PDC_ctx();
 #else
-  static char strbuf[3] = { 0, 0, 0 };
+  static char strbuf[3] =
+  {
+    0, 0, 0
+  };
 #endif
 
   chtype ic;
@@ -210,7 +213,10 @@ wchar_t *wunctrl(cchar_t *wc)
 #ifdef CONFIG_PDCURSES_MULTITHREAD
   FAR struct pdc_context_s *ctx = PDC_ctx();
 #else
-  static wchar_t strbuf2[3] = { 0, 0, 0 };
+  static wchar_t strbuf2[3] =
+  {
+    0, 0, 0
+  };
 #endif
 
   cchar_t ic;
@@ -223,7 +229,7 @@ wchar_t *wunctrl(cchar_t *wc)
     {
       strbuf2[0] = (wchar_t) ic;
       strbuf2[1] = L'\0';
-      return strbuf;
+      return strbuf2;
     }
 
   strbuf2[0] = '^';              /* '^' prefix */

Reply via email to