From 8f937bd8e22babc9b1d891aa5211c562d3eccb46 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 6 May 2008 00:38:18 +0000 Subject: [PATCH] client: Fix compiler warning. MGR: allow showing graphics with or without sandbox for Mac, UNIX, Linux svn path=/trunk/boinc/; revision=15131 --- checkin_notes | 10 ++++++++++ client/cs_benchmark.C | 2 +- clientgui/MainDocument.cpp | 20 ++++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index b96a28071a..fa0461e72c 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3587,3 +3587,13 @@ David May 4 2008 whetstone.C clientgui/ ViewMessages.cpp + +Charlie May 5 2008 + - client: Fix compiler warning. + - MGR: Fix CMainDocument::WorkShowGraphics() for Mac, UNIX and Linux + to allow showing graphics with or without sandbox. + + client/ + cs_benchmark.C + clientgui/ + MainDocument.cpp diff --git a/client/cs_benchmark.C b/client/cs_benchmark.C index 08cf7dac15..7f2e56e62d 100644 --- a/client/cs_benchmark.C +++ b/client/cs_benchmark.C @@ -154,7 +154,7 @@ int cpu_benchmarks(BENCHMARK_DESC* bdp) { int retval; double vax_mips, int_loops=0, int_time=0, fp_time; - sprintf(bdp->error_str, ""); + bdp->error_str[0] = '\0'; host_info.clear_host_info(); retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); if (retval) { diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 765126e9ac..ffb4fe7f30 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -1210,24 +1210,28 @@ int CMainDocument::WorkShowGraphics(RESULT* result) // See if we are already running the graphics application for this task previous_gfx_app = GetRunningGraphicsApp(result, slot); -#ifdef __WXMAC__ - ProcessSerialNumber gfx_app_psn; +#ifndef __WXMSW__ char* argv[5]; if (previous_gfx_app) { +#ifdef __WXMAC__ + ProcessSerialNumber gfx_app_psn; // If this graphics app is already running, // just bring it to the front // if (!GetProcessForPID(previous_gfx_app->pid, &gfx_app_psn)) { SetFrontProcess(&gfx_app_psn); } +#endif + // If graphics app is already running, don't launch a second instance + // return 0; } - // For unknown reasons, the graphics application exits with - // "RegisterProcess failed (error = -50)" unless we pass its - // full path twice in the argument list to execv. - // argv[0] = "switcher"; + // For unknown reasons on Macs, the graphics application + // exits with "RegisterProcess failed (error = -50)" unless + // we pass its full path twice in the argument list to execv. + // argv[1] = (char *)result->graphics_exec_path.c_str(); argv[2] = (char *)result->graphics_exec_path.c_str(); argv[3] = "--graphics"; @@ -1246,8 +1250,8 @@ int CMainDocument::WorkShowGraphics(RESULT* result) iRetVal = run_program( result->slot_path.c_str(), result->graphics_exec_path.c_str(), - 3, - &argv[1], + 2, + &argv[2], 0, id );