mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[mucurses] Fix GCC 6 nonnull-compare errors
Remove null checks for arguments declared as nonnull. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
57d0ea7c46
commit
e2f14c2f8c
@@ -18,9 +18,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
* @ret rc return status code
|
* @ret rc return status code
|
||||||
*/
|
*/
|
||||||
int delwin ( WINDOW *win ) {
|
int delwin ( WINDOW *win ) {
|
||||||
if ( win == NULL )
|
|
||||||
return ERR;
|
|
||||||
|
|
||||||
/* I think we should blank the region covered by the window -
|
/* I think we should blank the region covered by the window -
|
||||||
ncurses doesn't do this, but they have a buffer, so they
|
ncurses doesn't do this, but they have a buffer, so they
|
||||||
may just be deleting from an offscreen context whereas we
|
may just be deleting from an offscreen context whereas we
|
||||||
@@ -51,8 +48,6 @@ int delwin ( WINDOW *win ) {
|
|||||||
WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
|
WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
|
||||||
int begin_y, int begin_x ) {
|
int begin_y, int begin_x ) {
|
||||||
WINDOW *child;
|
WINDOW *child;
|
||||||
if ( parent == NULL )
|
|
||||||
return NULL;
|
|
||||||
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
|
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
if ( ( (unsigned)ncols > parent->width ) ||
|
if ( ( (unsigned)ncols > parent->width ) ||
|
||||||
@@ -75,8 +70,6 @@ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
|
|||||||
*/
|
*/
|
||||||
WINDOW *dupwin ( WINDOW *orig ) {
|
WINDOW *dupwin ( WINDOW *orig ) {
|
||||||
WINDOW *copy;
|
WINDOW *copy;
|
||||||
if ( orig == NULL )
|
|
||||||
return NULL;
|
|
||||||
if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
|
if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
copy->scr = orig->scr;
|
copy->scr = orig->scr;
|
||||||
@@ -99,8 +92,6 @@ WINDOW *dupwin ( WINDOW *orig ) {
|
|||||||
* @ret rc return status code
|
* @ret rc return status code
|
||||||
*/
|
*/
|
||||||
int mvwin ( WINDOW *win, int y, int x ) {
|
int mvwin ( WINDOW *win, int y, int x ) {
|
||||||
if ( win == NULL )
|
|
||||||
return ERR;
|
|
||||||
if ( ( ( (unsigned)y + win->height ) > LINES ) ||
|
if ( ( ( (unsigned)y + win->height ) > LINES ) ||
|
||||||
( ( (unsigned)x + win->width ) > COLS ) )
|
( ( (unsigned)x + win->width ) > COLS ) )
|
||||||
return ERR;
|
return ERR;
|
||||||
@@ -149,8 +140,6 @@ WINDOW *newwin ( int nlines, int ncols, int begin_y, int begin_x ) {
|
|||||||
WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
|
WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
|
||||||
int begin_y, int begin_x ) {
|
int begin_y, int begin_x ) {
|
||||||
WINDOW *child;
|
WINDOW *child;
|
||||||
if ( parent == NULL )
|
|
||||||
return NULL;
|
|
||||||
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
|
if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
|
||||||
return NULL;
|
return NULL;
|
||||||
child = newwin( nlines, ncols, begin_y, begin_x );
|
child = newwin( nlines, ncols, begin_y, begin_x );
|
||||||
|
|||||||
Reference in New Issue
Block a user