From 79ec5aac1f39e4a6b0916439b7d32b555f739a9f Mon Sep 17 00:00:00 2001 From: Jaroslaw Pelczar Date: Wed, 28 Aug 2019 09:59:09 +0200 Subject: [PATCH] RosterShell.cpp: Fix for error: cast from 'void*' to 'team_id' loses precision Signed-off-by: Jaroslaw Pelczar Change-Id: Icc4fb1347b2473f52e4b25855356c0708651edf4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/1765 Reviewed-by: waddlesplash --- src/tests/servers/registrar/RosterShell.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tests/servers/registrar/RosterShell.cpp b/src/tests/servers/registrar/RosterShell.cpp index 4238ba03c5..0dd89a6505 100644 --- a/src/tests/servers/registrar/RosterShell.cpp +++ b/src/tests/servers/registrar/RosterShell.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -80,7 +81,7 @@ public: return; } // activate the team - team_id team = (team_id)teamList.ItemAt(0); + team_id team = (team_id)(uintptr_t)teamList.ItemAt(0); status_t error = roster.ActivateApp(team); if (error != B_OK) { printf("activate: failed to activate application %ld: %s\n", @@ -148,7 +149,7 @@ public: printf("%-8s%-40s\n", "team", "signature"); printf("---------------------------------------------------------\n"); for (int32 i = 0; i < count; i++) { - team_id team = (team_id)teamList.ItemAt(i); + team_id team = (team_id)(uintptr_t)teamList.ItemAt(i); app_info info; status_t error = roster.GetRunningAppInfo(team, &info); if (error == B_OK) @@ -173,7 +174,7 @@ public: // print an info for each team int32 count = teamList.CountItems(); for (int32 i = 0; i < count; i++) { - team_id team = (team_id)teamList.ItemAt(i); + team_id team = (team_id)(uintptr_t)teamList.ItemAt(i); printf("team %8ld\n", team); printf("-------------\n"); app_info info; @@ -207,7 +208,7 @@ public: } // send a B_QUIT_REQUESTED message to each team for (int32 i = 0; i < count; i++) { - team_id team = (team_id)teamList.ItemAt(i); + team_id team = (team_id)(uintptr_t)teamList.ItemAt(i); status_t error = B_OK; BMessenger messenger(NULL, team, &error); if (messenger.IsValid()) {