scan-build: remove dead stores

This commit is contained in:
nick black 2020-12-13 02:43:49 -05:00
parent 228bd17237
commit 33862979da
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
4 changed files with 5 additions and 6 deletions

View File

@ -1790,7 +1790,7 @@ cells_load_box(struct ncplane* n, uint32_t style, uint64_t channels,
if((ulen = cell_prime(n, ll, gclusters += ulen, style, channels)) > 0){
if((ulen = cell_prime(n, lr, gclusters += ulen, style, channels)) > 0){
if((ulen = cell_prime(n, hl, gclusters += ulen, style, channels)) > 0){
if((ulen = cell_prime(n, vl, gclusters += ulen, style, channels)) > 0){
if(cell_prime(n, vl, gclusters + ulen, style, channels) > 0){
return 0;
}
cell_release(n, hl);

View File

@ -2192,7 +2192,7 @@ cells_load_box(struct ncplane* n, uint32_t styles, uint64_t channels,
if((ulen = cell_prime(n, ll, gclusters += ulen, styles, channels)) > 0){
if((ulen = cell_prime(n, lr, gclusters += ulen, styles, channels)) > 0){
if((ulen = cell_prime(n, hl, gclusters += ulen, styles, channels)) > 0){
if((ulen = cell_prime(n, vl, gclusters += ulen, styles, channels)) > 0){
if(cell_prime(n, vl, gclusters + ulen, styles, channels) > 0){
return 0;
}
cell_release(n, hl);

View File

@ -35,7 +35,6 @@ fdthread(ncfdplane* ncfp, int pidfd){
struct pollfd pfds[2];
memset(pfds, 0, sizeof(pfds));
char* buf = malloc(BUFSIZ + 1);
int pevents;
pfds[0].fd = ncfp->fd;
pfds[0].events = NCPOLLEVENTS;
const int fdcount = pidfd < 0 ? 1 : 2;
@ -44,7 +43,7 @@ fdthread(ncfdplane* ncfp, int pidfd){
pfds[1].events = NCPOLLEVENTS;
}
ssize_t r = 0;
while((pevents = poll(pfds, fdcount, -1)) >= 0 || errno == EINTR){
while(poll(pfds, fdcount, -1) >= 0 || errno == EINTR){
if(pfds[0].revents){
while((r = read(ncfp->fd, buf, BUFSIZ)) >= 0){
if(r == 0){

View File

@ -267,7 +267,7 @@ ncvisual* ncvisual_from_file(const char* filename) {
goto err;
}
// FIXME do we need avcodec_parameters_to_context() here?
if((averr = avcodec_open2(ncv->details.subtcodecctx, ncv->details.subtcodec, nullptr)) < 0){
if(avcodec_open2(ncv->details.subtcodecctx, ncv->details.subtcodec, nullptr) < 0){
//fprintf(stderr, "Couldn't open codec for %s (%s)\n", filename, av_err2str(*averr));
goto err;
}
@ -296,7 +296,7 @@ ncvisual* ncvisual_from_file(const char* filename) {
if(avcodec_parameters_to_context(ncv->details.codecctx, st->codecpar) < 0){
goto err;
}
if((averr = avcodec_open2(ncv->details.codecctx, ncv->details.codec, nullptr)) < 0){
if(avcodec_open2(ncv->details.codecctx, ncv->details.codec, nullptr) < 0){
//fprintf(stderr, "Couldn't open codec for %s (%s)\n", filename, av_err2str(*averr));
goto err;
}