diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-02-23 13:01:53 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2018-02-23 13:01:53 +0000 |
commit | b7718c339dde99eb2f4bf2e8a4cdabfc3acf9d6c (patch) | |
tree | 92d313f21c843f56ef4dd64594a4f51ccd82804c /usr/src/lib/libcurses/screen | |
parent | 4f5bbb4c37e2dca7b0722f89c8dfe13be1fbc131 (diff) | |
parent | cf421650297f304644a9fe84c51540de5823fe84 (diff) | |
download | illumos-joyent-b7718c339dde99eb2f4bf2e8a4cdabfc3acf9d6c.tar.gz |
[illumos-gate merge]
commit cf421650297f304644a9fe84c51540de5823fe84
9160 libtecla: this statement may fall through
commit 38a641c5970af3d16902370fb738a6792620e1bf
9155 pkcs11: this statement may fall through
commit d7fdecd2374114124f192b3bfc84d2d294bb45ab
9154 libldap5: this statement may fall through
commit e10a6edabdc38e5fd1d9da6a6a54774a41f91b22
9152 loader: allow comma in variable names
commit e501678557789347eedf20b9e0f9a5014f56f18d
9151 libdhcputil: this statement may fall through
commit 48122e8f03678c2b5a9cea6e9c4d4d2629c5a13f
9148 sun_sas: this statement may fall through
commit 69b2e41e53282c11528827637e627614e2af615b
9147 sun_sas: comparison between pointer and zero character constant
commit 59ee40951f56cfa1c0e6c5c6aeea10605267116a
9138 libcurses: this statement may fall through
Diffstat (limited to 'usr/src/lib/libcurses/screen')
-rw-r--r-- | usr/src/lib/libcurses/screen/scr_reset.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/usr/src/lib/libcurses/screen/scr_reset.c b/usr/src/lib/libcurses/screen/scr_reset.c index 5d5a359fbf..490863c2e0 100644 --- a/usr/src/lib/libcurses/screen/scr_reset.c +++ b/usr/src/lib/libcurses/screen/scr_reset.c @@ -37,8 +37,6 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /*LINTLIBRARY*/ #include "curses_inc.h" @@ -97,13 +95,13 @@ scr_reset(FILE *filep, int type) } /* check magic number */ - if (fread((char *) &magic, sizeof (short), 1, filep) != 1) + if (fread((char *)&magic, sizeof (short), 1, filep) != 1) goto err; if (magic != SVR3_DUMP_MAGIC_NUMBER) goto err; /* get modification time of image in file */ - if (fread((char *) &ttytime, sizeof (time_t), 1, filep) != 1) + if (fread((char *)&ttytime, sizeof (time_t), 1, filep) != 1) goto err; if ((type != 1) && ((ttyname(cur_term->Filedes) == NULL) || @@ -128,13 +126,13 @@ scr_reset(FILE *filep, int type) ((type == 2) && ((win1 = dupwin(win)) == NULL)) || (win->_maxy != curscr->_maxy) || (win->_maxx != curscr->_maxx) || /* soft labels */ - (fread((char *) &magic, sizeof (int), 1, filep) != 1)) + (fread((char *)&magic, sizeof (int), 1, filep) != 1)) goto err; /* - * if soft labels were dumped, we would like either read them - * or advance the file pointer pass them - */ + * if soft labels were dumped, we would like either read them + * or advance the file pointer pass them + */ if (magic) { short i, labmax, lablen; SLK_MAP *slk = SP->slk; @@ -144,10 +142,10 @@ scr_reset(FILE *filep, int type) */ /* * char **labdis = SP->slk->_ldis, **labval = SP->slk->_lval; - */ + */ - if ((fread((char *) &labmax, sizeof (short), 1, filep) != 1) || - (fread((char *) &lablen, sizeof (short), 1, filep) != 1)) { + if ((fread((char *)&labmax, sizeof (short), 1, filep) != 1) || + (fread((char *)&lablen, sizeof (short), 1, filep) != 1)) { goto err; } @@ -162,7 +160,7 @@ scr_reset(FILE *filep, int type) * filep) != lablen) || * (fread(labval[i], sizeof (char), lablen, * filep != lablen)) - */ + */ if ((fread(slk->_ldis[i], sizeof (char), lablen, filep) != lablen) || (fread(slk->_lval[i], @@ -172,7 +170,7 @@ scr_reset(FILE *filep, int type) } (*_do_slk_tch)(); } else { - if (fseek(filep, (long) (2 * labmax * lablen * + if (fseek(filep, (long)(2 * labmax * lablen * sizeof (char)), 1) != 0) goto err; } @@ -180,7 +178,7 @@ scr_reset(FILE *filep, int type) /* read the color information(if any) from the file */ - if (fread((char *) &magic, sizeof (int), 1, filep) != 1) + if (fread((char *)&magic, sizeof (int), 1, filep) != 1) goto err; if (magic) { @@ -196,15 +194,15 @@ scr_reset(FILE *filep, int type) /* new terminal doesn't support color, in order to know how to */ /* deal with the rest of the file */ - if ((fread((char *) &colors, sizeof (int), 1, filep) != 1) || - (fread((char *) &color_pairs, sizeof (int), 1, - filep) != 1) || (fread((char *) &could_change, + if ((fread((char *)&colors, sizeof (int), 1, filep) != 1) || + (fread((char *)&color_pairs, sizeof (int), 1, + filep) != 1) || (fread((char *)&could_change, sizeof (char), 1, filep) != 1)) goto err; if (max_pairs == -1 || cur_term->_pairs_tbl == NULL || colors > max_colors || color_pairs > max_pairs) { - if (fseek(filep, (long) (colors * sizeof (_Color) + + if (fseek(filep, (long)(colors * sizeof (_Color) + color_pairs * sizeof (_Color_pair)), 1) != 0) goto err; } else { @@ -237,7 +235,7 @@ scr_reset(FILE *filep, int type) /* the old terminal could modify colors, by the new one */ /* cannot skip over color_table info. */ - if (fseek(filep, (long) (colors * + if (fseek(filep, (long)(colors * sizeof (_Color)), 1) != 0) goto err; } @@ -265,7 +263,7 @@ err: if (ptp->init) /* LINTED */ (void) init_pair((short)i, - ptp->foreground, ptp->background); + ptp->foreground, ptp->background); } free(save_ptp); } @@ -289,7 +287,7 @@ err: /* clear the hash table */ for (y = curscr->_maxy; y > 0; --y) *hash++ = _NOHASH; - /* LINTED */ /* Known fall-through on case statement. */ + /* FALLTHROUGH */ case 0: { int saveflag = curscr->_flags & _CANT_BE_IMMED; |