Commit Graph

1179 Commits

Author SHA1 Message Date
Christian Beer b1bfac8efa
Merge pull request #4159 from winkies/issue-1328
Enhance clean commands for build unix
2021-02-06 23:26:41 +01:00
Vitalii Koshura ccd591ab3f
Merge pull request #3262 from smoe/maxpathlen_sprintf
Revisited Debian patch 'more_maxpathlen.patch'
2021-01-27 23:33:12 +01:00
winkies 6b0ce34b40 build: add files to make clean command 2021-01-24 22:03:12 +01:00
davidpanderson 8b852cb2c9 Win code cleanup; no functional changes
Platform-wide #defines belong in .h files, not .cpp
Also fixed a couple of compiler warnings.
2020-08-31 13:56:15 -07:00
Charlie Fenton f451430bab Update copyright dates in source files I recently modified 2020-08-26 01:10:14 -07:00
Charlie Fenton 90cbb1ab2b Mac: Enable close button when running "Show Graphics" from BOINC Manager under MacOS 11 Big Sur 2020-08-06 05:12:49 -07:00
Biswapriyo Nath 68599941ac fix some gcc warnings
list of changes:
* api/reduce_lib.cpp:188:10: warning: declaration of 'h' shadows a previous local
* lib/gui_rpc_client_ops.cpp:1479:42: warning: clearing an object of non-trivial type 'struct VERSION_INFO'
* client/boinc_cmd.cpp:434:32: warning: clearing an object of non-trivial type 'class HOST_INFO'

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
2020-06-27 00:53:44 +05:30
David Anderson fad4210f7b Various files: simplify #includes.
On Windows, include boinc_win.h
No references to STDWX_H, STDAFX_H etc.

Note: .cpp files should not have a bunch of gnarly #if logic in their includes.
If such logic is needed, put it in a central place.
2020-06-04 01:24:49 -07:00
Charlie Fenton fb11bbaf96 Mac graphics library: optimization and generalization. Graphics apps should work on all versions of OS X whether built on Xcode 11 or an earlier version.
They work around the apparent bug in Xcode 11 handling of OpenGL / GLUT on Retina displays, and should continue to work correctly even if future Xcode versions fix the bug.
2020-05-06 05:42:53 -07:00
Charlie Fenton e040aec92d Mac: update copyright dates 2020-05-01 04:59:37 -07:00
Charlie Fenton e091b98d07 Mac: fix BOINC graphics library libboinc_graphics2.a built with Xcode 11 to properly display graphics apps when invoked from "Show graphics" button on BOINC Manager. 2020-05-01 03:51:09 -07:00
Charlie Fenton a918b54b60 Fix comments to be more accurate 2019-11-11 00:08:40 -08:00
Charlie Fenton b1987ef43d Fix comments 2019-11-09 01:12:20 -08:00
Charlie Fenton 40ecc0ce9c mac: Fixes for screensaver under OS 10.15 Catalina
* Screensavers can't launch setuid / sergid executables like gfx_switcher
 * Screensavers can't launch executables downloaded from Internet unless vetted by user vis GateKeeper
 * Apple's ScreenSaverEngine doesn't always call stopAnimation before exiting
 * Apple's ScreenSaverEngine always passes true for isPreview argument
 * OpenGL apps built under Xcode 11 & Catalina use window doubled window dimensions on Retina displays (2 pixels per point)
 * The CGWindowList method we have used to display project graphics apps which have not been updated no longer works
* Screensaver output files are put in an obscure sandboxed directory
2019-11-08 03:40:22 -08:00
Steffen Moeller ebb85ac6c3 Revisited Debian patch 'more_maxpathlen.patch'
Joint work by Steffen, Gianfranco and Yixuan since August 2012
https://salsa.debian.org/pkg-boinc-team/boinc/commits/master/debian/patches/more_maxpathlen.patch
2019-08-29 15:09:44 +02:00
Christian Beer 50e52ba32d fix small typo in translatable text 2019-06-01 13:27:48 +02:00
Veronica K. B. Olsen 5b9e491523
Added a few more API functions to the Fortran API 2019-05-14 09:33:08 +02:00
Juha Sointusalo 97e6469b2f
Merge pull request #2800 from BOINC/dpa_suspend_threads
client: throttling: only resume threads you suspended
2019-04-09 21:16:55 +03:00
Vitalii Koshura b92f7a9d29
Remove boinc_try_critical_section() header
Remove header from boinc_api.h of the function boinc_try_critical_section() that was removed in
6984ec8cf4

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2019-03-26 21:22:08 +02:00
Vitalii Koshura 58f9a6d67b
Fix prototype header leftovers
Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2019-03-26 21:22:06 +02:00
Gabor Gombas 0cab8848f3
Fix "-Wstrict-prototypes" warnings in API headers
When the BOINC API headers are included from C source code that gets compiled with "-Wstrict-prototypes", they generate a lot of "function declaration isn’t a prototype" warnings. The attached patch fixes it by turning "foo()" to "foo(void)".

