diff --git a/daemon/cli.c b/daemon/cli.c index 336183f56..c65ea9328 100644 --- a/daemon/cli.c +++ b/daemon/cli.c @@ -1887,8 +1887,8 @@ static void cli_incoming_media_list_files(str *instr, struct cli_writer *cw, con if (media_player_get_file_times(name, &mtime, &atime)) cw->cw_printf(cw, STR_FORMAT ", loaded %lu s ago, last used %lu s ago\n", STR_FMT(name), - (long) rtpe_now.tv_sec - mtime, - (long) rtpe_now.tv_sec - atime); + (long) (rtpe_now.tv_sec - mtime), + (long) (rtpe_now.tv_sec - atime)); str_free(name); } } @@ -1901,8 +1901,8 @@ static void cli_incoming_media_list_dbs(str *instr, struct cli_writer *cw, const time_t atime, mtime; if (media_player_get_db_times(id, &mtime, &atime)) cw->cw_printf(cw, "%llu, loaded %lu s ago, last used %lu s ago\n", id, - (long) rtpe_now.tv_sec - mtime, - (long) rtpe_now.tv_sec - atime); + (long) (rtpe_now.tv_sec - mtime), + (long) (rtpe_now.tv_sec - atime)); } } @@ -2071,8 +2071,8 @@ static void cli_incoming_media_list_caches(str *instr, struct cli_writer *cw, co time_t atime, mtime; if (media_player_get_cache_times(id, &mtime, &atime)) cw->cw_printf(cw, "%llu, loaded %lu s ago, last used %lu s ago\n", id, - (long) rtpe_now.tv_sec - mtime, - (long) rtpe_now.tv_sec - atime); + (long) (rtpe_now.tv_sec - mtime), + (long) (rtpe_now.tv_sec - atime)); } } diff --git a/daemon/codec.c b/daemon/codec.c index cdf72e932..a4c821155 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -3753,7 +3753,7 @@ static void __dtx_send_later(struct codec_timer *ct) { else if (ts_diff_us < -100000 || dtxb->discard_old_count > 3) ilogs(dtx, LOG_DEBUG, "DTX timestamp reset (from %lu to %lu)", dtxb->head_ts, ts); else if (ts_diff < 0 || (ts_diff == 0 && discarded_old)) { - ilogs(dtx, LOG_DEBUG, "Discarding old packet (TS %lu < %lu, %" PRId64 " ms old)", + ilogs(dtx, LOG_DEBUG, "Discarding old packet (TS %lu < %lu, %ld ms old)", ts, dtxb->head_ts, -ts_diff); t_queue_pop_head(&dtxb->packets); dtx_packet_free(dtxp); @@ -3765,7 +3765,7 @@ static void __dtx_send_later(struct codec_timer *ct) { dtxb->head_ts, ts, ts_diff_us / 1000); else if (ts_diff >= dtxb->tspp * 2) { ilogs(dtx, LOG_DEBUG, "First packet in DTX buffer not ready yet (packet TS %lu, " - "DTX TS %lu, diff %li)", + "DTX TS %lu, diff %ld)", ts, dtxb->head_ts, ts_diff); dtxp = NULL; } diff --git a/lib/bufferpool.h b/lib/bufferpool.h index baa56c435..de03d95fa 100644 --- a/lib/bufferpool.h +++ b/lib/bufferpool.h @@ -6,7 +6,7 @@ #define BUFFERPOOL_ALIGNMENT (sizeof(void *)) // bytes #define BUFFERPOOL_ALIGN(x) (((x + BUFFERPOOL_ALIGNMENT - 1) / BUFFERPOOL_ALIGNMENT) * BUFFERPOOL_ALIGNMENT) -#define BUFFERPOOL_SHARD_SIZE (1LL<<24) // 16 MB, must be a power of two +#define BUFFERPOOL_SHARD_SIZE ((size_t) (1LL<<24)) // 16 MB, must be a power of two #define BUFFERPOOL_OVERHEAD BUFFERPOOL_ALIGN(sizeof(void *)) // storage space not available #define BUFFERPOOL_BOTTOM_MASK (BUFFERPOOL_SHARD_SIZE - 1) diff --git a/recording-daemon/notify.c b/recording-daemon/notify.c index dba575231..b56520f07 100644 --- a/recording-daemon/notify.c +++ b/recording-daemon/notify.c @@ -212,7 +212,7 @@ static void *notify_timer(void *p) { gettimeofday(&now, NULL); if (now.tv_sec < first->retry_time) { ilog(LOG_DEBUG, "Sleeping until next scheduled HTTP notification retry in %lu seconds", - (unsigned long) first->retry_time - now.tv_sec); + (unsigned long) (first->retry_time - now.tv_sec)); struct timespec ts = {.tv_sec = first->retry_time, .tv_nsec = 0}; pthread_cond_timedwait(&timer_cond, &timer_lock, &ts); continue;