Commit 274c3d2bd6f670431db3bd5e1dd6863d260554d4

Authored by dmayerich
1 parent 318b88d0

fixed visual studio warnings

CMakeLists.txt
... ... @@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
10 10 set(Boost_USE_STATIC_LIBS ON)
11 11 set(Boost_USE_MULTITHREADED ON)
12 12 set(Boost_USE_STATIC_RUNTIME OFF)
13   -find_package( Boost 1.49.0 COMPONENTS program_options )
  13 +find_package( Boost 1.46.0 COMPONENTS program_options )
14 14  
15 15 #find the Qt4
16 16 find_package(Qt4 REQUIRED)
... ...
montecarlo.cpp
... ... @@ -45,8 +45,8 @@ void mcSampleNA(bsVector* samples, int N, bsVector k, ptype NAin, ptype NAout)
45 45 ptype z, phi, theta;
46 46 for(int i=0; i<N; i++)
47 47 {
48   - z = ((double)rand() / (double)RAND_MAX) * rangeZ + outZ;
49   - theta = ((double)rand() / (double)RAND_MAX) * 2 * PI;
  48 + z = ((ptype)rand() / (ptype)RAND_MAX) * rangeZ + outZ;
  49 + theta = ((ptype)rand() / (ptype)RAND_MAX) * 2 * (ptype)PI;
50 50  
51 51 //calculate theta
52 52 phi = acos(z);
... ...
nearfield.cpp
... ... @@ -106,7 +106,7 @@ void nearfieldStruct::calcSpheres()
106 106  
107 107  
108 108 //for each sphere
109   - for(int i=0; i<sVector.size(); i++)
  109 + for(unsigned int i=0; i<sVector.size(); i++)
110 110 {
111 111 //a = sVector[i].a;
112 112  
... ... @@ -203,7 +203,7 @@ void nearfieldStruct::calcBesselLut(ptype* j, ptype d_min, ptype d_max, int dR)
203 203 bessjyv_sph(Nl, kd, vm, cjv_kd, cyv_kd, cjvp_kd, cyvp_kd);
204 204  
205 205 //copy the double data to the bsComplex array
206   - for(int l=0; l<=Nl; l++)
  206 + for(unsigned int l=0; l<=Nl; l++)
207 207 {
208 208 jv = cjv_kd[l];
209 209 if(isnan(jv) || isinf(jv))
... ... @@ -223,7 +223,7 @@ void nearfieldStruct::calcBesselLut(ptype* j, ptype d_min, ptype d_max, int dR)
223 223 for(int ir = 0; ir < dR; ir++)
224 224 {
225 225 outfile<<ir*dr + d_min<<endl;
226   - for(int l = 0; l<=Nl; l++)
  226 + for(unsigned int l = 0; l<=Nl; l++)
227 227 {
228 228 outfile<<j[ir * (Nl+1) + l]<<" -- ";
229 229 }
... ...
options.h
... ... @@ -286,7 +286,7 @@ void lSpheres(po::variables_map vm)
286 286  
287 287 vector<string> filenames = vm["sphere-file"].as< vector<string> >();
288 288 //load each file
289   - for(int iS=0; iS<filenames.size(); iS++)
  289 + for(unsigned int iS=0; iS<filenames.size(); iS++)
290 290 {
291 291 //load the file into a string
292 292 std::ifstream ifs(filenames[iS].c_str());
... ... @@ -338,7 +338,7 @@ static void lMaterials(po::variables_map vm)
338 338 }
339 339 else
340 340 {
341   - for(int i=0; i<matVec.size(); i+=2)
  341 + for(unsigned int i=0; i<matVec.size(); i+=2)
342 342 {
343 343 rts::material<ptype> newM(SCOPE->nf.lambda, matVec[i], matVec[i+1]);
344 344 SCOPE->nf.mVector.push_back(newM);
... ... @@ -350,7 +350,7 @@ static void lMaterials(po::variables_map vm)
350 350 if(vm.count("material-file"))
351 351 {
352 352 vector<string> filenames = vm["material-file"].as< vector<string> >();
353   - for(int i=0; i<filenames.size(); i++)
  353 + for(unsigned int i=0; i<filenames.size(); i++)
354 354 {
355 355 //load the file into a string
356 356 std::ifstream ifs(filenames[i].c_str());
... ...
sphere.h
... ... @@ -20,7 +20,7 @@ struct sphere
20 20 ptype a;
21 21  
22 22 //sphere material index
23   - int iMaterial;
  23 + unsigned int iMaterial;
24 24  
25 25 //GPU pointer to the scattered field produced by a plane wave
26 26 // this is a function of cos(theta) and |r| (distance from sphere center)
... ...