summaryrefslogtreecommitdiffstats
path: root/src/plist.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2025-05-14 10:23:37 +0200
committerGravatar Nikias Bassen2025-05-14 10:23:37 +0200
commitcf5897a71ea412ea2aeb1e2f6b5ea74d4fabfd8c (patch)
tree4dd07870482794e7c6584a7ed9cb57aae3413572 /src/plist.c
parentb8cfac2aae312225ffb9bee944a4d84dbb73fbcd (diff)
downloadlibplist-cf5897a71ea412ea2aeb1e2f6b5ea74d4fabfd8c.tar.gz
libplist-cf5897a71ea412ea2aeb1e2f6b5ea74d4fabfd8c.tar.bz2
Silence deprecation warning by using underlying code directly2.7.0
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.
Diffstat (limited to 'src/plist.c')
-rw-r--r--src/plist.c9
1 files changed, 6 insertions, 3 deletions
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)
1701 if (!PLIST_IS_DATE(datenode)) { 1701 if (!PLIST_IS_DATE(datenode)) {
1702 return -1; 1702 return -1;
1703 } 1703 }
1704 int32_t sec = 0; 1704 plist_data_t data = plist_get_data(datenode);
1705 int32_t usec = 0; 1705 assert(data->length == sizeof(double));
1706 plist_get_date_val(datenode, &sec, &usec); 1706 double val = data->realval;
1707 int32_t sec = (int32_t)val;
1708 val = fabs((val - (int64_t)val) * 1000000);
1709 int32_t usec = (int32_t)val;
1707 uint64_t dateval = ((int64_t)sec << 32) | usec; 1710 uint64_t dateval = ((int64_t)sec << 32) | usec;
1708 uint64_t cmpval = ((int64_t)cmpsec << 32) | cmpusec; 1711 uint64_t cmpval = ((int64_t)cmpsec << 32) | cmpusec;
1709 if (dateval == cmpval) { 1712 if (dateval == cmpval) {