mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=5443
This commit is contained in:
parent
45942fbe5f
commit
8d0ab453b3
|
@ -69,17 +69,17 @@ int xwin_glut_is_initialized() {
|
|||
return glut_is_initialized;
|
||||
}
|
||||
|
||||
void app_debug_msg (char *fmt, ...);
|
||||
void app_debug_msg (const char *fmt, ...);
|
||||
|
||||
// This callback is invoked when a user presses a key.
|
||||
//
|
||||
void keyboardD(unsigned char key, int x, int y) {
|
||||
void keyboardD(unsigned char /*key*/, int /*x*/, int /*y*/) {
|
||||
if (current_graphics_mode == MODE_FULLSCREEN) {
|
||||
set_mode(MODE_HIDE_GRAPHICS);
|
||||
}
|
||||
}
|
||||
|
||||
void keyboardU(unsigned char key, int x, int y) {
|
||||
void keyboardU(unsigned char /*key*/, int /*x*/, int /*y*/) {
|
||||
if (current_graphics_mode == MODE_FULLSCREEN) {
|
||||
set_mode(MODE_HIDE_GRAPHICS);
|
||||
}
|
||||
|
@ -159,10 +159,10 @@ static void make_new_window(int mode) {
|
|||
// this should only called once, even if restarted by user-exit
|
||||
//
|
||||
static void boinc_glut_init() {
|
||||
char* args[2] = {"screensaver", NULL};
|
||||
const char* args[2] = {"screensaver", NULL};
|
||||
int one=1;
|
||||
app_debug_msg("Calling glutInit()... \n");
|
||||
glutInit (&one, args);
|
||||
glutInit (&one, (char**)args);
|
||||
app_debug_msg("...survived glutInit(). \n");
|
||||
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
|
||||
|
@ -225,7 +225,6 @@ static void timer_handler(int) {
|
|||
char buf[MSG_CHANNEL_SIZE];
|
||||
GRAPHICS_MSG m;
|
||||
|
||||
int new_mode;
|
||||
if (*g_bmsp->app_client_shmp) {
|
||||
if ((*g_bmsp->app_client_shmp)->shm->graphics_request.get_msg(buf)) {
|
||||
(*g_bmsp->app_client_shmp)->decode_graphics_msg(buf, m);
|
||||
|
@ -301,7 +300,7 @@ void restart() {
|
|||
// into xwin_graphics_event_loop. If we are in the main thread, then
|
||||
// restore the old signal handler and raise SIGABORT.
|
||||
//
|
||||
void restart_sig(int signal_number) {
|
||||
void restart_sig(int /*signal_number*/) {
|
||||
if (pthread_equal(pthread_self(), graphics_thread)) {
|
||||
// alternative approach is for the signal hander to call exit().
|
||||
fprintf(stderr, "Caught SIGABRT in graphics thread\n");
|
||||
|
@ -401,7 +400,7 @@ void xwin_graphics_event_loop() {
|
|||
|
||||
|
||||
|
||||
void app_debug_msg (char *fmt, ...) {
|
||||
void app_debug_msg (const char* /*fmt*/, ...) {
|
||||
#ifndef _DEBUG
|
||||
return;
|
||||
#else
|
||||
|
|
|
@ -24879,3 +24879,32 @@ David 16 Feb 2005
|
|||
html/user/
|
||||
account_setup_first_done.php
|
||||
team_display.php
|
||||
|
||||
David 16 Feb 2005
|
||||
- Giant checkin to remove warnings when compiled with
|
||||
all known warnings enabled.
|
||||
This consisted of:
|
||||
1) string literals ("foo") are type const char*,
|
||||
so any variables or args that you assign them to
|
||||
must be const char*
|
||||
2) shadowed variables
|
||||
3) unused params (removed or commented out)
|
||||
4) a couple of printf format/var mismatches
|
||||
(nothing that would cause a problem at this point)
|
||||
|
||||
api/
|
||||
x_opengl.C
|
||||
client/
|
||||
(most .C, .h)
|
||||
clientgui/
|
||||
(most .C, .h)
|
||||
res/
|
||||
*.xpm
|
||||
db/
|
||||
(most .C, .h)
|
||||
lib/
|
||||
(most .C, .h)
|
||||
sched/
|
||||
(most .C, .h)
|
||||
tools/
|
||||
(most .C, .h)
|
||||
|
|
|
@ -118,7 +118,8 @@ void ACCT_MGR::handle_reply() {
|
|||
if (pp) {
|
||||
if (strcmp(pp->authenticator, acct.authenticator.c_str())) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"You're attached to project %s with a different account"
|
||||
"You're attached to project %s with a different account",
|
||||
pp->get_project_name()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -460,7 +460,7 @@ int ACTIVE_TASK_SET::parse(MIOFILE& fin) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void MSG_QUEUE::msg_queue_send(char* msg, MSG_CHANNEL& channel) {
|
||||
void MSG_QUEUE::msg_queue_send(const char* msg, MSG_CHANNEL& channel) {
|
||||
if (channel.send_msg(msg)) {
|
||||
//msg_printf(NULL, MSG_INFO, "sent %s to %s", msg, name);
|
||||
return;
|
||||
|
@ -470,8 +470,8 @@ void MSG_QUEUE::msg_queue_send(char* msg, MSG_CHANNEL& channel) {
|
|||
|
||||
void MSG_QUEUE::msg_queue_poll(MSG_CHANNEL& channel) {
|
||||
if (msgs.size() > 0) {
|
||||
if (channel.send_msg((char*)(msgs[0].c_str()))) {
|
||||
//msg_printf(NULL, MSG_INFO, "sent %s to %s (delayed)", (char*)(msgs[0].c_str()), name);
|
||||
if (channel.send_msg(msgs[0].c_str())) {
|
||||
//msg_printf(NULL, MSG_INFO, "sent %s to %s (delayed)", (msgs[0].c_str()), name);
|
||||
msgs.erase(msgs.begin());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
int kill_task(); // send a SIGKILL signal or equivalent
|
||||
int suspend(); // send a SIGSTOP signal or equivalent
|
||||
int unsuspend(); // send a SIGCONT signal or equivalent
|
||||
int abort_task(char*); // flag as abort pending and send kill signal
|
||||
int abort_task(const char*); // flag as abort pending and send kill signal
|
||||
bool has_task_exited(); // return true if this task has exited
|
||||
int preempt(bool quit_task); // preempt (via suspend or quit) a running task
|
||||
int resume_or_start();
|
||||
|
|
|
@ -535,7 +535,7 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
|
|||
// If process is running, send it a kill signal
|
||||
// This is done when app has exceeded CPU, disk, or mem limits
|
||||
//
|
||||
int ACTIVE_TASK::abort_task(char* msg) {
|
||||
int ACTIVE_TASK::abort_task(const char* msg) {
|
||||
if (task_state == PROCESS_EXECUTING || task_state == PROCESS_SUSPENDED) {
|
||||
task_state = PROCESS_ABORT_PENDING;
|
||||
kill_task();
|
||||
|
|
|
@ -129,7 +129,6 @@ void ACTIVE_TASK_SET::hide_apps() {
|
|||
void ACTIVE_TASK_SET::restore_apps() {
|
||||
unsigned int i;
|
||||
ACTIVE_TASK* atp;
|
||||
GRAPHICS_MSG gm;
|
||||
|
||||
for (i=0; i<active_tasks.size(); i++) {
|
||||
atp = active_tasks[i];
|
||||
|
|
|
@ -141,7 +141,7 @@ int ACTIVE_TASK::write_app_init_file() {
|
|||
safe_strcpy(aid.user_name, wup->project->user_name);
|
||||
safe_strcpy(aid.team_name, wup->project->team_name);
|
||||
if (wup->project->project_specific_prefs.length()) {
|
||||
aid.project_preferences = (char*)wup->project->project_specific_prefs.c_str();
|
||||
aid.project_preferences = strdup(wup->project->project_specific_prefs.c_str());
|
||||
}
|
||||
get_project_dir(wup->project, project_dir);
|
||||
relative_to_absolute(project_dir, project_path);
|
||||
|
@ -267,7 +267,7 @@ int ACTIVE_TASK::start(bool first_time) {
|
|||
//
|
||||
strcpy(exec_name, "");
|
||||
for (i=0; i<app_version->app_files.size(); i++) {
|
||||
FILE_REF fref = app_version->app_files[i];
|
||||
fref = app_version->app_files[i];
|
||||
fip = fref.file_info;
|
||||
get_pathname(fip, file_path);
|
||||
if (fref.main_program) {
|
||||
|
@ -447,7 +447,7 @@ int ACTIVE_TASK::start(bool first_time) {
|
|||
// Postcondition: "state" is set correctly
|
||||
//
|
||||
int ACTIVE_TASK::resume_or_start() {
|
||||
char* str = "??";
|
||||
const char* str = "??";
|
||||
int retval;
|
||||
|
||||
switch (task_state) {
|
||||
|
|
|
@ -78,16 +78,12 @@ deque<MESSAGE_DESC*> message_descs;
|
|||
// and passes it to show_message
|
||||
// TODO: add translation functionality
|
||||
//
|
||||
void msg_printf(PROJECT *p, int priority, char *fmt, ...) {
|
||||
void msg_printf(PROJECT *p, int priority, const char *fmt, ...) {
|
||||
char buf[8192]; // output can be much longer than format
|
||||
va_list ap;
|
||||
|
||||
if (fmt == NULL) return;
|
||||
|
||||
// Since Windows doesn't support vsnprintf, we have to do a
|
||||
// workaround to prevent buffer overruns
|
||||
//
|
||||
if (strlen(fmt) > 512) fmt[511] = '\0';
|
||||
va_start(ap, fmt); // Parses string for variables
|
||||
vsprintf(buf, fmt, ap); // And convert symbols To actual numbers
|
||||
va_end(ap); // Results are stored in text
|
||||
|
|
|
@ -88,6 +88,6 @@ public:
|
|||
|
||||
extern CLIENT_MSG_LOG log_messages;
|
||||
|
||||
extern void msg_printf(PROJECT *p, int priority, char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
extern void msg_printf(PROJECT *p, int priority, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
|
||||
#endif
|
||||
|
|
|
@ -129,7 +129,7 @@ private:
|
|||
bool client_state_dirty;
|
||||
int old_major_version;
|
||||
int old_minor_version;
|
||||
char* platform_name;
|
||||
const char* platform_name;
|
||||
bool skip_cpu_benchmarks;
|
||||
// if set, use hardwired numbers rather than running benchmarks
|
||||
bool run_cpu_benchmarks;
|
||||
|
@ -279,7 +279,7 @@ private:
|
|||
|
||||
// --------------- cs_statefile.C:
|
||||
public:
|
||||
void set_client_state_dirty(char*);
|
||||
void set_client_state_dirty(const char*);
|
||||
int parse_state_file();
|
||||
int write_state(MIOFILE&);
|
||||
int write_state_file();
|
||||
|
|
|
@ -201,7 +201,7 @@ int CLIENT_STATE::parse_account_files() {
|
|||
|
||||
DirScanner dir(".");
|
||||
while (dir.scan(name)) {
|
||||
if (is_account_file((char*)name.c_str())) {
|
||||
if (is_account_file(name.c_str())) {
|
||||
f = fopen(name.c_str(), "r");
|
||||
if (!f) continue;
|
||||
project = new PROJECT;
|
||||
|
|
|
@ -357,7 +357,7 @@ bool CLIENT_STATE::schedule_cpus(double now) {
|
|||
ACTIVE_TASK *atp;
|
||||
PROJECT *p;
|
||||
bool some_app_started = false, first;
|
||||
double total_resource_share;
|
||||
double local_total_resource_share;
|
||||
int retval, j;
|
||||
double min_debt=0;
|
||||
double vm_limit, elapsed_time;
|
||||
|
@ -417,12 +417,12 @@ bool CLIENT_STATE::schedule_cpus(double now) {
|
|||
// compute total resource share among projects with runnable results
|
||||
//
|
||||
assign_results_to_projects(); // see which projects have work
|
||||
total_resource_share = 0;
|
||||
local_total_resource_share = 0;
|
||||
for (i=0; i<projects.size(); i++) {
|
||||
p = projects[i];
|
||||
if (p->non_cpu_intensive) continue;
|
||||
if (p->next_runnable_result) {
|
||||
total_resource_share += projects[i]->resource_share;
|
||||
local_total_resource_share += projects[i]->resource_share;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -439,7 +439,7 @@ bool CLIENT_STATE::schedule_cpus(double now) {
|
|||
p->anticipated_debt = 0;
|
||||
} else {
|
||||
p->debt +=
|
||||
(p->resource_share/total_resource_share)
|
||||
(p->resource_share/local_total_resource_share)
|
||||
* cpu_sched_work_done_this_period
|
||||
- p->work_done_this_period;
|
||||
if (first) {
|
||||
|
@ -535,9 +535,9 @@ bool CLIENT_STATE::schedule_cpus(double now) {
|
|||
}
|
||||
|
||||
// debts and active_tasks can only change if some project had a runnable result
|
||||
// (and thus if total_resource_share is positive)
|
||||
// (and thus if local_total_resource_share is positive)
|
||||
//
|
||||
if (total_resource_share > 0) {
|
||||
if (local_total_resource_share > 0) {
|
||||
set_client_state_dirty("schedule_cpus");
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -108,7 +108,7 @@ static BENCHMARK_DESC* benchmark_descs=0;
|
|||
static bool benchmarks_running=false; // at least 1 benchmark thread running
|
||||
static double cpu_benchmarks_start;
|
||||
|
||||
char *file_names[2] = {"do_fp", "do_int"};
|
||||
const char *file_names[2] = {"do_fp", "do_int"};
|
||||
|
||||
static void remove_benchmark_file(int which) {
|
||||
boinc_delete_file(file_names[which]);
|
||||
|
|
|
@ -131,7 +131,7 @@ inline bool now_between_two_hours(int start_hour, int end_hour) {
|
|||
// See if (on the basis of user run request and prefs)
|
||||
// we should suspend activities.
|
||||
//
|
||||
void CLIENT_STATE::check_suspend_activities(double now, int& reason) {
|
||||
void CLIENT_STATE::check_suspend_activities(double /*now*/, int& reason) {
|
||||
reason = 0;
|
||||
|
||||
// Don't work while we're running CPU benchmarks
|
||||
|
@ -202,7 +202,7 @@ int CLIENT_STATE::resume_activities() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void CLIENT_STATE::check_suspend_network(double now, int& reason) {
|
||||
void CLIENT_STATE::check_suspend_network(double /*now*/, int& reason) {
|
||||
reason = 0;
|
||||
|
||||
if (user_network_request == USER_RUN_REQUEST_ALWAYS) return;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "client_msgs.h"
|
||||
#include "client_state.h"
|
||||
|
||||
void CLIENT_STATE::set_client_state_dirty(char* source) {
|
||||
void CLIENT_STATE::set_client_state_dirty(const char* source) {
|
||||
log_messages.printf(CLIENT_MSG_LOG::DEBUG_STATE, "set dirty: %s\n", source);
|
||||
client_state_dirty = true;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ int CLIENT_STATE::parse_state_file() {
|
|||
PROJECT *project=NULL;
|
||||
int retval=0;
|
||||
int failnum;
|
||||
char *fname;
|
||||
const char *fname;
|
||||
|
||||
SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_STATE);
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ void get_account_filename(char* master_url, char* path) {
|
|||
sprintf(path, "account_%s.xml", buf);
|
||||
}
|
||||
|
||||
bool is_account_file(char* filename) {
|
||||
bool is_account_file(const char* filename) {
|
||||
return (strstr(filename, "account_") == filename);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ extern int make_project_dir(PROJECT&);
|
|||
extern int remove_project_dir(PROJECT&);
|
||||
extern int make_slot_dir(int);
|
||||
extern void get_account_filename(char* master_url, char* path);
|
||||
extern bool is_account_file(char*);
|
||||
extern bool is_account_file(const char*);
|
||||
extern void escape_project_url(char *in, char* out);
|
||||
extern int check_unique_instance();
|
||||
extern void get_sched_request_filename(PROJECT&, char*);
|
||||
|
|
|
@ -154,7 +154,7 @@ static void handle_result_show_graphics(char* buf, MIOFILE& fout) {
|
|||
}
|
||||
|
||||
|
||||
static void handle_project_op(char* buf, MIOFILE& fout, char* op) {
|
||||
static void handle_project_op(char* buf, MIOFILE& fout, const char* op) {
|
||||
PROJECT* p = get_project(buf, fout);
|
||||
if (!p) {
|
||||
fout.printf("<error>no such project</error>\n");
|
||||
|
@ -324,7 +324,8 @@ void handle_get_messages(char* buf, MIOFILE& fout) {
|
|||
// <project_url>XXX</project_url>
|
||||
// <filename>XXX</filename>
|
||||
// </retry_file_transfer>
|
||||
static void handle_file_transfer_op(char* buf, MIOFILE& fout, char* op) {
|
||||
//
|
||||
static void handle_file_transfer_op(char* buf, MIOFILE& fout, const char* op) {
|
||||
string filename;
|
||||
|
||||
PROJECT* p = get_project(buf, fout);
|
||||
|
@ -361,7 +362,7 @@ static void handle_file_transfer_op(char* buf, MIOFILE& fout, char* op) {
|
|||
fout.printf("<success/>\n");
|
||||
}
|
||||
|
||||
static void handle_result_op(char* buf, MIOFILE& fout, char* op) {
|
||||
static void handle_result_op(char* buf, MIOFILE& fout, const char* op) {
|
||||
RESULT* rp;
|
||||
char result_name[256];
|
||||
ACTIVE_TASK* atp;
|
||||
|
@ -586,14 +587,14 @@ int GUI_RPC_CONN_SET::get_allowed_hosts() {
|
|||
);
|
||||
|
||||
// read in each line, if it is not a comment
|
||||
// then resolve the address and add to our
|
||||
// allowed list
|
||||
// then resolve the address and add to our allowed list
|
||||
//
|
||||
memset(buf,0,sizeof(buf));
|
||||
while (fgets(buf, 256, f) != NULL) {
|
||||
strip_whitespace(buf);
|
||||
if (!(buf[0] =='#' || buf[0] == ';') && strlen(buf) > 0 ) {
|
||||
// resolve and add
|
||||
if (temp.get_ip_addr(buf, ipaddr) == 0) {
|
||||
strcpy(temp.hostname, buf);
|
||||
if (temp.get_ip_addr(ipaddr) == 0) {
|
||||
allowed_remote_ip_addresses.push_back((int)ntohl(ipaddr));
|
||||
}
|
||||
}
|
||||
|
@ -729,7 +730,7 @@ bool GUI_RPC_CONN_SET::poll(double) {
|
|||
show_connect_error(ia);
|
||||
boinc_close_socket(sock);
|
||||
} else {
|
||||
GUI_RPC_CONN* gr = new GUI_RPC_CONN(sock);
|
||||
gr = new GUI_RPC_CONN(sock);
|
||||
insert(gr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -477,7 +477,7 @@ int HOST_INFO::get_host_info() {
|
|||
|
||||
// returns true iff device was last accessed before t
|
||||
// or if an error occurred looking at the device.
|
||||
inline bool device_idle(time_t t, char *device) {
|
||||
inline bool device_idle(time_t t, const char *device) {
|
||||
struct stat sbuf;
|
||||
return stat(device, &sbuf) || (sbuf.st_atime < t);
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ static void http_get_request_header(
|
|||
}
|
||||
|
||||
static void http_get_request_header_proxy(
|
||||
char* buf, char* host, int port, char* file, double offset, char* encstr
|
||||
char* buf, char* host, int port, char* file, double offset, const char* encstr
|
||||
) {
|
||||
char offset_info[256];
|
||||
char user_agent_string[256];
|
||||
|
@ -155,7 +155,7 @@ static void http_head_request_header(
|
|||
}
|
||||
|
||||
static void http_head_request_header_proxy(
|
||||
char* buf, char* host, int port, char* file, char* encstr
|
||||
char* buf, char* host, int port, char* file, const char* encstr
|
||||
) {
|
||||
char user_agent_string[256];
|
||||
get_user_agent_string(user_agent_string);
|
||||
|
@ -191,7 +191,7 @@ static void http_post_request_header(
|
|||
}
|
||||
|
||||
static void http_post_request_header_proxy(
|
||||
char* buf, char* host, int port, char* file, int size, char* encstr
|
||||
char* buf, char* host, int port, char* file, int size, const char* encstr
|
||||
) {
|
||||
sprintf(buf,
|
||||
"POST %s HTTP/1.0\015\012"
|
||||
|
@ -377,7 +377,7 @@ int HTTP_OP::init_head(const char* url) {
|
|||
strcat(id_passwd,pi.http_user_passwd);
|
||||
encstr = r_base64_encode(id_passwd,strlen(id_passwd));
|
||||
http_head_request_header_proxy(
|
||||
request_header, url_hostname, port, proxy_buf, (char*)encstr.c_str()
|
||||
request_header, url_hostname, port, proxy_buf, encstr.c_str()
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
|
@ -385,7 +385,7 @@ int HTTP_OP::init_head(const char* url) {
|
|||
|
||||
// Initialize HTTP GET operation
|
||||
//
|
||||
int HTTP_OP::init_get(const char* url, char* out, bool del_old_file, double off) {
|
||||
int HTTP_OP::init_get(const char* url, const char* out, bool del_old_file, double off) {
|
||||
char proxy_buf[256];
|
||||
|
||||
if (del_old_file) {
|
||||
|
@ -418,7 +418,7 @@ int HTTP_OP::init_get(const char* url, char* out, bool del_old_file, double off)
|
|||
encstr = r_base64_encode(id_passwd,strlen(id_passwd));
|
||||
http_get_request_header_proxy(
|
||||
request_header, url_hostname,
|
||||
port, proxy_buf, (int)file_offset, (char*)encstr.c_str()
|
||||
port, proxy_buf, (int)file_offset, encstr.c_str()
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
|
@ -426,7 +426,9 @@ int HTTP_OP::init_get(const char* url, char* out, bool del_old_file, double off)
|
|||
|
||||
// Initialize HTTP POST operation
|
||||
//
|
||||
int HTTP_OP::init_post(const char* url, char* in, char* out) {
|
||||
int HTTP_OP::init_post(
|
||||
const char* url, const char* in, const char* out
|
||||
) {
|
||||
int retval;
|
||||
double size;
|
||||
char proxy_buf[256];
|
||||
|
@ -464,7 +466,7 @@ int HTTP_OP::init_post(const char* url, char* in, char* out) {
|
|||
encstr = r_base64_encode(id_passwd,strlen(id_passwd));
|
||||
http_post_request_header_proxy(
|
||||
request_header, url_hostname, port, proxy_buf, content_length,
|
||||
(char*)encstr.c_str()
|
||||
encstr.c_str()
|
||||
);
|
||||
}
|
||||
scope_messages.printf("HTTP_OP::init_post(): %p io_done %d\n", this, io_done);
|
||||
|
@ -474,7 +476,7 @@ int HTTP_OP::init_post(const char* url, char* in, char* out) {
|
|||
// Initialize HTTP POST operation
|
||||
//
|
||||
int HTTP_OP::init_post2(
|
||||
const char* url, char* r1, char* in, double offset
|
||||
const char* url, char* r1, const char* in, double offset
|
||||
) {
|
||||
int retval;
|
||||
double size;
|
||||
|
@ -516,7 +518,7 @@ int HTTP_OP::init_post2(
|
|||
encstr = r_base64_encode(id_passwd,strlen(id_passwd));
|
||||
http_post_request_header_proxy(
|
||||
request_header, url_hostname, port, proxy_buf, content_length,
|
||||
(char*)encstr.c_str()
|
||||
encstr.c_str()
|
||||
);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -82,12 +82,12 @@ public:
|
|||
//// bool proxy_auth_done;
|
||||
|
||||
int init_head(const char* url);
|
||||
int init_get(const char* url, char* outfile, bool del_old_file, double offset=0);
|
||||
int init_post(const char* url, char* infile, char* outfile);
|
||||
int init_get(const char* url, const char* outfile, bool del_old_file, double offset=0);
|
||||
int init_post(const char* url, const char* infile, const char* outfile);
|
||||
int init_post2(
|
||||
const char* url,
|
||||
char* req1, // first part of request. ALSO USED FOR REPLY
|
||||
char* infile, double offset // infile is NULL if no file sent
|
||||
const char* infile, double offset // infile is NULL if no file sent
|
||||
);
|
||||
bool http_op_done();
|
||||
};
|
||||
|
|
|
@ -75,7 +75,7 @@ void project_add_failed(PROJECT* project) {
|
|||
// Depending on the priority, the message may be more or less obtrusive
|
||||
//
|
||||
void show_message(PROJECT *p, char* msg, int priority) {
|
||||
char* x;
|
||||
const char* x;
|
||||
char message[1024];
|
||||
time_t now = time(0);
|
||||
char* time_string = time_to_string(now);
|
||||
|
|
|
@ -114,10 +114,6 @@ int get_socket_error(int fd) {
|
|||
}
|
||||
|
||||
int NET_XFER::get_ip_addr(int &ip_addr) {
|
||||
return get_ip_addr(hostname, ip_addr);
|
||||
}
|
||||
|
||||
int NET_XFER::get_ip_addr(char *hostname, int &ip_addr) {
|
||||
|
||||
#ifdef WIN32
|
||||
int retval;
|
||||
|
@ -207,7 +203,7 @@ int NET_XFER::open_server() {
|
|||
sockaddr_in addr;
|
||||
int fd=0, ipaddr, retval=0;
|
||||
|
||||
retval = get_ip_addr(hostname, ipaddr);
|
||||
retval = get_ip_addr(ipaddr);
|
||||
if (retval) return retval;
|
||||
|
||||
fd = ::socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
|
|
@ -37,9 +37,8 @@
|
|||
// or being transferred to/from a file
|
||||
//
|
||||
class NET_XFER {
|
||||
char hostname[256];
|
||||
// The host we're connecting to (possibly a proxy)
|
||||
public:
|
||||
char hostname[256]; // The host we're connecting to (possibly a proxy)
|
||||
int socket;
|
||||
bool is_connected;
|
||||
bool want_download; // at most one should be true
|
||||
|
@ -73,7 +72,6 @@ public:
|
|||
|
||||
void init(char* host, int port, int blocksize);
|
||||
int get_ip_addr(int &ip_addr);
|
||||
int get_ip_addr(char *hostname, int &ip_addr);
|
||||
int open_server();
|
||||
void close_socket();
|
||||
int do_xfer(int&);
|
||||
|
|
|
@ -283,7 +283,7 @@ bool PERS_FILE_XFER::poll(double now) {
|
|||
// If there are more URLs to try, the file_xfer is restarted with these new
|
||||
// urls until a good transfer is made or it completely gives up.
|
||||
//
|
||||
void PERS_FILE_XFER::check_giveup(char* why) {
|
||||
void PERS_FILE_XFER::check_giveup(const char* why) {
|
||||
if (fip->get_next_url(fip->upload_when_present) == NULL) {
|
||||
// the file has no appropriate download location
|
||||
// remove the file from the directory and delete the file xfer object
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
bool poll(double);
|
||||
void handle_xfer_failure();
|
||||
void retry_or_backoff();
|
||||
void check_giveup(char*);
|
||||
void check_giveup(const char*);
|
||||
void abort();
|
||||
int write(MIOFILE& fout);
|
||||
int parse(MIOFILE& fin);
|
||||
|
|
|
@ -91,9 +91,9 @@ PROXY::PROXY() {
|
|||
proxy_retval = 0;
|
||||
}
|
||||
|
||||
void PROXY::init(char *dst_host, int port) {
|
||||
void PROXY::init(char *dst_host, int _port) {
|
||||
strcpy(dest_serv_name, dst_host);
|
||||
dest_serv_port = port;
|
||||
dest_serv_port = _port;
|
||||
proxy_state = PROXY_STATE_CONNECTING;
|
||||
}
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ int SCHEDULER_OP::set_min_rpc_time(PROJECT* p) {
|
|||
// Back off contacting this project's schedulers,
|
||||
// and output an error msg if needed
|
||||
//
|
||||
void SCHEDULER_OP::backoff(PROJECT* p, char *error_msg ) {
|
||||
void SCHEDULER_OP::backoff(PROJECT* p, const char *error_msg ) {
|
||||
msg_printf(p, MSG_ERROR, error_msg);
|
||||
|
||||
if (p->master_fetch_failures >= gstate.master_fetch_retry_cap) {
|
||||
|
@ -319,15 +319,15 @@ int SCHEDULER_OP::parse_master_file(vector<STRING256> &urls) {
|
|||
// transfer scheduler urls to project.
|
||||
// Return true if any of them is new
|
||||
//
|
||||
bool SCHEDULER_OP::update_urls(PROJECT& project, vector<STRING256> &urls) {
|
||||
bool SCHEDULER_OP::update_urls(vector<STRING256> &urls) {
|
||||
unsigned int i, j;
|
||||
bool found, any_new;
|
||||
|
||||
any_new = false;
|
||||
for (i=0; i<urls.size(); i++) {
|
||||
found = false;
|
||||
for (j=0; j<project.scheduler_urls.size(); j++) {
|
||||
if (!strcmp(urls[i].text, project.scheduler_urls[i].text)) {
|
||||
for (j=0; j<project->scheduler_urls.size(); j++) {
|
||||
if (!strcmp(urls[i].text, project->scheduler_urls[i].text)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
@ -335,9 +335,9 @@ bool SCHEDULER_OP::update_urls(PROJECT& project, vector<STRING256> &urls) {
|
|||
if (!found) any_new = true;
|
||||
}
|
||||
|
||||
project.scheduler_urls.clear();
|
||||
project->scheduler_urls.clear();
|
||||
for (i=0; i<urls.size(); i++) {
|
||||
project.scheduler_urls.push_back(urls[i]);
|
||||
project->scheduler_urls.push_back(urls[i]);
|
||||
}
|
||||
|
||||
return any_new;
|
||||
|
@ -386,7 +386,7 @@ bool SCHEDULER_OP::poll() {
|
|||
} else {
|
||||
// everything succeeded. Clear error counters
|
||||
//
|
||||
changed = update_urls(*project, urls);
|
||||
changed = update_urls(urls);
|
||||
if (changed) {
|
||||
project->min_rpc_time = 0;
|
||||
project->nrpc_failures = 0;
|
||||
|
|
|
@ -78,10 +78,10 @@ struct SCHEDULER_OP {
|
|||
int init_op_project(double ns);
|
||||
int init_master_fetch(PROJECT*);
|
||||
int set_min_rpc_time(PROJECT*);
|
||||
bool update_urls(PROJECT& project, std::vector<STRING256> &urls);
|
||||
bool update_urls(std::vector<STRING256> &urls);
|
||||
int start_op(PROJECT*);
|
||||
bool check_master_fetch_start();
|
||||
void backoff(PROJECT* p, char *error_msg);
|
||||
void backoff(PROJECT* p, const char *error_msg);
|
||||
int start_rpc();
|
||||
int parse_master_file(std::vector<STRING256>&);
|
||||
};
|
||||
|
|
|
@ -101,7 +101,7 @@ wxString CBOINCBaseView::GetViewName()
|
|||
// The user friendly icon of the view.
|
||||
// If it has not been defined by the view the BOINC icon is returned.
|
||||
//
|
||||
char** CBOINCBaseView::GetViewIcon()
|
||||
const char** CBOINCBaseView::GetViewIcon()
|
||||
{
|
||||
wxASSERT(NULL != boinc_xpm);
|
||||
return boinc_xpm;
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
~CBOINCBaseView();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
virtual wxInt32 GetListRowCount();
|
||||
|
||||
void FireOnListRender( wxTimerEvent& event );
|
||||
|
|
|
@ -485,8 +485,8 @@ bool CMainFrame::RestoreState()
|
|||
wxInt32 iPageCount = 0;
|
||||
bool bWindowIconized = false;
|
||||
bool bWindowMaximized = false;
|
||||
wxInt32 iTop = 0;
|
||||
wxInt32 iLeft = 0;
|
||||
//wxInt32 iTop = 0;
|
||||
//wxInt32 iLeft = 0;
|
||||
wxInt32 iHeight = 0;
|
||||
wxInt32 iWidth = 0;
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ wxString CViewMessages::GetViewName()
|
|||
}
|
||||
|
||||
|
||||
char** CViewMessages::GetViewIcon()
|
||||
const char** CViewMessages::GetViewIcon()
|
||||
{
|
||||
return mess_xpm;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
~CViewMessages();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ wxString CViewProjects::GetViewName()
|
|||
}
|
||||
|
||||
|
||||
char** CViewProjects::GetViewIcon()
|
||||
const char** CViewProjects::GetViewIcon()
|
||||
{
|
||||
return proj_xpm;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
~CViewProjects();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ wxString CViewResources::GetViewName()
|
|||
}
|
||||
|
||||
|
||||
char** CViewResources::GetViewIcon()
|
||||
const char** CViewResources::GetViewIcon()
|
||||
{
|
||||
return usage_xpm;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
~CViewResources();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ wxString CViewTransfers::GetViewName()
|
|||
}
|
||||
|
||||
|
||||
char** CViewTransfers::GetViewIcon()
|
||||
const char** CViewTransfers::GetViewIcon()
|
||||
{
|
||||
return xfer_xpm;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
~CViewTransfers();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ wxString CViewWork::GetViewName()
|
|||
}
|
||||
|
||||
|
||||
char** CViewWork::GetViewIcon()
|
||||
const char** CViewWork::GetViewIcon()
|
||||
{
|
||||
return result_xpm;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
~CViewWork();
|
||||
|
||||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
virtual const char** GetViewIcon();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *APP_ICON_xpm[] = {
|
||||
static const char *APP_ICON_xpm[] = {
|
||||
"16 16 32 1",
|
||||
" c None",
|
||||
". c #000066",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *boinc_xpm[] = {
|
||||
static const char *boinc_xpm[] = {
|
||||
"16 16 32 1",
|
||||
" c None",
|
||||
". c #000066",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *boincsm_xpm[] = {
|
||||
static const char *boincsm_xpm[] = {
|
||||
"50 50 84 1",
|
||||
" c None",
|
||||
". c #94B5D6",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *mess_xpm[] = {
|
||||
static const char *mess_xpm[] = {
|
||||
"16 16 3 1",
|
||||
" c #FF00FF",
|
||||
". c #000000",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *proj_xpm[] = {
|
||||
static const char *proj_xpm[] = {
|
||||
"16 16 4 1",
|
||||
" c #FF00FF",
|
||||
". c #000000",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *result_xpm[] = {
|
||||
static const char *result_xpm[] = {
|
||||
"16 16 3 1",
|
||||
" c #FF00FF",
|
||||
". c #000000",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *usage_xpm[] = {
|
||||
static const char *usage_xpm[] = {
|
||||
"16 16 3 1",
|
||||
" c #FF00FF",
|
||||
". c #000000",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/* XPM */
|
||||
static char *xfer_xpm[] = {
|
||||
static const char *xfer_xpm[] = {
|
||||
"16 16 4 1",
|
||||
" c #FF00FF",
|
||||
". c #000000",
|
||||
|
|
|
@ -1021,7 +1021,7 @@ void WORK_ITEM::parse(MYSQL_ROW& r) {
|
|||
strcpy2(wu.result_template_file, r[i++]);
|
||||
}
|
||||
|
||||
int DB_WORK_ITEM::enumerate(int limit, char* order_clause) {
|
||||
int DB_WORK_ITEM::enumerate(int limit, const char* order_clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
int retval;
|
||||
MYSQL_ROW row;
|
||||
|
|
|
@ -117,7 +117,7 @@ struct APP_VERSION {
|
|||
int max_core_version; // if <>0, max core version this will run with
|
||||
bool deprecated;
|
||||
|
||||
int write(FILE*, APP&);
|
||||
int write(FILE*);
|
||||
void clear();
|
||||
};
|
||||
|
||||
|
@ -633,7 +633,7 @@ class DB_WORK_ITEM : public WORK_ITEM, public DB_BASE_SPECIAL {
|
|||
public:
|
||||
DB_WORK_ITEM(DB_CONN* p=0);
|
||||
// CURSOR cursor;
|
||||
int enumerate(int limit, char* order_clause);
|
||||
int enumerate(int limit, const char* order_clause);
|
||||
// used by feeder
|
||||
int read_result();
|
||||
// used by scheduler to read result server state
|
||||
|
|
28
db/db_base.C
28
db/db_base.C
|
@ -50,7 +50,7 @@ void DB_CONN::close() {
|
|||
if (mysql) mysql_close(mysql);
|
||||
}
|
||||
|
||||
int DB_CONN::do_query(char* p) {
|
||||
int DB_CONN::do_query(const char* p) {
|
||||
int retval;
|
||||
#ifdef SHOW_QUERIES
|
||||
fprintf(stderr, "query: %s\n", p);
|
||||
|
@ -75,7 +75,7 @@ int DB_CONN::insert_id() {
|
|||
return atoi(row[0]);
|
||||
}
|
||||
|
||||
void DB_CONN::print_error(char* p) {
|
||||
void DB_CONN::print_error(const char* p) {
|
||||
fprintf(stderr, "%s: Database error: %s\n", p, error_string());
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ int DB_CONN::commit_transaction() {
|
|||
return do_query("COMMIT");
|
||||
}
|
||||
|
||||
DB_BASE::DB_BASE(char *tn, DB_CONN* p) : db(p), table_name(tn) {
|
||||
DB_BASE::DB_BASE(const char *tn, DB_CONN* p) : db(p), table_name(tn) {
|
||||
is_high_priority = false;
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ int DB_BASE::insert() {
|
|||
int DB_BASE::insert_batch(std::string& values) {
|
||||
std::string query;
|
||||
query = "insert into " + std::string(table_name) + " values " + values;
|
||||
return db->do_query((char*)query.c_str());
|
||||
return db->do_query(query.c_str());
|
||||
}
|
||||
|
||||
// update an entire record
|
||||
|
@ -125,7 +125,7 @@ int DB_BASE::update() {
|
|||
// update one or more fields
|
||||
// "clause" is something like "foo=5, blah='xxx'" or "foo=foo+5"
|
||||
//
|
||||
int DB_BASE::update_field(char* clause) {
|
||||
int DB_BASE::update_field(const char* clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
sprintf(query, "update %s set %s where id=%d", table_name, clause, get_id());
|
||||
return db->do_query(query);
|
||||
|
@ -140,7 +140,7 @@ int DB_BASE::delete_from_db() {
|
|||
return db->do_query(query);
|
||||
}
|
||||
|
||||
int DB_BASE::get_field_int(char* field, int& val) {
|
||||
int DB_BASE::get_field_int(const char* field, int& val) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
int retval;
|
||||
MYSQL_ROW row;
|
||||
|
@ -158,7 +158,7 @@ int DB_BASE::get_field_int(char* field, int& val) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DB_BASE::lookup(char* clause) {
|
||||
int DB_BASE::lookup(const char* clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
int retval;
|
||||
MYSQL_ROW row;
|
||||
|
@ -206,7 +206,7 @@ int DB_BASE::lookup_id(int id) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DB_BASE::enumerate(char* clause, bool use_use_result) {
|
||||
int DB_BASE::enumerate(const char* clause, bool use_use_result) {
|
||||
int x;
|
||||
char query[MAX_QUERY_LEN];
|
||||
MYSQL_ROW row;
|
||||
|
@ -237,7 +237,7 @@ int DB_BASE::enumerate(char* clause, bool use_use_result) {
|
|||
if (!row) {
|
||||
mysql_free_result(cursor.rp);
|
||||
cursor.active = false;
|
||||
int x = mysql_errno(db->mysql);
|
||||
x = mysql_errno(db->mysql);
|
||||
if (x) return x;
|
||||
return ERR_DB_NOT_FOUND;
|
||||
} else {
|
||||
|
@ -256,7 +256,7 @@ int DB_BASE::end_enumerate() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DB_BASE::get_integer(char* query, int& n) {
|
||||
int DB_BASE::get_integer(const char* query, int& n) {
|
||||
int retval;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES* resp;
|
||||
|
@ -273,7 +273,7 @@ int DB_BASE::get_integer(char* query, int& n) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DB_BASE::get_double(char* query, double& x) {
|
||||
int DB_BASE::get_double(const char* query, double& x) {
|
||||
int retval;
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES* resp;
|
||||
|
@ -290,7 +290,7 @@ int DB_BASE::get_double(char* query, double& x) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DB_BASE::count(int& n, char* clause) {
|
||||
int DB_BASE::count(int& n, const char* clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
|
||||
if (is_high_priority) {
|
||||
|
@ -302,13 +302,13 @@ int DB_BASE::count(int& n, char* clause) {
|
|||
return get_integer(query, n);
|
||||
}
|
||||
|
||||
int DB_BASE::max_id(int& n, char* clause) {
|
||||
int DB_BASE::max_id(int& n, const char* clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
sprintf(query, "select max(id) from %s %s", table_name, clause);
|
||||
return get_integer(query, n);
|
||||
}
|
||||
|
||||
int DB_BASE::sum(double& x, char* field, char* clause) {
|
||||
int DB_BASE::sum(double& x, const char* field, const char* clause) {
|
||||
char query[MAX_QUERY_LEN];
|
||||
|
||||
if (is_high_priority) {
|
||||
|
|
26
db/db_base.h
26
db/db_base.h
|
@ -38,7 +38,7 @@ inline float safe_atof(const char* s) {
|
|||
|
||||
#define strcpy2(x, y) \
|
||||
{ \
|
||||
char* z = y; \
|
||||
const char* z = y; \
|
||||
if (!z) { \
|
||||
x[0]=0; \
|
||||
} else { \
|
||||
|
@ -61,10 +61,10 @@ class DB_CONN {
|
|||
public:
|
||||
DB_CONN();
|
||||
int open(char* name, char* host, char* user, char* passwd);
|
||||
int do_query(char*);
|
||||
int do_query(const char*);
|
||||
void close();
|
||||
int insert_id();
|
||||
void print_error(char*);
|
||||
void print_error(const char*);
|
||||
const char* error_string();
|
||||
|
||||
MYSQL* mysql;
|
||||
|
@ -77,22 +77,22 @@ public:
|
|||
//
|
||||
class DB_BASE {
|
||||
public:
|
||||
DB_BASE(char *table_name, DB_CONN*);
|
||||
DB_BASE(const char *table_name, DB_CONN*);
|
||||
int insert();
|
||||
int insert_batch(std::string&);
|
||||
int update();
|
||||
int update_field(char*);
|
||||
int update_field(const char*);
|
||||
int delete_from_db();
|
||||
int get_field_int(char*, int&);
|
||||
int get_field_int(const char*, int&);
|
||||
int lookup_id(int id);
|
||||
int lookup(char*);
|
||||
int enumerate(char* clause="", bool use_use_result=false);
|
||||
int lookup(const char*);
|
||||
int enumerate(const char* clause="", bool use_use_result=false);
|
||||
int end_enumerate();
|
||||
int count(int&, char* clause="");
|
||||
int max_id(int&, char* clause="");
|
||||
int sum(double&, char* field, char* clause="");
|
||||
int get_double(char* query, double&);
|
||||
int get_integer(char* query, int&);
|
||||
int count(int&, const char* clause="");
|
||||
int max_id(int&, const char* clause="");
|
||||
int sum(double&, const char* field, const char* clause="");
|
||||
int get_double(const char* query, double&);
|
||||
int get_integer(const char* query, int&);
|
||||
bool is_high_priority;
|
||||
|
||||
DB_CONN* db;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
using std::string;
|
||||
|
||||
char* xml_graphics_modes[NGRAPHICS_MSGS] = {
|
||||
const char* xml_graphics_modes[NGRAPHICS_MSGS] = {
|
||||
"<mode_unsupported/>",
|
||||
"<mode_hide_graphics/>",
|
||||
"<mode_window/>",
|
||||
|
@ -50,6 +50,14 @@ GRAPHICS_MSG::GRAPHICS_MSG() {
|
|||
memset(this, 0, sizeof(GRAPHICS_MSG));
|
||||
}
|
||||
|
||||
APP_INIT_DATA::APP_INIT_DATA() {
|
||||
project_preferences = 0;
|
||||
}
|
||||
|
||||
APP_INIT_DATA::~APP_INIT_DATA() {
|
||||
if (project_preferences) free(project_preferences);
|
||||
}
|
||||
|
||||
int write_init_data_file(FILE* f, APP_INIT_DATA& ai) {
|
||||
string str1, str2;
|
||||
fprintf(f, "<app_init_data>\n<core_version>%d</core_version>\n", ai.core_version);
|
||||
|
@ -187,14 +195,14 @@ bool MSG_CHANNEL::has_msg() {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool MSG_CHANNEL::send_msg(char *msg) {
|
||||
bool MSG_CHANNEL::send_msg(const char *msg) {
|
||||
if (buf[0]) return false;
|
||||
safe_strncpy(buf+1, msg, MSG_CHANNEL_SIZE-1);
|
||||
buf[0] = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void MSG_CHANNEL::send_msg_overwrite(char* msg) {
|
||||
void MSG_CHANNEL::send_msg_overwrite(const char* msg) {
|
||||
safe_strncpy(buf+1, msg, MSG_CHANNEL_SIZE-1);
|
||||
buf[0] = 1;
|
||||
}
|
||||
|
|
|
@ -54,9 +54,9 @@ struct MSG_CHANNEL {
|
|||
char buf[MSG_CHANNEL_SIZE];
|
||||
bool get_msg(char*); // returns a message and clears pending flag
|
||||
bool has_msg();
|
||||
bool send_msg(char*); // if there is not a message in the segment,
|
||||
bool send_msg(const char*); // if there is not a message in the segment,
|
||||
// writes specified message and sets pending flag
|
||||
void send_msg_overwrite(char*);
|
||||
void send_msg_overwrite(const char*);
|
||||
// write message, overwriting any msg already there
|
||||
};
|
||||
|
||||
|
@ -101,7 +101,7 @@ struct SHARED_MEM {
|
|||
struct MSG_QUEUE {
|
||||
std::vector<std::string> msgs;
|
||||
char name[256];
|
||||
void msg_queue_send(char*, MSG_CHANNEL& channel);
|
||||
void msg_queue_send(const char*, MSG_CHANNEL& channel);
|
||||
void msg_queue_poll(MSG_CHANNEL& channel);
|
||||
};
|
||||
|
||||
|
@ -186,6 +186,9 @@ struct APP_INIT_DATA {
|
|||
// fraction of the total.
|
||||
double fraction_done_start;
|
||||
double fraction_done_end;
|
||||
|
||||
APP_INIT_DATA();
|
||||
~APP_INIT_DATA();
|
||||
};
|
||||
|
||||
struct GRAPHICS_INFO {
|
||||
|
@ -210,7 +213,7 @@ int parse_graphics_file(FILE* f, GRAPHICS_INFO* gi);
|
|||
#define STDOUT_FILE "stdout.txt"
|
||||
#define LOCKFILE "boinc_lockfile"
|
||||
|
||||
extern char* xml_graphics_modes[NGRAPHICS_MSGS];
|
||||
extern const char* xml_graphics_modes[NGRAPHICS_MSGS];
|
||||
int boinc_link(const char* existing, const char* new_link);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -93,7 +93,6 @@ int main(int argc, char** argv) {
|
|||
MESSAGES messages;
|
||||
int retval;
|
||||
char* hostname=0;
|
||||
PROJECT project;
|
||||
|
||||
#ifdef _WIN32
|
||||
WSADATA wsdata;
|
||||
|
|
18
lib/crypt.C
18
lib/crypt.C
|
@ -113,7 +113,7 @@ int scan_hex_data(FILE* f, DATA_BLOCK& x) {
|
|||
|
||||
// same, but read from buffer
|
||||
//
|
||||
static int sscan_hex_data(char* p, DATA_BLOCK& x) {
|
||||
static int sscan_hex_data(const char* p, DATA_BLOCK& x) {
|
||||
int m, n, nleft=x.len;
|
||||
|
||||
x.len = 0;
|
||||
|
@ -189,7 +189,7 @@ int scan_key_hex(FILE* f, KEY* key, int size) {
|
|||
|
||||
// parse a text-encoded key from a memory buffer
|
||||
//
|
||||
int sscan_key_hex(char* buf, KEY* key, int size) {
|
||||
int sscan_key_hex(const char* buf, KEY* key, int size) {
|
||||
int n, retval,num_bits;
|
||||
DATA_BLOCK db;
|
||||
|
||||
|
@ -234,7 +234,7 @@ int decrypt_public(R_RSA_PUBLIC_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out) {
|
|||
return RSAPublicDecrypt(out.data, &out.len, in.data, in.len, &key);
|
||||
}
|
||||
|
||||
int sign_file(char* path, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
|
||||
int sign_file(const char* path, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signature) {
|
||||
char md5_buf[MD5_LEN];
|
||||
double file_length;
|
||||
DATA_BLOCK in_block;
|
||||
|
@ -266,7 +266,7 @@ int sign_block(DATA_BLOCK& data_block, R_RSA_PRIVATE_KEY& key, DATA_BLOCK& signa
|
|||
}
|
||||
|
||||
int verify_file(
|
||||
char* path, R_RSA_PUBLIC_KEY& key, DATA_BLOCK& signature, bool& answer
|
||||
const char* path, R_RSA_PUBLIC_KEY& key, DATA_BLOCK& signature, bool& answer
|
||||
) {
|
||||
char md5_buf[MD5_LEN], clear_buf[MD5_LEN];
|
||||
double file_length;
|
||||
|
@ -291,7 +291,7 @@ int verify_file(
|
|||
}
|
||||
|
||||
int verify_file2(
|
||||
char* path, char* signature_text, char* key_text, bool& answer
|
||||
const char* path, const char* signature_text, const char* key_text, bool& answer
|
||||
) {
|
||||
R_RSA_PUBLIC_KEY key;
|
||||
unsigned char signature_buf[SIGNATURE_SIZE_BINARY];
|
||||
|
@ -313,7 +313,7 @@ int verify_file2(
|
|||
// verify, where both text and signature are char strings
|
||||
//
|
||||
int verify_string(
|
||||
char* text, char* signature_text, R_RSA_PUBLIC_KEY& key, bool& answer
|
||||
const char* text, const char* signature_text, R_RSA_PUBLIC_KEY& key, bool& answer
|
||||
) {
|
||||
char md5_buf[MD5_LEN];
|
||||
unsigned char signature_buf[SIGNATURE_SIZE_BINARY];
|
||||
|
@ -321,7 +321,7 @@ int verify_string(
|
|||
int retval, n;
|
||||
DATA_BLOCK signature, clear_signature;
|
||||
|
||||
retval = md5_block((unsigned char*)text, strlen(text), md5_buf);
|
||||
retval = md5_block((const unsigned char*)text, strlen(text), md5_buf);
|
||||
if (retval) return retval;
|
||||
n = strlen(md5_buf);
|
||||
signature.data = signature_buf;
|
||||
|
@ -339,7 +339,7 @@ int verify_string(
|
|||
// Same, where public key is also encoded as text
|
||||
//
|
||||
int verify_string2(
|
||||
char* text, char* signature_text, char* key_text, bool& answer
|
||||
const char* text, const char* signature_text, const char* key_text, bool& answer
|
||||
) {
|
||||
R_RSA_PUBLIC_KEY key;
|
||||
int retval;
|
||||
|
@ -349,7 +349,7 @@ int verify_string2(
|
|||
return verify_string(text, signature_text, key, answer);
|
||||
}
|
||||
|
||||
int read_key_file(char* keyfile, R_RSA_PRIVATE_KEY& key) {
|
||||
int read_key_file(const char* keyfile, R_RSA_PRIVATE_KEY& key) {
|
||||
int retval;
|
||||
FILE* fkey = fopen(keyfile, "r");
|
||||
if (!fkey) {
|
||||
|
|
22
lib/crypt.h
22
lib/crypt.h
|
@ -52,18 +52,26 @@ int sprint_hex_data(char* p, DATA_BLOCK&);
|
|||
int scan_hex_data(FILE* f, DATA_BLOCK&);
|
||||
int print_key_hex(FILE*, KEY* key, int len);
|
||||
int scan_key_hex(FILE*, KEY* key, int len);
|
||||
int sscan_key_hex(char*, KEY* key, int len);
|
||||
int sscan_key_hex(const char*, KEY* key, int len);
|
||||
int encrypt_private(
|
||||
R_RSA_PRIVATE_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out, int&
|
||||
);
|
||||
int decrypt_public(R_RSA_PUBLIC_KEY& key, DATA_BLOCK& in, DATA_BLOCK& out);
|
||||
int sign_file(char* path, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature);
|
||||
int sign_file(const char* path, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature);
|
||||
int sign_block(DATA_BLOCK& data, R_RSA_PRIVATE_KEY&, DATA_BLOCK& signature);
|
||||
int verify_file(char* path, R_RSA_PUBLIC_KEY&, DATA_BLOCK& signature, bool&);
|
||||
int verify_file2(char* path, char* signature, char* key, bool&);
|
||||
int verify_string(char* text, char* signature, R_RSA_PUBLIC_KEY&, bool&);
|
||||
int verify_string2(char* text, char* signature, char* key, bool&);
|
||||
int verify_file(
|
||||
const char* path, R_RSA_PUBLIC_KEY&, DATA_BLOCK& signature, bool&
|
||||
);
|
||||
int verify_file2(
|
||||
const char* path, const char* signature, const char* key, bool&
|
||||
);
|
||||
int verify_string(
|
||||
const char* text, const char* signature, R_RSA_PUBLIC_KEY&, bool&
|
||||
);
|
||||
int verify_string2(
|
||||
const char* text, const char* signature, const char* key, bool&
|
||||
);
|
||||
|
||||
int read_key_file(char* keyfile, R_RSA_PRIVATE_KEY& key);
|
||||
int read_key_file(const char* keyfile, R_RSA_PRIVATE_KEY& key);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include "crypt.h"
|
||||
|
||||
void die(char* p) {
|
||||
void die(const char* p) {
|
||||
fprintf(stderr, "Error: %s\n", p);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -145,7 +145,8 @@ int main(int argc, char** argv) {
|
|||
if (!fpub) die("fopen");
|
||||
retval = scan_key_hex(fpub, (KEY*)&public_key, sizeof(public_key));
|
||||
if (retval) die("read_public_key");
|
||||
in.data = (unsigned char*) "foobar";
|
||||
strcpy((char*)buf2, "foobar");
|
||||
in.data = buf2;
|
||||
in.len = strlen((char*)in.data);
|
||||
out.data = buf;
|
||||
encrypt_private(private_key, in, out, n);
|
||||
|
|
|
@ -104,7 +104,9 @@ int boinc_install_signal_handlers() {
|
|||
|
||||
// initialize the diagnostics environment.
|
||||
//
|
||||
int diagnostics_init(int _flags, char* stdout_prefix, char* stderr_prefix) {
|
||||
int diagnostics_init(
|
||||
int _flags, const char* stdout_prefix, const char* stderr_prefix
|
||||
) {
|
||||
|
||||
flags = _flags;
|
||||
snprintf(stdout_log, sizeof(stdout_log), "%s.txt", stdout_prefix);
|
||||
|
|
|
@ -136,7 +136,9 @@ extern int boinc_init_diagnostics(int flags);
|
|||
extern int boinc_finish_diag();
|
||||
extern int boinc_install_signal_handlers();
|
||||
|
||||
extern int diagnostics_init(int flags, char* stdout_prefix, char* stderr_prefix);
|
||||
extern int diagnostics_init(
|
||||
int flags, const char* stdout_prefix, const char* stderr_prefix
|
||||
);
|
||||
extern int diagnostics_cycle_logs();
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -471,7 +471,7 @@ typedef int HANDLE;
|
|||
#endif
|
||||
HANDLE app_lockfile_handle;
|
||||
|
||||
int lock_file(char* filename) {
|
||||
int lock_file(const char* filename) {
|
||||
int retval=0;
|
||||
#ifdef _WIN32
|
||||
app_lockfile_handle = CreateFile(
|
||||
|
@ -517,7 +517,7 @@ int lock_file(char* filename) {
|
|||
return retval;
|
||||
}
|
||||
|
||||
void relative_to_absolute(char* relname, char* path) {
|
||||
void relative_to_absolute(const char* relname, char* path) {
|
||||
#ifdef _WIN32
|
||||
_getcwd(path, 256);
|
||||
#else
|
||||
|
|
|
@ -65,8 +65,8 @@ extern "C" {
|
|||
extern int boinc_rename(const char* old, const char* newf);
|
||||
extern int boinc_mkdir(const char*);
|
||||
extern int boinc_rmdir(const char*);
|
||||
extern int lock_file(char*);
|
||||
extern void relative_to_absolute(char* relname, char* path);
|
||||
extern int lock_file(const char*);
|
||||
extern void relative_to_absolute(const char* relname, char* path);
|
||||
extern int boinc_make_dirs(char*, char*);
|
||||
extern char boinc_failed_file[256];
|
||||
int is_dir(const char* path);
|
||||
|
|
|
@ -981,7 +981,7 @@ int RPC_CLIENT::init(const char* host) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::send_request(char* p) {
|
||||
int RPC_CLIENT::send_request(const char* p) {
|
||||
char buf[4096];
|
||||
sprintf(buf,
|
||||
"<boinc_gui_rpc_request>\n"
|
||||
|
@ -1023,7 +1023,7 @@ RPC::~RPC() {
|
|||
if (mbuf) free(mbuf);
|
||||
}
|
||||
|
||||
int RPC::do_rpc(char* req) {
|
||||
int RPC::do_rpc(const char* req) {
|
||||
int retval;
|
||||
|
||||
if (rpc_client->sock == 0) return ERR_CONNECT;
|
||||
|
@ -1222,8 +1222,9 @@ int RPC_CLIENT::show_graphics(
|
|||
return rpc.do_rpc(buf);
|
||||
}
|
||||
|
||||
int RPC_CLIENT::project_op(PROJECT& project, char* op) {
|
||||
char buf[256], *tag;
|
||||
int RPC_CLIENT::project_op(PROJECT& project, const char* op) {
|
||||
char buf[256];
|
||||
const char *tag;
|
||||
RPC rpc(this);
|
||||
|
||||
if (!strcmp(op, "reset")) {
|
||||
|
@ -1268,8 +1269,8 @@ int RPC_CLIENT::project_attach(char* url, char* auth) {
|
|||
return rpc.do_rpc(buf);
|
||||
}
|
||||
|
||||
char* RPC_CLIENT::mode_name(int mode) {
|
||||
char* p = NULL;
|
||||
const char* RPC_CLIENT::mode_name(int mode) {
|
||||
const char* p = NULL;
|
||||
switch (mode) {
|
||||
case RUN_MODE_ALWAYS: p="<always/>"; break;
|
||||
case RUN_MODE_NEVER: p="<never/>"; break;
|
||||
|
@ -1448,8 +1449,9 @@ int RPC_CLIENT::get_messages(int seqno, MESSAGES& msgs) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::file_transfer_op(FILE_TRANSFER& ft, char* op) {
|
||||
char buf[4096], *tag;
|
||||
int RPC_CLIENT::file_transfer_op(FILE_TRANSFER& ft, const char* op) {
|
||||
char buf[4096];
|
||||
const char *tag;
|
||||
RPC rpc(this);
|
||||
|
||||
if (!strcmp(op, "retry")) {
|
||||
|
@ -1472,8 +1474,9 @@ int RPC_CLIENT::file_transfer_op(FILE_TRANSFER& ft, char* op) {
|
|||
return rpc.do_rpc(buf);
|
||||
}
|
||||
|
||||
int RPC_CLIENT::result_op(RESULT& result, char* op) {
|
||||
char buf[4096], *tag;
|
||||
int RPC_CLIENT::result_op(RESULT& result, const char* op) {
|
||||
char buf[4096];
|
||||
const char *tag;
|
||||
RPC rpc(this);
|
||||
|
||||
if (!strcmp(op, "abort")) {
|
||||
|
|
|
@ -371,7 +371,7 @@ struct DISPLAY_INFO {
|
|||
class RPC_CLIENT {
|
||||
public:
|
||||
int sock;
|
||||
int send_request(char*);
|
||||
int send_request(const char*);
|
||||
int get_reply(char*&);
|
||||
|
||||
public:
|
||||
|
@ -389,7 +389,7 @@ public:
|
|||
const char* project, const char* result_name, bool full_screen,
|
||||
DISPLAY_INFO&
|
||||
);
|
||||
int project_op(PROJECT&, char* op);
|
||||
int project_op(PROJECT&, const char* op);
|
||||
int project_attach(char* url, char* auth);
|
||||
int set_run_mode(int mode);
|
||||
int get_run_mode(int& mode);
|
||||
|
@ -403,12 +403,12 @@ public:
|
|||
int set_proxy_settings(PROXY_INFO&);
|
||||
int get_proxy_settings(PROXY_INFO&);
|
||||
int get_messages(int seqno, MESSAGES&);
|
||||
int file_transfer_op(FILE_TRANSFER&, char*);
|
||||
int result_op(RESULT&, char*);
|
||||
int file_transfer_op(FILE_TRANSFER&, const char*);
|
||||
int result_op(RESULT&, const char*);
|
||||
int get_host_info(HOST_INFO&);
|
||||
int quit();
|
||||
int acct_mgr_rpc(char* url, char* name, char* passwd);
|
||||
char* mode_name(int mode);
|
||||
const char* mode_name(int mode);
|
||||
};
|
||||
|
||||
struct RPC {
|
||||
|
@ -418,5 +418,5 @@ struct RPC {
|
|||
|
||||
RPC(RPC_CLIENT*);
|
||||
~RPC();
|
||||
int do_rpc(char*);
|
||||
int do_rpc(const char*);
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ LANGUAGE::~LANGUAGE() {
|
|||
language_file_contents = NULL;
|
||||
}
|
||||
|
||||
int LANGUAGE::read_language_file(char *file_name) {
|
||||
int LANGUAGE::read_language_file(const char *file_name) {
|
||||
int retval;
|
||||
|
||||
// TODO: put in a size limitation here?
|
||||
|
|
|
@ -35,7 +35,7 @@ class LANGUAGE {
|
|||
public:
|
||||
LANGUAGE();
|
||||
~LANGUAGE();
|
||||
int read_language_file(char *);
|
||||
int read_language_file(const char *);
|
||||
int get_translation(char *, char *, char *, int );
|
||||
};
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ int read_file_malloc(const char* pathname, char*& str) {
|
|||
// replace XML element contents (element must be present)
|
||||
//
|
||||
void replace_element_contents(
|
||||
char* buf, char* start, char* end, char* replacement
|
||||
char* buf, const char* start, const char* end, const char* replacement
|
||||
) {
|
||||
char temp[4096], *p, *q;
|
||||
|
||||
|
@ -240,7 +240,7 @@ void replace_element_contents(
|
|||
|
||||
// if the string contains a substring of the form X...Y,
|
||||
// remove the first such.
|
||||
bool remove_element(char* buf, char* start, char* end) {
|
||||
bool remove_element(char* buf, const char* start, const char* end) {
|
||||
char* p, *q;
|
||||
p = strstr(buf, start);
|
||||
if (!p) return false;
|
||||
|
@ -252,7 +252,7 @@ bool remove_element(char* buf, char* start, char* end) {
|
|||
|
||||
// replace a substring. Do at most one instance.
|
||||
//
|
||||
bool str_replace(char* str, char* substr, char* replacement) {
|
||||
bool str_replace(char* str, const char* substr, const char* replacement) {
|
||||
char temp[4096], *p;
|
||||
|
||||
p = strstr(str, substr);
|
||||
|
|
|
@ -41,10 +41,10 @@ extern int copy_element_contents(FILE* in, const char* end_tag, char* p, int len
|
|||
extern int copy_element_contents(FILE* in, const char* end_tag, std::string&);
|
||||
extern int read_file_malloc(const char* pathname, char*& str);
|
||||
extern void replace_element_contents(
|
||||
char* buf, char* start, char* end, char* replacement
|
||||
char* buf, const char* start, const char* end, const char* replacement
|
||||
);
|
||||
extern bool remove_element(char* buf, char* start, char* end);
|
||||
extern bool str_replace(char* str, char* old, char* neww);
|
||||
extern bool remove_element(char* buf, const char* start, const char* end);
|
||||
extern bool str_replace(char* str, const char* old, const char* neww);
|
||||
extern char* sgets(char* buf, int len, char* &in);
|
||||
extern void xml_escape(std::string&, std::string&);
|
||||
extern void xml_escape(char*, std::string&);
|
||||
|
|
|
@ -90,7 +90,7 @@ GLOBAL_PREFS::GLOBAL_PREFS() {
|
|||
// where X==host_venue, then parse that and ignore the rest.
|
||||
// Otherwise ignore <venue> elements.
|
||||
//
|
||||
int GLOBAL_PREFS::parse(FILE* in, char* host_venue, bool& found_venue) {
|
||||
int GLOBAL_PREFS::parse(FILE* in, const char* host_venue, bool& found_venue) {
|
||||
char buf[256], buf2[256];
|
||||
bool in_venue = false, in_correct_venue=false;
|
||||
|
||||
|
@ -206,7 +206,7 @@ int GLOBAL_PREFS::parse(FILE* in, char* host_venue, bool& found_venue) {
|
|||
// Parse global prefs file
|
||||
//
|
||||
int GLOBAL_PREFS::parse_file(
|
||||
char* filename, char* host_venue, bool& found_venue
|
||||
const char* filename, const char* host_venue, bool& found_venue
|
||||
) {
|
||||
FILE* f;
|
||||
int retval;
|
||||
|
|
|
@ -63,8 +63,8 @@ struct GLOBAL_PREFS {
|
|||
GLOBAL_PREFS();
|
||||
void defaults();
|
||||
void clear_bools();
|
||||
int parse(FILE*, char* venue, bool& found_venue);
|
||||
int parse_file(char* filename, char* venue, bool& found_venue);
|
||||
int parse(FILE*, const char* venue, bool& found_venue);
|
||||
int parse_file(const char* filename, const char* venue, bool& found_venue);
|
||||
int write(FILE*);
|
||||
};
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ using std::vector;
|
|||
using std::string;
|
||||
|
||||
int assimilate_handler(
|
||||
WORKUNIT& wu, vector<RESULT>& results, RESULT& canonical_result
|
||||
WORKUNIT& wu, vector<RESULT>& /*results*/, RESULT& canonical_result
|
||||
) {
|
||||
SCOPE_MSG_LOG scope_messages(log_messages, SCHED_MSG_LOG::NORMAL);
|
||||
scope_messages.printf("[%s] Assimilating\n", wu.name);
|
||||
|
|
|
@ -79,8 +79,8 @@ using std::vector;
|
|||
#define TABLE_HOST 2
|
||||
|
||||
// must match the above
|
||||
char* table_name[3] = {"user", "team", "host"};
|
||||
char* tag_name[3] = {"users", "teams", "hosts"};
|
||||
const char* table_name[3] = {"user", "team", "host"};
|
||||
const char* tag_name[3] = {"users", "teams", "hosts"};
|
||||
|
||||
struct OUTPUT {
|
||||
int recs_per_file;
|
||||
|
@ -366,7 +366,7 @@ void write_host(HOST& host, FILE* f, bool detail) {
|
|||
);
|
||||
}
|
||||
|
||||
void write_user(USER& user, FILE* f, bool detail) {
|
||||
void write_user(USER& user, FILE* f, bool /*detail*/) {
|
||||
char buf[1024];
|
||||
char cpid[MD5_LEN];
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ int max_number_workunits_to_purge=0;
|
|||
#define COMPRESSION_ZIP 2
|
||||
|
||||
// subscripts MUST be in agreement with defines above
|
||||
char *suffix[3]={"", ".gz", ".zip"};
|
||||
const char *suffix[3]={"", ".gz", ".zip"};
|
||||
|
||||
// default is no compression
|
||||
int compression_type=COMPRESSION_NONE;
|
||||
|
@ -128,7 +128,7 @@ bool time_to_quit() {
|
|||
// asked for compression, then we popen(2) a pipe to gzip or zip.
|
||||
// This does 'in place' compression.
|
||||
//
|
||||
void open_archive(char* filename_prefix, FILE*& f){
|
||||
void open_archive(const char* filename_prefix, FILE*& f){
|
||||
char path[256];
|
||||
char command[512];
|
||||
|
||||
|
@ -174,7 +174,7 @@ void open_archive(char* filename_prefix, FILE*& f){
|
|||
return;
|
||||
}
|
||||
|
||||
void close_archive(char *filename, FILE*& fp){
|
||||
void close_archive(const char *filename, FILE*& fp){
|
||||
char path[256];
|
||||
|
||||
// Set file pointer to NULL after closing file to indicate that it's closed.
|
||||
|
|
|
@ -124,7 +124,7 @@
|
|||
SCHED_CONFIG config;
|
||||
SCHED_SHMEM* ssp;
|
||||
key_t sema_key;
|
||||
char* order_clause="";
|
||||
const char* order_clause="";
|
||||
|
||||
void cleanup_shmem() {
|
||||
detach_shmem((void*)ssp);
|
||||
|
@ -195,7 +195,7 @@ static int remove_infeasible(int i) {
|
|||
|
||||
static void scan_work_array(
|
||||
DB_WORK_ITEM& wi,
|
||||
int& nadditions, int& ncollisions, int& ninfeasible,
|
||||
int& nadditions, int& ncollisions, int& /*ninfeasible*/,
|
||||
bool& no_wus
|
||||
) {
|
||||
int i, j, retval;
|
||||
|
|
|
@ -114,7 +114,7 @@ int return_error(bool transient, const char* message, ...) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int return_success(char* text) {
|
||||
int return_success(const char* text) {
|
||||
printf(
|
||||
"Content-type: text/plain\n\n"
|
||||
"<data_server_reply>\n"
|
||||
|
@ -413,7 +413,7 @@ int get_key(R_RSA_PUBLIC_KEY& key) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void boinc_catch_signal(int x) {
|
||||
void boinc_catch_signal(int ) {
|
||||
}
|
||||
|
||||
void installer() {
|
||||
|
|
|
@ -252,7 +252,7 @@ make_new_host:
|
|||
// somewhat arbitrary formula for credit as a function of CPU time.
|
||||
// Could also include terms for RAM size, network speed etc.
|
||||
//
|
||||
static void compute_credit_rating(HOST& host, SCHEDULER_REQUEST& sreq) {
|
||||
static void compute_credit_rating(HOST& host) {
|
||||
double cobblestone_factor = 100;
|
||||
host.credit_per_cpu_sec =
|
||||
(fabs(host.p_fpops)/1e9 + fabs(host.p_iops)/1e9)
|
||||
|
@ -293,7 +293,7 @@ static int modify_host_struct(SCHEDULER_REQUEST& sreq, HOST& host) {
|
|||
host.n_bwdown = sreq.host.n_bwdown;
|
||||
host.fix_nans();
|
||||
|
||||
compute_credit_rating(host, sreq);
|
||||
compute_credit_rating(host);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -474,7 +474,7 @@ int handle_results(
|
|||
reply.host.id, srip->id, srip->name, srip->hostid
|
||||
);
|
||||
DB_HOST result_host;
|
||||
int retval = result_host.lookup_id(srip->hostid);
|
||||
retval = result_host.lookup_id(srip->hostid);
|
||||
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
|
@ -799,7 +799,7 @@ void handle_msgs_from_host(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
|||
}
|
||||
}
|
||||
|
||||
void handle_msgs_to_host(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
|
||||
void handle_msgs_to_host(SCHEDULER_REPLY& reply) {
|
||||
DB_MSG_TO_HOST mth;
|
||||
char buf[256];
|
||||
sprintf(buf, "where hostid = %d and handled = %d", reply.host.id, 0);
|
||||
|
@ -987,7 +987,7 @@ void process_request(
|
|||
|
||||
handle_msgs_from_host(sreq, reply);
|
||||
if (config.msg_to_host) {
|
||||
handle_msgs_to_host(sreq, reply);
|
||||
handle_msgs_to_host(reply);
|
||||
}
|
||||
|
||||
update_host_record(reply.host, reply.user);
|
||||
|
|
|
@ -68,7 +68,7 @@ GUI_URLS gui_urls;
|
|||
key_t sema_key;
|
||||
int g_pid;
|
||||
|
||||
void send_message(char* msg, int delay) {
|
||||
void send_message(const char* msg, int delay) {
|
||||
printf(
|
||||
"Content-type: text/plain\n\n"
|
||||
"<scheduler_reply>\n"
|
||||
|
|
|
@ -29,5 +29,5 @@ extern int g_pid;
|
|||
extern void lock_sema();
|
||||
extern void unlock_sema();
|
||||
|
||||
extern void send_message(char*, int);
|
||||
extern void send_message(const char*, int);
|
||||
extern int open_database();
|
||||
|
|
|
@ -31,7 +31,7 @@ using std::vector;
|
|||
using std::string;
|
||||
|
||||
int assimilate_handler(
|
||||
WORKUNIT& wu, vector<RESULT>& results, RESULT& canonical_result
|
||||
WORKUNIT& wu, vector<RESULT>& /*results*/, RESULT& canonical_result
|
||||
) {
|
||||
SCOPE_MSG_LOG scope_messages(log_messages, SCHED_MSG_LOG::NORMAL);
|
||||
scope_messages.printf("[%s] Assimilating\n", wu.name);
|
||||
|
|
|
@ -26,7 +26,7 @@ using std::vector;
|
|||
|
||||
static const double MIN_CPU_TIME = 0;
|
||||
|
||||
int init_result_trivial(RESULT const& result, void*& data) {
|
||||
int init_result_trivial(RESULT const& /*result*/, void*& /*data*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ const char* CONFIG_FILE = "config.xml";
|
|||
|
||||
// look for a boolean; accepts either <foobar/> or <foobar>1</foobar>
|
||||
//
|
||||
static void parse_bool(char* buf, char* tag, bool& result) {
|
||||
static void parse_bool(char* buf, const char* tag, bool& result) {
|
||||
char single_tag[256], start_tag[256];
|
||||
int x;
|
||||
|
||||
|
@ -104,7 +104,7 @@ int SCHED_CONFIG::parse(char* buf) {
|
|||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
||||
int SCHED_CONFIG::parse_file(char* dir) {
|
||||
int SCHED_CONFIG::parse_file(const char* dir) {
|
||||
char* p;
|
||||
char path[256];
|
||||
int retval;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
bool cache_md5_info;
|
||||
|
||||
int parse(char*);
|
||||
int parse_file(char* dir=".");
|
||||
int parse_file(const char* dir=".");
|
||||
};
|
||||
|
||||
// get the project's home directory
|
||||
|
|
|
@ -118,7 +118,7 @@ bool host_has_file(
|
|||
// routine, in the same way as if there was no scheduling locality.
|
||||
//
|
||||
int decrement_disk_space_locality(
|
||||
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
||||
WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
||||
SCHEDULER_REPLY& reply
|
||||
) {
|
||||
char filename[256], path[512];
|
||||
|
@ -385,7 +385,7 @@ static int send_results_for_file(
|
|||
int& nsent,
|
||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
||||
SCHED_SHMEM& ss,
|
||||
bool in_working_set
|
||||
bool /*in_working_set*/
|
||||
) {
|
||||
DB_RESULT result, prev_result;
|
||||
char buf[256], query[1024];
|
||||
|
@ -481,7 +481,6 @@ static int send_results_for_file(
|
|||
if (config.one_result_per_user_per_wu) {
|
||||
|
||||
// do an EXPENSIVE db query
|
||||
char query[256];
|
||||
#ifdef USE_REGEXP
|
||||
sprintf(query,
|
||||
"where server_state=%d and name like '%s__%%' limit 1",
|
||||
|
@ -585,7 +584,7 @@ static int send_results_for_file(
|
|||
//
|
||||
static int send_new_file_work_deterministic_seeded(
|
||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
||||
SCHED_SHMEM& ss, int& nsent, char *start_f, char *end_f
|
||||
SCHED_SHMEM& ss, int& nsent, const char *start_f, const char *end_f
|
||||
) {
|
||||
DB_RESULT result;
|
||||
char filename[256], min_resultname[256], query[1024];
|
||||
|
@ -651,7 +650,9 @@ static int send_new_file_work_deterministic(
|
|||
// continue deterministic search at lexically first possible
|
||||
// filename, continue to randomly choosen one
|
||||
if (!getfile_retval && reply.work_needed(true)) {
|
||||
send_new_file_work_deterministic_seeded(sreq, reply, platform, ss, nsent, "", start_filename);
|
||||
send_new_file_work_deterministic_seeded(
|
||||
sreq, reply, platform, ss, nsent, "", start_filename
|
||||
);
|
||||
if (nsent) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,6 @@ extern void send_work_locality(
|
|||
SCHED_SHMEM& ss
|
||||
);
|
||||
extern int decrement_disk_space_locality(
|
||||
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
||||
WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
||||
SCHEDULER_REPLY& reply
|
||||
);
|
||||
|
|
|
@ -227,7 +227,10 @@ int wu_is_infeasible(
|
|||
reason |= INFEASIBLE_DISK;
|
||||
}
|
||||
|
||||
if (!config.ignore_delay_bound && 0.0<request.estimated_delay) {
|
||||
// skip delay check if host currently doesn't have any work
|
||||
// (i.e. everyone gets one result, no matter how slow they are)
|
||||
//
|
||||
if (!config.ignore_delay_bound && request.estimated_delay>0) {
|
||||
double ewd = estimate_wallclock_duration(wu, request, reply);
|
||||
if (request.estimated_delay + ewd > wu.delay_bound) {
|
||||
log_messages.printf(
|
||||
|
@ -246,7 +249,7 @@ int wu_is_infeasible(
|
|||
|
||||
// insert "text" right after "after" in the given buffer
|
||||
//
|
||||
int insert_after(char* buffer, char* after, char* text) {
|
||||
int insert_after(char* buffer, const char* after, const char* text) {
|
||||
char* p;
|
||||
char temp[LARGE_BLOB_SIZE];
|
||||
|
||||
|
@ -556,7 +559,7 @@ int add_result_to_reply(
|
|||
// the file OR the file was not already sent.
|
||||
//
|
||||
if (!config.locality_scheduling ||
|
||||
decrement_disk_space_locality(result, wu, request, reply)
|
||||
decrement_disk_space_locality(wu, request, reply)
|
||||
) {
|
||||
reply.wreq.disk_available -= wu.rsc_disk_bound;
|
||||
}
|
||||
|
@ -854,8 +857,8 @@ int send_work(
|
|||
|
||||
if (reply.wreq.nresults == 0) {
|
||||
reply.set_delay(3600);
|
||||
USER_MESSAGE um("No work available", "high");
|
||||
reply.insert_message(um);
|
||||
USER_MESSAGE um2("No work available", "high");
|
||||
reply.insert_message(um2);
|
||||
if (reply.wreq.no_app_version) {
|
||||
USER_MESSAGE um("(there was work for other platforms)", "high");
|
||||
reply.insert_message(um);
|
||||
|
@ -883,11 +886,11 @@ int send_work(
|
|||
);
|
||||
reply.insert_message(um);
|
||||
if (!config.ignore_delay_bound && sreq.resource_share_fraction<1.0) {
|
||||
USER_MESSAGE um(
|
||||
USER_MESSAGE um3 (
|
||||
"Review preferences for this project's Resource Share",
|
||||
"high"
|
||||
);
|
||||
reply.insert_message(um);
|
||||
reply.insert_message(um3);
|
||||
}
|
||||
}
|
||||
if (reply.wreq.homogeneous_redundancy_reject) {
|
||||
|
|
|
@ -67,7 +67,7 @@ int SCHED_SHMEM::verify() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void overflow(char* table, char* param_name) {
|
||||
static void overflow(const char* table, const char* param_name) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
"The SCHED_SHMEM structure is too small for the %s table.\n"
|
||||
|
@ -183,6 +183,7 @@ APP_VERSION* SCHED_SHMEM::lookup_app_version(
|
|||
return best_avp;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// find the latest core version for a given platform
|
||||
//
|
||||
CORE_VERSION* SCHED_SHMEM::lookup_core_version(int platformid) {
|
||||
|
@ -197,6 +198,7 @@ CORE_VERSION* SCHED_SHMEM::lookup_core_version(int platformid) {
|
|||
}
|
||||
return best;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool SCHED_SHMEM::no_work(int pid) {
|
||||
int i;
|
||||
|
|
|
@ -91,7 +91,9 @@ struct SCHED_SHMEM {
|
|||
|
||||
APP* lookup_app(int);
|
||||
APP_VERSION* lookup_app_version(int appid, int platform, int version);
|
||||
#if 0
|
||||
CORE_VERSION* lookup_core_version(int platform);
|
||||
#endif
|
||||
PLATFORM* lookup_platform(char*);
|
||||
};
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ static int hostid=0;
|
|||
// earth. This function finds the 'shortest way around'
|
||||
//
|
||||
static int compare(const void *x, const void *y) {
|
||||
URLTYPE *a=(URLTYPE *)x;
|
||||
URLTYPE *b=(URLTYPE *)y;
|
||||
const URLTYPE *a=(const URLTYPE *)x;
|
||||
const URLTYPE *b=(const URLTYPE *)y;
|
||||
|
||||
char longname[512];
|
||||
|
||||
|
@ -168,12 +168,12 @@ URLTYPE* read_download_list() {
|
|||
|
||||
// return number of bytes written, or <0 to indicate an error
|
||||
//
|
||||
int make_download_list(char *buffer, char *path, int timezone) {
|
||||
int make_download_list(char *buffer, char *path, int tz) {
|
||||
char *start=buffer;
|
||||
int i;
|
||||
|
||||
// global variable used in the compare() function
|
||||
tzone=timezone;
|
||||
tzone=tz;
|
||||
URLTYPE *serverlist=read_download_list();
|
||||
|
||||
if (!serverlist) return -1;
|
||||
|
@ -196,7 +196,7 @@ int make_download_list(char *buffer, char *path, int timezone) {
|
|||
|
||||
// returns zero on success, non-zero to indicate an error
|
||||
//
|
||||
int add_download_servers(char *old_xml, char *new_xml, int timezone) {
|
||||
int add_download_servers(char *old_xml, char *new_xml, int tz) {
|
||||
char *p, *q, *r;
|
||||
|
||||
p=r=old_xml;
|
||||
|
@ -232,7 +232,7 @@ int add_download_servers(char *old_xml, char *new_xml, int timezone) {
|
|||
|
||||
// insert new download list in place of the original one
|
||||
//
|
||||
len = make_download_list(new_xml, s, timezone);
|
||||
len = make_download_list(new_xml, s, tz);
|
||||
if (len<0) {
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ bool check_stop_sched() {
|
|||
// (this is generally a recoverable error,
|
||||
// like NFS mount failure, that may go away later)
|
||||
//
|
||||
int try_fopen(char* path, FILE*& f, char* mode) {
|
||||
int try_fopen(const char* path, FILE*& f, const char* mode) {
|
||||
char* p;
|
||||
DIR* d;
|
||||
char dirpath[256];
|
||||
|
@ -114,7 +114,7 @@ int try_fopen(char* path, FILE*& f, char* mode) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void get_log_path(char* p, char* filename) {
|
||||
void get_log_path(char* p, const char* filename) {
|
||||
char buf[256];
|
||||
char path[256];
|
||||
gethostname(buf, 256);
|
||||
|
|
|
@ -33,8 +33,8 @@ extern void set_debug_level(int);
|
|||
extern void check_stop_daemons();
|
||||
extern bool check_stop_sched();
|
||||
extern void install_stop_signal_handler();
|
||||
extern int try_fopen(char* path, FILE*& f, char* mode);
|
||||
extern void get_log_path(char*, char*);
|
||||
extern int try_fopen(const char* path, FILE*& f, const char* mode);
|
||||
extern void get_log_path(char*, const char*);
|
||||
|
||||
// convert filename to path in a hierarchical directory system
|
||||
//
|
||||
|
|
|
@ -331,8 +331,8 @@ int SCHEDULER_REPLY::write(FILE* fout) {
|
|||
);
|
||||
|
||||
if (request_delay) {
|
||||
fprintf(fout, "<request_delay>%d</request_delay>\n", request_delay);
|
||||
log_messages.printf(SCHED_MSG_LOG::NORMAL, "sending delay request %d\n", request_delay);
|
||||
fprintf(fout, "<request_delay>%f</request_delay>\n", request_delay);
|
||||
log_messages.printf(SCHED_MSG_LOG::NORMAL, "sending delay request %f\n", request_delay);
|
||||
}
|
||||
if (wreq.core_client_version < 462) {
|
||||
std::string msg;
|
||||
|
@ -455,7 +455,7 @@ int SCHEDULER_REPLY::write(FILE* fout) {
|
|||
for (i=0; i<app_versions.size(); i++) {
|
||||
for (j=0; j<apps.size(); j++) {
|
||||
if (apps[j].id == app_versions[i].appid) {
|
||||
app_versions[i].write(fout, apps[j]);
|
||||
app_versions[i].write(fout);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -525,9 +525,10 @@ end:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void SCHEDULER_REPLY::set_delay(int delay) {
|
||||
// set delay to the MAX of the existing value or the requested value
|
||||
// never send a delay request longer than two days.
|
||||
// set delay to the MAX of the existing value or the requested value
|
||||
// never send a delay request longer than two days.
|
||||
//
|
||||
void SCHEDULER_REPLY::set_delay(double delay) {
|
||||
if (request_delay < delay) {
|
||||
request_delay = delay;
|
||||
}
|
||||
|
@ -570,7 +571,7 @@ void SCHEDULER_REPLY::insert_message(USER_MESSAGE& um) {
|
|||
messages.push_back(um);
|
||||
}
|
||||
|
||||
USER_MESSAGE::USER_MESSAGE(char* m, char* p) {
|
||||
USER_MESSAGE::USER_MESSAGE(const char* m, const char* p) {
|
||||
message = m;
|
||||
priority = p;
|
||||
}
|
||||
|
@ -585,7 +586,7 @@ int APP::write(FILE* fout) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int APP_VERSION::write(FILE* fout, APP& app) {
|
||||
int APP_VERSION::write(FILE* fout) {
|
||||
fputs(xml_doc, fout);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ struct SCHEDULER_REQUEST {
|
|||
struct USER_MESSAGE {
|
||||
std::string message;
|
||||
std::string priority;
|
||||
USER_MESSAGE(char* m, char*p);
|
||||
USER_MESSAGE(const char* m, const char*p);
|
||||
};
|
||||
|
||||
// NOTE: if any field requires initialization,
|
||||
|
@ -150,7 +150,7 @@ struct USER_MESSAGE {
|
|||
//
|
||||
struct SCHEDULER_REPLY {
|
||||
WORK_REQ wreq;
|
||||
int request_delay; // don't request again until this time elapses
|
||||
double request_delay; // don't request again until this time elapses
|
||||
std::vector<USER_MESSAGE> messages;
|
||||
int hostid;
|
||||
// nonzero only if a new host record was created.
|
||||
|
@ -185,7 +185,7 @@ struct SCHEDULER_REPLY {
|
|||
void insert_result(RESULT&);
|
||||
void insert_message(USER_MESSAGE&);
|
||||
bool work_needed(bool locality_sched=false);
|
||||
void set_delay(int delay);
|
||||
void set_delay(double);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -134,7 +134,6 @@ int generic_check_set(
|
|||
size_t min_valid)
|
||||
{
|
||||
assert (!results.empty());
|
||||
assert (min_valid >= 0);
|
||||
|
||||
vector<void*> data;
|
||||
vector<RESULT>::size_type i, j, neq = 0, n = results.size();
|
||||
|
|
|
@ -26,7 +26,7 @@ using std::vector;
|
|||
|
||||
static const double MIN_CPU_TIME = 0;
|
||||
|
||||
int init_result_trivial(RESULT const& result, void*& data) {
|
||||
int init_result_trivial(RESULT const& /*result*/, void*& /*data*/) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -415,7 +415,6 @@ int create_work(
|
|||
const char* result_template_filepath,
|
||||
const char** infiles,
|
||||
int ninfiles,
|
||||
R_RSA_PRIVATE_KEY& key,
|
||||
SCHED_CONFIG& config
|
||||
) {
|
||||
int retval;
|
||||
|
|
|
@ -55,7 +55,6 @@ extern int create_work(
|
|||
const char* result_template_filepath,
|
||||
const char** infiles,
|
||||
int ninfiles,
|
||||
R_RSA_PRIVATE_KEY&,
|
||||
SCHED_CONFIG&
|
||||
);
|
||||
|
||||
|
|
|
@ -54,16 +54,14 @@
|
|||
#include "backend_lib.h"
|
||||
#include "sched_config.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, const char** argv) {
|
||||
DB_APP app;
|
||||
DB_WORKUNIT wu;
|
||||
int retval;
|
||||
char wu_template[LARGE_BLOB_SIZE];
|
||||
char wu_template_file[256], result_template_file[256], result_template_path[1024];
|
||||
char keyfile[256];
|
||||
char** infiles = NULL;
|
||||
const char** infiles = NULL;
|
||||
int i, ninfiles;
|
||||
R_RSA_PRIVATE_KEY key;
|
||||
char download_dir[256], db_name[256], db_passwd[256],db_user[256],db_host[256];
|
||||
char buf[256];
|
||||
SCHED_CONFIG config;
|
||||
|
@ -71,8 +69,7 @@ int main(int argc, char** argv) {
|
|||
strcpy(result_template_file, "");
|
||||
strcpy(app.name, "");
|
||||
strcpy(db_passwd, "");
|
||||
strcpy(keyfile, "");
|
||||
char* config_dir = ".";
|
||||
const char* config_dir = ".";
|
||||
i = 1;
|
||||
ninfiles = 0;
|
||||
wu.clear();
|
||||
|
@ -159,7 +156,6 @@ int main(int argc, char** argv) {
|
|||
strcpy(db_user, config.db_user);
|
||||
strcpy(db_host, config.db_host);
|
||||
strcpy(download_dir, config.download_dir);
|
||||
sprintf(keyfile, "%s/upload_private", config.key_dir);
|
||||
}
|
||||
|
||||
retval = boinc_db.open(db_name, db_host, db_user, db_passwd);
|
||||
|
@ -182,12 +178,6 @@ int main(int argc, char** argv) {
|
|||
|
||||
wu.appid = app.id;
|
||||
|
||||
retval = read_key_file(keyfile, key);
|
||||
if (retval) {
|
||||
fprintf(stderr, "create_work: can't read key: %d", retval);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
strcpy(result_template_path, "./");
|
||||
strcat(result_template_path, result_template_file);
|
||||
retval = create_work(
|
||||
|
@ -197,7 +187,6 @@ int main(int argc, char** argv) {
|
|||
result_template_path,
|
||||
const_cast<const char **>(infiles),
|
||||
ninfiles,
|
||||
key,
|
||||
config
|
||||
);
|
||||
if (retval) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue