Skip to content

Commit

Permalink
(Facepalm) PDC_free_platform_dependent_memory() was completely stupid…
Browse files Browse the repository at this point in the history
…. We already have PDC_scr_free() for exactly that purpose.
  • Loading branch information
Bill-Gray committed Aug 21, 2022
1 parent 150a9f2 commit 60138ca
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 59 deletions.
1 change: 0 additions & 1 deletion curspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ void PDC_scr_free(void);
int PDC_scr_open(void);
void PDC_set_keyboard_binary(bool);
void PDC_transform_line(int, int, int, const chtype *);
void PDC_free_platform_dependent_memory( void);
const char *PDC_sysname(void);

/* Internal cross-module functions */
Expand Down
7 changes: 0 additions & 7 deletions docs/IMPLEMNT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
PDCurses Implementor's Guide
============================

2022/07/06 - added PDC_free_platform_dependent_memory()
- Version 1.6 - 2019/09/?? - added PDC_doupdate(); removed argc, argv,
lines, cols and SP allocation from
PDC_scr_open(); removed PDC_init_pair(),
Expand Down Expand Up @@ -246,12 +245,6 @@ the cursor to the lower left corner. (The X11 port does nothing.)

Free any memory allocated by PDC_scr_open(). Called by delscreen().

### void PDC_free_platform_dependent_memory( void);

Free any platform-specific memory. Called by PDC_free_memory_allocations().
Does nothing (at present) on all platforms except DOS and OS/2. On those,
it frees the initial screen state.

### int PDC_scr_open(void);

The platform-specific part of initscr(). It must initialize acs_map[]
Expand Down
10 changes: 3 additions & 7 deletions dos/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ void PDC_scr_close(void)

void PDC_scr_free(void)
{
if( saved_screen)
free(saved_screen);
saved_screen = NULL;
}

/* open the physical screen -- miscellaneous initialization, may save
Expand Down Expand Up @@ -702,10 +705,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
INTENTIONALLY_UNUSED_PARAMETER( new_min_cols);
INTENTIONALLY_UNUSED_PARAMETER( new_max_cols);
}

void PDC_free_platform_dependent_memory( void)
{
if( saved_screen)
free(saved_screen);
saved_screen = NULL;
}
4 changes: 0 additions & 4 deletions dosvga/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
const int new_min_cols, const int new_max_cols)
{
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions fb/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,3 @@ int PDC_init_color( int color, int red, int green, int blue)
}
return OK;
}

void PDC_free_platform_dependent_memory( void)
{
}
10 changes: 3 additions & 7 deletions os2/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ void PDC_scr_close(void)

void PDC_scr_free(void)
{
if( saved_screen)
free(saved_screen);
saved_screen = NULL;
}

/* open the physical screen -- miscellaneous initialization, may save
Expand Down Expand Up @@ -226,10 +229,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
const int new_min_cols, const int new_max_cols)
{
}

void PDC_free_platform_dependent_memory( void)
{
if( saved_screen)
free(saved_screen);
saved_screen = NULL;
}
1 change: 0 additions & 1 deletion pdcurses/initscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ bool isendwin(void)

void PDC_free_memory_allocations( void)
{
PDC_free_platform_dependent_memory( );
PDC_clearclipboard( );
traceoff( );
delscreen( SP);
Expand Down
4 changes: 0 additions & 4 deletions plan9/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,3 @@ void PDC_scr_free(void)
{
free(SP);
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions sdl1/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,3 @@ void PDC_set_resize_limits( const int new_min_lines,
INTENTIONALLY_UNUSED_PARAMETER( new_max_cols);
return;
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions sdl2/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
INTENTIONALLY_UNUSED_PARAMETER( new_min_cols);
INTENTIONALLY_UNUSED_PARAMETER( new_max_cols);
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions vt/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,3 @@ int PDC_init_color( int color, int red, int green, int blue)
curscr->_clear = TRUE;
return OK;
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions wincon/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
INTENTIONALLY_UNUSED_PARAMETER( new_min_cols);
INTENTIONALLY_UNUSED_PARAMETER( new_max_cols);
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions wingui/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,3 @@ int PDC_init_color( int color, int red, int green, int blue)
PDC_set_palette_entry( color, new_rgb);
return OK;
}

void PDC_free_platform_dependent_memory( void)
{
}
4 changes: 0 additions & 4 deletions x11/pdcscrn.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,3 @@ void PDC_set_resize_limits( const int new_min_lines, const int new_max_lines,
PDC_min_cols = max( new_min_cols, 2);
PDC_max_cols = max( new_max_cols, PDC_min_cols);
}

void PDC_free_platform_dependent_memory( void)
{
}

0 comments on commit 60138ca

Please sign in to comment.