Skip to content

Commit

Permalink
- sample apps: compile fixes
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=21774
  • Loading branch information
davidpanderson committed Jun 18, 2010
1 parent 28bd0f4 commit b9cdeb7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion api/boinc_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static void graphics_cleanup();
static void block_sigalrm();
static int start_worker_signals();

static char* boinc_msg_prefix(char* sbuf) {
char* boinc_msg_prefix(char* sbuf) {
char buf[256];

time_t x = time(0);
Expand Down
2 changes: 1 addition & 1 deletion api/boinc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ extern double boinc_elapsed_time();
extern int boinc_upload_file(std::string& name);
extern int boinc_upload_status(std::string& name);
extern int boinc_write_init_data_file(APP_INIT_DATA&);
extern char* boinc_msg_prefix();
extern char* boinc_msg_prefix(char*);
extern int suspend_activities(); // deprecated
extern int resume_activities(); // deprecated
extern int restore_activities(); //deprecated
Expand Down
3 changes: 2 additions & 1 deletion api/graphics2_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ static bool need_show = false;
bool fullscreen;

void boinc_close_window_and_quit(const char* p) {
fprintf(stderr, "%s Quitting: %s\n", boinc_msg_prefix(), p);
char buf[256];
fprintf(stderr, "%s Quitting: %s\n", boinc_msg_prefix(buf), p);
exit(0);
}

Expand Down
18 changes: 9 additions & 9 deletions apps/upper_case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int main(int argc, char **argv) {
int i;
int c, nchars = 0, retval, n;
double fsize, fd;
char input_path[512], output_path[512], chkpt_path[512];
char input_path[512], output_path[512], chkpt_path[512], buf[256];
MFILE out;
FILE* state, *infile;

Expand All @@ -151,7 +151,7 @@ int main(int argc, char **argv) {
retval = boinc_init();
if (retval) {
fprintf(stderr, "%s boinc_init returned %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(retval);
}
Expand All @@ -163,7 +163,7 @@ int main(int argc, char **argv) {
if (!infile) {
fprintf(stderr,
"%s Couldn't find input file, resolved name %s.\n",
boinc_msg_prefix(), input_path
boinc_msg_prefix(buf), input_path
);
exit(-1);
}
Expand Down Expand Up @@ -192,10 +192,10 @@ int main(int argc, char **argv) {
}
if (retval) {
fprintf(stderr, "%s APP: upper_case output open failed:\n",
boinc_msg_prefix()
boinc_msg_prefix(buf)
);
fprintf(stderr, "%s resolved name %s, retval %d\n",
boinc_msg_prefix(), output_path, retval
boinc_msg_prefix(buf), output_path, retval
);
perror("open");
exit(1);
Expand All @@ -207,7 +207,7 @@ int main(int argc, char **argv) {
shmem = (UC_SHMEM*)boinc_graphics_make_shmem("uppercase", sizeof(UC_SHMEM));
if (!shmem) {
fprintf(stderr, "%s failed to create shared mem segment\n",
boinc_msg_prefix()
boinc_msg_prefix(buf)
);
}
update_shmem();
Expand Down Expand Up @@ -243,7 +243,7 @@ int main(int argc, char **argv) {
retval = do_checkpoint(out, nchars);
if (retval) {
fprintf(stderr, "%s APP: upper_case checkpoint failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(retval);
}
Expand All @@ -258,7 +258,7 @@ int main(int argc, char **argv) {
retval = out.flush();
if (retval) {
fprintf(stderr, "%s APP: upper_case flush failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(1);
}
Expand All @@ -277,7 +277,7 @@ int main(int argc, char **argv) {
retval = do_checkpoint(out, nchars);
if (retval) {
fprintf(stderr, "%s APP: upper_case checkpoint failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(1);
}
Expand Down
11 changes: 11 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -4381,3 +4381,14 @@ Charlie 18 Jun 2010

clientgui/
MainDocument.cpp, .h

David 18 Jun 2010
- sample apps: compile fixes

apps/
upper_case.cpp
samples/example_app/
uc2.cpp
api/
boinc_api.cpp,h
graphics2_unix.cpp
20 changes: 11 additions & 9 deletions samples/example_app/uc2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ int main(int argc, char **argv) {
int i;
int c, nchars = 0, retval, n;
double fsize, fd;
char input_path[512], output_path[512], chkpt_path[512];
char input_path[512], output_path[512], chkpt_path[512], buf[256];
MFILE out;
FILE* state, *infile;

Expand All @@ -151,7 +151,7 @@ int main(int argc, char **argv) {
retval = boinc_init();
if (retval) {
fprintf(stderr, "%s boinc_init returned %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(retval);
}
Expand All @@ -163,7 +163,7 @@ int main(int argc, char **argv) {
if (!infile) {
fprintf(stderr,
"%s Couldn't find input file, resolved name %s.\n",
boinc_msg_prefix(), input_path
boinc_msg_prefix(buf), input_path
);
exit(-1);
}
Expand Down Expand Up @@ -192,10 +192,10 @@ int main(int argc, char **argv) {
}
if (retval) {
fprintf(stderr, "%s APP: upper_case output open failed:\n",
boinc_msg_prefix()
boinc_msg_prefix(buf)
);
fprintf(stderr, "%s resolved name %s, retval %d\n",
boinc_msg_prefix(), output_path, retval
boinc_msg_prefix(buf), output_path, retval
);
perror("open");
exit(1);
Expand All @@ -207,7 +207,7 @@ int main(int argc, char **argv) {
shmem = (UC_SHMEM*)boinc_graphics_make_shmem("uppercase", sizeof(UC_SHMEM));
if (!shmem) {
fprintf(stderr, "%s failed to create shared mem segment\n",
boinc_msg_prefix()
boinc_msg_prefix(buf)
);
}
update_shmem();
Expand Down Expand Up @@ -243,7 +243,7 @@ int main(int argc, char **argv) {
retval = do_checkpoint(out, nchars);
if (retval) {
fprintf(stderr, "%s APP: upper_case checkpoint failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(retval);
}
Expand All @@ -258,7 +258,7 @@ int main(int argc, char **argv) {
retval = out.flush();
if (retval) {
fprintf(stderr, "%s APP: upper_case flush failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(1);
}
Expand All @@ -277,7 +277,7 @@ int main(int argc, char **argv) {
retval = do_checkpoint(out, nchars);
if (retval) {
fprintf(stderr, "%s APP: upper_case checkpoint failed %d\n",
boinc_msg_prefix(), retval
boinc_msg_prefix(buf), retval
);
exit(1);
}
Expand Down Expand Up @@ -305,3 +305,5 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR Args, int WinMode
}
#endif

const char *BOINC_RCSID_33ac47a071 = "$Id: upper_case.cpp 20315 2010-01-29 15:50:47Z davea $";

0 comments on commit b9cdeb7

Please sign in to comment.