summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCameron Desrochers <Cameron.Desrochers@octasic.com>2019-11-20 21:31:14 (GMT)
committerCameron Desrochers <Cameron.Desrochers@octasic.com>2019-11-20 21:31:14 (GMT)
commit546e27c6459b862e3394caad1c71d63da0891041 (patch)
tree09689eb96945fa6bbc07012ee6aa3c19862c66da /src
parent9d502da06d179d598c2167ca0b97756e19d687c2 (diff)
downloadNinja-546e27c6459b862e3394caad1c71d63da0891041.zip
Ninja-546e27c6459b862e3394caad1c71d63da0891041.tar.gz
Ninja-546e27c6459b862e3394caad1c71d63da0891041.tar.bz2
Style changes following code review
Diffstat (limited to 'src')
-rw-r--r--src/util.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util.cc b/src/util.cc
index ac4f247..9049f90 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -489,20 +489,24 @@ int GetProcessorCount() {
std::vector<char> buf(len);
int cores = 0;
if (GetLogicalProcessorInformationEx(RelationProcessorCore,
- (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX)buf.data(), &len)) {
+ reinterpret_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(
+ buf.data()), &len)) {
for (DWORD i = 0; i < len; ) {
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX info =
- (PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX)(buf.data() + i);
+ reinterpret_cast<PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX>(
+ buf.data() + i);
if (info->Relationship == RelationProcessorCore &&
info->Processor.GroupCount == 1) {
for (KAFFINITY core_mask = info->Processor.GroupMask[0].Mask;
- core_mask; core_mask >>= 1)
+ core_mask; core_mask >>= 1) {
cores += (core_mask & 1);
+ }
}
i += info->Size;
}
- if (cores)
+ if (cores) {
return cores;
+ }
}
}
// fallback just in case