-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and enable multi-threaded analysis
- Loading branch information
Showing
38 changed files
with
1,718 additions
and
861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include "util/math.h" | ||
|
||
|
||
typedef double AnalyzerProgress; | ||
|
||
constexpr AnalyzerProgress kAnalyzerProgressUnknown = -1.0; | ||
constexpr AnalyzerProgress kAnalyzerProgressNone = 0.0; // 0.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressHalf = 0.5; // 50.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressFinalizing = 0.95; // 95.0 % | ||
constexpr AnalyzerProgress kAnalyzerProgressDone = 1.0; // 100.0% | ||
|
||
Q_DECLARE_METATYPE(AnalyzerProgress); | ||
|
||
// Integer [0, 100] | ||
inline | ||
int analyzerProgressPercent(AnalyzerProgress analyzerProgress) { | ||
DEBUG_ASSERT(analyzerProgress >= kAnalyzerProgressNone); | ||
return int((100 * (math_min(analyzerProgress, kAnalyzerProgressDone) - kAnalyzerProgressNone)) / | ||
(kAnalyzerProgressDone - kAnalyzerProgressNone)); | ||
} |
Oops, something went wrong.