fixed warning messages

svn path=/trunk/boinc/; revision=1344
This commit is contained in:
Eric Heien 2003-06-10 05:33:39 +00:00
parent afbb4c7022
commit d708e0f3eb
8 changed files with 19 additions and 18 deletions

View File

@ -77,7 +77,7 @@ APP_INIT_DATA uc_aid;
int do_checkpoint(MFILE& mf, int nchars) { int do_checkpoint(MFILE& mf, int nchars) {
int retval; int retval;
char resolved_name[512],res_name2[512]; char resolved_name[512],res_name2[512];
FILE *app_time, *client_time; FILE *app_time=NULL, *client_time=NULL;
if (cpu_time) { if (cpu_time) {
app_time = fopen("app.time", "w"), app_time = fopen("app.time", "w"),

View File

@ -146,7 +146,7 @@ PROJECT* CLIENT_STATE::next_project(PROJECT* old) {
// //
void CLIENT_STATE::compute_resource_debts() { void CLIENT_STATE::compute_resource_debts() {
unsigned int i, j; unsigned int i, j;
PROJECT* p, *pbest; PROJECT* p, *pbest=NULL;
double best; double best;
for (i=0; i<projects.size(); i++) { for (i=0; i<projects.size(); i++) {

View File

@ -302,7 +302,7 @@ bool SCHEDULER_OP::poll() {
vector<STRING256> urls; vector<STRING256> urls;
bool changed, scheduler_op_done; bool changed, scheduler_op_done;
bool action = false, err = false; bool action = false, err = false;
char err_msg[256],*err_url; char err_msg[256],*err_url=NULL;
switch(state) { switch(state) {
case SCHEDULER_OP_STATE_GET_MASTER: case SCHEDULER_OP_STATE_GET_MASTER:

View File

@ -232,7 +232,7 @@ void write_team(TEAM& team, FILE* f, bool detail) {
void team_total_credit() { void team_total_credit() {
DB_TEAM team; DB_TEAM team;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!team.enumerate("order by total_credit desc")) { while (!team.enumerate("order by total_credit desc")) {
@ -261,7 +261,7 @@ void team_total_credit() {
void team_expavg_credit() { void team_expavg_credit() {
DB_TEAM team; DB_TEAM team;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!team.enumerate("order by expavg_credit desc")) { while (!team.enumerate("order by expavg_credit desc")) {
@ -290,7 +290,7 @@ void team_expavg_credit() {
void team_id() { void team_id() {
DB_TEAM team; DB_TEAM team;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!team.enumerate("order by id")) { while (!team.enumerate("order by id")) {
@ -319,7 +319,7 @@ void team_id() {
void user_total_credit() { void user_total_credit() {
DB_USER user; DB_USER user;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!user.enumerate("order by total_credit desc")) { while (!user.enumerate("order by total_credit desc")) {
@ -348,7 +348,7 @@ void user_total_credit() {
void user_expavg_credit() { void user_expavg_credit() {
DB_USER user; DB_USER user;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!user.enumerate("order by expavg_credit desc")) { while (!user.enumerate("order by expavg_credit desc")) {
@ -377,7 +377,7 @@ void user_expavg_credit() {
void user_id() { void user_id() {
DB_USER user; DB_USER user;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!user.enumerate("order by id")) { while (!user.enumerate("order by id")) {
@ -406,7 +406,7 @@ void user_id() {
void host_total_credit() { void host_total_credit() {
DB_HOST host; DB_HOST host;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!host.enumerate("order by total_credit desc")) { while (!host.enumerate("order by total_credit desc")) {
@ -435,7 +435,7 @@ void host_total_credit() {
void host_expavg_credit() { void host_expavg_credit() {
DB_HOST host; DB_HOST host;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!host.enumerate("order by expavg_credit desc")) { while (!host.enumerate("order by expavg_credit desc")) {
@ -464,7 +464,7 @@ void host_expavg_credit() {
void host_id() { void host_id() {
DB_HOST host; DB_HOST host;
FILE* f = NULL; FILE* f = NULL;
int nfile=0, nrec; int nfile=0, nrec=0;
char buf[256], cmd_line[256]; char buf[256], cmd_line[256];
while (!host.enumerate("order by id")) { while (!host.enumerate("order by id")) {

View File

@ -38,7 +38,7 @@ CONFIG config;
int wu_delete_files(WORKUNIT& wu) { int wu_delete_files(WORKUNIT& wu) {
char* p; char* p;
char filename[256], pathname[256], buf[MAX_BLOB_SIZE], logbuf[256]; char filename[256], pathname[256], buf[MAX_BLOB_SIZE], logbuf[256];
bool no_delete; bool no_delete=false;
safe_strcpy(buf, wu.xml_doc); safe_strcpy(buf, wu.xml_doc);
@ -67,7 +67,7 @@ int wu_delete_files(WORKUNIT& wu) {
int result_delete_files(RESULT& result) { int result_delete_files(RESULT& result) {
char* p; char* p;
char filename[256], pathname[256], buf[MAX_BLOB_SIZE], logbuf[256]; 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); safe_strcpy(buf, result.xml_doc_in);
p = strtok(buf,"\n"); p = strtok(buf,"\n");

View File

@ -244,7 +244,8 @@ int handle_get_file_size(char* file_name) {
write_log(buf); write_log(buf);
return return_success("<file_size>0</file_size>"); return return_success("<file_size>0</file_size>");
} else { } 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); write_log(buf);
sprintf(buf, "<file_size>%d</file_size>", (int)sbuf.st_size); sprintf(buf, "<file_size>%d</file_size>", (int)sbuf.st_size);
return return_success(buf); return return_success(buf);

View File

@ -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. // If DB has more recent global prefs than client's, send them.
// //
int handle_global_prefs(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { 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; bool need_update;
DB_USER user; DB_USER user;

View File

@ -42,11 +42,11 @@ int get_output_file_path(RESULT& result, char* path) {
// See if there's a strict majority under equality. // See if there's a strict majority under equality.
// //
int check_set(vector<RESULT>& results, int& canonicalid, double& credit) { int check_set(vector<RESULT>& 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* files[100];
char path[256]; char path[256];
bool found; bool found;
double c, low, high; double c, low=0.0, high=0.0;
canonical = 0; canonical = 0;
n = results.size(); n = results.size();