Skip to content

Commit 3ef52ad

Browse files
seankyerkartben
authored andcommitted
samples: net: ocpp: Fix cast warning
Fix warnings generated for casting between pointers and integers of different sizes in ocpp sample. Signed-off-by: Sean Kyer <[email protected]>
1 parent a28925a commit 3ef52ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/net/ocpp/src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int user_notify_cb(enum ocpp_notify_reason reason,
126126

127127
tid[idx] = k_thread_create(&tinfo[idx], cp_stk[idx],
128128
sizeof(cp_stk[idx]), ocpp_cp_entry,
129-
(void *)(idx + 1), idtag[idx],
129+
(void *)(uintptr_t)(idx + 1), idtag[idx],
130130
obs[idx], 7, 0, K_NO_WAIT);
131131

132132
return 0;
@@ -148,7 +148,7 @@ static int user_notify_cb(enum ocpp_notify_reason reason,
148148
static void ocpp_cp_entry(void *p1, void *p2, void *p3)
149149
{
150150
int ret;
151-
int idcon = (uint32_t)p1;
151+
int idcon = (int)(uintptr_t)p1;
152152
char *idtag = (char *)p2;
153153
struct zbus_observer *obs = (struct zbus_observer *)p3;
154154
ocpp_session_handle_t sh = NULL;
@@ -322,7 +322,7 @@ int main(void)
322322

323323
tid[i] = k_thread_create(&tinfo[i], cp_stk[i],
324324
sizeof(cp_stk[i]),
325-
ocpp_cp_entry, (void *)(i + 1),
325+
ocpp_cp_entry, (void *)(uintptr_t)(i + 1),
326326
idtag[i], obs[i], 7, 0, K_NO_WAIT);
327327
}
328328

0 commit comments

Comments
 (0)