RemoteDesktop: Fix x86_64 build.

This commit is contained in:
Rene Gollent 2014-06-17 18:40:56 -04:00
parent a852846fc2
commit 37b6923b87
2 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2009, Haiku, Inc. * Copyright 2009-2014, Haiku, Inc.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -46,7 +46,8 @@ main(int argc, char *argv[])
for (int32 i = 2; i < argc; i++) { for (int32 i = 2; i < argc; i++) {
if (strcmp(argv[i], "-p") == 0) { if (strcmp(argv[i], "-p") == 0) {
if (argc < i + 1 || sscanf(argv[i + 1], "%lu", &listenPort) != 1) { if (argc < i + 1 || sscanf(argv[i + 1], "%" B_PRIu32, &listenPort)
!= 1) {
print_usage(argv[0]); print_usage(argv[0]);
return 2; return 2;
} }
@ -56,7 +57,8 @@ main(int argc, char *argv[])
} }
if (strcmp(argv[i], "-s") == 0) { if (strcmp(argv[i], "-s") == 0) {
if (argc < i + 1 || sscanf(argv[i + 1], "%lu", &sshPort) != 1) { if (argc < i + 1 || sscanf(argv[i + 1], "%" B_PRIu32, &sshPort)
!= 1) {
print_usage(argv[0]); print_usage(argv[0]);
return 2; return 2;
} }
@ -103,8 +105,8 @@ main(int argc, char *argv[])
char shellCommand[4096]; char shellCommand[4096];
snprintf(shellCommand, sizeof(shellCommand), snprintf(shellCommand, sizeof(shellCommand),
"echo connected; export TARGET_SCREEN=localhost:%lu; %s\n", "echo connected; export TARGET_SCREEN=localhost:%" B_PRIu32
listenPort, terminalPath.Path()); "; %s\n", listenPort, terminalPath.Path());
int pipes[4]; int pipes[4];
if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) { if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {
@ -129,15 +131,15 @@ main(int argc, char *argv[])
close(pipes[i]); close(pipes[i]);
char localRedirect[50]; char localRedirect[50];
sprintf(localRedirect, "localhost:%lu:localhost:%lu", sprintf(localRedirect, "localhost:%" B_PRIu32 ":localhost:%"
listenPort + 1, listenPort + 1); B_PRIu32, listenPort + 1, listenPort + 1);
char remoteRedirect[50]; char remoteRedirect[50];
sprintf(remoteRedirect, "localhost:%lu:localhost:%lu", sprintf(remoteRedirect, "localhost:%" B_PRIu32 ":localhost:%"
listenPort, listenPort); B_PRIu32, listenPort, listenPort);
char portNumber[10]; char portNumber[10];
sprintf(portNumber, "%lu", sshPort); sprintf(portNumber, "%" B_PRIu32, sshPort);
int result = execl("ssh", "-C", "-L", localRedirect, int result = execl("ssh", "-C", "-L", localRedirect,
"-R", remoteRedirect, "-p", portNumber, argv[1], "-R", remoteRedirect, "-p", portNumber, argv[1],

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2009-2010, Haiku, Inc. * Copyright 2009-2014, Haiku, Inc.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -362,7 +362,7 @@ RemoteView::_CreateState(uint32 token)
{ {
int32 index = fStates.BinarySearchIndexByKey(token, &_StateCompareByKey); int32 index = fStates.BinarySearchIndexByKey(token, &_StateCompareByKey);
if (index >= 0) { if (index >= 0) {
TRACE_ERROR("state for token %lu already in list\n", token); TRACE_ERROR("state for token %" B_PRIu32 " already in list\n", token);
return; return;
} }
@ -619,7 +619,7 @@ RemoteView::_DrawThread()
engine_state *state = _FindState(token); engine_state *state = _FindState(token);
if (state == NULL) { if (state == NULL) {
TRACE_ERROR("didn't find state for token %lu\n", token); TRACE_ERROR("didn't find state for token %" B_PRIu32 "\n", token);
continue; continue;
} }