Explorar el Código

[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>
tags/v1.20.1
Vinson Lee hace 8 años
padre
commit
e2f14c2f8c
Se han modificado 1 ficheros con 0 adiciones y 11 borrados
  1. 0
    11
      src/hci/mucurses/windows.c

+ 0
- 11
src/hci/mucurses/windows.c Ver fichero

@@ -18,9 +18,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
18 18
  * @ret rc	return status code
19 19
  */
20 20
 int delwin ( WINDOW *win ) {
21
-	if ( win == NULL )
22
-		return ERR;
23
-
24 21
 	/* I think we should blank the region covered by the window -
25 22
 	   ncurses doesn't do this, but they have a buffer, so they
26 23
 	   may just be deleting from an offscreen context whereas we
@@ -51,8 +48,6 @@ int delwin ( WINDOW *win ) {
51 48
 WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
52 49
 	     		  	 int begin_y, int begin_x ) {
53 50
 	WINDOW *child;
54
-	if ( parent == NULL )
55
-		return NULL;
56 51
 	if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
57 52
 		return NULL;
58 53
 	if ( ( (unsigned)ncols > parent->width ) || 
@@ -75,8 +70,6 @@ WINDOW *derwin ( WINDOW *parent, int nlines, int ncols,
75 70
  */
76 71
 WINDOW *dupwin ( WINDOW *orig ) {
77 72
 	WINDOW *copy;
78
-	if ( orig == NULL )
79
-		return NULL;
80 73
 	if ( ( copy = malloc( sizeof( WINDOW ) ) ) == NULL )
81 74
 		return NULL;
82 75
 	copy->scr = orig->scr;
@@ -99,8 +92,6 @@ WINDOW *dupwin ( WINDOW *orig ) {
99 92
  * @ret rc	return status code
100 93
  */
101 94
 int mvwin ( WINDOW *win, int y, int x ) {
102
-	if ( win == NULL )
103
-		return ERR;
104 95
 	if ( ( ( (unsigned)y + win->height ) > LINES ) ||
105 96
 	     ( ( (unsigned)x + win->width ) > COLS ) )
106 97
 		return ERR;
@@ -149,8 +140,6 @@ WINDOW *newwin ( int nlines, int ncols, int begin_y, int begin_x ) {
149 140
 WINDOW *subwin ( WINDOW *parent, int nlines, int ncols,
150 141
 			         int begin_y, int begin_x ) {
151 142
 	WINDOW *child;
152
-	if ( parent == NULL )
153
-		return NULL;
154 143
 	if ( ( child = malloc( sizeof( WINDOW ) ) ) == NULL )
155 144
 		return NULL;
156 145
 	child = newwin( nlines, ncols, begin_y, begin_x );

Loading…
Cancelar
Guardar