From 10a4ec0b08af7fc7ae29d69c8598a3d1f9eca5b0 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Wed, 22 Jul 2020 00:12:24 +0200 Subject: [PATCH] Define DC_TIMEZONE_NONE as a signed integer The hexadecimal value 0x80000000 is too large to be represented as a signed 32bit integer. Therefore the default type for the constant is an unsigned 32bit integer. This is a bit annoying because the timezone field is actually defined as a signed integer, and thus comparisions produce -Wsign-compare compiler warnings. Fixed by switching to INT_MIN, which is the same underlying value but interpreted as a signed integer. --- include/libdivecomputer/datetime.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/libdivecomputer/datetime.h b/include/libdivecomputer/datetime.h index 768883d..e5b876f 100644 --- a/include/libdivecomputer/datetime.h +++ b/include/libdivecomputer/datetime.h @@ -22,11 +22,13 @@ #ifndef DC_DATETIME_H #define DC_DATETIME_H +#include + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#define DC_TIMEZONE_NONE 0x80000000 +#define DC_TIMEZONE_NONE INT_MIN #if defined (_WIN32) && !defined (__GNUC__) typedef __int64 dc_ticks_t;