[Top][All Lists]

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

Question about the winch function change (5.2 - 5.3)

From: James Long
Subject: Question about the winch function change (5.2 - 5.3)
Date: Wed, 19 Jan 2005 16:56:31 -0800

I hope this is the correct place to send this email to.  Our software uses
ncurses and is running on a redhat enterprise server (fully patched), and
between 5.2 and 5.3, the winch function in ncurses changed.  It used to return
the chtype of the current character position, now it returns  
    returnChar(CharOf(win->_line[win->_cury].text[win->_curx])  | 

For some reason, the above code returns a different value than the original:

It only appears to do this on the alternate character set.  For testing, I
changed the function winch in the 5.3 source from
    returnChar(CharOf(win->_line[win->_cury].text[win->_curx]) |

And did a full build (./configure --with-shared, make, make install).  With
the change, the winch function returns, for example, 6292187, whereas the
original 5.3 code returns 6292016.  I am not sure how the function can return
two different numbers, as the 5.3 code just returns the &'ed chtype with it's
#define ChCharOf(c)    ((c) & (chtype)A_CHARTEXT)
#define ChAttrOf(c)     ((c) & (chtype)A_ATTRIBUTES)

and the 5.2 function just returns (c).

When, in my code, I  call my functions (ch is declared as a chtype):
           ch = mvwinch( pwin, r, c );
           setattrs( ch & (chtype)A_ATTRIBUTES );
           paddescch( ch & (chtype)A_CHARTEXT );

The paddescch function (which just prints the character to an output stream)
doesn't work correctly, as the number (which maps to a character) in the 5.3
code is 48, whereas in the 5.2 code it is 219 (which makes it work the way it
used to).

Are there any known bugs with winch, or did I do a horrible job of explaining
what my problem is and just confuse everyone?

Oh, also, this is for a C program, not C++ if that makes any difference, and I
don't configure with --enable-widec.

Thank you,

James Long
(888) 923-8368 ext. 2220
Fax (310) 241-0011
Advent Resources, Inc

reply via email to

[Prev in Thread] Current Thread [Next in Thread]