graphics/timg: fix build on 32-bit architectures

Add a bunch of missing casts.

Approved by:	portmgr (build fix blanket)
MFH:		2025Q1
This commit is contained in:
Robert Clausecker 2025-01-30 14:47:39 +01:00
parent 6d8eb4f8ff
commit bf83a6ced2
2 changed files with 19 additions and 3 deletions

View file

@ -10,9 +10,6 @@ WWW= https://github.com/hzeller/timg
LICENSE= GPLv2 LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE LICENSE_FILE= ${WRKSRC}/LICENSE
NOT_FOR_ARCHS= i386
NOT_FOR_ARCHS_REASON= non-constant-expression cannot be narrowed from type 'int64_t' (aka 'long long') to 'long' in initializer list
LIB_DEPENDS= libavutil.so:multimedia/ffmpeg \ LIB_DEPENDS= libavutil.so:multimedia/ffmpeg \
libdeflate.so:archivers/libdeflate \ libdeflate.so:archivers/libdeflate \
libexif.so:graphics/libexif \ libexif.so:graphics/libexif \

View file

@ -0,0 +1,19 @@
--- src/timg-time.h.orig 2025-01-30 13:44:32 UTC
+++ src/timg-time.h
@@ -50,13 +50,13 @@ class Duration { (public)
}
static constexpr Duration Millis(int64_t ms) {
- return {ms / 1000, (ms % 1000) * 1000000};
+ return {static_cast<time_t>(ms / 1000), static_cast<long>((ms % 1000) * 1000000)};
}
static constexpr Duration Micros(int64_t usec) {
- return {usec / 1000, (usec % 1000000) * 1000};
+ return {static_cast<time_t>(usec / 1000), static_cast<long>((usec % 1000000) * 1000)};
}
static constexpr Duration Nanos(int64_t nanos) {
- return {nanos / 1000000000, nanos % 1000000000};
+ return {static_cast<time_t>(nanos / 1000000000), static_cast<long>(nanos % 1000000000)};
}
static constexpr Duration InfiniteFuture() {
return {1000000000, 0}; // a few years; infinite enough :)