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 18:34:07 -0400
User-agent: Mozilla Thunderbird

On 7/26/24 16:36, Thomas Dickey wrote:> But the prototype (X/Open) uses "int", and this causes warnings in the
stricter builds:

Took me a little while to see why I didn't encounter that : my builds were using the macro definitions for those functions. Add -DNCURSES_NOMACROS, and hey presto, I get those warnings. (Interestingly, I see that PDCurses* has those functions take attr_t values rather than integers.)

   Changing,  for example,

wattron(menu->win, (int)menu->back);

   to

wattr_on(menu->win, menu->back, NULL);

   appears to get around this obstacle,  resulting in the following patch.

-- Bill

--- /tmp/m_post.c       2022-09-24 05:38:44.000000000 -0400
+++ m_post.c    2024-07-26 18:29:07.282558879 -0400
@@ -70 +70 @@
-  wattron(menu->win, (int)menu->back);
+  wattr_on(menu->win, menu->back, NULL);
@@ -82 +82 @@
-             wattron(menu->win, (int)menu->fore);
+             wattr_on(menu->win, menu->fore, NULL);
@@ -88 +88 @@
-             wattron(menu->win, (int)menu->fore);
+             wattr_on(menu->win, menu->fore, NULL);
@@ -96 +96 @@
-  wattroff(menu->win, (int)menu->back);
+  wattr_off(menu->win, menu->back, NULL);
@@ -104 +104 @@
-      wattron(menu->win, (int)menu->grey);
+      wattr_on(menu->win, menu->grey, NULL);
@@ -111 +111 @@
-         wattron(menu->win, (int)menu->fore);
+         wattr_on(menu->win, menu->fore, NULL);
@@ -116 +116 @@
-         wattron(menu->win, (int)menu->back);
+         wattr_on(menu->win, menu->back, NULL);
@@ -162 +162 @@
-           wattroff(menu->win, (int)menu->grey);
+           wattr_off(menu->win, menu->grey, NULL);
@@ -164,2 +164,2 @@
-           wattroff(menu->win, (int)menu->fore);
-         wattron(menu->win, (int)menu->back);
+           wattr_off(menu->win, menu->fore, NULL);
+         wattr_on(menu->win, menu->back, NULL);
@@ -179 +179 @@
-           wattroff(menu->win, (int)menu->back);
+           wattr_off(menu->win, menu->back, NULL);
@@ -185 +185 @@
-    wattroff(menu->win, (int)menu->fore);
+    wattr_off(menu->win, menu->fore, NULL);
@@ -187 +187 @@
-    wattroff(menu->win, (int)menu->back);
+    wattr_off(menu->win, menu->back, NULL);
@@ -189 +189 @@
-    wattroff(menu->win, (int)menu->grey);
+    wattr_off(menu->win, menu->grey, NULL);
@@ -234 +234 @@
-             wattron(menu->win, (int)menu->back);
+             wattr_on(menu->win, menu->back, NULL);
@@ -253 +253 @@
-         wattroff(menu->win, (int)menu->back);
+         wattr_off(menu->win, menu->back, NULL);



reply via email to

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