]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/widechar/lib_add_wch.c
ncurses 5.7 - patch 20100403
[ncurses.git] / ncurses / widechar / lib_add_wch.c
index c1c565c13436b757fca7ea344365ad0f35087ac6..eada2f19c4f3add534e325f6ae82ef9e58ba99f7 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004-2006,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 2004-2009,2010 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.7 2009/07/04 21:59:25 tom Exp $")
+MODULE_ID("$Id: lib_add_wch.c,v 1.10 2010/03/31 23:38:02 tom Exp $")
 
 /* clone/adapt lib_addch.c */
 static const cchar_t blankchar = NewChar(BLANK_TEXT);
@@ -81,12 +81,6 @@ render_char(WINDOW *win, cchar_t ch)
            if ((pair = GET_WINDOW_PAIR(win)) == 0)
                pair = GetPair(win->_nc_bkgd);
        }
-#if 0
-       if (pair > 255) {
-           cchar_t fixme = ch;
-           SetPair(fixme, pair);
-       }
-#endif
        AddAttr(ch, (a & COLOR_MASK(AttrOf(ch))));
        SetPair(ch, pair);
     }
@@ -308,6 +302,9 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch)
     NCURSES_SIZE_T x, y;
     wchar_t *s;
     int tabsize = 8;
+#if USE_REENTRANT
+    SCREEN *sp = _nc_screen_of(win);
+#endif
 
     /*
      * If we are using the alternate character set, forget about locale.
@@ -328,7 +325,7 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch)
     switch (CharOf(ch)) {
     case '\t':
 #if USE_REENTRANT
-       tabsize = sp->_TABSIZE;
+       tabsize = *ptrTabsize(sp);
 #else
        tabsize = TABSIZE;
 #endif
@@ -412,7 +409,8 @@ wadd_wch(WINDOW *win, const cchar_t *wch)
 {
     int code = ERR;
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win,
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"),
+                                     (void *) win,
                                      _tracecchar_t(wch)));
 
     if (win && (wadd_wch_nosync(win, *wch) != ERR)) {
@@ -429,7 +427,8 @@ wecho_wchar(WINDOW *win, const cchar_t *wch)
 {
     int code = ERR;
 
-    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), win,
+    TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"),
+                                     (void *) win,
                                      _tracecchar_t(wch)));
 
     if (win && (wadd_wch_nosync(win, *wch) != ERR)) {