[Top][All Lists]

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

Re: wide characters, get_wch() and form_driver() - cannot get them worki

From: Thomas Dickey
Subject: Re: wide characters, get_wch() and form_driver() - cannot get them working together.
Date: Thu, 19 Jun 2008 12:13:54 -0400 (EDT)

On Thu, 19 Jun 2008, Adam Spragg wrote:


On Thursday 19 June 2008 00:37:58 Thomas Dickey wrote:
Using ncurses's trace, I can see that the form_driver is seeing the
parameter passed to it as sign-extended.  That's happening in this

                     if ((i = form_driver(form, buf[j])) != E_OK) {

since 'buf' is a (by default on some platforms) signed char.
A quick check with that changed to unsigned char seems to work.

Ah - that fixes it for me too. Thanks!

I can't see anything about needing to cast the "i" parameter of
form_driver() to "unsigned char" in any of the guides, the FAQ, the

The prototype for form_driver() says it expects an int.

That's because it would normally hold values from 0 on up (and possibly
a -1 for illegal keycode).  So it's not expecting a -63 (a sign-extended
character).  Passing an unsigned char works though.

Thomas E. Dickey

reply via email to

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