Skip to content

Commit

Permalink
apps: correct print specifiers to fix compilation warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
  • Loading branch information
pkarashchenko authored and xiaoxiang781216 committed Jun 23, 2023
1 parent a2f01f5 commit c9c4cc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions examples/rpmsgsocket/rpsock_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static int rpsock_stream_client(int argc, char *argv[])
ptr[i] = cnt * 100 + i;
}

printf("client send data, cnt %d, total len %d, BUFHEAD %s\n",
printf("client send data, cnt %d, total len %zu, BUFHEAD %s\n",
cnt, sendsize, outbuf);

tmp = outbuf;
Expand Down Expand Up @@ -368,7 +368,7 @@ static int rpsock_stream_client(int argc, char *argv[])
}
else if (act < 0)
{
printf("client recv data failed %d\n", act);
printf("client recv data failed %zd\n", act);
break;
}

Expand All @@ -382,8 +382,8 @@ static int rpsock_stream_client(int argc, char *argv[])

if (recvsize >= sendsize)
{
printf("client recv total %d, send total %d\n",
recvsize, sendsize);
printf("client recv total %zu, send total %zu\n",
recvsize, sendsize);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/rpmsgsocket/rpsock_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void *rpsock_thread(pthread_addr_t pvarg)
}
else if (ret < 0)
{
printf("server recv data failed ret %d, errno %d\n", ret, errno);
printf("server recv data failed ret %zd, errno %d\n", ret, errno);
break;
}

Expand Down Expand Up @@ -147,7 +147,7 @@ static void *rpsock_thread(pthread_addr_t pvarg)
}
}

printf("server Complete ret %d, errno %d\n", ret, errno);
printf("server Complete ret %zd, errno %d\n", ret, errno);
free(args);
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion system/uorb/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ static void listener_top(FAR struct list_node *objlist,
uorbinfo_raw("\033[H"); /* move cursor to top left corner */
}

uorbinfo_raw("\033[K" "current objects: %i", list_length(objlist));
uorbinfo_raw("\033[K" "current objects: %zu", list_length(objlist));
uorbinfo_raw("\033[K" "%-*s INST #SUB RATE #Q SIZE",
ORB_MAX_PRINT_NAME - 2, "NAME");

Expand Down

0 comments on commit c9c4cc1

Please sign in to comment.