diff options
| author | Michael Brown | 2006-12-18 22:11:30 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-18 22:11:30 +0100 |
| commit | 1f74fa2cada55ac2034b3320d6d292c49d6d794c (patch) | |
| tree | 369213d6cbb7b99ff50a7bdace0e5f2153ce3a1b /src | |
| parent | Convert _{store,restore}_cursor_pos to static inlines. (diff) | |
| download | ipxe-1f74fa2cada55ac2034b3320d6d292c49d6d794c.tar.gz ipxe-1f74fa2cada55ac2034b3320d6d292c49d6d794c.tar.xz ipxe-1f74fa2cada55ac2034b3320d6d292c49d6d794c.zip | |
Remove some unnecessary use of calloc() for tiny memory areas.
Diffstat (limited to 'src')
| -rw-r--r-- | src/hci/mucurses/slk.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/hci/mucurses/slk.c b/src/hci/mucurses/slk.c index 36063a0b7..a13164f28 100644 --- a/src/hci/mucurses/slk.c +++ b/src/hci/mucurses/slk.c @@ -19,7 +19,7 @@ struct _softlabel { 1: centre justify 2: right justify */ - unsigned short fmt; + unsigned int fmt; }; struct _softlabelkeys { @@ -31,12 +31,12 @@ struct _softlabelkeys { 2: 4-4-4 3: 4-4-4 with index line */ - unsigned short fmt; - unsigned short max_label_len; - unsigned short maj_space_len; - unsigned short num_labels; - unsigned short num_spaces; - unsigned short *spaces; + unsigned int fmt; + unsigned int max_label_len; + unsigned int maj_space_len; + unsigned int num_labels; + unsigned int num_spaces; + unsigned int spaces[2]; }; struct _softlabelkeys *slks; @@ -236,19 +236,16 @@ int slk_init ( int fmt ) { switch(fmt) { case 0: nblocks = 8; nmaj = 2; nmin = 5; - slks->spaces = calloc(2, sizeof(unsigned short)); slks->spaces[0] = 2; slks->spaces[1] = 4; break; case 1: nblocks = 8; nmaj = 1; nmin = 6; - slks->spaces = calloc(1, sizeof(unsigned short)); slks->spaces[0] = 3; break; case 2: // same allocations as format 3 case 3: nblocks = 12; nmaj = 2; nmin = 9; - slks->spaces = calloc(2, sizeof(unsigned short)); slks->spaces[0] = 3; slks->spaces[1] = 7; break; default: @@ -290,7 +287,7 @@ char* slk_label ( int labnum ) { * @ret rc return status code */ int slk_restore ( void ) { - unsigned short i, j, + unsigned int i, j, *next_space, *last_space; chtype space_ch; |
