diff --git a/api/api_app.C b/api/api_app.C index 55d231721d..4556e9ed4d 100644 --- a/api/api_app.C +++ b/api/api_app.C @@ -2,24 +2,24 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // // test program for MFILE class -#include +#include #ifdef HAVE_SYS_TIME_H #include #endif diff --git a/api/api_test.C b/api/api_test.C index f7f75af367..52901224dd 100644 --- a/api/api_test.C +++ b/api/api_test.C @@ -2,30 +2,29 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include - -#include +#include +#include #include "boinc_api.h" int get_run_info(double& time, unsigned long int& counter); void run_api_test(char* args); -int print_results(double time1, double time2, +int print_results(double time1, double time2, unsigned long int counter1, unsigned long int counter2 ); int initialize_api(); diff --git a/api/boinc_api.C b/api/boinc_api.C index b4f2d5e753..9cc19211eb 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -37,9 +37,7 @@ #ifdef HAVE_SYS_TIME_H #include #endif -#ifdef HAVE_SIGNAL_H -#include -#endif +#include #include "config.h" using namespace std; #endif diff --git a/api/boinc_api.h b/api/boinc_api.h index 12747dfe14..a661e20b4c 100755 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -20,9 +20,6 @@ #ifndef _BOINC_API_ #define _BOINC_API_ -// NOTE: this is required on windows as well as unix, do not add "#ifndef -// _WIN32" -- if something is not working on a particular version of MSVC -// let's find a working solution #include #include "app_ipc.h" diff --git a/api/graphics_api.C b/api/graphics_api.C index 00d04fd13a..5b7a916b55 100755 --- a/api/graphics_api.C +++ b/api/graphics_api.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -28,13 +28,13 @@ extern DWORD WINAPI win_graphics_event_loop( LPVOID duff ); HANDLE graphics_threadh=NULL; #endif -#ifndef _WIN32 #ifdef __APPLE_CC__ #include "mac_app_opengl.h" -#endif +#ndif -#include -#include +#ifndef _WIN32 +#include +#include #ifdef HAVE_PTHREAD #include @@ -119,20 +119,20 @@ int boinc_init_graphics() { OSErr theErr = noErr; ThreadID graphicsThreadID = 0; ThreadEntryUPP entry_proc; - + entry_proc = NewThreadEntryUPP( mac_graphics_event_loop ); - + // Create the thread in a suspended state theErr = NewThread ( kCooperativeThread, entry_proc, (void *)(&gi), 0, kNewSuspend | kCreateIfNeeded, NULL, &graphicsThreadID ); if (theErr != noErr) return ERR_THREAD; - + // In theory we could do customized scheduling or install thread disposal routines here - + // Put the graphics event loop into the ready state SetThreadState(graphicsThreadID, kReadyThreadState, kNoThreadID); - + YieldToAnyThread(); #endif @@ -145,7 +145,7 @@ int boinc_init_graphics() { if (retval) return ERR_THREAD; pthread_attr_destroy( &graphics_thread_attr ); #endif - + graphics_inited = true; return 0; @@ -160,7 +160,7 @@ int boinc_finish_graphics() { } } #endif - + return 0; } @@ -215,4 +215,4 @@ bool throttled_app_render(int x, int y, double t) { return true; } return false; -} \ No newline at end of file +} diff --git a/api/gutil.C b/api/gutil.C index 314d9d9a34..471cc523ba 100755 --- a/api/gutil.C +++ b/api/gutil.C @@ -24,47 +24,19 @@ #include "jpeglib.h" #include "bmplib.h" #include "tgalib.h" -#include -#include -#include #endif #ifndef _WIN32 -#include -#include -#include -#include -#include - -#ifdef HAVE_GL_H -#include "gl.h" -#elif defined(HAVE_GL_GL_H) -#include -#elif defined(HAVE_OPENGL_GL_H) -#include -#else -#endif - -#ifdef HAVE_GLU_H -#include "glu.h" -#elif defined(HAVE_GL_GLU_H) -#include -#elif defined(HAVE_OPENGL_GLU_H) -#include -#endif - -#ifdef HAVE_GLUT_H -#include "glut.h" -#elif defined(HAVE_GL_GLUT_H) -#include -#elif defined(HAVE_OPENGL_GLUT_H) -#include -#elif defined(HAVE_GLUT_GLUT_H) -#include -#endif +#include +#include +#include +#include +#include #include #endif +#include "boinc_gl.h" + #include "gutil.h" #include "filesys.h" #include "util.h" diff --git a/api/mac_app_opengl.C b/api/mac_app_opengl.C index 3be0fa7bca..401982089c 100644 --- a/api/mac_app_opengl.C +++ b/api/mac_app_opengl.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -21,10 +21,7 @@ #include "mac_carbon_gl.h" #ifdef __APPLE_CC__ - #include #else - #include - #include #include #include @@ -37,8 +34,10 @@ #include #endif -#include -#include +#include "boinc_gl.h" + +#include +#include // project includes --------------------------------------------------------- @@ -76,14 +75,14 @@ int InitGLWindow(int xsize, int ysize, int depth, double refresh_period) { TimerUPP boincYieldUPP; EventLoopTimerRef boincYieldTimer; short i,fNum; - + InitCursor(); SetRect( &winRect, 100, 100, 100+xsize, 100+ysize ); - + err = CreateNewWindow ( kDocumentWindowClass, kWindowStandardDocumentAttributes, &winRect, &appGLWindow ); if (err != noErr) return -1; - + // Application-level event handler installer appCommandProcessor = NewEventHandlerUPP(MainAppEventHandler); err = InstallApplicationEventHandler(appCommandProcessor, GetEventTypeCount(appEventList), @@ -107,15 +106,15 @@ int InitGLWindow(int xsize, int ysize, int depth, double refresh_period) { err = InstallEventLoopTimer(GetMainEventLoop(), 0, kEventDurationMillisecond*refresh_period*1000, boincYieldUPP, NULL, &boincYieldTimer); - + // TODO: add an event handler for the window ChangeWindowAttributes( appGLWindow, kWindowStandardHandlerAttribute, 0 ); SetWTitle (appGLWindow, "\pWindow"); ShowWindow(appGLWindow); SetPortWindowPort (appGLWindow); - + glInfo.fmt = 0; // output pixel format - + i = 0; glInfo.aglAttributes [i++] = AGL_RGBA; glInfo.aglAttributes [i++] = AGL_DOUBLEBUFFER; @@ -124,13 +123,13 @@ int InitGLWindow(int xsize, int ysize, int depth, double refresh_period) { glInfo.aglAttributes [i++] = AGL_DEPTH_SIZE; glInfo.aglAttributes [i++] = 16; glInfo.aglAttributes [i++] = AGL_NONE; - + BuildGLonWindow (appGLWindow, &boincAGLContext, &glInfo); if (!boincAGLContext) { DestroyGLFromWindow (&boincAGLContext, &glInfo); } else { Rect rectPort; - + GetWindowPortBounds (appGLWindow, &rectPort); aglSetCurrentContext (boincAGLContext); aglReportError (); @@ -141,7 +140,7 @@ int InitGLWindow(int xsize, int ysize, int depth, double refresh_period) { aglReportError (); ReSizeGLScene( rectPort.right - rectPort.left, rectPort.bottom - rectPort.top ); glReportError (); - + InitGL(); app_init_gl(); @@ -149,16 +148,16 @@ int InitGLWindow(int xsize, int ysize, int depth, double refresh_period) { glReportError (); aglSwapBuffers (boincAGLContext); aglReportError (); - + GetFNum("\pTimes New Roman", &fNum); // build font main_font = BuildFontGL (boincAGLContext, fNum, normal, 9); aglUpdateContext (boincAGLContext); aglReportError (); - + using_opengl = true; } - + return 0; } @@ -252,10 +251,10 @@ pascal OSStatus MainAppEventHandler(EventHandlerCallRef appHandler, EventRef the pascal void *mac_graphics_event_loop ( void *data ) { GRAPHICS_INFO *gi = (GRAPHICS_INFO *)data; - + InitGLWindow(gi->xsize, gi->ysize, 16, gi->refresh_period); RunApplicationEventLoop(); - + return NULL; } diff --git a/api/mac_carbon_gl.C b/api/mac_carbon_gl.C index 1de487ace5..1a322cdd86 100755 --- a/api/mac_carbon_gl.C +++ b/api/mac_carbon_gl.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -50,7 +50,7 @@ #include #endif -#include +#include // project includes --------------------------------------------------------- @@ -77,18 +77,18 @@ OSStatus BuildGLonWindow (WindowPtr pWindow, AGLContext* paglContext, pstructGLW GrafPtr cgrafSave = NULL; short numDevices; OSStatus err = noErr; - + GetPort (&cgrafSave); SetPortWindowPort(pWindow); // check renderer VRAM and acceleration numDevices = FindGDHandleFromWindow (pWindow, &hGD); - + // do agl if ((Ptr) kUnresolvedCFragSymbolAddress == (Ptr) aglChoosePixelFormat) { // check for existance of OpenGL ReportError ("OpenGL not installed"); return NULL; - } + } // we successfully passed the renderer check pcontextInfo->fmt = aglChoosePixelFormat (NULL, 0, pcontextInfo->aglAttributes); // get an appropriate pixel format @@ -104,10 +104,10 @@ OSStatus BuildGLonWindow (WindowPtr pWindow, AGLContext* paglContext, pstructGLW ReportError ("Could not create context"); return NULL; } - + if (!aglSetDrawable (*paglContext, GetWindowPort (pWindow))) // attach the CGrafPtr to the context return aglReportError (); - + if(!aglSetCurrentContext (*paglContext)) // make the context the current context return aglReportError (); @@ -126,7 +126,7 @@ OSStatus BuildGLonWindow (WindowPtr pWindow, AGLContext* paglContext, pstructGLW OSStatus DestroyGLFromWindow (AGLContext* paglContext, pstructGLWindowInfo pcontextInfo) { OSStatus err; - + if ((!paglContext) || (!*paglContext)) return paramErr; // not a valid context glFinish (); @@ -143,7 +143,7 @@ OSStatus DestroyGLFromWindow (AGLContext* paglContext, pstructGLWindowInfo pcont err = aglReportError (); } pcontextInfo->fmt = 0; - + return err; } @@ -190,30 +190,30 @@ short FindGDHandleFromWindow (WindowPtr pWindow, GDHandle * phgdOnThisDevice) long greatestArea, sectArea; short numDevices = 0; GDHandle hgdNthDevice; - + if (!pWindow || !phgdOnThisDevice) return NULL; - + *phgdOnThisDevice = NULL; - + GetPort (&pgpSave); SetPortWindowPort (pWindow); - + GetWindowPortBounds (pWindow, &rectWind); LocalToGlobal ((Point*)& rectWind.top); // convert to global coordinates LocalToGlobal ((Point*)& rectWind.bottom); hgdNthDevice = GetDeviceList (); greatestArea = 0; - // check window against all gdRects in gDevice list and remember + // check window against all gdRects in gDevice list and remember // which gdRect contains largest area of window} while (hgdNthDevice) { if (TestDeviceAttribute (hgdNthDevice, screenDevice)) { if (TestDeviceAttribute (hgdNthDevice, screenActive)) { - // The SectRect routine calculates the intersection - // of the window rectangle and this gDevice - // rectangle and returns TRUE if the rectangles intersect, + // The SectRect routine calculates the intersection + // of the window rectangle and this gDevice + // rectangle and returns TRUE if the rectangles intersect, // FALSE if they don't. SectRect (&rectWind, &(**hgdNthDevice).gdRect, &rectSect); // determine which screen holds greatest window area @@ -230,7 +230,7 @@ short FindGDHandleFromWindow (WindowPtr pWindow, GDHandle * phgdOnThisDevice) } } } - + SetPort (pgpSave); return numDevices; } @@ -267,14 +267,14 @@ void DeleteFontGL (GLuint fontList) void ReportErrorNum (char * strError, long numError) { - fprintf (stderr, "%s %ld (0x%lx)\n", strError, numError, numError); + fprintf (stderr, "%s %ld (0x%lx)\n", strError, numError, numError); } // -------------------------------------------------------------------------- void ReportError (char * strError) { - fprintf (stderr, "%s\n", strError); + fprintf (stderr, "%s\n", strError); } //----------------------------------------------------------------------------------------------------------------------- @@ -382,12 +382,12 @@ void DoUpdate (AGLContext aglContext) { Rect portRect; int width, height; - + if (aglContext) { aglSetCurrentContext (aglContext); aglUpdateContext (aglContext); - + GetWindowBounds( appGLWindow, kWindowContentRgn, &portRect ); width = portRect.right - portRect.left; height = portRect.bottom - portRect.top; @@ -427,7 +427,7 @@ OSStatus StartDSp (void) gDSpStarted = true; } } - return err; + return err; } // -------------------------------------------------------------------------- @@ -479,7 +479,7 @@ void DestroyDSpContext (DSpContextReference* pdspContext) #pragma mark - //----------------------------------------------------------------------------------------------------------------------- -OSStatus DSpContext_CustomFadeGammaIn (DSpContextReference inContext, long fadeTicks) +OSStatus DSpContext_CustomFadeGammaIn (DSpContextReference inContext, long fadeTicks) { OSStatus err = noErr; RGBColor inZeroIntensityColor; @@ -495,7 +495,7 @@ OSStatus DSpContext_CustomFadeGammaIn (DSpContextReference inContext, long fadeT inZeroIntensityColor.green = 0x0000; inZeroIntensityColor.blue = 0x0000; currTick = TickCount (); - for (x = 1; x <= fadeTicks; x++) + for (x = 1; x <= fadeTicks; x++) { percent = step * x / 8; err = DSpContext_FadeGamma(inContext, percent, &inZeroIntensityColor); @@ -511,7 +511,7 @@ OSStatus DSpContext_CustomFadeGammaIn (DSpContextReference inContext, long fadeT //----------------------------------------------------------------------------------------------------------------------- -OSStatus DSpContext_CustomFadeGammaOut (DSpContextReference inContext, long fadeTicks ) +OSStatus DSpContext_CustomFadeGammaOut (DSpContextReference inContext, long fadeTicks ) { OSStatus err = noErr; RGBColor inZeroIntensityColor; @@ -527,7 +527,7 @@ OSStatus DSpContext_CustomFadeGammaOut (DSpContextReference inContext, long fade inZeroIntensityColor.green = 0x0000; inZeroIntensityColor.blue = 0x0000; currTick = TickCount (); - for (x = fadeTicks - 1; x >= 0; x--) + for (x = fadeTicks - 1; x >= 0; x--) { percent = step * x / 8; err = DSpContext_FadeGamma(inContext, percent, &inZeroIntensityColor); diff --git a/api/reduce.C b/api/reduce.C index 7e4649a73d..edf5154226 100644 --- a/api/reduce.C +++ b/api/reduce.C @@ -16,17 +16,17 @@ #ifdef _WIN32 #include "boinc_win.h" -#include #endif #ifndef _WIN32 -#include -#include -#include -#include +#include +#include +#include +#include + +#include "boinc_gl.h" #ifdef __APPLE_CC__ -#include #define max(a,b) (a>b?a:b) #define min(a,b) (a>b?b:a) #endif @@ -286,21 +286,21 @@ void REDUCED_ARRAY::draw_row_quad(int row) { #endif } -void REDUCED_ARRAY::draw_row_rect_x(int row) { +void REDUCED_ARRAY::draw_row_rect_x(int row) { float z0=0,z1=0,x0=0,x1=0,y0=0,y1=0,h=0,xm=0; - int i=0; + int i=0; float* row0=0; int trow=row-1; float* trow0=0; - double hue,sat,lum; + double hue,sat,lum; COLOR color; switch(draw_style) { case GRAPH_STYLE_RECTANGLES: z0 = draw_pos[2] + (draw_size[2]*row)/rdimy; - z1 = z0+.14f; + z1 = z0+.14f; row0 = rrow(row); - + glBegin(GL_QUADS); for (i=0; i 1) hue -= 1; sat = 1.; - lum = .5 + h/2; + lum = .5 + h/2; HLStoRGB(hue, lum, sat, color); - glColor4f(color.r, color.g, color.b, alpha); - + glColor4f(color.r, color.g, color.b, alpha); + if(row!=0) { - float lh = (trow0[i]-rdata_min)/(rdata_max-rdata_min); - float ly = draw_pos[1] + draw_size[1]*lh; - float lz = draw_pos[2] + (draw_size[2]*trow)/rdimy + .14f; + float lh = (trow0[i]-rdata_min)/(rdata_max-rdata_min); + float ly = draw_pos[1] + draw_size[1]*lh; + float lz = draw_pos[2] + (draw_size[2]*trow)/rdimy + .14f; glVertex3f(xm,ly,lz); glVertex3f(xm,y1,z1); } - } + } glEnd(); break; case GRAPH_STYLE_WIREFRAME: glLineWidth(1.0f); z0 = draw_pos[2] + (draw_size[2]*row)/rdimy; - z1 = z0+.14f; - row0 = rrow(row); - if(row!=0) trow0 = rrow(trow); - + z1 = z0+.14f; + row0 = rrow(row); + if(row!=0) trow0 = rrow(trow); + glEnable(GL_LINE_SMOOTH); - glBegin(GL_LINES); + glBegin(GL_LINES); for (i=0; i 1) hue -= 1; sat = 1.; - lum = .5 + h/2; + lum = .5 + h/2; HLStoRGB(hue, lum, sat, color); - glColor4f(color.r, color.g, color.b, alpha); - - if(i!=rdimx-1) glVertex3f(x0+((x1-x0)/2.0f), y1, z0); + glColor4f(color.r, color.g, color.b, alpha); + + if(i!=rdimx-1) glVertex3f(x0+((x1-x0)/2.0f), y1, z0); if(row!=0) { float h2 = (trow0[i]-rdata_min)/(rdata_max-rdata_min); float z2 = draw_pos[2] + (draw_size[2]*trow)/rdimy; float y2 = draw_pos[1] + draw_size[1]*h2; - glVertex3f(x0+((x1-x0)/2.0f), y1, z0); - glVertex3f(x0+((x1-x0)/2.0f), y2, z2); + glVertex3f(x0+((x1-x0)/2.0f), y1, z0); + glVertex3f(x0+((x1-x0)/2.0f), y2, z2); } if(i!=0) glVertex3f(x0+((x1-x0)/2.0f), y1, z0); - } + } glEnd(); glDisable(GL_LINE_SMOOTH); break; case GRAPH_STYLE_PLANES: z0 = draw_pos[2] + (draw_size[2]*row)/rdimy; - z1 = z0+.14f; - row0 = rrow(row); - i=0; + z1 = z0+.14f; + row0 = rrow(row); + i=0; x0 = draw_pos[0] + (draw_size[0]*i)/rdimx; x1 = x0 + draw_deltax*.8f; @@ -510,9 +510,9 @@ void REDUCED_ARRAY::draw_row_rect_x(int row) { hue = hue0 + (dhue*i)/rdimx; if (hue > 1) hue -= 1; sat = 1.; - lum = .5 + h/2; + lum = .5 + h/2; HLStoRGB(hue, lum, sat, color); - glColor4f(color.r, color.g, color.b, alpha); + glColor4f(color.r, color.g, color.b, alpha); glVertex3f(draw_pos[0],draw_pos[1],z0); @@ -538,9 +538,9 @@ void REDUCED_ARRAY::draw_row_rect_x(int row) { glVertex3d(x1,y0,z0); glVertex3d(x1,y1,z0); } - glEnd(); + glEnd(); break; - default: + default: break; } } @@ -638,7 +638,7 @@ void REDUCED_ARRAY::draw_part(double frac) { draw(0, nr); } -void REDUCED_ARRAY::draw_axis_labels() { +void REDUCED_ARRAY::draw_axis_labels() { GLfloat char_height = .5f; GLfloat line_width = 3.0f; GLfloat spacing = 2.0f; @@ -664,7 +664,7 @@ void REDUCED_ARRAY::draw_axis_labels() { draw_rotated_text(x_text_pos,char_height,line_width,spacing,x_label,rotation,rotation_vector); //draw_text_line(x_text_pos,char_height,line_width,x_label,0); - + } void REDUCED_ARRAY::draw_axes() { @@ -677,11 +677,11 @@ void REDUCED_ARRAY::draw_axes() { float adj3=0; // box mode_unshaded(); - + glLineWidth(.5); glBegin(GL_LINES); - glColor4d(1,1,1,.5); - + glColor4d(1,1,1,.5); + //back square glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj); glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj); @@ -707,7 +707,7 @@ void REDUCED_ARRAY::draw_axes() { glVertex3f(draw_pos[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2); glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]+draw_size[1], draw_pos[2]+draw_size[2]+adj2); - + //connecting lines glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj); glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2); @@ -724,13 +724,13 @@ void REDUCED_ARRAY::draw_axes() { mode_unshaded(); - + glLineWidth(1.0); glEnable(GL_LINE_SMOOTH); glBegin(GL_LINES); - glColor4d(1,1,1,1); - - + glColor4d(1,1,1,1); + + glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+adj); glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+adj); @@ -743,22 +743,22 @@ void REDUCED_ARRAY::draw_axes() { glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2); glVertex3f(draw_pos[0], draw_pos[1], draw_pos[2]+draw_size[2]+adj2); - glEnd(); - + glEnd(); + glColor4d(1,1,1,.2); - glBegin(GL_QUADS); - glVertex3f(draw_pos[0], draw_pos[1]-adj3, draw_pos[2]+draw_size[2]+adj2); + glBegin(GL_QUADS); + glVertex3f(draw_pos[0], draw_pos[1]-adj3, draw_pos[2]+draw_size[2]+adj2); glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]-adj3, draw_pos[2]+draw_size[2]+adj2); glVertex3f(draw_pos[0]+draw_size[0], draw_pos[1]-adj3, draw_pos[2]+adj); - glVertex3f(draw_pos[0], draw_pos[1]-adj3, draw_pos[2]+adj); + glVertex3f(draw_pos[0], draw_pos[1]-adj3, draw_pos[2]+adj); glEnd(); glDisable(GL_LINE_SMOOTH); } -void REDUCED_ARRAY::draw_labels() { - double model[16]; +void REDUCED_ARRAY::draw_labels() { + double model[16]; double proj[16]; double z_pos[3]; double x_pos[3]; @@ -768,7 +768,7 @@ void REDUCED_ARRAY::draw_labels() { float arroww = .05f; float ch = .015f; - float lw = .02f; + float lw = .02f; float ls = 0; float wd=.015f; @@ -798,26 +798,26 @@ void REDUCED_ARRAY::draw_labels() { int viewport[4]; get_matrix(model); - get_projection(proj); + get_projection(proj); get_viewport(viewport); int w = viewport[2]; int h = viewport[3]; glPushMatrix(); //unscale modelview matrix - - double aspect_ratio = 4.0/3.0; + + double aspect_ratio = 4.0/3.0; if ((double)h*aspect_ratio > (double)w) { - model[1]*=1.0f/(((double)w/aspect_ratio)/(double)h); + model[1]*=1.0f/(((double)w/aspect_ratio)/(double)h); model[5]*=1.0f/(((double)w/aspect_ratio)/(double)h); model[9]*=1.0f/(((double)w/aspect_ratio)/(double)h); - } else { - model[0]*=1.0f/(((double)h*aspect_ratio)/(double)w); + } else { + model[0]*=1.0f/(((double)h*aspect_ratio)/(double)w); model[4]*=1.0f/(((double)h*aspect_ratio)/(double)w); model[8]*=1.0f/(((double)h*aspect_ratio)/(double)w); - } + } - //project to ortho coordinates + //project to ortho coordinates viewport[0]=0; viewport[1]=0; viewport[2]=1; @@ -826,7 +826,7 @@ void REDUCED_ARRAY::draw_labels() { get_2d_positions(draw_pos[0],draw_pos[1],draw_pos[2]+(draw_size[2]/2.0f), model, proj, viewport,z_pos ); - + get_2d_positions(draw_pos[0]+draw_size[0]/2.0f,draw_pos[1],draw_pos[2]+draw_size[2], model, proj, viewport,x_pos ); @@ -837,16 +837,16 @@ void REDUCED_ARRAY::draw_labels() { glPopMatrix(); mode_ortho(); - mode_unshaded(); - glColor3d(1,1,1); + mode_unshaded(); + glColor3d(1,1,1); float zpos[3]={(float)z_pos[0],(float)z_pos[1],(float)z_pos[2]}; float xpos[3]={(float)x_pos[0],(float)x_pos[1],(float)x_pos[2]}; - float ppos[3]={(float)p_pos[0],(float)p_pos[1],(float)p_pos[2]}; + float ppos[3]={(float)p_pos[0],(float)p_pos[1],(float)p_pos[2]}; draw_text_right(zpos,ch,lw,ls,zlabel); draw_text(xpos,ch,lw,ls,xlabel); draw_text(ppos,ch,lw,ls,ylabel); - - ortho_done(); -} \ No newline at end of file + + ortho_done(); +} diff --git a/api/static_graphics.C b/api/static_graphics.C index 7fd57e1071..70d613ad45 100644 --- a/api/static_graphics.C +++ b/api/static_graphics.C @@ -6,12 +6,10 @@ #ifdef _WIN32 #include "boinc_win.h" -#include // Header File For The OpenGL32 Library -#include // Header File For The GLu32 Library -#include // Header File For The Glaux Library -#include #endif +#include "boinc_gl.h" + #include "gutil.h" #define FILENAME "background" diff --git a/api/x_opengl.C b/api/x_opengl.C index 402a424ac8..826f9c02de 100644 --- a/api/x_opengl.C +++ b/api/x_opengl.C @@ -1,10 +1,8 @@ #include "x_opengl.h" -#include +#include #ifdef HAVE_GL -#include -#include -#include +#include "boinc_gl.h" #include "graphics_api.h" @@ -77,7 +75,7 @@ void *p_graphics_loop( void *duff ) { fprintf(stderr, "glXMakeCurrent failed (window)!\n"); return 0; } - + InitGL(); win_open = true; @@ -90,7 +88,7 @@ void *p_graphics_loop( void *duff ) { } // How do we prevent broken pipes and broken connection error messages? -// +// void process_input(Display *dpy) { XEvent event; @@ -117,7 +115,7 @@ void process_input(Display *dpy) { GLvoid buildFont(GLvoid) { XFontStruct *font; - + main_font = glGenLists(256); /* storage for 256 characters */ /* load a font with a specific name in "Host Portable Character Encoding" */ /*font = XLoadQueryFont(dpy, diff --git a/apps/1sec.C b/apps/1sec.C index ea242ad815..bf07b0a6b7 100644 --- a/apps/1sec.C +++ b/apps/1sec.C @@ -2,25 +2,25 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // // burn up to one CPU second -#include -#include +#include +#include int main() { int now = time(0), i; diff --git a/apps/concat.C b/apps/concat.C index f946830c82..3083551122 100644 --- a/apps/concat.C +++ b/apps/concat.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -21,9 +21,9 @@ // // concatenate files, write to outfile -#include -#include -#include +#include +#include +#include #include #include "filesys.h" diff --git a/apps/error.C b/apps/error.C index 8518473c63..6b23799b7d 100644 --- a/apps/error.C +++ b/apps/error.C @@ -2,25 +2,25 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // // crash and burn -#include -#include +#include +#include int main() { char * hello = (char *) 100; diff --git a/apps/upper_case.C b/apps/upper_case.C index 3c6750ae26..50bf1771df 100755 --- a/apps/upper_case.C +++ b/apps/upper_case.C @@ -30,30 +30,17 @@ #endif #ifndef _WIN32 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #endif #ifdef BOINC_APP_GRAPHICS -#ifdef __APPLE_CC__ -#include -#include -#include "mac_carbon_gl.h" -#elif _WIN32 -#include // Header File For The OpenGL32 Library -#include // Header File For The GLu32 Library -#include // Header File For The Glaux Library -#elif HAVE_GL_LIB -#include -#include -#include -#endif - +#include "boinc_gl.h" #include "graphics_api.h" #endif diff --git a/checkin_notes b/checkin_notes index 3e5db58b55..8d96be7438 100755 --- a/checkin_notes +++ b/checkin_notes @@ -15145,11 +15145,27 @@ Karl 2004-07-13 - new function generic_check_set() which generalizes generic_check_set_majority() - - rename validate_test to validate_bitwise + - Cleaned up sample validators and sample assimilator. Renames: + validate_test -> sample_bitwise_validator + validate_trivial -> sample_trivial_validator + assimilator -> sample_dummy_assimilator sched/ Makefile.am validate_util.C validate_util.h - validate_test.C -> validate_bitwise.C + validate.C -> validator.C (consistent w/ assimilator.C) + validate_test.C -> sample_bitwise_validator.C + validate_trivial.C -> sample_trivial_validator.C + assimilate_handler.C -> sample_dummy_assimilator.C +Karl 2004-07-13 + - updated #includes of C headers in C++ files to C++ headers + (e.g. instead of ) + + - refactored HAVE_GL* preprocessing logic for OpenGL headers + + api/ + boinc_gl.h (new) + + 113 files modified diff --git a/client/app.C b/client/app.C index b989cf9888..ccedba5f0c 100644 --- a/client/app.C +++ b/client/app.C @@ -29,9 +29,7 @@ #ifndef _WIN32 -#if HAVE_ERRNO_H -#include -#endif +#include #if HAVE_UNISTD_H #include #endif @@ -56,15 +54,13 @@ #if HAVE_FCNTL_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #endif @@ -1050,7 +1046,7 @@ bool ACTIVE_TASK::read_stderr_file() { int ACTIVE_TASK::request_reread_prefs() { int retval; APP_INIT_DATA aid; - + link_user_files(); retval = write_app_init_file(aid); @@ -1643,7 +1639,7 @@ int ACTIVE_TASK_SET::parse(MIOFILE& fin) { // return the next graphics-capable app // try to choose an app from a different project // preferences goes to pre-ss mode WINDOW, then apps with pre-ss mode HIDE -// +// ACTIVE_TASK* ACTIVE_TASK_SET::get_next_graphics_capable_app() { static int project_index = 0; unsigned int i, j; diff --git a/client/check_state.C b/client/check_state.C index 348a0af5f0..297fad3caa 100644 --- a/client/check_state.C +++ b/client/check_state.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -27,7 +27,7 @@ #endif #ifndef _WIN32 -#include +#include #endif #include "client_state.h" diff --git a/client/client_msgs.C b/client/client_msgs.C index 5776cf39fc..3f939bb1a6 100644 --- a/client/client_msgs.C +++ b/client/client_msgs.C @@ -21,7 +21,7 @@ #include "boinc_win.h" #endif #ifndef _WIN32 -#include +#include #include #endif diff --git a/client/client_state.C b/client/client_state.C index 5d3ff86607..8491bfa737 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -30,9 +30,6 @@ #if HAVE_SYS_WAIT_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif #if HAVE_SYS_SIGNAL_H #include #endif @@ -40,10 +37,11 @@ #include #endif -#include -#include -#include -#include +#include +#include +#include +#include +#include #endif #include "parse.h" diff --git a/client/client_state.h b/client/client_state.h index cdb5b38f93..2b8ca70d39 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -22,7 +22,7 @@ #ifndef _WIN32 #include -#include +#include #endif #include "app.h" diff --git a/client/cs_account.C b/client/cs_account.C index a56302d50e..28df0da517 100644 --- a/client/cs_account.C +++ b/client/cs_account.C @@ -22,7 +22,7 @@ #endif #ifndef _WIN32 -#include +#include #include #endif diff --git a/client/cs_apps.C b/client/cs_apps.C index 24f1e31da0..6b43391dac 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -27,9 +27,7 @@ #endif #ifndef _WIN32 -#if HAVE_SIGNAL_H -#include -#endif +#include #endif #include "md5_file.h" diff --git a/client/cs_benchmark.C b/client/cs_benchmark.C index e1767078c0..41f769f5ff 100644 --- a/client/cs_benchmark.C +++ b/client/cs_benchmark.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -43,9 +43,7 @@ #if HAVE_SYS_WAIT_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif +#include #if HAVE_SYS_SIGNAL_H #include #endif @@ -53,9 +51,9 @@ #include #endif -#include -#include -#include +#include +#include +#include #endif #include "error_numbers.h" diff --git a/client/dhrystone.C b/client/dhrystone.C index fc39e87187..1394d66fda 100644 --- a/client/dhrystone.C +++ b/client/dhrystone.C @@ -40,9 +40,9 @@ #include "boinc_win.h" #endif -#include -#include -#include +#include +#include +#include #include "boinc_api.h" #include "cpu_benchmark.h" diff --git a/client/file_names.C b/client/file_names.C index 35f1ada533..7a20c519c6 100644 --- a/client/file_names.C +++ b/client/file_names.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -24,9 +24,9 @@ #endif #ifndef _WIN32 -#include +#include #include -#include +#include #endif #include "filesys.h" diff --git a/client/gui_rpc_client.C b/client/gui_rpc_client.C index 91a39204b7..5572709d0f 100644 --- a/client/gui_rpc_client.C +++ b/client/gui_rpc_client.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -25,10 +25,10 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/client/gui_test.C b/client/gui_test.C index c8a8b145f6..efa4fef1f0 100644 --- a/client/gui_test.C +++ b/client/gui_test.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -37,7 +37,7 @@ using std::vector; #ifndef _WIN32 -#include +#include #endif #include "gui_rpc_client.h" diff --git a/client/hostinfo_network.C b/client/hostinfo_network.C index 4721aea709..b78b4b952b 100644 --- a/client/hostinfo_network.C +++ b/client/hostinfo_network.C @@ -22,8 +22,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #if HAVE_UNISTD_H #include @@ -151,7 +151,7 @@ int get_local_network_info( sprintf(buf, "/usr/sbin/ping -s %s 1 1 > %s 2>/dev/null", hostname, TEMP_FILE_NAME); retval = try_ping(buf, domain_name, domlen, ip_addr, iplen); if (!retval) return 0; - + msg_printf(NULL, MSG_INFO, "Couldn't get hostname and IP address"); msg_printf(NULL, MSG_INFO, "Make sure 'ping' is in your search path"); diff --git a/client/hostinfo_unix.C b/client/hostinfo_unix.C index 36517e92eb..f8598bb7d3 100644 --- a/client/hostinfo_unix.C +++ b/client/hostinfo_unix.C @@ -2,27 +2,27 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #include "cpp.h" -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -143,16 +143,16 @@ bool HOST_INFO::host_is_running_on_batteries() { char ac_state[64]; std::string ac_name; FILE* facpi; - - // we need to find the right ac adapter first + + // we need to find the right ac adapter first DirScanner dir("/proc/acpi/ac_adapter/"); while (dir.scan(ac_name)) { if ((ac_name.c_str()==".")||(ac_name.c_str()=="..")) continue; - + // newer ACPI versions use "state" as filename sprintf(ac_state, "/proc/acpi/ac_adapter/%s/state", ac_name.c_str()); facpi = fopen(ac_state, "r"); - if (!facpi) { + if (!facpi) { // older ACPI versions use "status" instead sprintf(ac_state, "/proc/acpi/ac_adapter/%s/status", ac_name.c_str()); facpi = fopen(ac_state, "r"); @@ -163,7 +163,7 @@ bool HOST_INFO::host_is_running_on_batteries() { fclose(facpi); // only valid state if it contains "state" (newer) or "Status" (older) - if ((strstr(buf, "state:") != NULL) || (strstr(buf, "Status:") != NULL)) { + if ((strstr(buf, "state:") != NULL) || (strstr(buf, "Status:") != NULL)) { // on batteries if ac adapter is "off-line" (or maybe "offline") retval = (strstr(buf, "off") != NULL); break; @@ -284,7 +284,7 @@ int HOST_INFO::get_host_info() { mib[1] = HW_MACHINE; len = sizeof(p_vendor); sysctl(mib, 2, &p_vendor, &len, NULL, 0); - + // Get model mib[0] = CTL_HW; mib[1] = HW_MODEL; @@ -292,7 +292,7 @@ int HOST_INFO::get_host_info() { sysctl(mib, 2, &p_model, &len, NULL, 0); #endif #endif - + #if defined(_SC_NPROCESSORS_ONLN) p_ncpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -344,7 +344,7 @@ int HOST_INFO::get_host_info() { #elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_VM) && defined(VM_METER) // TODO: figure this out /*vmtotal vm_info; - + mib[0] = CTL_VM; mib[1] = VM_METER; len = sizeof(vm_info); @@ -354,7 +354,7 @@ int HOST_INFO::get_host_info() { #else #endif -#if defined(HAVE_SYS_SYSTEMINFO_H) +#if defined(HAVE_SYS_SYSTEMINFO_H) #if defined(SI_HW_SERIAL) sysinfo(SI_HW_SERIAL, serialnum, sizeof(serialnum)); #else @@ -375,7 +375,7 @@ int HOST_INFO::get_host_info() { } #endif #endif - + get_local_network_info( domain_name, sizeof(domain_name), ip_addr, sizeof(ip_addr) ); @@ -391,7 +391,7 @@ int HOST_INFO::get_host_info() { mib[1] = KERN_OSTYPE; len = sizeof(os_name); sysctl(mib, 2, &os_name, &len, NULL, 0); - + mib[0] = CTL_KERN; mib[1] = KERN_OSRELEASE; len = sizeof(os_version); diff --git a/client/http.C b/client/http.C index 7bf98583ad..8778c15ef7 100644 --- a/client/http.C +++ b/client/http.C @@ -35,9 +35,7 @@ #if HAVE_SYS_SOCKET_H #include #endif -#if HAVE_ERRNO_H -#include -#endif +#include #if HAVE_UNISTD_H #include #endif @@ -339,7 +337,7 @@ int HTTP_OP::init_head(const char* url) { strcat(id_passwd,pi.http_user_passwd); encstr = r_base64_encode(id_passwd,strlen(id_passwd)); http_head_request_header_proxy( - request_header, url_hostname, port, proxy_buf, (char*)encstr.c_str() + request_header, url_hostname, port, proxy_buf, (char*)encstr.c_str() ); } return 0; diff --git a/client/log_flags.C b/client/log_flags.C index 55a0f7cda0..53fceb7e32 100644 --- a/client/log_flags.C +++ b/client/log_flags.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -24,8 +24,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #endif #include "error_numbers.h" diff --git a/client/main.C b/client/main.C index 60e2d2cfa3..f19df5258b 100644 --- a/client/main.C +++ b/client/main.C @@ -33,9 +33,7 @@ #ifdef HAVE_UNISTD_H #include #endif -#ifdef HAVE_SIGNAL_H -#include -#endif +#include #include "synch.h" #endif @@ -238,7 +236,7 @@ int boinc_main_loop(int argc, char** argv) { #endif boinc_init_diagnostics( - BOINC_DIAG_DUMPCALLSTACKENABLED | + BOINC_DIAG_DUMPCALLSTACKENABLED | BOINC_DIAG_HEAPCHECKENABLED | BOINC_DIAG_TRACETOSTDERR ); diff --git a/client/net_stats.C b/client/net_stats.C index 1fdd8fbaf7..c216e41c73 100644 --- a/client/net_stats.C +++ b/client/net_stats.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -31,8 +31,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #endif #include "parse.h" diff --git a/client/net_stats.h b/client/net_stats.h index 1d3c7ba4b6..d7a0f18f60 100644 --- a/client/net_stats.h +++ b/client/net_stats.h @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -22,7 +22,7 @@ // #ifndef _WIN32 -#include +#include #endif #include "net_xfer.h" @@ -49,7 +49,7 @@ public: NET_STATS(); void poll(NET_XFER_SET&); - + int write(MIOFILE&, bool to_server); int parse(MIOFILE&); }; diff --git a/client/net_xfer.C b/client/net_xfer.C index 89de50c05f..68e80f742e 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -33,8 +33,8 @@ #ifndef _WIN32 -#include -#include +#include +#include #if HAVE_SYS_TIME_H #include @@ -62,10 +62,10 @@ #endif #include -#include -#include -#include -#include +#include +#include +#include +#include #endif @@ -76,7 +76,7 @@ #include "client_state.h" #include "client_msgs.h" -#if defined(_WIN32) +#if defined(_WIN32) typedef int socklen_t; #elif defined ( __APPLE__) typedef int32_t socklen_t; diff --git a/client/pers_file_xfer.C b/client/pers_file_xfer.C index 34a6bcbf6a..2fa21b593b 100644 --- a/client/pers_file_xfer.C +++ b/client/pers_file_xfer.C @@ -24,8 +24,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #endif #include "error_numbers.h" @@ -115,7 +115,7 @@ int PERS_FILE_XFER::start_xfer() { fip->project, MSG_INFO, "File %s exists already, skipping download", pathname ); - + return retval; } } diff --git a/client/prefs.C b/client/prefs.C index 5dc602310b..34f4fd0a52 100644 --- a/client/prefs.C +++ b/client/prefs.C @@ -24,9 +24,9 @@ #endif #ifndef _WIN32 -#include -#include -#include +#include +#include +#include #endif #include "parse.h" diff --git a/client/prefs.h b/client/prefs.h index a4724d091b..dce0c8490f 100644 --- a/client/prefs.h +++ b/client/prefs.h @@ -2,25 +2,25 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #ifndef _PREFS_ #define _PREFS_ -#include +#include // Global preferences are edited and stored on BOINC servers. // The native representation of preferences is XML. diff --git a/client/scheduler_op.C b/client/scheduler_op.C index eea6fe6bb4..f82a6756c9 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -22,10 +22,10 @@ #endif #ifndef _WIN32 -#include -#include -#include -#include +#include +#include +#include +#include #endif #include "util.h" diff --git a/client/ss_logic.h b/client/ss_logic.h index c16edfc908..179947a4b1 100644 --- a/client/ss_logic.h +++ b/client/ss_logic.h @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -39,7 +39,7 @@ #define _SS_LOGIC_ #ifndef _WIN32 -#include +#include #endif class SS_LOGIC { diff --git a/client/test_file_xfer.C b/client/test_file_xfer.C index 2828e2e415..15bcc5eb23 100644 --- a/client/test_file_xfer.C +++ b/client/test_file_xfer.C @@ -2,25 +2,25 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #include "cpp.h" -#include +#include +#include #include -#include #include "http.h" #include "file_xfer.h" diff --git a/client/test_http.C b/client/test_http.C index abe55d5a68..5d223c8783 100644 --- a/client/test_http.C +++ b/client/test_http.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -23,7 +23,7 @@ #include "winsock.h" #include "win_net.h" #endif -#include +#include #if HAVE_UNISTD_H #include #endif diff --git a/client/time_stats.C b/client/time_stats.C index 717383ebb4..cd45d1f8a9 100644 --- a/client/time_stats.C +++ b/client/time_stats.C @@ -22,9 +22,9 @@ #endif #ifndef _WIN32 -#include -#include -#include +#include +#include +#include #endif #include "parse.h" diff --git a/client/whetstone.C b/client/whetstone.C index b28cffa804..b92eb3cee3 100644 --- a/client/whetstone.C +++ b/client/whetstone.C @@ -24,11 +24,11 @@ #endif #ifndef _WIN32 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #endif #include "boinc_api.h" diff --git a/configure b/configure index f5f09a17f4..91e10de9db 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.108 . +# From configure.ac Revision: 1.111 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for BOINC 4.00. # @@ -8579,12 +8579,6 @@ _ACEOF fi -# by default, create static binaries on linux. -#[if [ "$target_os" = "linux-gnu" ]; then -# STATIC_FLAGS="-static" -#fi -#echo "checking static flags... ${STATIC_FLAGS:-(none)}"] -#AC_SUBST(STATIC_FLAGS) ac_config_files="$ac_config_files Makefile RSAEuro/source/Makefile RSAEuro/Makefile api/Makefile apps/Makefile client/Makefile db/Makefile lib/Makefile sched/Makefile tools/Makefile test/Makefile test/version.inc py/Makefile py/Boinc/Makefile py/Boinc/version.py py/Boinc/boinc_path_config.py:py/Boinc/boinc_path_config.py.in py/boinc_path_config.py:py/Boinc/boinc_path_config.py.in client/win/boinc_path_config.py:py/Boinc/boinc_path_config.py.in sched/boinc_path_config.py:py/Boinc/boinc_path_config.py.in tools/boinc_path_config.py:py/Boinc/boinc_path_config.py.in test/boinc_path_config.py:py/Boinc/boinc_path_config.py.in" @@ -10105,3 +10099,13 @@ EOF ) +if test "${enable_server}" = yes ; then + cat< #include #include -#include +#include #include "util.h" #include "boinc_db.h" diff --git a/db/boinc_db.h b/db/boinc_db.h index 392b031009..48dfcea4c2 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -27,7 +27,7 @@ // The parse and write functions are for use in scheduler RPC. // They don't necessarily serialize the entire records. -#include +#include #include #include "db_base.h" diff --git a/db/db_base.C b/db/db_base.C index 823818b114..47d291f39b 100644 --- a/db/db_base.C +++ b/db/db_base.C @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include "error_numbers.h" #include "util.h" diff --git a/lib/app_ipc.C b/lib/app_ipc.C index d6af674240..e94bf7b2bd 100755 --- a/lib/app_ipc.C +++ b/lib/app_ipc.C @@ -22,7 +22,7 @@ #endif #ifndef _WIN32 -#include +#include #endif #include "boinc_api.h" diff --git a/lib/boinc_win.h b/lib/boinc_win.h index d7a527310d..b9737fda29 100644 --- a/lib/boinc_win.h +++ b/lib/boinc_win.h @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -35,7 +35,7 @@ #ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later. #define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later. -#endif +#endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0400 // Change this to the appropriate value to target Windows Me or later. @@ -83,17 +83,24 @@ // Standard Libraries // -// Standard Template libraries +// C headers +#include +#include #include -#include -#include #include -#include +#include +#include #include +#include +#include #include #include -#include #include +#include +#include + +// C++ headers +#include #include #include #include @@ -103,14 +110,6 @@ #include -// Standard C Runtime libraries -#include -#include -#include -#include -#include - - #define vsnprintf _vsnprintf #define snprintf _snprintf #define fdopen _fdopen @@ -141,17 +140,17 @@ #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) -// The following macros set and clear, respectively, given bits -// of the C runtime library debug flag, as specified by a bitmask. -#define SET_CRT_DEBUG_FIELD(a) _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) -#define CLEAR_CRT_DEBUG_FIELD(a) _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +// The following macros set and clear, respectively, given bits +// of the C runtime library debug flag, as specified by a bitmask. +#define SET_CRT_DEBUG_FIELD(a) _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +#define CLEAR_CRT_DEBUG_FIELD(a) _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) #else //_DEBUG #define DEBUG_NEW new -#define SET_CRT_DEBUG_FIELD(a) ((void) 0) -#define CLEAR_CRT_DEBUG_FIELD(a) ((void) 0) +#define SET_CRT_DEBUG_FIELD(a) ((void) 0) +#define CLEAR_CRT_DEBUG_FIELD(a) ((void) 0) #endif //_DEBUG diff --git a/lib/crypt.C b/lib/crypt.C index 17c896a091..3ab0600d0a 100644 --- a/lib/crypt.C +++ b/lib/crypt.C @@ -23,8 +23,8 @@ #ifndef _WIN32 #include -#include -#include +#include +#include #if HAVE_MALLOC_H #include #endif diff --git a/lib/crypt.h b/lib/crypt.h index 0574e07348..203998489d 100644 --- a/lib/crypt.h +++ b/lib/crypt.h @@ -21,7 +21,7 @@ #define H_CRYPT // some interface functions for RSAEuro -#include +#include #include "rsaeuro.h" extern "C" { diff --git a/lib/crypt_prog.C b/lib/crypt_prog.C index 68710d859b..f08cfe7cfa 100644 --- a/lib/crypt_prog.C +++ b/lib/crypt_prog.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -31,8 +31,8 @@ // -test_crypt private_keyfile public_keyfile // test encrypt/decrypt -#include -#include +#include +#include #include "rsaeuro.h" diff --git a/lib/diagnostics.C b/lib/diagnostics.C index 73c3a425e5..43b4f18626 100644 --- a/lib/diagnostics.C +++ b/lib/diagnostics.C @@ -15,7 +15,7 @@ // University of California at Berkeley. All Rights Reserved. // // Purpose: -// +// // // // Contributor(s): @@ -26,12 +26,9 @@ #endif #ifndef _WIN32 -#include -#include -#include -#ifdef HAVE_SIGNAL_H -//#include -#endif +#include +#include +#include #include "config.h" #endif @@ -67,7 +64,7 @@ int boinc_init_diagnostics(int _flags) { boinc_copy( BOINC_DIAG_STDOUT, BOINC_DIAG_STDOUTOLD ); } - + // Redirect stderr and/or stdout streams, if requested if (flags & BOINC_DIAG_REDIRECTSTDERR ) { lpRetVal = (void*) freopen(BOINC_DIAG_STDERR, "a", stderr); @@ -219,7 +216,7 @@ LONG CALLBACK boinc_catch_signal(EXCEPTION_POINTERS *pExPtrs) { LONG lReturnValue = NULL; char status[256]; char substatus[256]; - + static long lDetectNestedException = 0; // If we've been in this procedure before, something went wrong so we immediately exit @@ -241,73 +238,73 @@ LONG CALLBACK boinc_catch_signal(EXCEPTION_POINTERS *pExPtrs) { } } break; - case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_DATATYPE_MISALIGNMENT: safe_strncpy( status, "Data Type Misalignment", sizeof(status) ); break; - case EXCEPTION_BREAKPOINT: + case EXCEPTION_BREAKPOINT: safe_strncpy( status, "Breakpoint Encountered", sizeof(status) ); break; - case EXCEPTION_SINGLE_STEP: + case EXCEPTION_SINGLE_STEP: safe_strncpy( status, "Single Instruction Executed", sizeof(status) ); break; - case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: safe_strncpy( status, "Array Bounds Exceeded", sizeof(status) ); break; - case EXCEPTION_FLT_DENORMAL_OPERAND: + case EXCEPTION_FLT_DENORMAL_OPERAND: safe_strncpy( status, "Float Denormal Operand", sizeof(status) ); break; - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - safe_strncpy( status, "Divide by Zero", sizeof(status) ); + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + safe_strncpy( status, "Divide by Zero", sizeof(status) ); break; - case EXCEPTION_FLT_INEXACT_RESULT: - safe_strncpy( status, "Float Inexact Result", sizeof(status) ); + case EXCEPTION_FLT_INEXACT_RESULT: + safe_strncpy( status, "Float Inexact Result", sizeof(status) ); break; - case EXCEPTION_FLT_INVALID_OPERATION: + case EXCEPTION_FLT_INVALID_OPERATION: safe_strncpy( status, "Float Invalid Operation", sizeof(status) ); break; - case EXCEPTION_FLT_OVERFLOW: + case EXCEPTION_FLT_OVERFLOW: safe_strncpy( status, "Float Overflow", sizeof(status) ); break; - case EXCEPTION_FLT_STACK_CHECK: + case EXCEPTION_FLT_STACK_CHECK: safe_strncpy( status, "Float Stack Check", sizeof(status) ); break; - case EXCEPTION_FLT_UNDERFLOW: + case EXCEPTION_FLT_UNDERFLOW: safe_strncpy( status, "Float Underflow", sizeof(status) ); break; - case EXCEPTION_INT_DIVIDE_BY_ZERO: + case EXCEPTION_INT_DIVIDE_BY_ZERO: safe_strncpy( status, "Integer Divide by Zero", sizeof(status) ); break; - case EXCEPTION_INT_OVERFLOW: + case EXCEPTION_INT_OVERFLOW: safe_strncpy( status, "Integer Overflow", sizeof(status) ); break; - case EXCEPTION_PRIV_INSTRUCTION: + case EXCEPTION_PRIV_INSTRUCTION: safe_strncpy( status, "Privileged Instruction", sizeof(status) ); break; - case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_IN_PAGE_ERROR: safe_strncpy( status, "In Page Error", sizeof(status) ); break; - case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_ILLEGAL_INSTRUCTION: safe_strncpy( status, "Illegal Instruction", sizeof(status) ); break; - case EXCEPTION_NONCONTINUABLE_EXCEPTION: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: safe_strncpy( status, "Noncontinuable Exception", sizeof(status) ); break; - case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_STACK_OVERFLOW: safe_strncpy( status, "Stack Overflow", sizeof(status) ); break; - case EXCEPTION_INVALID_DISPOSITION: + case EXCEPTION_INVALID_DISPOSITION: safe_strncpy( status, "Invalid Disposition", sizeof(status) ); break; - case EXCEPTION_GUARD_PAGE: + case EXCEPTION_GUARD_PAGE: safe_strncpy( status, "Guard Page Violation", sizeof(status) ); break; - case EXCEPTION_INVALID_HANDLE: + case EXCEPTION_INVALID_HANDLE: safe_strncpy( status, "Invalid Handle", sizeof(status) ); break; - case CONTROL_C_EXIT: + case CONTROL_C_EXIT: safe_strncpy( status, "Ctrl+C Exit", sizeof(status) ); break; - default: + default: safe_strncpy( status, "Unknown exception", sizeof(status) ); break; } @@ -340,8 +337,8 @@ LONG CALLBACK boinc_catch_signal(EXCEPTION_POINTERS *pExPtrs) { // Trap ASSERTs and TRACEs from the CRT and spew them to stderr. // -int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){ - (*retVal) = 0; +int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){ + (*retVal) = 0; switch(reportType){ @@ -349,12 +346,12 @@ int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){ case _CRT_ERROR: OutputDebugString(szMsg); // Reports string to the debugger output window - + if (flags & BOINC_DIAG_TRACETOSTDERR ) { fprintf( stderr, szMsg ); fflush( stderr ); } - + if (flags & BOINC_DIAG_TRACETOSTDOUT ) { fprintf( stdout, szMsg ); fflush( stdout ); @@ -376,7 +373,7 @@ int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){ } return(TRUE); -} +} // Converts the BOINCTRACE macro into a single string and report it @@ -385,7 +382,7 @@ int __cdecl boinc_message_reporting( int reportType, char *szMsg, int *retVal ){ void boinc_trace(const char *pszFormat, ...) { static char szBuffer[1024]; - // Trace messages should only be reported if running as a standalone + // Trace messages should only be reported if running as a standalone // application or told too. if ((flags & BOINC_DIAG_TRACETOSTDERR) || (flags & BOINC_DIAG_TRACETOSTDOUT) ) { diff --git a/lib/diagnostics.h b/lib/diagnostics.h index 882c35d844..f536d23f75 100644 --- a/lib/diagnostics.h +++ b/lib/diagnostics.h @@ -69,7 +69,7 @@ void boinc_info_release(const char *pszFormat, ...); #endif // _DEBUG #else // non-Win starts here -#include +#include extern void boinc_set_signal_handler(int sig, void(*handler)(int)); extern void boinc_set_signal_handler_force(int sig, void(*handler)(int)); #endif // _WIN32 diff --git a/lib/filesys.C b/lib/filesys.C index 027253f4f9..fe48ee6c1c 100755 --- a/lib/filesys.C +++ b/lib/filesys.C @@ -22,14 +22,14 @@ #endif #ifndef _WIN32 -#include +#include #include -#include +#include #include #include -#include -#include -#include +#include +#include +#include #ifdef HAVE_SYS_TIME_H #include @@ -193,7 +193,7 @@ DirScanner::DirScanner(string const& path) { bool DirScanner::scan(string& s) { #ifdef HAVE_DIRENT_H if (!dirp) return false; - + while (1) { dirent* dp = readdir(dirp); if (dp) { diff --git a/lib/filesys.h b/lib/filesys.h index d228bba333..4df4839ec0 100755 --- a/lib/filesys.h +++ b/lib/filesys.h @@ -6,18 +6,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -38,7 +38,7 @@ typedef DIR_DESC *DIRREF; #ifndef _WIN32 -#include +#include #include #ifdef HAVE_DIRENT_H diff --git a/lib/hostinfo.C b/lib/hostinfo.C index 9c46e48961..290e5b2d79 100644 --- a/lib/hostinfo.C +++ b/lib/hostinfo.C @@ -22,8 +22,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #if HAVE_UNISTD_H #include diff --git a/lib/language.C b/lib/language.C index 71dbac4e60..da88ad8e9d 100755 --- a/lib/language.C +++ b/lib/language.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -22,8 +22,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #endif #include "util.h" @@ -44,7 +44,7 @@ int LANGUAGE::read_language_file(char *file_name) { int retval; // TODO: put in a size limitation here? - + if (language_file_contents) free(language_file_contents); language_file_contents = NULL; diff --git a/lib/language.h b/lib/language.h index 1ec278c9f2..5b71349e82 100755 --- a/lib/language.h +++ b/lib/language.h @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -27,7 +27,7 @@ #define _LANGUAGE_H_ #ifndef _WIN32 -#include +#include #endif class LANGUAGE { diff --git a/lib/md5_file.C b/lib/md5_file.C index c508d428fa..1acde3615e 100644 --- a/lib/md5_file.C +++ b/lib/md5_file.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -22,7 +22,7 @@ #endif #ifndef _WIN32 -#include +#include #endif #include "md5.h" diff --git a/lib/md5_test.C b/lib/md5_test.C index 0a26deeeda..53e3d386d0 100644 --- a/lib/md5_test.C +++ b/lib/md5_test.C @@ -1,4 +1,4 @@ -#include +#include #include "md5_file.h" diff --git a/lib/mfile.C b/lib/mfile.C index 711084685a..c09abde348 100644 --- a/lib/mfile.C +++ b/lib/mfile.C @@ -22,12 +22,12 @@ #endif #ifndef _WIN32 -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include #if HAVE_MALLOC_H #include #endif diff --git a/lib/mfile.h b/lib/mfile.h index 70f619d48d..35ffcaf352 100644 --- a/lib/mfile.h +++ b/lib/mfile.h @@ -2,26 +2,26 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #ifndef _MFILE_ #define _MFILE_ -#include -#include +#include +#include // MFILE supports a primitive form of checkpointing. // Write all your output (and restart file) to MFILEs. diff --git a/lib/miofile.C b/lib/miofile.C index 9a15bf589b..e1926043bd 100644 --- a/lib/miofile.C +++ b/lib/miofile.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -23,8 +23,8 @@ #ifndef _WIN32 #include -#include -#include +#include +#include #endif #include "error_numbers.h" diff --git a/lib/msg_log.C b/lib/msg_log.C index da722b8208..7d83117f02 100644 --- a/lib/msg_log.C +++ b/lib/msg_log.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -22,8 +22,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #include #endif diff --git a/lib/msg_log.h b/lib/msg_log.h index bc06762b77..515625f938 100644 --- a/lib/msg_log.h +++ b/lib/msg_log.h @@ -1,4 +1,4 @@ -#include +#include #include // the __attribute((format...)) tags are GCC extensions that let the compiler diff --git a/lib/msg_queue.C b/lib/msg_queue.C index a8ac366afe..e920151279 100644 --- a/lib/msg_queue.C +++ b/lib/msg_queue.C @@ -2,25 +2,25 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // // interfaces for accessing message queues -#include -#include +#include +#include #include "msg_queue.h" diff --git a/lib/msg_test.C b/lib/msg_test.C index 97cae08402..c04ef3c2bc 100644 --- a/lib/msg_test.C +++ b/lib/msg_test.C @@ -8,8 +8,8 @@ #define KEY 0xb01fcafe -#include -#include +#include +#include #include "msg_queue.h" diff --git a/lib/parse.C b/lib/parse.C index df8c5adf93..c05cf6deb1 100644 --- a/lib/parse.C +++ b/lib/parse.C @@ -29,8 +29,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #include #endif diff --git a/lib/shmem.C b/lib/shmem.C index 418b48e879..f30973bcfe 100755 --- a/lib/shmem.C +++ b/lib/shmem.C @@ -24,8 +24,8 @@ #endif #ifndef _WIN32 -#include -#include +#include +#include #include #include @@ -61,7 +61,7 @@ HANDLE create_shmem(LPCTSTR seg_name, int size, void** pp) { hSharedMem = CreateFileMapping(INVALID_HANDLE_VALUE, &security, PAGE_READWRITE, 0, size, seg_name); if (!hSharedMem) return NULL; - if (hSharedMem && (ERROR_ALREADY_EXISTS == GetLastError())) return NULL; + if (hSharedMem && (ERROR_ALREADY_EXISTS == GetLastError())) return NULL; pMemPtr = MapViewOfFile( hSharedMem, FILE_MAP_ALL_ACCESS, 0, 0, 0 ); if (pp) *pp = pMemPtr; diff --git a/lib/shmem_test.C b/lib/shmem_test.C index 7e43a8f134..99d24b7134 100644 --- a/lib/shmem_test.C +++ b/lib/shmem_test.C @@ -6,8 +6,8 @@ #define KEY 0xbeefcafe -#include -#include +#include +#include #include #include diff --git a/lib/std_fixes.h b/lib/std_fixes.h index 6010b4b4c1..23d18c03f6 100644 --- a/lib/std_fixes.h +++ b/lib/std_fixes.h @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #ifndef _STD_FIXES_H_ @@ -74,7 +74,7 @@ o_iterator transform(i_iterator first, i_iterator last, o_iterator res, OP op) { #if defined(LARGEFILE_BREAKS_CXX) && (defined(_LARGE_FILES) || (_FILE_OFFSET_BITS==64)) -#include +#include #undef fopen #undef freopen diff --git a/lib/synch.C b/lib/synch.C index 37e779517b..403fda0234 100644 --- a/lib/synch.C +++ b/lib/synch.C @@ -2,26 +2,26 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // // interfaces for accessing sempahores -#include -#include +#include +#include #include "error_numbers.h" #include "synch.h" diff --git a/lib/synch_test.C b/lib/synch_test.C index 8a869dd7ba..f1d614465a 100644 --- a/lib/synch_test.C +++ b/lib/synch_test.C @@ -3,8 +3,6 @@ // -l lock semaphore, sleep 10 secs, unlock #include -#include -#include #include "synch.h" diff --git a/lib/util.C b/lib/util.C index e0dc7088ca..d72768fa48 100755 --- a/lib/util.C +++ b/lib/util.C @@ -36,7 +36,6 @@ #endif #include #include -#include #include #include #include diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py index acddfdc9f4..676f74feda 100644 --- a/py/Boinc/setup_project.py +++ b/py/Boinc/setup_project.py @@ -276,13 +276,15 @@ def install_boinc_files(dest_dir): map(lambda (s): install(builddir('sched',s), dir('cgi-bin',s)), [ 'cgi', 'file_upload_handler']) map(lambda (s): install(builddir('sched',s), dir('bin',s)), - [ 'make_work', 'feeder', 'transitioner', 'validate_test', 'validate_trivial', - 'file_deleter', 'assimilator', 'update_stats', 'db_dump' ]) + [ 'make_work', 'feeder', 'transitioner', + 'sample_bitwise_validator', 'sample_trivial_validator', + 'file_deleter', 'sample_dummy_assimilator', + 'update_stats', 'db_dump' ]) map(lambda (s): install(srcdir('sched',s), dir('bin',s)), [ 'start', 'stop', 'status' ]) map(lambda (s): install(srcdir('tools',s), dir('bin',s)), [ 'boinc_path_config.py', 'create_work', 'add', 'xadd', 'dbcheck_files_exist', - 'update_versions', 'upgrade', 'parse_config', 'grep_logs', 'db_query', + 'update_versions', 'upgrade', 'parse_config', 'grep_logs', 'db_query', 'watch_tcp' ]) diff --git a/sched/Makefile.in b/sched/Makefile.in index 121b740c65..fb8f002d6d 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -18,7 +18,7 @@ -SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(make_work_SOURCES) $(message_handler_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(validate_test_SOURCES) $(validate_trivial_SOURCES) $(wu_check_SOURCES) +SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(make_work_SOURCES) $(message_handler_SOURCES) $(sample_bitwise_validator_SOURCES) $(sample_dummy_assimilator_SOURCES) $(sample_trivial_validator_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(wu_check_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -46,13 +46,13 @@ target_triplet = @target@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/Makefile.incl \ $(top_srcdir)/py/Boinc/boinc_path_config.py.in -noinst_PROGRAMS = assimilator$(EXEEXT) cgi$(EXEEXT) feeder$(EXEEXT) \ - db_dump$(EXEEXT) file_deleter$(EXEEXT) \ - file_upload_handler$(EXEEXT) make_work$(EXEEXT) \ - show_shmem$(EXEEXT) transitioner$(EXEEXT) \ +noinst_PROGRAMS = cgi$(EXEEXT) feeder$(EXEEXT) db_dump$(EXEEXT) \ + file_deleter$(EXEEXT) file_upload_handler$(EXEEXT) \ + make_work$(EXEEXT) show_shmem$(EXEEXT) transitioner$(EXEEXT) \ message_handler$(EXEEXT) update_stats$(EXEEXT) \ - validate_test$(EXEEXT) validate_trivial$(EXEEXT) \ - wu_check$(EXEEXT) + sample_dummy_assimilator$(EXEEXT) \ + sample_bitwise_validator$(EXEEXT) \ + sample_trivial_validator$(EXEEXT) wu_check$(EXEEXT) EXTRA_PROGRAMS = fcgi$(EXEEXT) subdir = sched ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -79,15 +79,11 @@ am_libsched_a_OBJECTS = sched_shmem.$(OBJEXT) sched_util.$(OBJEXT) \ backend_lib.$(OBJEXT) libsched_a_OBJECTS = $(am_libsched_a_OBJECTS) PROGRAMS = $(noinst_PROGRAMS) -am_assimilator_OBJECTS = assimilator.$(OBJEXT) \ - assimilate_handler.$(OBJEXT) -assimilator_OBJECTS = $(am_assimilator_OBJECTS) -assimilator_LDADD = $(LDADD) -am__DEPENDENCIES_1 = am_cgi_OBJECTS = handle_request.$(OBJEXT) main.$(OBJEXT) \ sched_send.$(OBJEXT) server_types.$(OBJEXT) synch.$(OBJEXT) cgi_OBJECTS = $(am_cgi_OBJECTS) cgi_LDADD = $(LDADD) +am__DEPENDENCIES_1 = am_db_dump_OBJECTS = db_dump.$(OBJEXT) db_dump_OBJECTS = $(am_db_dump_OBJECTS) db_dump_LDADD = $(LDADD) @@ -117,6 +113,21 @@ am_make_work_OBJECTS = make_work.$(OBJEXT) make_work_OBJECTS = $(am_make_work_OBJECTS) am_message_handler_OBJECTS = message_handler.$(OBJEXT) message_handler_OBJECTS = $(am_message_handler_OBJECTS) +am_sample_bitwise_validator_OBJECTS = validator.$(OBJEXT) \ + sample_bitwise_validator.$(OBJEXT) validate_util.$(OBJEXT) +sample_bitwise_validator_OBJECTS = \ + $(am_sample_bitwise_validator_OBJECTS) +sample_bitwise_validator_LDADD = $(LDADD) +am_sample_dummy_assimilator_OBJECTS = assimilator.$(OBJEXT) \ + sample_dummy_assimilator.$(OBJEXT) +sample_dummy_assimilator_OBJECTS = \ + $(am_sample_dummy_assimilator_OBJECTS) +sample_dummy_assimilator_LDADD = $(LDADD) +am_sample_trivial_validator_OBJECTS = validator.$(OBJEXT) \ + sample_trivial_validator.$(OBJEXT) validate_util.$(OBJEXT) +sample_trivial_validator_OBJECTS = \ + $(am_sample_trivial_validator_OBJECTS) +sample_trivial_validator_LDADD = $(LDADD) am_show_shmem_OBJECTS = show_shmem.$(OBJEXT) show_shmem_OBJECTS = $(am_show_shmem_OBJECTS) show_shmem_LDADD = $(LDADD) @@ -125,14 +136,6 @@ transitioner_OBJECTS = $(am_transitioner_OBJECTS) am_update_stats_OBJECTS = update_stats.$(OBJEXT) update_stats_OBJECTS = $(am_update_stats_OBJECTS) update_stats_LDADD = $(LDADD) -am_validate_test_OBJECTS = validate.$(OBJEXT) validate_test.$(OBJEXT) \ - validate_util.$(OBJEXT) -validate_test_OBJECTS = $(am_validate_test_OBJECTS) -validate_test_LDADD = $(LDADD) -am_validate_trivial_OBJECTS = validate.$(OBJEXT) \ - validate_trivial.$(OBJEXT) validate_util.$(OBJEXT) -validate_trivial_OBJECTS = $(am_validate_trivial_OBJECTS) -validate_trivial_LDADD = $(LDADD) am_wu_check_OBJECTS = wu_check.$(OBJEXT) wu_check_OBJECTS = $(am_wu_check_OBJECTS) wu_check_LDADD = $(LDADD) @@ -142,8 +145,7 @@ SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/assimilate_handler.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/assimilator.Po \ +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/assimilator.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/backend_lib.Po ./$(DEPDIR)/base64.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/boinc_db.Po ./$(DEPDIR)/crypt.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/db_base.Po ./$(DEPDIR)/db_dump.Po \ @@ -176,6 +178,9 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@ ./$(DEPDIR)/message_handler.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/msg_log.Po ./$(DEPDIR)/parse.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/process_result_template.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/sample_bitwise_validator.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/sample_dummy_assimilator.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/sample_trivial_validator.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sched_config.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sched_msgs.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sched_send.Po \ @@ -185,11 +190,8 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@ ./$(DEPDIR)/show_shmem.Po ./$(DEPDIR)/synch.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/transitioner.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/update_stats.Po ./$(DEPDIR)/util.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/validate.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/validate_test.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/validate_trivial.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/validate_util.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/wu_check.Po +@AMDEP_TRUE@ ./$(DEPDIR)/validator.Po ./$(DEPDIR)/wu_check.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) @@ -199,20 +201,21 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) $(cgi_SOURCES) \ - $(db_dump_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) \ - $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) \ - $(make_work_SOURCES) $(message_handler_SOURCES) \ - $(show_shmem_SOURCES) $(transitioner_SOURCES) \ - $(update_stats_SOURCES) $(validate_test_SOURCES) \ - $(validate_trivial_SOURCES) $(wu_check_SOURCES) -DIST_SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) \ - $(cgi_SOURCES) $(db_dump_SOURCES) $(fcgi_SOURCES) \ - $(feeder_SOURCES) $(file_deleter_SOURCES) \ +SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) \ + $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) \ $(file_upload_handler_SOURCES) $(make_work_SOURCES) \ - $(message_handler_SOURCES) $(show_shmem_SOURCES) \ + $(message_handler_SOURCES) $(sample_bitwise_validator_SOURCES) \ + $(sample_dummy_assimilator_SOURCES) \ + $(sample_trivial_validator_SOURCES) $(show_shmem_SOURCES) \ + $(transitioner_SOURCES) $(update_stats_SOURCES) \ + $(wu_check_SOURCES) +DIST_SOURCES = $(libsched_a_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) \ + $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) \ + $(file_upload_handler_SOURCES) $(make_work_SOURCES) \ + $(message_handler_SOURCES) $(sample_bitwise_validator_SOURCES) \ + $(sample_dummy_assimilator_SOURCES) \ + $(sample_trivial_validator_SOURCES) $(show_shmem_SOURCES) \ $(transitioner_SOURCES) $(update_stats_SOURCES) \ - $(validate_test_SOURCES) $(validate_trivial_SOURCES) \ $(wu_check_SOURCES) ETAGS = etags CTAGS = ctags @@ -392,14 +395,14 @@ wu_check_SOURCES = wu_check.C wu_check_DEPENDENCIES = $(LIB_SCHED) show_shmem_SOURCES = show_shmem.C show_shmem_DEPENDENCIES = $(LIB_SCHED) -validate_test_SOURCES = validate.C validate_test.C validate_util.C validate_util.h -validate_test_DEPENDENCIES = $(LIB_SCHED) -validate_trivial_SOURCES = validate.C validate_trivial.C validate_util.C validate_util.h -validate_trivial_DEPENDENCIES = $(LIB_SCHED) file_deleter_SOURCES = file_deleter.C file_deleter_DEPENDENCIES = $(LIB_SCHED) -assimilator_SOURCES = assimilator.C assimilate_handler.C -assimilator_DEPENDENCIES = $(LIB_SCHED) +sample_bitwise_validator_SOURCES = validator.C sample_bitwise_validator.C validate_util.C validate_util.h +sample_bitwise_validator_DEPENDENCIES = $(LIB_SCHED) +sample_trivial_validator_SOURCES = validator.C sample_trivial_validator.C validate_util.C validate_util.h +sample_trivial_validator_DEPENDENCIES = $(LIB_SCHED) +sample_dummy_assimilator_SOURCES = assimilator.C sample_dummy_assimilator.C +sample_dummy_assimilator_DEPENDENCIES = $(LIB_SCHED) db_dump_SOURCES = db_dump.C db_dump_DEPENDENCIES = $(LIB_SCHED) update_stats_SOURCES = update_stats.C @@ -488,9 +491,6 @@ libsched.a: $(libsched_a_OBJECTS) $(libsched_a_DEPENDENCIES) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) -assimilator$(EXEEXT): $(assimilator_OBJECTS) $(assimilator_DEPENDENCIES) - @rm -f assimilator$(EXEEXT) - $(CXXLINK) $(assimilator_LDFLAGS) $(assimilator_OBJECTS) $(assimilator_LDADD) $(LIBS) cgi$(EXEEXT): $(cgi_OBJECTS) $(cgi_DEPENDENCIES) @rm -f cgi$(EXEEXT) $(CXXLINK) $(cgi_LDFLAGS) $(cgi_OBJECTS) $(cgi_LDADD) $(LIBS) @@ -515,6 +515,15 @@ make_work$(EXEEXT): $(make_work_OBJECTS) $(make_work_DEPENDENCIES) message_handler$(EXEEXT): $(message_handler_OBJECTS) $(message_handler_DEPENDENCIES) @rm -f message_handler$(EXEEXT) $(CXXLINK) $(message_handler_LDFLAGS) $(message_handler_OBJECTS) $(message_handler_LDADD) $(LIBS) +sample_bitwise_validator$(EXEEXT): $(sample_bitwise_validator_OBJECTS) $(sample_bitwise_validator_DEPENDENCIES) + @rm -f sample_bitwise_validator$(EXEEXT) + $(CXXLINK) $(sample_bitwise_validator_LDFLAGS) $(sample_bitwise_validator_OBJECTS) $(sample_bitwise_validator_LDADD) $(LIBS) +sample_dummy_assimilator$(EXEEXT): $(sample_dummy_assimilator_OBJECTS) $(sample_dummy_assimilator_DEPENDENCIES) + @rm -f sample_dummy_assimilator$(EXEEXT) + $(CXXLINK) $(sample_dummy_assimilator_LDFLAGS) $(sample_dummy_assimilator_OBJECTS) $(sample_dummy_assimilator_LDADD) $(LIBS) +sample_trivial_validator$(EXEEXT): $(sample_trivial_validator_OBJECTS) $(sample_trivial_validator_DEPENDENCIES) + @rm -f sample_trivial_validator$(EXEEXT) + $(CXXLINK) $(sample_trivial_validator_LDFLAGS) $(sample_trivial_validator_OBJECTS) $(sample_trivial_validator_LDADD) $(LIBS) show_shmem$(EXEEXT): $(show_shmem_OBJECTS) $(show_shmem_DEPENDENCIES) @rm -f show_shmem$(EXEEXT) $(CXXLINK) $(show_shmem_LDFLAGS) $(show_shmem_OBJECTS) $(show_shmem_LDADD) $(LIBS) @@ -524,12 +533,6 @@ transitioner$(EXEEXT): $(transitioner_OBJECTS) $(transitioner_DEPENDENCIES) update_stats$(EXEEXT): $(update_stats_OBJECTS) $(update_stats_DEPENDENCIES) @rm -f update_stats$(EXEEXT) $(CXXLINK) $(update_stats_LDFLAGS) $(update_stats_OBJECTS) $(update_stats_LDADD) $(LIBS) -validate_test$(EXEEXT): $(validate_test_OBJECTS) $(validate_test_DEPENDENCIES) - @rm -f validate_test$(EXEEXT) - $(CXXLINK) $(validate_test_LDFLAGS) $(validate_test_OBJECTS) $(validate_test_LDADD) $(LIBS) -validate_trivial$(EXEEXT): $(validate_trivial_OBJECTS) $(validate_trivial_DEPENDENCIES) - @rm -f validate_trivial$(EXEEXT) - $(CXXLINK) $(validate_trivial_LDFLAGS) $(validate_trivial_OBJECTS) $(validate_trivial_LDADD) $(LIBS) wu_check$(EXEEXT): $(wu_check_OBJECTS) $(wu_check_DEPENDENCIES) @rm -f wu_check$(EXEEXT) $(CXXLINK) $(wu_check_LDFLAGS) $(wu_check_OBJECTS) $(wu_check_LDADD) $(LIBS) @@ -559,7 +562,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assimilate_handler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/assimilator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backend_lib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @@ -602,6 +604,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_result_template.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_bitwise_validator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_dummy_assimilator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_trivial_validator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_msgs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_send.Po@am__quote@ @@ -614,10 +619,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transitioner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update_stats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_trivial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wu_check.Po@am__quote@ .C.o: diff --git a/sched/assimilator.C b/sched/assimilator.C index e465dfa22c..af912d4d02 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -20,10 +20,10 @@ // assimilator [ -noinsert ] // -#include -#include +#include +#include #include -#include +#include #include #include "boinc_db.h" diff --git a/sched/db_dump.C b/sched/db_dump.C index 95815c5e41..093b0f06e1 100644 --- a/sched/db_dump.C +++ b/sched/db_dump.C @@ -40,9 +40,9 @@ // ... // -#include -#include -#include +#include +#include +#include #include #include #include @@ -570,7 +570,7 @@ int print_app(FILE* f, APP& app) { fprintf(f, " %d\n", n); } #endif - + fprintf(f, " \n"); return 0; } diff --git a/sched/fcgi_stdio.h b/sched/fcgi_stdio.h index a17ec2157f..bf5c27a372 100644 --- a/sched/fcgi_stdio.h +++ b/sched/fcgi_stdio.h @@ -1,4 +1,4 @@ -/* +/* * fcgi_stdio.h -- * * FastCGI-stdio compatibility package @@ -12,7 +12,7 @@ * $Id$ */ -#include +#include #ifndef _FCGI_STDIO #define _FCGI_STDIO 1 diff --git a/sched/fcgiapp.h b/sched/fcgiapp.h index 3fc8fd4cfa..8dd9591382 100644 --- a/sched/fcgiapp.h +++ b/sched/fcgiapp.h @@ -15,12 +15,7 @@ #ifndef _FCGIAPP_H #define _FCGIAPP_H -/* Hack to see if we are building TCL - TCL needs varargs not stdarg */ -#ifndef TCL_LIBRARY -#include -#else -#include -#endif +#include #ifndef DLLAPI #ifdef _WIN32 @@ -232,7 +227,7 @@ DLLAPI void FCGX_Finish_r(FCGX_Request *request); * * FCGX_Free -- * - * Free the memory and, if close is true, + * Free the memory and, if close is true, * IPC FD associated with the request (multi-thread safe). * *---------------------------------------------------------------------- @@ -584,7 +579,7 @@ DLLAPI void FCGX_ClearError(FCGX_Stream *stream); * * FCGX_CreateWriter -- * - * Create a FCGX_Stream (used by cgi-fcgi). This shouldn't + * Create a FCGX_Stream (used by cgi-fcgi). This shouldn't * be needed by a FastCGI applictaion. * *---------------------------------------------------------------------- @@ -600,7 +595,7 @@ DLLAPI FCGX_Stream *FCGX_CreateWriter( * * FCGX_FreeStream -- * - * Free a FCGX_Stream (used by cgi-fcgi). This shouldn't + * Free a FCGX_Stream (used by cgi-fcgi). This shouldn't * be needed by a FastCGI applictaion. * *---------------------------------------------------------------------- diff --git a/sched/feeder.C b/sched/feeder.C index d2a5aacbab..35d8afe526 100644 --- a/sched/feeder.C +++ b/sched/feeder.C @@ -77,10 +77,10 @@ // configuration, or decrease the MAX_PLATFORMS, MAX_APPS // MAX_APP_VERSIONS, and MAX_WU_RESULTS in sched_shmem.h -#include -#include -#include -#include +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif diff --git a/sched/file_deleter.C b/sched/file_deleter.C index b6b90ad3af..75aab34d96 100644 --- a/sched/file_deleter.C +++ b/sched/file_deleter.C @@ -20,9 +20,9 @@ // file_deleter: deletes files that are no longer needed -#include -#include -#include +#include +#include +#include #include #include "boinc_db.h" diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index f86eb74541..2feb716607 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -20,17 +20,17 @@ // See doc/upload.html for protocol spec. // -#include -#include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #ifdef HAVE_UNISTD_H #include -#include #endif +#include #include "crypt.h" #include "parse.h" diff --git a/sched/handle_request.C b/sched/handle_request.C index 35ad6224cd..56248cdfca 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -23,12 +23,12 @@ #include using namespace std; -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include "boinc_db.h" #include "backend_lib.h" diff --git a/sched/handle_request.h b/sched/handle_request.h index ffa372dffc..7dd17c2625 100644 --- a/sched/handle_request.h +++ b/sched/handle_request.h @@ -2,22 +2,22 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include +#include #include "sched_shmem.h" #include "server_types.h" diff --git a/sched/main.C b/sched/main.C index e867b87a23..fd90001268 100644 --- a/sched/main.C +++ b/sched/main.C @@ -21,14 +21,13 @@ // // command-line options: -//#include #include #include using namespace std; -#include +#include #include -#include +#include #include #include diff --git a/sched/make_work.C b/sched/make_work.C index b9c9cf425c..807b611f32 100644 --- a/sched/make_work.C +++ b/sched/make_work.C @@ -27,11 +27,11 @@ // Clones the WU of the given name. // -#include -#include -#include +#include +#include +#include #include -#include +#include #include "boinc_db.h" #include "crypt.h" diff --git a/sched/sched_config.C b/sched/sched_config.C index b00d2bb8d0..0f14d8f148 100644 --- a/sched/sched_config.C +++ b/sched/sched_config.C @@ -19,7 +19,7 @@ // Parse a server configuration file -#include +#include #include #include diff --git a/sched/sched_shmem.C b/sched/sched_shmem.C index 32dd47b987..d62fe7a3cc 100644 --- a/sched/sched_shmem.C +++ b/sched/sched_shmem.C @@ -21,9 +21,9 @@ // the feeder (which reads from the database) // and instances of the scheduling server -#include -#include -#include +#include +#include +#include #include "boinc_db.h" #include "error_numbers.h" diff --git a/sched/sched_util.C b/sched/sched_util.C index 4daa158bd3..4b62cbb0b4 100644 --- a/sched/sched_util.C +++ b/sched/sched_util.C @@ -19,8 +19,8 @@ using namespace std; -#include -#include +#include +#include #include #include "filesys.h" diff --git a/sched/server_types.C b/sched/server_types.C index 193e3af916..8a3e4a7172 100644 --- a/sched/server_types.C +++ b/sched/server_types.C @@ -21,8 +21,8 @@ #include using namespace std; -#include -#include +// #include +#include #include "parse.h" #include "error_numbers.h" @@ -319,7 +319,7 @@ int SCHEDULER_REPLY::write(FILE* fout) { MSG_TO_HOST& md = msgs_to_host[i]; fprintf(fout, "%s\n", md.xml); } - + if (config.non_cpu_intensive) { fprintf(fout, "\n"); } diff --git a/sched/server_types.h b/sched/server_types.h index a4a0412613..13060a1e47 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -20,7 +20,7 @@ #ifndef _SERVER_TYPES_ #define _SERVER_TYPES_ -#include +#include #include #include "boinc_db.h" diff --git a/sched/show_shmem.C b/sched/show_shmem.C index 8738f88a97..71726c0493 100644 --- a/sched/show_shmem.C +++ b/sched/show_shmem.C @@ -19,8 +19,8 @@ // show_shmem: display WU part of shared-memory structure -#include -#include +#include +#include #include #include "shmem.h" diff --git a/sched/transitioner.C b/sched/transitioner.C index 9964618710..1c87225c49 100644 --- a/sched/transitioner.C +++ b/sched/transitioner.C @@ -32,7 +32,7 @@ using namespace std; #include #include -#include +#include #include #include "boinc_db.h" diff --git a/sched/update_stats.C b/sched/update_stats.C index 4cca0ff0fd..28ea00a684 100644 --- a/sched/update_stats.C +++ b/sched/update_stats.C @@ -27,9 +27,9 @@ // // usage: update_stats [-update_teams] [-update_users] [-update_hosts] [-asynch] -#include -#include -#include +#include +#include +#include #include #include "boinc_db.h" diff --git a/sched/validate.C b/sched/validate.C deleted file mode 100644 index 10ebfd848b..0000000000 --- a/sched/validate.C +++ /dev/null @@ -1,457 +0,0 @@ -// The contents of this file are subject to the BOINC Public License -// Version 1.0 (the "License"); you may not use this file except in -// compliance with the License. You may obtain a copy of the License at -// http://boinc.berkeley.edu/license_1.0.txt -// -// Software distributed under the License is distributed on an "AS IS" -// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -// License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// -// The Initial Developer of the Original Code is the SETI@home project. -// Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// -// Contributor(s): -// - -// -// validate - check and validate new results, and grant credit -// -app appname -// [-d debug_level] -// [-one_pass] // make one pass through WU table, then exit -// [-asynch] // fork, run in separate process -// -// This program must be linked with two project-specific functions: -// -// int check_set(vector, int& canonical, double& credit) -// Compare a set of results. -// If a canonical result is found, return its ID, -// and set the "validate_state" field of all the results -// according to whether they match the canonical result. -// Also return the "canonical credit" (e.g. the average or median) -// -// int pair_check(RESULT& new_result, RESULT& canonical, bool& valid); -// return valid=true iff the new result matches the canonical one -// -// Both functions return nonzero if an error occurred, -// in which case other outputs are undefined - -using namespace std; - -#include -#include -#include - -#include "boinc_db.h" -#include "util.h" -#include "sched_config.h" -#include "sched_util.h" -#include "sched_msgs.h" - -#define LOCKFILE "validate.out" -#define PIDFILE "validate.pid" - -extern int check_set(vector&, int& canonical, double& credit); -extern int check_pair(RESULT const&, RESULT const&, bool&); - -SCHED_CONFIG config; -char app_name[256]; - -// here when a result has been validated; -// grant credit to host, user and team -// -int grant_credit(DB_RESULT& result, double credit) { - DB_USER user; - DB_HOST host; - DB_TEAM team; - int retval; - - retval = host.lookup_id(result.hostid); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] lookup of host %d failed %d\n", - result.id, result.hostid, retval - ); - return retval; - } - retval = user.lookup_id(host.userid); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] lookup of user %d failed %d\n", - result.id, host.userid, retval - ); - return retval; - } - - user.total_credit += credit; - update_average(result.sent_time, credit, CREDIT_HALF_LIFE, user.expavg_credit, user.expavg_time); - retval = user.update(); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] update of user %d failed %d\n", - result.id, host.userid, retval - ); - } - - host.total_credit += credit; - update_average(result.sent_time, credit, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time); - retval = host.update(); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] update of host %d failed %d\n", - result.id, result.hostid, retval - ); - } - - if (user.teamid) { - retval = team.lookup_id(user.teamid); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] lookup of team %d failed %d\n", - result.id, user.teamid, retval - ); - return retval; - } - team.total_credit += credit; - update_average(result.sent_time, credit, CREDIT_HALF_LIFE, team.expavg_credit, team.expavg_time); - retval = team.update(); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d] update of team %d failed %d\n", - result.id, team.id, retval - ); - } - } - - return 0; -} - -void handle_wu(DB_WORKUNIT& wu) { - DB_RESULT result, canonical_result; - bool match, update_result, need_transition = false; - int retval, canonicalid = 0; - double credit; - unsigned int i; - char buf[256]; - - if (wu.canonical_resultid) { - log_messages.printf( - SCHED_MSG_LOG::NORMAL, - "[WU#%d %s] handle_wu(): Already has canonical result\n", - wu.id, wu.name - ); - ++log_messages; - - // Here if WU already has a canonical result. - // Get unchecked results and see if they match the canonical result - // - retval = canonical_result.lookup_id(wu.canonical_resultid); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[WU#%d %s] Can't read canonical result; marking as validated: %d\n", - wu.id, wu.name, retval - ); - // Mark this WU as validated, otherwise we'll keep checking it - goto mark_validated; - } - - // scan this WU's results, and check the unchecked ones - // TODO: do we have an index on these fields? - // maybe better just to enum on workunitid - // - sprintf(buf, "where workunitid=%d and validate_state=%d and server_state=%d and outcome=%d", - wu.id, VALIDATE_STATE_INIT, RESULT_SERVER_STATE_OVER, RESULT_OUTCOME_SUCCESS - ); - while (!result.enumerate(buf)) { - need_transition = true; - - // it's possible that we've deleted canonical result outputs - // - if (canonical_result.file_delete_state == FILE_DELETE_DONE) { - log_messages.printf( - SCHED_MSG_LOG::DEBUG, - "[WU#%d]: Canonical result (%d) has been deleted\n", - wu.id, canonical_result.id - ); - match = false; - retval = 0; - } else { - retval = check_pair(result, canonical_result, match); - } - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::DEBUG, - "[RESULT#%d %s]: pair_check() failed for result: %d\n", - result.id, result.name, retval - ); - continue; - } else { - if (match) { - result.validate_state = VALIDATE_STATE_VALID; - result.granted_credit = wu.canonical_credit; - log_messages.printf( - SCHED_MSG_LOG::NORMAL, - "[RESULT#%d %s] pair_check() matched: setting result to valid; credit %f\n", - result.id, result.name, result.granted_credit - ); - } else { - result.validate_state = VALIDATE_STATE_INVALID; - log_messages.printf( - SCHED_MSG_LOG::NORMAL, - "[RESULT#%d %s] pair_check() didn't match: setting result to invalid\n", - result.id, result.name - ); - } - } - retval = result.update(); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[RESULT#%d %s] Can't update result: %d\n", - result.id, result.name, retval - ); - continue; - } - retval = grant_credit(result, result.granted_credit); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::NORMAL, - "[RESULT#%d %s] Can't grant credit: %d\n", - result.id, result.name, retval - ); - continue; - } - } - } else { - vector results; - - // Here if WU doesn't have a canonical result yet. - // Try to get one - - log_messages.printf( - SCHED_MSG_LOG::NORMAL, - "[WU#%d %s] handle_wu(): No canonical result yet\n", wu.id, wu.name - ); - ++log_messages; - - // sprintf(buf, "where workunitid=%d", wu.id); - // TODO: do we have an index on these fields? - // maybe better to enum on workunitid - // while (!result.enumerate(buf)) { - // if (result.server_state == RESULT_SERVER_STATE_OVER - // && result.outcome == RESULT_OUTCOME_SUCCESS - // ) { - sprintf( - buf, "where workunitid=%d and server_state=%d and outcome=%d", - wu.id, RESULT_SERVER_STATE_OVER, RESULT_OUTCOME_SUCCESS - ); - while (!result.enumerate(buf)) { - results.push_back(result); - } - log_messages.printf( - SCHED_MSG_LOG::DEBUG, "[WU#%d %s] Found %d successful results\n", - wu.id, wu.name, (int)results.size() - ); - if (results.size() >= (unsigned int)wu.min_quorum) { - log_messages.printf( - SCHED_MSG_LOG::DEBUG, - "[WU#%d %s] Enough for quorum, checking set.\n", wu.id, wu.name - ); - retval = check_set(results, canonicalid, credit); - if (!retval && canonicalid) { - need_transition = true; - log_messages.printf( - SCHED_MSG_LOG::DEBUG, - "[WU#%d %s] Found a canonical result: id=%d\n", - wu.id, wu.name, canonicalid - ); - wu.canonical_resultid = canonicalid; - wu.canonical_credit = credit; - wu.assimilate_state = ASSIMILATE_READY; - for (i=0; i wu.max_success_results) { - wu.error_mask |= WU_ERROR_TOO_MANY_SUCCESS_RESULTS; - need_transition = true; - } - } - } - } - - --log_messages; - -mark_validated: - - if (need_transition) { - wu.transition_time = time(0); - } - - // we've checked all results for this WU, so turn off flag - // - wu.need_validate = 0; - retval = wu.update(); - if (retval) { - log_messages.printf( - SCHED_MSG_LOG::CRITICAL, - "[WU#%d %s] wu.update() failed: %d; exiting\n", wu.id, wu.name, retval - ); - exit(1); - } -} - -// make one pass through the workunits with need_validate set. -// return true if there were any -// -bool do_validate_scan(APP& app) { - DB_WORKUNIT wu; - char buf[256]; - bool found=false; - - sprintf(buf, "where appid=%d and need_validate > 0", app.id); - while (!wu.enumerate(buf)) { - handle_wu(wu); - found = true; - } - return found; -} - -int main_loop(bool one_pass) { - int retval; - DB_APP app; - bool did_something; - char buf[256]; - - retval = boinc_db.open(config.db_name, config.db_host, config.db_user, config.db_passwd); - if (retval) { - log_messages.printf(SCHED_MSG_LOG::CRITICAL, "boinc_db.open failed: %d\n", retval); - exit(1); - } - - sprintf(buf, "where name='%s'", app_name); - retval = app.lookup(buf); - if (retval) { - log_messages.printf(SCHED_MSG_LOG::CRITICAL, "can't find app %s\n", app.name); - exit(1); - } - - while (1) { - check_stop_daemons(); - did_something = do_validate_scan(app); - if (one_pass) break; - if (!did_something) { - sleep(5); - } - } - return 0; -} - - -int main(int argc, char** argv) { - int i, retval; - bool asynch = false, one_pass = false; - - check_stop_daemons(); - - for (i=1; i& results, int& canonicalid, double& credit, diff --git a/sched/validator.C b/sched/validator.C index 10ebfd848b..6547fb889c 100644 --- a/sched/validator.C +++ b/sched/validator.C @@ -42,7 +42,7 @@ using namespace std; #include -#include +#include #include #include "boinc_db.h" diff --git a/sched/wu_check.C b/sched/wu_check.C index 4d80297752..1836b1fc4e 100644 --- a/sched/wu_check.C +++ b/sched/wu_check.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -21,7 +21,7 @@ // look for results with missing input files // -repair change them to server_state OVER, outcome COULDNT_SEND -#include +#include #include "parse.h" #include "error_numbers.h" diff --git a/sched_fcgi/feeder.C b/sched_fcgi/feeder.C index a95daa6180..b3b3e55545 100644 --- a/sched_fcgi/feeder.C +++ b/sched_fcgi/feeder.C @@ -2,18 +2,18 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // @@ -41,7 +41,7 @@ // The feeder deletes the trigger file to indicate that it // has completed the request. -#include +#include #if HAVE_UNISTD_H #include #endif diff --git a/sched_fcgi/handle_request.C b/sched_fcgi/handle_request.C index b8a5c522bb..96f8308c47 100644 --- a/sched_fcgi/handle_request.C +++ b/sched_fcgi/handle_request.C @@ -2,24 +2,24 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #include #include -#include +#include #ifdef _USING_FCGI_ #include "/usr/local/include/fcgi_stdio.h" diff --git a/sched_fcgi/handle_request.h b/sched_fcgi/handle_request.h index 4d2cd05792..518191dcb9 100644 --- a/sched_fcgi/handle_request.h +++ b/sched_fcgi/handle_request.h @@ -2,22 +2,22 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include +#include #include "sched_shmem.h" #include "server_types.h" diff --git a/sched_fcgi/main.C b/sched_fcgi/main.C index a606cc749a..9d5736c25e 100644 --- a/sched_fcgi/main.C +++ b/sched_fcgi/main.C @@ -2,22 +2,22 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include +#include #include #include "db.h" @@ -51,7 +51,7 @@ int main() { char req_path[256], reply_path[256]; SCHED_SHMEM* ssp; void* p; - + #ifdef _USING_FCGI_ while(FCGI_Accept >= 0) { #endif diff --git a/sched_fcgi/sched_shmem.C b/sched_fcgi/sched_shmem.C index e191905c07..c8eacf81a3 100644 --- a/sched_fcgi/sched_shmem.C +++ b/sched_fcgi/sched_shmem.C @@ -1,5 +1,5 @@ -#include -#include +#include +#include #ifdef _USING_FCGI_ #include "/usr/local/include/fcgi_stdio.h" diff --git a/sched_fcgi/server_types.C b/sched_fcgi/server_types.C index 5782cd9e7f..cd4ae8d563 100644 --- a/sched_fcgi/server_types.C +++ b/sched_fcgi/server_types.C @@ -2,22 +2,22 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include +// #include #ifdef _USING_FCGI_ #include "/usr/local/include/fcgi_stdio.h" @@ -121,7 +121,7 @@ int SCHEDULER_REPLY::write(FILE* fout) { if (hostid) { fprintf(fout, "%d\n", hostid); } - + if (send_prefs) { fprintf(fout, "%d\n", diff --git a/sched_fcgi/server_types.h b/sched_fcgi/server_types.h index 895dd99603..cd37cf45f1 100644 --- a/sched_fcgi/server_types.h +++ b/sched_fcgi/server_types.h @@ -2,30 +2,30 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // #ifndef _SERVER_TYPES_ #define _SERVER_TYPES_ -#include +#include #include #include "db.h" -//The following are the states that the client is in according to the result. +//The following are the states that the client is in according to the result. #define CLIENT_UNINITIALIZED 0 #define CLIENT_DOWNLOADING 1 #define CLIENT_COMPUTING 2 diff --git a/tools/add.C b/tools/add.C index 2296dd6022..097e5412de 100644 --- a/tools/add.C +++ b/tools/add.C @@ -54,9 +54,9 @@ // add user -email_addr x -name y -authenticator a // [ -global_prefs_file y ] -#include -#include -#include +#include +#include +#include #include "boinc_db.h" #include "sched_config.h" diff --git a/tools/backend_lib.C b/tools/backend_lib.C index 2821a5fa86..2c14175b5f 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -17,10 +17,10 @@ // Contributor(s): // -#include -#include -#include -#include +#include +#include +#include +#include #include #include "boinc_db.h" @@ -55,12 +55,12 @@ int read_filename(const char* path, char* buf, int len) { // process WU template // static int process_wu_template( - WORKUNIT& wu, + WORKUNIT& wu, char* tmplate, - const char* dirpath, - const char** infiles, + const char* dirpath, + const char** infiles, int n, - const char* upload_url, + const char* upload_url, const char* download_url ) { char* p; @@ -210,7 +210,7 @@ int create_result( int workunit_appid, char* wu_name, char* result_template_filename, - char* result_name_suffix, + char* result_name_suffix, R_RSA_PRIVATE_KEY& key, char* upload_url ) { @@ -226,7 +226,7 @@ int create_result( retval = read_filename(result_template_filename, result_template, sizeof(result_template)); if (retval) { - fprintf(stderr, "Failed to read result template file '%s': %d\n", + fprintf(stderr, "Failed to read result template file '%s': %d\n", result_template_filename, retval); return retval; } diff --git a/tools/create_work.C b/tools/create_work.C index fb201ecfdf..77869605ed 100644 --- a/tools/create_work.C +++ b/tools/create_work.C @@ -42,10 +42,10 @@ // infile1 infile2 ... // -#include -#include -#include -#include +#include +#include +#include +#include #include "boinc_db.h" #include "crypt.h" diff --git a/tools/process_result_template.C b/tools/process_result_template.C index 7bef1d0440..97b9a9d3c2 100644 --- a/tools/process_result_template.C +++ b/tools/process_result_template.C @@ -2,24 +2,24 @@ // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt -// +// // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations -// under the License. -// -// The Original Code is the Berkeley Open Infrastructure for Network Computing. -// +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 -// University of California at Berkeley. All Rights Reserved. -// +// University of California at Berkeley. All Rights Reserved. +// // Contributor(s): // -#include -#include -#include +#include +#include +#include #include "boinc_db.h" #include "error_numbers.h"