Gabor

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2019-03-26 21:21:51 +02:00
Vitalii Koshura 1ce3793c76
Remove unused BOINC_RCSID constants
This fixes #2953

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2019-01-12 23:43:48 +02:00
David Anderson 09c1422ba0 API and wrapper: fix possible race condition when throttling multithread apps
To quote from comments in lib/proc_control.cpp:
// The only way to do this on Windows is to enumerate
// all the threads in the entire system,
// and identify those belonging to one of the processes (ugh!!)
//
// In the suspend case, this creates a potential synch problem:
// - CPU throttling sends suspend message
// - we enumerate threads
// - one of those threads creates a new thread T
// - we suspend the enumerated threads
//
// In this case, T will run, which is undesirable but not an error.
// But suppose that
// - the app uses a mutex,
// - at the start of the above sequence some thread holds the mutex
// - T immediately tries to acquire the mutex (and is suspended).
// Then when the client sends a resume message,
// T resumes and there are two threads in the mutex section. Error!
//
// There are a couple of solutions to this.
// 1) enumerate all the threads twice.
// 2) have suspend() make a record of the threads it suspends,
//    and have resume() resume only these threads.
//
// 1) doubles the overhead, so I'm going with 2) for now.
2018-11-05 12:54:59 -08:00
Charlie Fenton 32dfd64156 Mac GFX Library: fix bugs introduced in commit baac677 when rendering some graphics apps. Project graphics apps for Macintosh should be relinked with libboinc_graphics2.a built using these updated source files. 2018-02-04 03:21:54 -08:00
Charlie Fenton 6ae2b433c3 Mac: Changes to Xcode project to support screensaver changes for Mac OS 10.13. Added file needed for Mach-O communication. 2017-10-02 18:02:00 -07:00
Charlie Fenton 2dbdc578b4 api: fix Mac compiler warning by eliminating unnecessary include file 2017-10-01 03:04:54 -07:00
Charlie Fenton baac6772d2 api: BOINC graphics library changes to support Mac OS 10.13 2017-09-30 04:57:59 -07:00
Vitalii Koshura bd9ada5aa8
api: Move 'strlen' function outside of the loop
From PVS Studio:
V814
Decreased performance. The 'strlen' function was called multiple times inside the body of a loop.
https://www.viva64.com/en/w/V814/print

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
2017-05-02 16:10:00 +03:00
David Anderson cae62587af API, Android: don't show time/pid in debug message prefix; causes crashes 2017-04-14 11:58:29 -07:00
David Anderson d71616dd7c Android API: fix bug when using MSGS_FROM_FILE (from David K) 2017-04-13 23:57:32 -07:00
David Anderson 247e6b096b API: check for null FILE pointers with MSGS_FROM_FILE option. 2017-04-12 18:25:24 -07:00
David Anderson ea0e453bc6 API: fix Android version, hopefully. Add new debugging mechanism.
See http://boinc.berkeley.edu/trac/wiki/AppDebug#TestingwithoutaBOINCclientpart2
2017-04-12 13:47:23 -07:00
David Anderson 163adf784d Forgot to turn off debug flag in API code 2017-04-09 11:20:46 -07:00
David Anderson 13a5b9bf3e change multiple-inclusion guard names to BOINC_FILENAME_H 2017-04-07 23:54:49 -07:00
David Anderson b717942bb3 API: add debugging mechanism for control messages.
Set MSGS_FROM_FILE in boinc_api.cpp, put msgs in "msgs.txt"
e.g. writing "<quit/>" to msgs.txt tells the app to quit
2017-04-07 17:38:57 -07:00
David Anderson d726d1b0bc API: my revisions to David Kim's Android version 2017-04-07 16:46:45 -07:00
Fabrice Fontaine bf807980c1 Fix LDFLAGS for cross-compilation
Remove "-L$(libdir) -rapth $(libdr)" from LDFLAGS of boinc libraries in
Makefile.am of api, lib, sched and zlib directories to be able to
cross-compile boinc.

