diff options
author | Lutz Helwing <lutz_helwing@mentor.com> | 2015-10-09 14:58:32 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2015-10-28 11:38:00 +0100 |
commit | 2355ca4927cffd8307fdb78aaadeb584450bef21 (patch) | |
tree | 8b681db88138ab259f3994cbe6943e6030a5eb1f /src/lib/dlt_user.c | |
parent | fb99b7875dfe64a4073aa14f33c551098632847c (diff) | |
download | DLT-daemon-2355ca4927cffd8307fdb78aaadeb584450bef21.tar.gz |
Got rid of warnings from some older compilers
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r-- | src/lib/dlt_user.c | 15 |
1 files changed, 10 insertions, 5 deletions
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; |