sliders: simplify, kill compiler warning

This commit is contained in:
nick black 2021-03-03 23:33:33 -05:00
parent eb87cd4892
commit 60ff6a73d6
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -94,7 +94,6 @@ static int
fill_chunk(struct ncplane* n, int idx){ fill_chunk(struct ncplane* n, int idx){
const int hidx = idx % CHUNKS_HORZ; const int hidx = idx % CHUNKS_HORZ;
const int vidx = idx / CHUNKS_HORZ; const int vidx = idx / CHUNKS_HORZ;
char buf[4];
int maxy, maxx; int maxy, maxx;
ncplane_dim_yx(n, &maxy, &maxx); ncplane_dim_yx(n, &maxy, &maxx);
uint64_t channels = 0; uint64_t channels = 0;
@ -113,11 +112,8 @@ fill_chunk(struct ncplane* n, int idx){
} }
ret |= ncplane_double_box(n, 0, channels, maxy - 1, maxx - 1, 0); ret |= ncplane_double_box(n, 0, channels, maxy - 1, maxx - 1, 0);
if(maxx >= 4 && maxy >= 3){ if(maxx >= 4 && maxy >= 3){
ret |= ncplane_cursor_move_yx(n, (maxy - 1) / 2, (maxx - 1) / 2); // don't zero-index to viewer
snprintf(buf, sizeof(buf), "%d", (idx + 1) / 10); // don't zero-index to viewer ret |= (ncplane_printf_yx(n, (maxy - 1) / 2, (maxx - 1) / 2, "%02d", idx + 1) < 0);
ret |= (ncplane_putegc(n, buf, NULL) < 0);
snprintf(buf, sizeof(buf), "%d", (idx + 1) % 10);
ret |= (ncplane_putegc(n, buf, NULL) < 0);
} }
return ret; return ret;
} }