[Bf-blender-cvs] [797820fc208] master: Cleanup: replace wchar_t with char32_t 3D text accent input

Campbell Barton noreply at git.blender.org
Thu Jul 23 06:05:11 CEST 2020


Commit: 797820fc208a65de97ef85f18a8611f26c7e8a0a
Author: Campbell Barton
Date:   Thu Jul 23 12:39:03 2020 +1000
Branches: master
https://developer.blender.org/rB797820fc208a65de97ef85f18a8611f26c7e8a0a

Cleanup: replace wchar_t with char32_t 3D text accent input

===================================================================

M	source/blender/editors/curve/editfont.c

===================================================================

diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index a89b352630b..d78c543f94b 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -76,9 +76,9 @@ static int kill_selection(Object *obedit, int ins);
 /** \name Internal Utilities
  * \{ */
 
-static wchar_t findaccent(wchar_t char1, uint code)
+static char32_t findaccent(char32_t char1, uint code)
 {
-  wchar_t new = 0;
+  char32_t new = 0;
 
   if (char1 == 'a') {
     if (code == '`') {
@@ -1661,7 +1661,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event)
   uintptr_t ascii = event->ascii;
   int alt = event->alt, shift = event->shift, ctrl = event->ctrl;
   int event_type = event->type, event_val = event->val;
-  wchar_t inserted_text[2] = {0};
+  char32_t inserted_text[2] = {0};
 
   if (RNA_struct_property_is_set(op->ptr, "text")) {
     return insert_text_exec(C, op);
@@ -1733,7 +1733,7 @@ static int insert_text_invoke(bContext *C, wmOperator *op, const wmEvent *event)
     /* store as utf8 in RNA string */
     char inserted_utf8[8] = {0};
 
-    BLI_strncpy_wchar_as_utf8(inserted_utf8, inserted_text, sizeof(inserted_utf8));
+    BLI_str_utf32_as_utf8(inserted_utf8, inserted_text, sizeof(inserted_utf8));
     RNA_string_set(op->ptr, "text", inserted_utf8);
   }
 
@@ -1876,7 +1876,7 @@ void ED_curve_editfont_make(Object *obedit)
     ef->textbufinfo = MEM_callocN((MAXTEXT + 4) * sizeof(CharInfo), "texteditbufinfo");
   }
 
-  /* Convert the original text to wchar_t */
+  /* Convert the original text to chat32_t. */
   len_char32 = BLI_str_utf8_as_utf32(ef->textbuf, cu->str, MAXTEXT + 4);
   BLI_assert(len_char32 == cu->len_char32);
   ef->len = len_char32;



More information about the Bf-blender-cvs mailing list