diff --git a/source/lib/sysdep/win/wposix.h b/source/lib/sysdep/win/wposix.h index dc67d74881..fd2afaab2c 100755 --- a/source/lib/sysdep/win/wposix.h +++ b/source/lib/sysdep/win/wposix.h @@ -266,6 +266,7 @@ extern int close(int); _CRTIMP int access(const char*, int); extern int chdir(const char*); +#undef getcwd extern char* getcwd(char*, size_t); // user tests if available via #ifdef; can't use enum. diff --git a/source/ps/Loader.cpp b/source/ps/Loader.cpp index ef73c285b5..7abc1914e9 100644 --- a/source/ps/Loader.cpp +++ b/source/ps/Loader.cpp @@ -161,16 +161,11 @@ static bool HaveTimeForNextTask(double time_left, double time_budget, int estima if(time_left <= 0.0) return false; - // we've already used up more than 60%: - // (if it's less than that, we won't check the next task length) - if(time_left < 0.40*time_budget) - { - const double estimated_duration = estimated_duration_ms*1e-3; - // .. and the upcoming task is expected to be long - - // leave it for the next timeslice. - if(estimated_duration > time_left + time_budget*0.20) - return false; - } + // check next task length. we want a lengthy task to happen in its own + // timeslice so that its description is displayed beforehand. + const double estimated_duration = estimated_duration_ms*1e-3; + if(time_left+estimated_duration > time_budget*1.20) + return false; return true; } @@ -252,7 +247,7 @@ int LDR_ProgressiveLoad(double time_budget, wchar_t* description_, // check if we're out of time; take into account next task length. // note: do this at the end of the loop to make sure there's // progress even if the timer is low-resolution (=> time_left = 0). -// if(!HaveTimeForNextTask(time_left, time_budget, lr.estimated_duration_ms)) + if(!HaveTimeForNextTask(time_left, time_budget, lr.estimated_duration_ms)) { ret = ERR_TIMED_OUT; goto done; diff --git a/source/ps/Singleton.h b/source/ps/Singleton.h index 0e78261f79..5285a8a79f 100755 --- a/source/ps/Singleton.h +++ b/source/ps/Singleton.h @@ -31,7 +31,7 @@ class Singleton public: Singleton() { - assert( !ms_singleton ); + assert2( !ms_singleton ); //use a cunning trick to get the singleton pointing to the start of //the whole, rather than the start of the Singleton part of the object @@ -41,19 +41,19 @@ class Singleton ~Singleton() { - assert( ms_singleton ); + assert2( ms_singleton ); ms_singleton=0; } static T& GetSingleton() { - assert( ms_singleton ); + assert2( ms_singleton ); return *ms_singleton; } static T* GetSingletonPtr() { - assert( ms_singleton ); + assert2( ms_singleton ); return ms_singleton; }