From cf5897a71ea412ea2aeb1e2f6b5ea74d4fabfd8c Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 14 May 2025 10:23:37 +0200 Subject: Silence deprecation warning by using underlying code directly plist_date_val_compare calls plist_get_date_val which is now marked deprecated. To avoid compiler warnings during build, we use the underlying implementation directly instead of calling the function to work around it. --- src/plist.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plist.c b/src/plist.c index 4fc2f00..a33a6fb 100644 --- a/src/plist.c +++ b/src/plist.c @@ -1701,9 +1701,12 @@ int plist_date_val_compare(plist_t datenode, int32_t cmpsec, int32_t cmpusec) if (!PLIST_IS_DATE(datenode)) { return -1; } - int32_t sec = 0; - int32_t usec = 0; - plist_get_date_val(datenode, &sec, &usec); + plist_data_t data = plist_get_data(datenode); + assert(data->length == sizeof(double)); + double val = data->realval; + int32_t sec = (int32_t)val; + val = fabs((val - (int64_t)val) * 1000000); + int32_t usec = (int32_t)val; uint64_t dateval = ((int64_t)sec << 32) | usec; uint64_t cmpval = ((int64_t)cmpsec << 32) | cmpusec; if (dateval == cmpval) { -- cgit v1.1-32-gdbae