Browse Source

[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 8 years ago
parent
commit
e2f14c2f8c
1 changed files with 0 additions and 11 deletions
  1. 0
    11
      src/hci/mucurses/windows.c

+ 0
- 11
src/hci/mucurses/windows.c View File

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

Loading…
Cancel
Save