]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/widechar/lib_add_wch.c
ncurses 6.1 - patch 20191019
[ncurses.git] / ncurses / widechar / lib_add_wch.c
index 38d3130a54c422550e5686edc2eda0d7ab94e4e6..c780466f72a93c3ea92e374d880aa6ea66d803e5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 2004-2016,2019 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 #include <wctype.h>
 #endif
 
-MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $")
+MODULE_ID("$Id: lib_add_wch.c,v 1.15 2019/05/04 20:31:31 tom Exp $")
 
 /* clone/adapt lib_addch.c */
 static const cchar_t blankchar = NewChar(BLANK_TEXT);
@@ -55,7 +55,7 @@ static const cchar_t blankchar = NewChar(BLANK_TEXT);
  */
 
 /* Return bit mask for clearing color pair number if given ch has color */
-#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0))
+#define COLOR_MASK(ch) (~(attr_t)(((ch) & A_COLOR) ? A_COLOR : 0))
 
 static NCURSES_INLINE cchar_t
 render_char(WINDOW *win, cchar_t ch)
@@ -114,7 +114,7 @@ render_char(WINDOW *win, cchar_t ch)
 #endif
 
 static bool
-newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos)
+newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T *ypos)
 {
     bool result = FALSE;
 
@@ -195,7 +195,7 @@ wadd_wch_literal(WINDOW *win, cchar_t ch)
      * adjustments.
      */
     {
-       int len = wcwidth(CharOf(ch));
+       int len = _nc_wacs_width(CharOf(ch));
        int i;
        int j;
        wchar_t *chars;