diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/daemon/dlt_daemon_client.c | 2 | ||||
-rw-r--r-- | src/lib/dlt_user.c | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/daemon/dlt_daemon_client.c b/src/daemon/dlt_daemon_client.c index e6135e3..e1cf841 100644 --- a/src/daemon/dlt_daemon_client.c +++ b/src/daemon/dlt_daemon_client.c @@ -1183,7 +1183,7 @@ int dlt_daemon_control_message_timezone(int sock, DltDaemon *daemon, DltDaemonLo resp->status = DLT_SERVICE_RESPONSE_OK; time_t t = time(NULL); - struct tm lt = {0}; + struct tm lt; localtime_r(&t, <); #if !defined(__CYGWIN__) resp->timezone = (int32_t) lt.tm_gmtoff; diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c index 2823208..8e5b6a1 100644 --- a/src/lib/dlt_user.c +++ b/src/lib/dlt_user.c @@ -1409,7 +1409,8 @@ DltReturnValue dlt_user_log_write_raw_formatted(DltContextData *log, void *data, if (log == NULL || data == NULL) return DLT_RETURN_WRONG_PARAMETER; - if (type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) + // Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning + if ((int16_t)type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) { dlt_vlog(LOG_ERR, "Format type %d is outside valid range", type); return DLT_RETURN_WRONG_PARAMETER; @@ -1760,7 +1761,8 @@ DltReturnValue dlt_user_log_write_uint8_formatted(DltContextData *log, uint8_t d if (log == NULL) return DLT_RETURN_WRONG_PARAMETER; - if (type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) + // Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning + if ((int16_t)type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) { dlt_vlog(LOG_ERR, "Format type %d is outside valid range", type); return DLT_RETURN_WRONG_PARAMETER; @@ -1815,7 +1817,8 @@ DltReturnValue dlt_user_log_write_uint16_formatted(DltContextData *log, uint16_t if (log == NULL) return DLT_RETURN_WRONG_PARAMETER; - if (type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) + // Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning + if ((int16_t)type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) { dlt_vlog(LOG_ERR, "Format type %d is outside valid range", type); return DLT_RETURN_WRONG_PARAMETER; @@ -1870,7 +1873,8 @@ DltReturnValue dlt_user_log_write_uint32_formatted(DltContextData *log, uint32_t if (log == NULL) return DLT_RETURN_WRONG_PARAMETER; - if (type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) + // Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning + if ((int16_t)type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) { dlt_vlog(LOG_ERR, "Format type %d is outside valid range", type); return DLT_RETURN_WRONG_PARAMETER; @@ -1925,7 +1929,8 @@ DltReturnValue dlt_user_log_write_uint64_formatted(DltContextData *log, uint64_t if (log == NULL) return DLT_RETURN_WRONG_PARAMETER; - if (type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) + // Have to cast type to signed type because some compilers assume that DltFormatType is unsigned and issue a warning + if ((int16_t)type < DLT_FORMAT_DEFAULT || type >= DLT_FORMAT_MAX) { dlt_vlog(LOG_ERR, "Format type %d is outside valid range", type); return DLT_RETURN_WRONG_PARAMETER; |