From d708e0f3eb60316ea5ba725ff03a0f08656cb38c Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Tue, 10 Jun 2003 05:33:39 +0000 Subject: [PATCH] fixed warning messages svn path=/trunk/boinc/; revision=1344 --- apps/upper_case.C | 2 +- client/cs_scheduler.C | 2 +- client/scheduler_op.C | 2 +- sched/db_dump.C | 18 +++++++++--------- sched/file_deleter.C | 4 ++-- sched/file_upload_handler.C | 3 ++- sched/handle_request.C | 2 +- sched/validate_test.C | 4 ++-- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/apps/upper_case.C b/apps/upper_case.C index 9499558f7e..50fcf2c6a5 100755 --- a/apps/upper_case.C +++ b/apps/upper_case.C @@ -77,7 +77,7 @@ APP_INIT_DATA uc_aid; int do_checkpoint(MFILE& mf, int nchars) { int retval; char resolved_name[512],res_name2[512]; - FILE *app_time, *client_time; + FILE *app_time=NULL, *client_time=NULL; if (cpu_time) { app_time = fopen("app.time", "w"), diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index bfe2a8234f..3ee5e34939 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -146,7 +146,7 @@ PROJECT* CLIENT_STATE::next_project(PROJECT* old) { // void CLIENT_STATE::compute_resource_debts() { unsigned int i, j; - PROJECT* p, *pbest; + PROJECT* p, *pbest=NULL; double best; for (i=0; i urls; bool changed, scheduler_op_done; bool action = false, err = false; - char err_msg[256],*err_url; + char err_msg[256],*err_url=NULL; switch(state) { case SCHEDULER_OP_STATE_GET_MASTER: diff --git a/sched/db_dump.C b/sched/db_dump.C index 547882d41f..e72b148692 100644 --- a/sched/db_dump.C +++ b/sched/db_dump.C @@ -232,7 +232,7 @@ void write_team(TEAM& team, FILE* f, bool detail) { void team_total_credit() { DB_TEAM team; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!team.enumerate("order by total_credit desc")) { @@ -261,7 +261,7 @@ void team_total_credit() { void team_expavg_credit() { DB_TEAM team; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!team.enumerate("order by expavg_credit desc")) { @@ -290,7 +290,7 @@ void team_expavg_credit() { void team_id() { DB_TEAM team; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!team.enumerate("order by id")) { @@ -319,7 +319,7 @@ void team_id() { void user_total_credit() { DB_USER user; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!user.enumerate("order by total_credit desc")) { @@ -348,7 +348,7 @@ void user_total_credit() { void user_expavg_credit() { DB_USER user; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!user.enumerate("order by expavg_credit desc")) { @@ -377,7 +377,7 @@ void user_expavg_credit() { void user_id() { DB_USER user; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!user.enumerate("order by id")) { @@ -406,7 +406,7 @@ void user_id() { void host_total_credit() { DB_HOST host; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!host.enumerate("order by total_credit desc")) { @@ -435,7 +435,7 @@ void host_total_credit() { void host_expavg_credit() { DB_HOST host; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!host.enumerate("order by expavg_credit desc")) { @@ -464,7 +464,7 @@ void host_expavg_credit() { void host_id() { DB_HOST host; FILE* f = NULL; - int nfile=0, nrec; + int nfile=0, nrec=0; char buf[256], cmd_line[256]; while (!host.enumerate("order by id")) { diff --git a/sched/file_deleter.C b/sched/file_deleter.C index 8c29ddfcfe..efbc37296e 100644 --- a/sched/file_deleter.C +++ b/sched/file_deleter.C @@ -38,7 +38,7 @@ CONFIG config; int wu_delete_files(WORKUNIT& wu) { char* p; char filename[256], pathname[256], buf[MAX_BLOB_SIZE], logbuf[256]; - bool no_delete; + bool no_delete=false; safe_strcpy(buf, wu.xml_doc); @@ -67,7 +67,7 @@ int wu_delete_files(WORKUNIT& wu) { int result_delete_files(RESULT& result) { char* p; char filename[256], pathname[256], buf[MAX_BLOB_SIZE], logbuf[256]; - bool no_delete; + bool no_delete=false; safe_strcpy(buf, result.xml_doc_in); p = strtok(buf,"\n"); diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 1b00203001..b3a6fe35a9 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -244,7 +244,8 @@ int handle_get_file_size(char* file_name) { write_log(buf); return return_success("0"); } else { - sprintf(buf, "handle_get_file_size: %s, returning %d\n", file_name, sbuf.st_size); + sprintf(buf, "handle_get_file_size: %s, returning %d\n", + file_name, (int)sbuf.st_size); write_log(buf); sprintf(buf, "%d", (int)sbuf.st_size); return return_success(buf); diff --git a/sched/handle_request.C b/sched/handle_request.C index 7159322190..2ccfdb27ec 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -415,7 +415,7 @@ int update_host_record(SCHEDULER_REQUEST& sreq, HOST& xhost) { // If DB has more recent global prefs than client's, send them. // int handle_global_prefs(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { - unsigned int req_mod_time, db_mod_time; + unsigned int req_mod_time=0, db_mod_time=0; bool need_update; DB_USER user; diff --git a/sched/validate_test.C b/sched/validate_test.C index 176b940c0b..8b8e2dcdde 100644 --- a/sched/validate_test.C +++ b/sched/validate_test.C @@ -42,11 +42,11 @@ int get_output_file_path(RESULT& result, char* path) { // See if there's a strict majority under equality. // int check_set(vector& results, int& canonicalid, double& credit) { - int i, j, n, neq, retval, ilow, ihigh, canonical; + int i, j, n, neq=0, retval, ilow, ihigh, canonical; char* files[100]; char path[256]; bool found; - double c, low, high; + double c, low=0.0, high=0.0; canonical = 0; n = results.size();