kill some warnings on macos

pull/1988/head
nick black 3 years ago
parent 4f1ef47b09
commit 8c8d07d5e8

@ -1038,7 +1038,7 @@ int ncblit_rgb_packed(const void* data, int linesize,
int ncblit_rgba(const void* data, int linesize, const struct ncvisual_options* vopts){
if(vopts->flags > NCVISUAL_OPTION_BLEND){
fprintf(stderr, "Warning: unknown ncvisual options %016" PRIx64 "\n", (uintmax_t)vopts->flags);
fprintf(stderr, "Warning: unknown ncvisual options %016" PRIx64 "\n", vopts->flags);
}
if(linesize <= 0 || (size_t)linesize < vopts->lenx * sizeof(uint32_t)){
return -1;

@ -70,9 +70,11 @@ const char *ncmetric(uintmax_t val, uintmax_t decimal, char *buf, int omitdec,
// 1,024). That can overflow with large 64-bit values, but we can first
// divide both sides by mult, and then scale by 100.
if(omitdec && (val % dv) == 0){
sprintfed = sprintf(buf, "%" PRIu64 "%lc", val / dv, (wint_t)prefixes[consumed - 1]);
sprintfed = sprintf(buf, "%" PRIu64 "%lc", (uint64_t)(val / dv),
(wint_t)prefixes[consumed - 1]);
}else{
sprintfed = sprintf(buf, "%.2f%lc", (double)val / dv, (wint_t)prefixes[consumed - 1]);
sprintfed = sprintf(buf, "%.2f%lc", (double)val / dv,
(wint_t)prefixes[consumed - 1]);
}
if(uprefix){
buf[sprintfed] = uprefix;
@ -84,13 +86,15 @@ const char *ncmetric(uintmax_t val, uintmax_t decimal, char *buf, int omitdec,
// val / decimal < dv (or we ran out of prefixes)
if(omitdec && val % decimal == 0){
if(consumed){
sprintfed = sprintf(buf, "%" PRIu64 "%lc", val / decimal, (wint_t)subprefixes[consumed - 1]);
sprintfed = sprintf(buf, "%" PRIu64 "%lc", (uint64_t)(val / decimal),
(wint_t)subprefixes[consumed - 1]);
}else{
sprintfed = sprintf(buf, "%" PRIu64, val / decimal);
sprintfed = sprintf(buf, "%" PRIu64, (uint64_t)(val / decimal));
}
}else{
if(consumed){
sprintfed = sprintf(buf, "%.2f%lc", (double)val / decimal, (wint_t)subprefixes[consumed - 1]);
sprintfed = sprintf(buf, "%.2f%lc", (double)val / decimal,
(wint_t)subprefixes[consumed - 1]);
}else{
sprintfed = sprintf(buf, "%.2f", (double)val / decimal);
}

@ -109,8 +109,7 @@ setup_kitty_bitmaps(tinfo* ti, int fd, int sixel_maxy_pristine){
sprite_init(ti, fd);
}
// kitty 0.19.3 didn't have C=1, and thus needs sixel_maxy_pristine. it also
// lacked animation, and thus requires the older interface.
#ifdef __linux__
static inline void
setup_fbcon_bitmaps(tinfo* ti, int fd){
ti->pixel_rebuild = fbcon_rebuild;
@ -121,6 +120,7 @@ setup_fbcon_bitmaps(tinfo* ti, int fd){
set_pixel_blitter(fbcon_blit);
sprite_init(ti, fd);
}
#endif
static bool
query_rgb(void){
@ -658,7 +658,6 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
int* cursor_y, int* cursor_x, ncsharedstats* stats){
queried_terminals_e qterm = TERMINAL_UNKNOWN;
memset(ti, 0, sizeof(*ti));
#ifdef __linux__
ti->linux_fb_fd = -1;
ti->linux_fbuffer = MAP_FAILED;
// we might or might not program quadrants into the console font
@ -668,7 +667,6 @@ int interrogate_terminfo(tinfo* ti, int fd, const char* termname, unsigned utf8,
// FIXME set up pixel-drawing API for framebuffer #1369
}
}
#endif
if(fd >= 0){
bool minimal = (qterm != TERMINAL_UNKNOWN);
if(send_initial_queries(fd, minimal)){

@ -95,7 +95,7 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
stdn->set_fg_rgb(0x80c080);
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
intmax_t ns = timespec_to_ns(&now) - timespec_to_ns(start);
int64_t ns = timespec_to_ns(&now) - timespec_to_ns(start);
marsh->blitter = vopts->blitter;
if(marsh->blitter == NCBLIT_DEFAULT){
marsh->blitter = ncvisual_media_defblitter(nc, vopts->scaling);
@ -110,11 +110,11 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
if(subtitle){
handle_subtitle(subtitle, marsh, vopts);
}
const intmax_t h = ns / (60 * 60 * NANOSECS_IN_SEC);
const int64_t h = ns / (60 * 60 * NANOSECS_IN_SEC);
ns -= h * (60 * 60 * NANOSECS_IN_SEC);
const intmax_t m = ns / (60 * NANOSECS_IN_SEC);
const int64_t m = ns / (60 * NANOSECS_IN_SEC);
ns -= m * (60 * NANOSECS_IN_SEC);
const intmax_t s = ns / NANOSECS_IN_SEC;
const int64_t s = ns / NANOSECS_IN_SEC;
ns -= s * NANOSECS_IN_SEC;
if(!marsh->quiet){
stdn->printf(0, NCAlign::Right, "%02" PRId64 ":%02" PRId64 ":%02" PRId64 ".%04" PRId64,

Loading…
Cancel
Save