From d5e035456d776928531a1b38eaf0adcaa7b2b920 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 21 Jun 2010 23:36:01 +0000 Subject: [PATCH] compile fixes svn path=/trunk/boinc/; revision=21786 --- api/boinc_api.cpp | 5 ++--- api/graphics2_win.cpp | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/api/boinc_api.cpp b/api/boinc_api.cpp index 9b008d12b4..ac62d81a9c 100644 --- a/api/boinc_api.cpp +++ b/api/boinc_api.cpp @@ -219,7 +219,6 @@ static int setup_shared_mem() { app_client_shm = new APP_CLIENT_SHM; #ifdef _WIN32 - char buf[256]; sprintf(buf, "%s%s", SHM_PREFIX, aid.shmem_seg_name); hSharedMem = attach_shmem(buf, (void**)&app_client_shm->shm); if (hSharedMem == NULL) { @@ -501,7 +500,6 @@ int boinc_temporary_exit(int delay) { // void boinc_exit(int status) { int retval; - char buf[256]; if (options.backwards_compatible_graphics) { graphics_cleanup(); @@ -774,9 +772,10 @@ static void handle_trickle_down_msg() { // runs in timer thread // static void handle_process_control_msg() { - char buf[MSG_CHANNEL_SIZE], log_buf[256]; + char buf[MSG_CHANNEL_SIZE]; if (app_client_shm->shm->process_control_request.get_msg(buf)) { #ifdef DEBUG_BOINC_API + char log_buf[256] fprintf(stderr, "%s got process control msg %s\n", boinc_msg_prefix(log_buf), buf ); diff --git a/api/graphics2_win.cpp b/api/graphics2_win.cpp index 36320cf32f..c0d01d5c99 100644 --- a/api/graphics2_win.cpp +++ b/api/graphics2_win.cpp @@ -50,8 +50,9 @@ static UINT_PTR gfx_timer_id = 0; static bool fullscreen; void boinc_close_window_and_quit(const char* p) { + char buf[256]; fprintf(stderr, "%s Close event (%s) detected, shutting down.\n", - boinc_msg_prefix(), p + boinc_msg_prefix(buf), p ); window_ready = false; @@ -72,6 +73,7 @@ void boinc_close_window_and_quit(const char* p) { void SetupPixelFormat(HDC win_dc) { int nPixelFormat; + char buf[256]; static PIXELFORMATDESCRIPTOR pfd = { sizeof(PIXELFORMATDESCRIPTOR), // size of structure. @@ -103,7 +105,7 @@ void SetupPixelFormat(HDC win_dc) { if (!SetPixelFormat(win_dc, nPixelFormat, &pfd)) { fprintf(stderr, "%s ERROR: Couldn't set pixel format for device context (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); } } @@ -113,6 +115,7 @@ static void make_window(const char* title) { int width, height; DWORD dwExStyle; DWORD dwStyle; + char buf[256]; if (fullscreen) { HDC screenDC=GetDC(NULL); @@ -165,14 +168,14 @@ static void make_window(const char* title) { if (!SetForegroundWindow(window)) { fprintf(stderr, "%s ERROR: SetForegroundWindow() failed (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); } if (!GetCursorPos(&mousePos)) { fprintf(stderr, "%s ERROR: GetCursorPos() failed (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); } @@ -180,7 +183,7 @@ static void make_window(const char* title) { if (!win_dc) { fprintf(stderr, "%s ERROR: GetDC() failed (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); } SetupPixelFormat(win_dc); @@ -189,7 +192,7 @@ static void make_window(const char* title) { if (!gl_dc) { fprintf(stderr, "%s ERROR: wglCreateContext() failed (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); ReleaseDC(window, win_dc); return; @@ -198,7 +201,7 @@ static void make_window(const char* title) { if(!wglMakeCurrent(win_dc, gl_dc)) { fprintf(stderr, "%s ERROR: wglMakeCurrent() failed (0x%x).\n", - boinc_msg_prefix(), GetLastError() + boinc_msg_prefix(buf), GetLastError() ); ReleaseDC(window, win_dc); wglDeleteContext(gl_dc); @@ -408,17 +411,18 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) { } void boinc_graphics_loop(int argc, char** argv, const char* title) { + char buf[256]; if (!diagnostics_is_initialized()) { boinc_init_graphics_diagnostics(BOINC_DIAG_DEFAULTS); } - fprintf(stderr, "%s Starting graphics application.\n", boinc_msg_prefix()); + fprintf(stderr, "%s Starting graphics application.\n", boinc_msg_prefix(buf)); for (int i=1; i