diff --git a/api/boinc_api.C b/api/boinc_api.C
index 6389276438..e4b97f9eeb 100644
--- a/api/boinc_api.C
+++ b/api/boinc_api.C
@@ -142,9 +142,7 @@ double boinc_cpu_time() {
);
#else
#ifdef _WIN32
-#ifndef WINNT_CLOCK
- return UtilGetCPUClock();
-#else
+#ifdef WINNT_CLOCK
HANDLE hProcess;
FILETIME creationTime,exitTime,kernelTime,userTime;
@@ -167,11 +165,21 @@ double boinc_cpu_time() {
// Convert to seconds and return
return(totTime / 10000000.0);
- } else {
- CloseHandle(hProcess);
- return ((double)clock())/CLOCKS_PER_SEC;
}
+ CloseHandle(hProcess);
+ // ... fall through
#endif // WINNT_CLOCK
+ static bool first=true;
+ static DWORD last_count = 0;
+
+ if (first) {
+ last_count = GetTickCount();
+ first = true;
+ }
+ DWORD cur = GetTickCount();
+ double x = (cur - last_count)/1000.;
+ last_count = cur;
+ return x;
#endif // _WIN32
#endif
diff --git a/api/graphics_api.C b/api/graphics_api.C
index f20e681a39..807195107a 100755
--- a/api/graphics_api.C
+++ b/api/graphics_api.C
@@ -1,11 +1,15 @@
+#include "graphics_api.h"
+
+#include "parse.h"
+
void write_graphics_file(FILE* f, GRAPHICS_INFO& gi) {
fprintf(f,
"%d\n"
"%d\n"
"%f\n",
- gi.graphics.xsize,
- gi.graphics.ysize,
- gi.graphics.refresh_period,
+ gi.xsize,
+ gi.ysize,
+ gi.refresh_period
);
}
@@ -13,9 +17,9 @@ int parse_graphics_file(FILE* f, GRAPHICS_INFO& gi) {
char buf[256];
while (fgets(buf, 256, f)) {
if (match_tag(buf, "")) return 0;
- else if (parse_int(buf, "", gi.graphics.xsize)) continue;
- else if (parse_int(buf, "", gi.graphics.ysize)) continue;
- else if (parse_double(buf, "", gi.graphics.refresh_period)) continue;
+ else if (parse_int(buf, "", gi.xsize)) continue;
+ else if (parse_int(buf, "", gi.ysize)) continue;
+ else if (parse_double(buf, "", gi.refresh_period)) continue;
else fprintf(stderr, "parse_core_file: unrecognized %s", buf);
}
return -1;
diff --git a/api/graphics_api.h b/api/graphics_api.h
index a543d4730c..85766c505b 100755
--- a/api/graphics_api.h
+++ b/api/graphics_api.h
@@ -1,8 +1,9 @@
-struct APP_IN_GRAPHICS {
+#include
+
+struct GRAPHICS_INFO {
int xsize;
int ysize;
double refresh_period;
- char shmem_seg_name[32];
};
struct APP_OUT_GRAPHICS {