Skip to content

Commit

Permalink
- fix gcc 4 compiler warnings
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=21882
  • Loading branch information
davidpanderson committed Jul 8, 2010
1 parent 0951733 commit 7e121f3
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
11 changes: 11 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -4962,3 +4962,14 @@ Charlie 8 Jul 2010
NoticeListCtrl.cpp, .h
mac/
MacAccessiblity.cpp

David 8 Jul 2010
- fix gcc 4 compiler warnings

sched/
file_deleter.cpp
single_job_assimilator.cpp
sched_locality.cpp
sched_send.cpp
tools/
backend_lib.cpp
3 changes: 2 additions & 1 deletion sched/file_deleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ int delete_antique_files() {
int nfiles=0;

log_messages.printf(MSG_DEBUG,
"delete_antique_files(): start (%d files)\n", files_to_delete.size()
"delete_antique_files(): start (%d files)\n",
(int)files_to_delete.size()
);
while (!files_to_delete.empty()) {
char timestamp[128];
Expand Down
2 changes: 1 addition & 1 deletion sched/sched_locality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static void build_working_set_namelist(bool slowhost) {
if (config.debug_locality) {
log_messages.printf(MSG_NORMAL,
"[locality] build_working_set_namelist(%s): pattern %s has %d matches\n",
hosttype, pattern, filesets.items.size()
hosttype, pattern, (int)filesets.items.size()
);
}
return;
Expand Down
4 changes: 3 additions & 1 deletion sched/sched_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,9 @@ static int insert_after(char* buffer, const char* after, const char* text) {

if (strlen(buffer) + strlen(text) > BLOB_SIZE-1) {
log_messages.printf(MSG_CRITICAL,
"insert_after: overflow: %d %d\n", strlen(buffer), strlen(text)
"insert_after: overflow: %d %d\n",
(int)strlen(buffer),
(int)strlen(text)
);
return ERR_BUFFER_OVERFLOW;
}
Expand Down
6 changes: 5 additions & 1 deletion sched/single_job_assimilator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ int assimilate_handler(
log_messages.printf(MSG_CRITICAL, "Can't open job file %s\n", buf);
return 0;
}
fgets(buf, 1024, f);
if (!fgets(buf, 1024, f)) {
log_messages.printf(MSG_CRITICAL, "Can't read job file %s\n", buf);
fclose(f);
return 0;
}
fclose(f);
unlink(job_dir_file);

Expand Down
16 changes: 9 additions & 7 deletions tools/backend_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ static int process_wu_template(
if (out.size() > sizeof(wu.xml_doc)-1) {
fprintf(stderr,
"create_work: WU XML field is too long (%d bytes; max is %d)\n",
out.size(), sizeof(wu.xml_doc)-1
(int)out.size(), (int)sizeof(wu.xml_doc)-1
);
return ERR_BUFFER_OVERFLOW;
}
Expand Down Expand Up @@ -483,7 +483,7 @@ int create_result(
if (strlen(result_template) > sizeof(result.xml_doc_in)-1) {
fprintf(stderr,
"result XML doc is too long: %d bytes, max is %d\n",
strlen(result_template), sizeof(result.xml_doc_in)-1
(int)strlen(result_template), (int)sizeof(result.xml_doc_in)-1
);
return ERR_BUFFER_OVERFLOW;
}
Expand Down Expand Up @@ -514,9 +514,9 @@ int check_files(char** infiles, int ninfiles, SCHED_CONFIG& config_loc) {
dir_hier_path(
infiles[i], config_loc.download_dir, config_loc.uldl_dir_fanout, path
);
if (!boinc_file_exists(path)) {
return 1;
}
if (!boinc_file_exists(path)) {
return 1;
}

}
return 0;
Expand Down Expand Up @@ -564,8 +564,10 @@ int create_work(
}

if (strlen(result_template_filename) > sizeof(wu.result_template_file)-1) {
fprintf(stderr, "result template filename is too big: %d bytes, max is %d\n",
strlen(result_template_filename), sizeof(wu.result_template_file)-1
fprintf(stderr,
"result template filename is too big: %d bytes, max is %d\n",
(int)strlen(result_template_filename),
(int)sizeof(wu.result_template_file)-1
);
return ERR_BUFFER_OVERFLOW;
}
Expand Down

0 comments on commit 7e121f3

Please sign in to comment.