Indeed, libdir is not equal to the path where BOINC will be installed
but to exec_prefix/lib. The full installation path is
$(DESTDIR)/$(libdir).

To cross-compile boinc, exec_prefix will be set to the target path (for
example: /usr) and DESTDIR will be set (during make install) to the
staging or target directory on the host (for example /home/xxx/target).
The issue of adding -L$(libdir) is that it is not allowed by the
compiler, the error "unsafe header/library path used in
cross-compilation: '-L/usr/lib'" will be raised.

As a result, remove "-L$(libdir) -rapth $(libdr)" from LDFLAGS, the
default library search paths are sufficient for "standard" compilation
or can be updated manually by passing the additional search path to
LDFLAGS during the configure call for cross-compilation.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2017-03-04 16:46:41 +01:00
Charlie Fenton 35ec133677 Mac: add comments that mac_icon.cpp and MakeAppIcon_h utility are obsolete, describing new preferred method for adding icons to Mac science applications. 2017-02-27 06:37:48 -08:00
Rom Walton 826437f244 API: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-15 20:11:03 -05:00
David Anderson d5f5918111 Replace strncpy() with strlcpy() various places.
Except for very specific cases, strncpy() should never be used.
It can result in a non-terminated string.

Also replace strncat() with strlcat(); the latter is simpler
because you don't have to calculate remaining buffer space.
2016-02-01 20:23:18 -08:00
Eric J Korpela 8fe6f95548 API GRAPHICS Fixed the reason the SETI@home 3D graph wasn't showing up. If
this is a problem for other projects we can attempt to fork this file into
SETI@home.
2015-12-09 12:59:40 -08:00
Christian Beer 365ca7960f initialize fields in constructors
fixes CID 28025 found by Coverity Scan
2015-10-20 17:57:57 +02:00
David Anderson 8b540139e0 API: tweak "waiting for lock" message that users see 2015-06-24 12:25:33 -07:00
David Anderson 55a998fc01 Fix build errors 2015-01-16 09:29:49 -08:00
Rom Walton 8bdf177e4e HTMLGFX: Checkpoint (Continuation of previous commit.)
* Custom IE Javascript interface is gone, it was replaced with a cross-browser Web RPC.
In the HTML doc you can add:
<script type='text/javascript' src='/api/static/boinc.js'></script>

In the JavaScript code you can:
var boinc = new BOINC();

From there you can get the username like:
var userName = boinc.getUserName();

* Default resources are embedded within the executable in much the same way XPM images are embedded in the manager.
  /api/static/index.html
  /api/static/boinc.png
  /api/static/boinc.js
2015-01-16 00:49:17 -05:00
David Anderson d53a3e3718 API: hard-write filename for graphics status; initialize stuff in parse 2015-01-05 15:16:35 -08:00
David Anderson 0bae306002 API: move graphics-related code to appropriate file 2015-01-05 14:04:22 -08:00
Rom Walton 4affcff684 API: Introduce the graphics_status APIs which will be used by vboxwrapper/wrapper/project app to inform htmlgfx what is going on. 2014-12-26 17:20:40 -05:00
David Anderson f0c39bdf51 API: fix bug where app doesn't exit if client dies while app in critical section
There were two parts to this:
- In the timer thread, we need to check for client death even if
  we're in a critical section.
  If both conditions hold, set the no_heartbeat status flag.
- In boinc_end_critical_section(), check no_heartbeat and exit if set.

Also: the various checks in boinc_end_critical_section()
(quit, abort, no heartbeat) should be conditioned on
options.direct_process_action.
Otherwise wrappers that use critical sections won't do the right thing.
2014-10-31 10:37:56 -07:00
Charlie Fenton 328d87be26 API: Fix a bug in boinc_get_opencl_ids() which incorrectly returned CL_INVALID_DEVICE on some systems. This would happen on hosts with multiple GPUs if:
* the host has GPUs from two different vendors with different OpenCL platforms (e.g., NVIDIA and AMD), and
 * the second platform queried has more GPUs than the first one, and
 * the requested GPU is a higher numbed one in the second platform.
2014-09-22 04:57:23 -07:00