Skip to content

Commit

Permalink
make panel_hidden portable
Browse files Browse the repository at this point in the history
fixing #325 while being a breaking change returning TRUE (1) and FALSE (0) instead of OK (0) and ERR (-1)
  • Loading branch information
GitMensch committed Dec 31, 2024
1 parent a5f13c2 commit d86f81a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 0 additions & 4 deletions demos/test_pan.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,7 @@ int main( const int argc, const char **argv)
case 9:
if( curr_top)
{
#ifdef __PDCURSES__
if( panel_hidden( curr_top) == OK)
#else
if( panel_hidden( curr_top) == TRUE)
#endif
show_panel( curr_top);
else
hide_panel( curr_top);
Expand Down
8 changes: 7 additions & 1 deletion docs/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Generally speaking, this history mentions only the more significant
changes. See the git log for full details.

Current PDCursesMod - 2024 Oct 28
Current PDCursesMod - 2024 Dec 31
=================================

Major new features
Expand Down Expand Up @@ -54,6 +54,8 @@ Minor new features
arbitrarily long strings via recursion. Added some code to test this
in 'show_col.c'. 3f8dfa9e06 18ef78de69

- PDC_wcwidth( ) updated from Unicode 14.0.0 to 16.0.0 93e32ef a5f13c2

Bug fixes
---------

Expand Down Expand Up @@ -119,6 +121,10 @@ Bug fixes
- Fixes for Borland Turbo C compilation. a59f452e78 26128c29aa
d6b7e998eb

- panel_hidden() is now portable, returning TRUE (1) and FALSE (0) instead
of OK (0) and ERR (-1) This may break existing applications, so you possibly
want to check for the PDCurses version number / date.

PDCursesMod 4.4.0 - 2023 November 30
===================================

Expand Down
6 changes: 3 additions & 3 deletions pdcurses/panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ panel
ceiling_panel() returns a pointer to the top panel in the deck.
panel_hidden() returns OK if pan is hidden and ERR if it is not.
panel_hidden() returns TRUE if pan is hidden, FALSE if not and
ERR if pan is NULL.
panel_userptr() - Each panel has a user pointer available for
maintaining relevant information. This function returns a pointer to
Expand Down Expand Up @@ -430,11 +431,10 @@ PANEL *ground_panel( SCREEN *sp)

int panel_hidden(const PANEL *pan)
{
assert( pan);
if (!pan)
return ERR;

return _panel_is_linked(pan) ? ERR : OK;
return _panel_is_linked(pan) ? FALSE : TRUE;
}

const void *panel_userptr(const PANEL *pan)
Expand Down

0 comments on commit d86f81a

Please sign in to comment.