mrc-ide / covid-sim

This is the COVID-19 CovidSim microsimulation model developed by the MRC Centre for Global Infectious Disease Analysis hosted at Imperial College, London.
GNU General Public License v3.0
1.23k stars 257 forks source link

Resolve many VS warnings including mystery 'k' #454

Closed weshinsley closed 3 years ago

weshinsley commented 3 years ago

Not a very exciting PR, but this deals with all the C26451 warnings VS gives about potential arithmetic overflows. (I don't think we have any, but this at least clears out the noise).

More excitingly (to me), it deals with the 1>C:\Files\Dev\covid-sim\src\SetupModel.cpp(770): warning C4101: 'k': unreferenced local variable

where there is clearly no reference to k on line 770

void SetupPopulation(std::string const& density_file, std::string const& out_density_file, std::string const& school_file, std::string const& reg_demog_file)

The warning actually refers to an OpenMP section where k is not needed and should be removed from line 1283

#pragma omp parallel for private(j,k,m,s) schedule(static,1) default(none) \