diff --git a/subsys/net/lib/lwm2m/lwm2m_engine.c b/subsys/net/lib/lwm2m/lwm2m_engine.c index cad4c5a1697..4431e71507d 100644 --- a/subsys/net/lib/lwm2m/lwm2m_engine.c +++ b/subsys/net/lib/lwm2m/lwm2m_engine.c @@ -4326,7 +4326,7 @@ static int generate_notify_message(struct lwm2m_ctx *ctx, obs->path.level, log_strdup(sprint_token(obs->token, obs->tkl)), log_strdup(lwm2m_sprint_ip_addr(&ctx->remote_addr)), - k_uptime_get()); + (long long)k_uptime_get()); obj_inst = get_engine_obj_inst(obs->path.obj_id, obs->path.obj_inst_id); diff --git a/subsys/net/lib/lwm2m/lwm2m_util.c b/subsys/net/lib/lwm2m/lwm2m_util.c index 008c6bbe307..1df92811ca9 100644 --- a/subsys/net/lib/lwm2m/lwm2m_util.c +++ b/subsys/net/lib/lwm2m/lwm2m_util.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "lwm2m_util.h" #define SHIFT_LEFT(v, o, m) (((v) << (o)) & (m)) @@ -378,7 +379,8 @@ int lwm2m_ftoa(double *input, char *out, size_t outlen, int8_t dec_limit) int64_t val1 = (int64_t)*input; int64_t val2 = (*input - (int64_t)*input) * PRECISION64; - len = snprintk(buf, sizeof(buf), "%0*lld", PRECISION64_LEN, llabs(val2)); + len = snprintk(buf, sizeof(buf), "%0*lld", PRECISION64_LEN, + (long long)llabs(val2)); if (len != PRECISION64_LEN) { strcpy(buf, "0"); } else { @@ -418,5 +420,5 @@ int lwm2m_ftoa(double *input, char *out, size_t outlen, int8_t dec_limit) return snprintk(out, outlen, "%s%lld.%s", /* handle negative val2 when val1 is 0 */ - (val1 == 0 && val2 < 0) ? "-" : "", val1, buf); + (val1 == 0 && val2 < 0) ? "-" : "", (long long)val1, buf); }