bug-ncurses
[Top][All Lists]
Advanced

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

Re: Portable menu and forms libraries


From: Bill Gray
Subject: Re: Portable menu and forms libraries
Date: Fri, 26 Jul 2024 12:18:51 -0400
User-agent: Mozilla Thunderbird

Follow-up re :

On 7/25/24 22:16, Bill Gray wrote:
(I did have to use 32-bit chtypes;  the default PDCursesMod 64-bit chtypes got their upper half stripped,  resulting in default-color menus.  Haven't puzzled that one out yet...)

Turns out to be simple enough : menu/m_post.c has many calls to wattron()/wattroff() that cast the second parameter to int. This, despite the parameter in question being a chtype, so it's getting cast to int and back to chtype. If chtype is larger than an int, upper bits are lost. (I'm surprised I didn't get a warning about that, despite using -Wall -Wextra -pedantic -Werror.)

The attached patch fixes the problem (basically, removes "(int)" over and over and over from m_post.c.)

I think with this fix, plus the 'StdScreen' one-line fix mentioned in my previous e-mail, the menu library can be considered portable to other curses implementations without further modifications.

-- Bill

Attachment: patch
Description: Text document


reply via email to

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