Replace some C-style cast by static_cast<>()

See https://stackoverflow.com/questions/1609163/what-is-the-difference-between-static-cast-and-c-style-casting
This commit is contained in:
Carles Fernandez
2017-08-18 12:45:47 +02:00
parent f71933e938
commit 61f8df3586
58 changed files with 398 additions and 390 deletions
@@ -280,7 +280,7 @@ rtklib_pvt_cc::rtklib_pvt_cc(unsigned int nchannels, bool dump, std::string dump
d_dump_filename.append("_raw.dat");
dump_ls_pvt_filename.append("_ls_pvt.dat");
d_ls_pvt = std::make_shared<rtklib_solver>((int)nchannels, dump_ls_pvt_filename, d_dump, rtk);
d_ls_pvt = std::make_shared<rtklib_solver>(static_cast<int>(nchannels), dump_ls_pvt_filename, d_dump, rtk);
d_ls_pvt->set_averaging_depth(1);
d_rx_time = 0.0;
+1 -1
View File
@@ -505,7 +505,7 @@ void Pvt_Solution::perform_pos_averaging()
bool avg = d_flag_averaging;
if (avg == true)
{
if (d_hist_longitude_d.size() == (unsigned int)d_averaging_depth)
if (d_hist_longitude_d.size() == static_cast<unsigned int>(d_averaging_depth))
{
// Pop oldest value
d_hist_longitude_d.pop_back();
+7 -7
View File
@@ -1133,7 +1133,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Galileo_Iono& gal
out.close();
out.open(navGalfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -1284,7 +1284,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
out.close();
out.open(navfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -1379,7 +1379,7 @@ void Rinex_Printer::update_nav_header(std::fstream & out, const Gps_CNAV_Utc_Mod
out.close();
out.open(navfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -1510,7 +1510,7 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
out.close();
out.open(navMixfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -3522,7 +3522,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_Utc_Model& ut
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>( data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -3581,7 +3581,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Gps_CNAV_Utc_Mode
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}
@@ -3641,7 +3641,7 @@ void Rinex_Printer::update_obs_header(std::fstream& out, const Galileo_Utc_Model
out.close();
out.open(obsfilename, std::ios::out | std::ios::trunc);
out.seekp(0);
for (int i = 0; i < (int) data.size() - 1; i++)
for (int i = 0; i < static_cast<int>(data.size()) - 1; i++)
{
out << data[i] << std::endl;
}