diff --git a/checkin_notes b/checkin_notes index eaa0920333..b3a64fec54 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2091,3 +2091,14 @@ Rom 25 Mar 2010 clientgui/ BOINCTaskBar.cpp + +David 25 Mar 2010 + - boinccmd: add --set_gpu_mode command + - fix some compile warnings + + client/ + cs_notice.cpp,h + work_fetch.cpp + boinc_cmd.cpp + gui_http.cpp,h + main.cpp diff --git a/client/boinc_cmd.cpp b/client/boinc_cmd.cpp index adb3dd12e4..6b739e5399 100644 --- a/client/boinc_cmd.cpp +++ b/client/boinc_cmd.cpp @@ -81,6 +81,8 @@ Commands:\n\ op = retry | abort\n\ --set_run_mode mode duration set run mode for given duration\n\ mode = always | auto | never\n\ + --set_gpu_mode mode duration set GPU run mode for given duration\n\ + mode = always | auto | never\n\ --set_network_mode mode duration\n\ --set_proxy_settings\n\ --run_benchmarks\n\ @@ -328,6 +330,23 @@ int main(int argc, char** argv) { } else { fprintf(stderr, "Unknown op %s\n", op); } + } else if (!strcmp(cmd, "--set_gpu_mode")) { + char* op = next_arg(argc, argv, i); + double duration; + if (i >= argc || (argv[i][0] == '-')) { + duration = 0; + } else { + duration = atof(next_arg(argc, argv, i)); + } + if (!strcmp(op, "always")) { + retval = rpc.set_gpu_mode(RUN_MODE_ALWAYS, duration); + } else if (!strcmp(op, "auto")) { + retval = rpc.set_gpu_mode(RUN_MODE_AUTO, duration); + } else if (!strcmp(op, "never")) { + retval = rpc.set_gpu_mode(RUN_MODE_NEVER, duration); + } else { + fprintf(stderr, "Unknown op %s\n", op); + } } else if (!strcmp(cmd, "--set_network_mode")) { char* op = next_arg(argc, argv, i); double duration; diff --git a/client/cs_notice.cpp b/client/cs_notice.cpp index be8a477147..b59e1d23e9 100644 --- a/client/cs_notice.cpp +++ b/client/cs_notice.cpp @@ -324,7 +324,7 @@ bool NOTICES::append(NOTICE& n, bool keep_old) { // If rfp is NULL it's a system msg, else a feed msg. // insert items in NOTICES // -int NOTICES::read_archive_file(char* path, RSS_FEED* rfp) { +int NOTICES::read_archive_file(const char* path, RSS_FEED* rfp) { char tag[256]; bool is_tag; diff --git a/client/cs_notice.h b/client/cs_notice.h index 2d527aaf24..71eb3955e5 100644 --- a/client/cs_notice.h +++ b/client/cs_notice.h @@ -72,7 +72,7 @@ struct NOTICES { bool append(NOTICE&, bool keep_old); void init(); void init_rss(); - int read_archive_file(char* file, struct RSS_FEED*); + int read_archive_file(const char* file, struct RSS_FEED*); void write_archive(struct RSS_FEED*); bool remove_dups(NOTICE&, bool keep_old); }; diff --git a/client/gui_http.cpp b/client/gui_http.cpp index 3ec823c60f..b8b9449a6f 100644 --- a/client/gui_http.cpp +++ b/client/gui_http.cpp @@ -28,7 +28,7 @@ #include "gui_http.h" -int GUI_HTTP::do_rpc(GUI_HTTP_OP* op, char* url, char* output_file) { +int GUI_HTTP::do_rpc(GUI_HTTP_OP* op, char* url, const char* output_file) { int retval; // this check should be done at a higher level. @@ -47,7 +47,10 @@ int GUI_HTTP::do_rpc(GUI_HTTP_OP* op, char* url, char* output_file) { return 0; } -int GUI_HTTP::do_rpc_post(GUI_HTTP_OP* op, char* url, char* input_file, char* output_file) { +int GUI_HTTP::do_rpc_post( + GUI_HTTP_OP* op, char* url, + const char* input_file, const char* output_file +) { int retval; if (gui_http_state != GUI_HTTP_STATE_IDLE) { diff --git a/client/gui_http.h b/client/gui_http.h index de6cefb146..0e997ea6b9 100644 --- a/client/gui_http.h +++ b/client/gui_http.h @@ -35,9 +35,10 @@ struct GUI_HTTP { HTTP_OP http_op; GUI_HTTP(): gui_http_state(GUI_HTTP_STATE_IDLE) {} - int do_rpc(struct GUI_HTTP_OP*, char* url, char* output_file); + int do_rpc(struct GUI_HTTP_OP*, char* url, const char* output_file); int do_rpc_post( - struct GUI_HTTP_OP*, char* url, char* input_file, char* output_file + struct GUI_HTTP_OP*, char* url, + const char* input_file, const char* output_file ); bool poll(); inline bool is_busy() { diff --git a/client/main.cpp b/client/main.cpp index 22c296ad52..a3f42e027e 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -115,7 +115,7 @@ void show_message(PROJECT *p, char* msg, int priority) { // Log informational messages to system specific places // -void log_message_startup(char* msg) { +void log_message_startup(const char* msg) { char evt_msg[2048]; snprintf(evt_msg, sizeof(evt_msg), "%s\n", @@ -136,7 +136,7 @@ void log_message_startup(char* msg) { // Log error messages to system specific places // -void log_message_error(char* msg) { +void log_message_error(const char* msg) { char evt_msg[2048]; #ifdef _WIN32 snprintf(evt_msg, sizeof(evt_msg), @@ -163,7 +163,7 @@ void log_message_error(char* msg) { } } -void log_message_error(char* msg, int error_code) { +void log_message_error(const char* msg, int error_code) { char evt_msg[2048]; snprintf(evt_msg, sizeof(evt_msg), "%s\n" diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index e413c819e2..b256870fd5 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -55,7 +55,7 @@ WORK_FETCH work_fetch; // to use its instance share, // get work from the one with greatest LTD. -static char* criterion_name(int criterion) { +static const char* criterion_name(int criterion) { switch (criterion) { case FETCH_IF_IDLE_INSTANCE: return "idle instance"; case FETCH_IF_MAJOR_SHORTFALL: return "major shortfall";