| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1bf1435 commit 2b35b92
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ class GridGraphGenerator | |||
| 35 | 35 | using Func2T = std::function<TValue(TValue,TValue)>; | |
| 36 | 36 | ||
| 37 | 37 | using SignalVectT = std::vector<MySignal>; | |
| 38 | - using WidthVectT = std::vector<int>; | ||
| 38 | + using WidthVectT = std::vector<size_t>; | ||
| 39 | 39 | ||
| 40 | 40 | SignalVectT InputSignals; | |
| 41 | 41 | SignalVectT OutputSignals; | |
@@ -56,9 +56,9 @@ class GridGraphGenerator | |||
| 56 | 56 | SignalVectT* curBuf = &buf1; | |
| 57 | 57 | SignalVectT* nextBuf = &buf2; | |
| 58 | 58 | ||
| 59 | - int curWidth = InputSignals.size(); | ||
| 59 | + size_t curWidth = InputSignals.size(); | ||
| 60 | 60 | ||
| 61 | - int nodeCount = 1; | ||
| 61 | + size_t nodeCount = 1; | ||
| 62 | 62 | nodeCount += curWidth; | |
| 63 | 63 | ||
| 64 | 64 | for (auto targetWidth : Widths) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -288,7 +288,7 @@ struct Benchmark_LifeSim : public BenchmarkBase<D> | |||
| 288 | 288 | vector<unique_ptr<Animal<D>>> animals; | |
| 289 | 289 | ||
| 290 | 290 | std::mt19937 gen( 2015 ); | |
| 291 | - std::uniform_int_distribution<unsigned> dist( 0u, theWorld.Regions.size()-1 ); | ||
| 291 | + std::uniform_int_distribution<size_t> dist( 0u, theWorld.Regions.size()-1 ); | ||
| 292 | 292 | ||
| 293 | 293 | for (int i=0; i<params.N; i++) | |
| 294 | 294 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,13 +207,16 @@ template <typename TTask, typename TIt, typename ... TArgs> | |||
| 207 | 207 | void spawnTasks | |
| 208 | 208 | ( | |
| 209 | 209 | task& rootTask, task_list& spawnList, | |
| 210 | - const uint count, TIt start, TIt end, | ||
| 210 | + const size_t count, TIt start, TIt end, | ||
| 211 | 211 | TArgs& ... args | |
| 212 | 212 | ) | |
| 213 | 213 | { | |
| 214 | - rootTask.set_ref_count(1 + count); | ||
| 214 | + assert(1 + count <= | ||
| 215 | + static_cast<size_t>((std::numeric_limits<int>::max)())); | ||
| 215 | 216 | ||
| 216 | - for (uint i=0; i < (count - 1); i++) | ||
| 217 | + rootTask.set_ref_count(1 + static_cast<int>(count)); | ||
| 218 | + | ||
| 219 | + for (size_t i=0; i < (count - 1); i++) | ||
| 217 | 220 | { | |
| 218 | 221 | spawnList.push_back(*new(rootTask.allocate_child()) | |
| 219 | 222 | TTask(args ..., start, start + chunk_size)); | |
@@ -230,7 +233,7 @@ void spawnTasks | |||
| 230 | 233 | ||
| 231 | 234 | void EngineBase::Propagate(Turn& turn) | |
| 232 | 235 | { | |
| 233 | - const uint initialTaskCount = (changedInputs_.size() - 1) / chunk_size + 1; | ||
| 236 | + const size_t initialTaskCount = (changedInputs_.size() - 1) / chunk_size + 1; | ||
| 234 | 237 | ||
| 235 | 238 | spawnTasks<MarkerTask>(rootTask_, spawnList_, initialTaskCount, | |
| 236 | 239 | changedInputs_.begin(), changedInputs_.end()); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -178,7 +178,10 @@ void EngineBase::Propagate(Turn& turn) | |||
| 178 | 178 | // Phase 2 | |
| 179 | 179 | isInPhase2_ = true; | |
| 180 | 180 | ||
| 181 | - rootTask_.set_ref_count(1 + subtreeRoots_.size()); | ||
| 181 | + assert((1 + subtreeRoots_.size()) <= | ||
| 182 | + static_cast<size_t>((std::numeric_limits<int>::max)())); | ||
| 183 | + | ||
| 184 | + rootTask_.set_ref_count(1 + static_cast<int>(subtreeRoots_.size())); | ||
| 182 | 185 | ||
| 183 | 186 | for (auto* node : subtreeRoots_) | |
| 184 | 187 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments