1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 11:40:33 +00:00

Apply readability-isolate-declaration clang-tidy check

This commit is contained in:
Carles Fernandez 2019-08-13 00:19:31 +02:00
parent b16ee3d919
commit 487010346f
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
97 changed files with 2590 additions and 802 deletions

View File

@ -245,7 +245,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path)
Rinex_Printer::~Rinex_Printer()
{
// close RINEX files
int64_t posn, poso, poss, posng, posmn, posnr, posnc;
int64_t posn;
int64_t poso;
int64_t poss;
int64_t posng;
int64_t posmn;
int64_t posnr;
int64_t posnc;
posn = navFile.tellp();
poso = obsFile.tellp();
poss = sbsFile.tellp();

View File

@ -105,7 +105,10 @@ GalileoE1PcpsAmbiguousAcquisitionFpga::GalileoE1PcpsAmbiguousAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data;
int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= GALILEO_E1_NUMBER_OF_CODES; PRN++)
{

View File

@ -106,7 +106,10 @@ GalileoE5aPcpsAcquisitionFpga::GalileoE5aPcpsAcquisitionFpga(ConfigurationInterf
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data;
int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= GALILEO_E5A_NUMBER_OF_CODES; PRN++)
{

View File

@ -98,7 +98,10 @@ GpsL1CaPcpsAcquisitionFpga::GpsL1CaPcpsAcquisitionFpga(
auto* fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(nsamples_total * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max;
int32_t tmp, tmp2, local_code, fft_data;
int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
// temporary maxima search
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{

View File

@ -101,7 +101,10 @@ GpsL2MPcpsAcquisitionFpga::GpsL2MPcpsAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data;
int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (unsigned int PRN = 1; PRN <= NUM_PRNs; PRN++)
{

View File

@ -102,7 +102,10 @@ GpsL5iPcpsAcquisitionFpga::GpsL5iPcpsAcquisitionFpga(
d_all_fft_codes_ = std::vector<uint32_t>(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32
float max; // temporary maxima search
int32_t tmp, tmp2, local_code, fft_data;
int32_t tmp;
int32_t tmp2;
int32_t local_code;
int32_t fft_data;
for (uint32_t PRN = 1; PRN <= NUM_PRNs; PRN++)
{

View File

@ -46,9 +46,11 @@ void beidou_b1i_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _c
std::bitset<11> G1_register(std::string("01010101010"));
std::bitset<11> G2_register(std::string("01010101010"));
bool feedback1, feedback2;
bool feedback1;
bool feedback2;
bool aux;
uint32_t lcv, lcv2;
uint32_t lcv;
uint32_t lcv2;
uint32_t delay;
int32_t prn_idx;
@ -145,7 +147,8 @@ void beidou_b1i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
{
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 2046> _code{};
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
float aux;

View File

@ -48,8 +48,12 @@ void beidou_b3i_code_gen_int(gsl::span<int> _dest, int32_t _prn, uint32_t _chip_
G1_register_reset.reset(0);
G1_register_reset.reset(1); // {false, false, true, true, true, true, true, true, true, true, true, true, true};
bool feedback1, feedback2, aux;
uint32_t lcv, lcv2, delay;
bool feedback1;
bool feedback2;
bool aux;
uint32_t lcv;
uint32_t lcv2;
uint32_t delay;
int32_t prn_idx = _prn - 1;
const std::array<std::bitset<13>, 63> G2_register_shifted =
@ -207,7 +211,8 @@ void beidou_b3i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, u
{
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 10230> _code{};
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
float aux;

View File

@ -44,7 +44,8 @@ void glonass_l1_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32
bool feedback1;
bool aux;
uint32_t delay;
uint32_t lcv, lcv2;
uint32_t lcv;
uint32_t lcv2;
/* Generate G1 Register */
for (lcv = 0; lcv < _code_length; lcv++)
@ -105,7 +106,8 @@ void glonass_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
{
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 511> _code{};
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
float aux;

View File

@ -44,7 +44,8 @@ void glonass_l2_ca_code_gen_complex(gsl::span<std::complex<float>> _dest, uint32
bool feedback1;
bool aux;
uint32_t delay;
uint32_t lcv, lcv2;
uint32_t lcv;
uint32_t lcv2;
/* Generate G1 Register */
for (lcv = 0; lcv < _code_length; lcv++)
@ -105,7 +106,8 @@ void glonass_l2_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest
{
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 511> _code{};
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
float aux;

View File

@ -96,7 +96,8 @@ void gps_l2c_m_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
gps_l2c_m_code(_code, _prn);
}
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
const int32_t _codeLength = GPS_L2_M_CODE_LENGTH_CHIPS;

View File

@ -213,7 +213,8 @@ void gps_l5i_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
make_l5i(_code, _prn - 1);
}
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
const int32_t _codeLength = GPS_L5I_CODE_LENGTH_CHIPS;
@ -287,7 +288,8 @@ void gps_l5q_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, uint
make_l5q(_code, _prn - 1);
}
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
const int32_t _codeLength = GPS_L5Q_CODE_LENGTH_CHIPS;

View File

@ -43,9 +43,11 @@ void gps_l1_ca_code_gen_int(gsl::span<int32_t> _dest, int32_t _prn, uint32_t _ch
std::bitset<_code_length> G2{};
std::bitset<10> G1_register{};
std::bitset<10> G2_register{};
bool feedback1, feedback2;
bool feedback1;
bool feedback2;
bool aux;
uint32_t lcv, lcv2;
uint32_t lcv;
uint32_t lcv2;
uint32_t delay;
int32_t prn_idx;
@ -155,7 +157,8 @@ void gps_l1_ca_code_gen_complex_sampled(gsl::span<std::complex<float>> _dest, ui
{
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
std::array<std::complex<float>, 1023> _code{};
int32_t _samplesPerCode, _codeValueIndex;
int32_t _samplesPerCode;
int32_t _codeValueIndex;
float _ts;
float _tc;
float aux;

View File

@ -132,7 +132,8 @@ obsd_t insert_obs_to_rtklib(obsd_t& rtklib_obs, const Gnss_Synchro& gnss_synchro
geph_t eph_to_rtklib(const Glonass_Gnav_Ephemeris& glonass_gnav_eph, const Glonass_Gnav_Utc_Model& gnav_clock_model)
{
double week, sec;
double week;
double sec;
int adj_week;
geph_t rtklib_sat = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, 0.0, 0.0, 0.0};
@ -206,7 +207,8 @@ eph_t eph_to_rtklib(const Galileo_Ephemeris& gal_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gal_eph.TOW_5);
/* adjustment for week handover */
double tow, toc;
double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0)
@ -263,7 +265,8 @@ eph_t eph_to_rtklib(const Gps_Ephemeris& gps_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_eph.d_TOW);
/* adjustment for week handover */
double tow, toc;
double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0)
@ -328,7 +331,9 @@ eph_t eph_to_rtklib(const Beidou_Dnav_Ephemeris& bei_eph)
rtklib_sat.toc = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_Toc));
rtklib_sat.ttr = bdt2gpst(bdt2time(rtklib_sat.week, bei_eph.d_TOW));
/* adjustment for week handover */
double tow, toc, toe;
double tow;
double toc;
double toe;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr);
toe = time2gpst(rtklib_sat.toe, nullptr);
@ -395,7 +400,8 @@ eph_t eph_to_rtklib(const Gps_CNAV_Ephemeris& gps_cnav_eph)
rtklib_sat.ttr = gpst2time(rtklib_sat.week, gps_cnav_eph.d_TOW);
/* adjustment for week handover */
double tow, toc;
double tow;
double toc;
tow = time2gpst(rtklib_sat.ttr, &rtklib_sat.week);
toc = time2gpst(rtklib_sat.toc, nullptr);
if (rtklib_sat.toes < tow - 302400.0)

View File

@ -123,7 +123,22 @@ double var_urassr(int ura)
*-----------------------------------------------------------------------------*/
void alm2pos(gtime_t time, const alm_t *alm, double *rs, double *dts)
{
double tk, M, E, Ek, sinE, cosE, u, r, i, O, x, y, sinO, cosO, cosi, mu;
double tk;
double M;
double E;
double Ek;
double sinE;
double cosE;
double u;
double r;
double i;
double O;
double x;
double y;
double sinO;
double cosO;
double cosi;
double mu;
int n;
trace(4, "alm2pos : time=%s sat=%2d\n", time_str(time, 3), alm->sat);
@ -207,9 +222,33 @@ double eph2clk(gtime_t time, const eph_t *eph)
void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,
double *var)
{
double tk, M, E, Ek, sinE, cosE, u, r, i, O, sin2u, cos2u, x, y, sinO, cosO, cosi, mu, omge;
double xg, yg, zg, sino, coso;
int n, sys, prn;
double tk;
double M;
double E;
double Ek;
double sinE;
double cosE;
double u;
double r;
double i;
double O;
double sin2u;
double cos2u;
double x;
double y;
double sinO;
double cosO;
double cosi;
double mu;
double omge;
double xg;
double yg;
double zg;
double sino;
double coso;
int n;
int sys;
int prn;
trace(4, "eph2pos : time=%s sat=%2d\n", time_str(time, 3), eph->sat);
@ -302,7 +341,12 @@ void eph2pos(gtime_t time, const eph_t *eph, double *rs, double *dts,
/* glonass orbit differential equations --------------------------------------*/
void deq(const double *x, double *xdot, const double *acc)
{
double a, b, c, r2 = dot(x, x, 3), r3 = r2 * sqrt(r2), omg2 = std::pow(OMGE_GLO, 2.0);
double a;
double b;
double c;
double r2 = dot(x, x, 3);
double r3 = r2 * sqrt(r2);
double omg2 = std::pow(OMGE_GLO, 2.0);
if (r2 <= 0.0)
{
@ -325,7 +369,11 @@ void deq(const double *x, double *xdot, const double *acc)
/* glonass position and velocity by numerical integration --------------------*/
void glorbit(double t, double *x, const double *acc)
{
double k1[6], k2[6], k3[6], k4[6], w[6];
double k1[6];
double k2[6];
double k3[6];
double k4[6];
double w[6];
int i;
deq(x, k1, acc);
@ -388,7 +436,9 @@ double geph2clk(gtime_t time, const geph_t *geph)
void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts,
double *var)
{
double t, tt, x[6];
double t;
double tt;
double x[6];
int i;
trace(4, "geph2pos: time=%s sat=%2d\n", time_str(time, 3), geph->sat);
@ -476,8 +526,11 @@ void seph2pos(gtime_t time, const seph_t *seph, double *rs, double *dts,
/* select ephemeris --------------------------------------------------------*/
eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
{
double t, tmax, tmin;
int i, j = -1;
double t;
double tmax;
double tmin;
int i;
int j = -1;
trace(4, "seleph : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode);
@ -535,8 +588,11 @@ eph_t *seleph(gtime_t time, int sat, int iode, const nav_t *nav)
/* select glonass ephemeris ------------------------------------------------*/
geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
{
double t, tmax = MAXDTOE_GLO, tmin = tmax + 1.0;
int i, j = -1;
double t;
double tmax = MAXDTOE_GLO;
double tmin = tmax + 1.0;
int i;
int j = -1;
trace(4, "selgeph : time=%s sat=%2d iode=%2d\n", time_str(time, 3), sat, iode);
@ -577,8 +633,11 @@ geph_t *selgeph(gtime_t time, int sat, int iode, const nav_t *nav)
/* select sbas ephemeris ---------------------------------------------------*/
seph_t *selseph(gtime_t time, int sat, const nav_t *nav)
{
double t, tmax = MAXDTOE_SBS, tmin = tmax + 1.0;
int i, j = -1;
double t;
double tmax = MAXDTOE_SBS;
double tmin = tmax + 1.0;
int i;
int j = -1;
trace(4, "selseph : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -660,8 +719,11 @@ int ephpos(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
eph_t *eph;
geph_t *geph;
seph_t *seph;
double rst[3], dtst[1], tt = 1e-3;
int i, sys;
double rst[3];
double dtst[1];
double tt = 1e-3;
int i;
int sys;
trace(4, "ephpos : time=%s sat=%2d iode=%d\n", time_str(time, 3), sat, iode);
@ -767,8 +829,19 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
{
const ssr_t *ssr;
eph_t *eph;
double t1, t2, t3, er[3], ea[3], ec[3], rc[3], deph[3], dclk, dant[3] = {0}, tk;
int i, sys;
double t1;
double t2;
double t3;
double er[3];
double ea[3];
double ec[3];
double rc[3];
double deph[3];
double dclk;
double dant[3] = {0};
double tk;
int i;
int sys;
trace(4, "satpos_ssr: time=%s sat=%2d\n", time_str(time, 3), sat);
@ -969,8 +1042,10 @@ void satposs(gtime_t teph, const obsd_t *obs, int n, const nav_t *nav,
int ephopt, double *rs, double *dts, double *var, int *svh)
{
gtime_t time[MAXOBS] = {};
double dt, pr;
int i, j;
double dt;
double pr;
int i;
int j;
trace(3, "satposs : teph=%s n=%d ephopt=%d\n", time_str(teph, 3), n, ephopt);

View File

@ -102,9 +102,12 @@ int dataindex(int i, int j, int k, const int *ndata)
tec_t *addtec(const double *lats, const double *lons, const double *hgts,
double rb, nav_t *nav)
{
tec_t *p, *nav_tec;
tec_t *p;
tec_t *nav_tec;
gtime_t time0 = {0, 0};
int i, n, ndata[3];
int i;
int n;
int ndata[3];
trace(3, "addtec :\n");
@ -159,8 +162,11 @@ tec_t *addtec(const double *lats, const double *lons, const double *hgts,
/* read ionex dcb aux data ----------------------------------------------------*/
void readionexdcb(FILE *fp, double *dcb, double *rms)
{
int i, sat;
char buff[1024], id[32], *label;
int i;
int sat;
char buff[1024];
char id[32];
char *label;
trace(3, "readionexdcb:\n");
@ -203,7 +209,8 @@ double readionexh(FILE *fp, double *lats, double *lons, double *hgts,
double *rb, double *nexp, double *dcb, double *rms)
{
double ver = 0.0;
char buff[1024], *label;
char buff[1024];
char *label;
trace(3, "readionexh:\n");
@ -268,9 +275,19 @@ int readionexb(FILE *fp, const double *lats, const double *lons,
{
tec_t *p = nullptr;
gtime_t time = {0, 0};
double lat, lon[3], hgt, x;
int i, j, k, n, m, index, type = 0;
char buff[1024], *label = buff + 60;
double lat;
double lon[3];
double hgt;
double x;
int i;
int j;
int k;
int n;
int m;
int index;
int type = 0;
char buff[1024];
char *label = buff + 60;
trace(3, "readionexb:\n");
@ -376,7 +393,9 @@ int readionexb(FILE *fp, const double *lats, const double *lons,
void combtec(nav_t *nav)
{
tec_t tmp;
int i, j, n = 0;
int i;
int j;
int n = 0;
trace(3, "combtec : nav->nt=%d\n", nav->nt);
@ -422,9 +441,15 @@ void combtec(nav_t *nav)
void readtec(const char *file, nav_t *nav, int opt)
{
FILE *fp;
double lats[3] = {0}, lons[3] = {0}, hgts[3] = {0}, rb = 0.0, nexp = -1.0;
double dcb[MAXSAT] = {0}, rms[MAXSAT] = {0};
int i, n;
double lats[3] = {0};
double lons[3] = {0};
double hgts[3] = {0};
double rb = 0.0;
double nexp = -1.0;
double dcb[MAXSAT] = {0};
double rms[MAXSAT] = {0};
int i;
int n;
char *efiles[MAXEXFILE];
trace(3, "readtec : file=%s\n", file);
@ -493,8 +518,16 @@ void readtec(const char *file, nav_t *nav, int opt)
int interptec(const tec_t *tec, int k, const double *posp, double *value,
double *rms)
{
double dlat, dlon, a, b, d[4] = {0}, r[4] = {0};
int i, j, n, index;
double dlat;
double dlon;
double a;
double b;
double d[4] = {0};
double r[4] = {0};
int i;
int j;
int n;
int index;
trace(3, "interptec: k=%d posp=%.2f %.2f\n", k, posp[0] * R2D, posp[1] * R2D);
*value = *rms = 0.0;
@ -587,7 +620,12 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos,
const double *azel, int opt, double *delay, double *var)
{
const double fact = 40.30E16 / FREQ1 / FREQ1; /* tecu->L1 iono (m) */
double fs, posp[3] = {0}, vtec, rms, hion, rp;
double fs;
double posp[3] = {0};
double vtec;
double rms;
double hion;
double rp;
int i;
trace(3, "iondelay: time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0),
@ -646,8 +684,12 @@ int iondelay(gtime_t time, const tec_t *tec, const double *pos,
int iontec(gtime_t time, const nav_t *nav, const double *pos,
const double *azel, int opt, double *delay, double *var)
{
double dels[2], vars[2], a, tt;
int i, stat[2];
double dels[2];
double vars[2];
double a;
double tt;
int i;
int stat[2];
trace(3, "iontec : time=%s pos=%.1f %.1f azel=%.1f %.1f\n", time_str(time, 0),
pos[0] * R2D, pos[1] * R2D, azel[0] * R2D, azel[1] * R2D);

View File

@ -57,8 +57,12 @@
/* LD factorization (Q=L'*diag(D)*L) -----------------------------------------*/
int LD(int n, const double *Q, double *L, double *D)
{
int i, j, k, info = 0;
double a, *A = mat(n, n);
int i;
int j;
int k;
int info = 0;
double a;
double *A = mat(n, n);
memcpy(A, Q, sizeof(double) * n * n);
for (i = n - 1; i >= 0; i--)
@ -97,7 +101,8 @@ int LD(int n, const double *Q, double *L, double *D)
/* integer gauss transformation ----------------------------------------------*/
void gauss(int n, double *L, double *Z, int i, int j)
{
int k, mu;
int k;
int mu;
if ((mu = static_cast<int> ROUND_LAMBDA(L[i + j * n])) != 0)
{
@ -117,7 +122,10 @@ void gauss(int n, double *L, double *Z, int i, int j)
void perm(int n, double *L, double *D, int j, double del, double *Z)
{
int k;
double eta, lam, a0, a1;
double eta;
double lam;
double a0;
double a1;
eta = D[j] / del;
lam = D[j + 1] * L[j + 1 + j * n] / del;
@ -145,7 +153,9 @@ void perm(int n, double *L, double *D, int j, double del, double *Z)
/* lambda reduction (z=Z'*a, Qz=Z'*Q*Z=L'*diag(D)*L) (ref.[1]) ---------------*/
void reduction(int n, double *L, double *D, double *Z)
{
int i, j, k;
int i;
int j;
int k;
double del;
j = n - 2;
@ -178,9 +188,20 @@ void reduction(int n, double *L, double *D, double *Z)
int search(int n, int m, const double *L, const double *D,
const double *zs, double *zn, double *s)
{
int i, j, k, c, nn = 0, imax = 0;
double newdist, maxdist = 1E99, y;
double *S = zeros(n, n), *dist = mat(n, 1), *zb = mat(n, 1), *z = mat(n, 1), *step = mat(n, 1);
int i;
int j;
int k;
int c;
int nn = 0;
int imax = 0;
double newdist;
double maxdist = 1E99;
double y;
double *S = zeros(n, n);
double *dist = mat(n, 1);
double *zb = mat(n, 1);
double *z = mat(n, 1);
double *step = mat(n, 1);
k = n - 1;
dist[k] = 0.0;
@ -302,7 +323,11 @@ int lambda(int n, int m, const double *a, const double *Q, double *F,
double *s)
{
int info;
double *L, *D, *Z, *z, *E;
double *L;
double *D;
double *Z;
double *z;
double *E;
if (n <= 0 || m <= 0)
{
@ -345,8 +370,11 @@ int lambda(int n, int m, const double *a, const double *Q, double *F,
*-----------------------------------------------------------------------------*/
int lambda_reduction(int n, const double *Q, double *Z)
{
double *L, *D;
int i, j, info;
double *L;
double *D;
int i;
int j;
int info;
if (n <= 0)
{
@ -392,7 +420,8 @@ int lambda_reduction(int n, const double *Q, double *Z)
int lambda_search(int n, int m, const double *a, const double *Q,
double *F, double *s)
{
double *L, *D;
double *L;
double *D;
int info;
if (n <= 0 || m <= 0)

View File

@ -59,7 +59,8 @@
/* pseudorange measurement error variance ------------------------------------*/
double varerr(const prcopt_t *opt, double el, int sys)
{
double fact, varr;
double fact;
double varr;
fact = sys == SYS_GLO ? EFACT_GLO : (sys == SYS_SBS ? EFACT_SBS : EFACT_GPS);
varr = std::pow(opt->err[0], 2.0) * (std::pow(opt->err[1], 2.0) + std::pow(opt->err[2], 2.0) / sin(el));
if (opt->ionoopt == IONOOPT_IFLC)
@ -424,8 +425,23 @@ int rescode(int iter, const obsd_t *obs, int n, const double *rs,
double *v, double *H, double *var, double *azel, int *vsat,
double *resp, int *ns)
{
double r, dion, dtrp, vmeas, vion, vtrp, rr[3], pos[3], dtr, e[3], P, lam_L1;
int i, j, nv = 0, sys, mask[4] = {0};
double r;
double dion;
double dtrp;
double vmeas;
double vion;
double vtrp;
double rr[3];
double pos[3];
double dtr;
double e[3];
double P;
double lam_L1;
int i;
int j;
int nv = 0;
int sys;
int mask[4] = {0};
trace(3, "resprng : n=%d\n", n);
@ -568,8 +584,10 @@ int valsol(const double *azel, const int *vsat, int n,
char *msg)
{
double azels[MAXOBS * 2] = {0};
double dop[4], vv;
int i, ns;
double dop[4];
double vv;
int i;
int ns;
trace(3, "valsol : n=%d nv=%d\n", n, nv);
@ -607,8 +625,20 @@ int estpos(const obsd_t *obs, int n, const double *rs, const double *dts,
const prcopt_t *opt, sol_t *sol, double *azel, int *vsat,
double *resp, char *msg)
{
double x[NX] = {0}, dx[NX], Q[NX * NX], *v, *H, *var, sig;
int i, j, k, info, stat, nv, ns;
double x[NX] = {0};
double dx[NX];
double Q[NX * NX];
double *v;
double *H;
double *var;
double sig;
int i;
int j;
int k;
int info;
int stat;
int nv;
int ns;
trace(3, "estpos : n=%d\n", n);
@ -707,9 +737,24 @@ int raim_fde(const obsd_t *obs, int n, const double *rs,
{
obsd_t *obs_e;
sol_t sol_e = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0};
char tstr[32], name[16], msg_e[128];
double *rs_e, *dts_e, *vare_e, *azel_e, *resp_e, rms_e, rms = 100.0;
int i, j, k, nvsat, stat = 0, *svh_e, *vsat_e, sat = 0;
char tstr[32];
char name[16];
char msg_e[128];
double *rs_e;
double *dts_e;
double *vare_e;
double *azel_e;
double *resp_e;
double rms_e;
double rms = 100.0;
int i;
int j;
int k;
int nvsat;
int stat = 0;
int *svh_e;
int *vsat_e;
int sat = 0;
trace(3, "raim_fde: %s n=%2d\n", time_str(obs[0].time, 0), n);
@ -813,8 +858,17 @@ int resdop(const obsd_t *obs, int n, const double *rs, const double *dts,
const nav_t *nav, const double *rr, const double *x,
const double *azel, const int *vsat, double *v, double *H)
{
double lam, rate, pos[3], E[9], a[3], e[3], vs[3], cosel;
int i, j, nv = 0;
double lam;
double rate;
double pos[3];
double E[9];
double a[3];
double e[3];
double vs[3];
double cosel;
int i;
int j;
int nv = 0;
int band = 0;
trace(3, "resdop : n=%d\n", n);
@ -878,8 +932,14 @@ void estvel(const obsd_t *obs, int n, const double *rs, const double *dts,
const nav_t *nav, const prcopt_t *opt __attribute__((unused)), sol_t *sol,
const double *azel, const int *vsat)
{
double x[4] = {0}, dx[4], Q[16], *v, *H;
int i, j, nv;
double x[4] = {0};
double dx[4];
double Q[16];
double *v;
double *H;
int i;
int j;
int nv;
trace(3, "estvel : n=%d\n", n);
@ -939,8 +999,15 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav,
char *msg)
{
prcopt_t opt_ = *opt;
double *rs, *dts, *var, *azel_, *resp;
int i, stat, vsat[MAXOBS] = {0}, svh[MAXOBS];
double *rs;
double *dts;
double *var;
double *azel_;
double *resp;
int i;
int stat;
int vsat[MAXOBS] = {0};
int svh[MAXOBS];
sol->stat = SOLQ_NONE;

View File

@ -62,7 +62,9 @@
/* wave length of LC (m) -----------------------------------------------------*/
double lam_LC(int i, int j, int k)
{
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5;
const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
return SPEED_OF_LIGHT / (i * f1 + j * f2 + k * f5);
}
@ -71,8 +73,12 @@ double lam_LC(int i, int j, int k)
/* carrier-phase LC (m) ------------------------------------------------------*/
double L_LC(int i, int j, int k, const double *L)
{
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5;
double L1, L2, L5;
const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
double L1;
double L2;
double L5;
if ((i && !L[0]) || (j && !L[1]) || (k && !L[2]))
{
@ -88,8 +94,12 @@ double L_LC(int i, int j, int k, const double *L)
/* pseudorange LC (m) --------------------------------------------------------*/
double P_LC(int i, int j, int k, const double *P)
{
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5;
double P1, P2, P5;
const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
double P1;
double P2;
double P5;
if ((i && !P[0]) || (j && !P[1]) || (k && !P[2]))
{
@ -105,7 +115,9 @@ double P_LC(int i, int j, int k, const double *P)
/* noise variance of LC (m) --------------------------------------------------*/
double var_LC(int i, int j, int k, double sig)
{
const double f1 = FREQ1, f2 = FREQ2, f5 = FREQ5;
const double f1 = FREQ1;
const double f2 = FREQ2;
const double f5 = FREQ5;
return (std::pow(i * f1, 2.0) + std::pow(j * f2, 2.0) + std::pow(k * f5, 2.0)) / std::pow(i * f1 + j * f2 + k * f5, 2.0) * std::pow(sig, 2.0);
}
@ -114,7 +126,8 @@ double var_LC(int i, int j, int k, double sig)
/* complementaty error function (ref [1] p.227-229) --------------------------*/
double p_gamma(double a, double x, double log_gamma_a)
{
double y, w;
double y;
double w;
int i;
if (x == 0.0)
@ -143,7 +156,11 @@ double p_gamma(double a, double x, double log_gamma_a)
double q_gamma(double a, double x, double log_gamma_a)
{
double y, w, la = 1.0, lb = x + 1.0 - a, lc;
double y;
double w;
double la = 1.0;
double lb = x + 1.0 - a;
double lc;
int i;
if (x < a + 1.0)
@ -177,7 +194,8 @@ double f_erfc(double x)
/* confidence function of integer ambiguity ----------------------------------*/
double conffunc(int N, double B, double sig)
{
double x, p = 1.0;
double x;
double p = 1.0;
int i;
x = fabs(B - N);
@ -194,8 +212,16 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu
const double *azel)
{
ambc_t *amb;
double LC1, LC2, LC3, var1, var2, var3, sig;
int i, j, sat;
double LC1;
double LC2;
double LC3;
double var1;
double var2;
double var3;
double sig;
int i;
int j;
int sat;
for (i = 0; i < n; i++)
{
@ -265,8 +291,11 @@ void average_LC(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav __attribu
/* fix wide-lane ambiguity ---------------------------------------------------*/
int fix_amb_WL(rtk_t *rtk, const nav_t *nav, int sat1, int sat2, int *NW)
{
ambc_t *amb1, *amb2;
double BW, vW, lam_WL = lam_LC(1, -1, 0);
ambc_t *amb1;
ambc_t *amb2;
double BW;
double vW;
double lam_WL = lam_LC(1, -1, 0);
amb1 = rtk->ambc + sat1 - 1;
amb2 = rtk->ambc + sat2 - 1;
@ -340,7 +369,10 @@ int is_depend(int sat1, int sat2, int *flgs, int *max_flg)
/* select fixed ambiguities --------------------------------------------------*/
int sel_amb(int *sat1, int *sat2, double *N, double *var, int n)
{
int i, j, flgs[MAXSAT] = {0}, max_flg = 0;
int i;
int j;
int flgs[MAXSAT] = {0};
int max_flg = 0;
/* sort by variance */
for (i = 0; i < n; i++)
@ -377,8 +409,13 @@ int sel_amb(int *sat1, int *sat2, double *N, double *var, int n)
int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2,
const double *NC, int n)
{
double *v, *H, *R;
int i, j, k, info;
double *v;
double *H;
double *R;
int i;
int j;
int k;
int info;
if (n <= 0)
{
@ -433,8 +470,24 @@ int fix_sol(rtk_t *rtk, const int *sat1, const int *sat2,
/* fix narrow-lane ambiguity by rounding -------------------------------------*/
int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
{
double C1, C2, B1, v1, BC, v, vc, *NC, *var, lam_NL = lam_LC(1, 1, 0), lam1, lam2;
int i, j, k, m = 0, N1, stat;
double C1;
double C2;
double B1;
double v1;
double BC;
double v;
double vc;
double *NC;
double *var;
double lam_NL = lam_LC(1, 1, 0);
double lam1;
double lam2;
int i;
int j;
int k;
int m = 0;
int N1;
int stat;
lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1];
@ -495,8 +548,26 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
/* fix narrow-lane ambiguity by ILS ------------------------------------------*/
int fix_amb_ILS(rtk_t *rtk, int *sat1, int *sat2, int *NW, int n)
{
double C1, C2, *B1, *N1, *NC, *D, *E, *Q, s[2], lam_NL = lam_LC(1, 1, 0), lam1, lam2;
int i, j, k, m = 0, info, stat, flgs[MAXSAT] = {0}, max_flg = 0;
double C1;
double C2;
double *B1;
double *N1;
double *NC;
double *D;
double *E;
double *Q;
double s[2];
double lam_NL = lam_LC(1, 1, 0);
double lam1;
double lam2;
int i;
int j;
int k;
int m = 0;
int info;
int stat;
int flgs[MAXSAT] = {0};
int max_flg = 0;
lam1 = LAM_CARR[0];
lam2 = LAM_CARR[1];
@ -619,7 +690,13 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav,
const double *azel)
{
double elmask;
int i, j, m = 0, stat = 0, *NW, *sat1, *sat2;
int i;
int j;
int m = 0;
int stat = 0;
int *NW;
int *sat1;
int *sat2;
if (n <= 0 || rtk->opt.ionoopt != IONOOPT_IFLC || rtk->opt.nf < 2)
{
@ -681,8 +758,14 @@ int pppamb(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav,
void pppoutsolstat(rtk_t *rtk, int level, FILE *fp)
{
ssat_t *ssat;
double tow, pos[3], vel[3], acc[3];
int i, j, week, nfreq = 1;
double tow;
double pos[3];
double vel[3];
double acc[3];
int i;
int j;
int week;
int nfreq = 1;
char id[32];
if (level <= 0 || !fp)
@ -756,8 +839,14 @@ void pppoutsolstat(rtk_t *rtk, int level, FILE *fp)
/* exclude meas of eclipsing satellite (block IIA) ---------------------------*/
void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs)
{
double rsun[3], esun[3], r, ang, erpv[5] = {0}, cosa;
int i, j;
double rsun[3];
double esun[3];
double r;
double ang;
double erpv[5] = {0};
double cosa;
int i;
int j;
const char *type;
trace(3, "testeclipse:\n");
@ -809,7 +898,11 @@ void testeclipse(const obsd_t *obs, int n, const nav_t *nav, double *rs)
/* measurement error variance ------------------------------------------------*/
double varerr(int sat __attribute__((unused)), int sys, double el, int type, const prcopt_t *opt)
{
double a, b, a2, b2, fact = 1.0;
double a;
double b;
double a2;
double b2;
double fact = 1.0;
double sinel = sin(el);
int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0);
@ -874,8 +967,18 @@ int ifmeas(const obsd_t *obs, const nav_t *nav, const double *azel,
double phw, double *meas, double *var)
{
const double *lam = nav->lam[obs->sat - 1];
double c1, c2, L1, L2, P1, P2, P1_C1, P2_C2, gamma;
int i = 0, j = 1, k;
double c1;
double c2;
double L1;
double L2;
double P1;
double P2;
double P1_C1;
double P2_C2;
double gamma;
int i = 0;
int j = 1;
int k;
trace(4, "ifmeas :\n");
@ -1018,7 +1121,14 @@ int corrmeas(const obsd_t *obs, const nav_t *nav, const double *pos,
double *meas, double *var, int *brk)
{
const double *lam = nav->lam[obs->sat - 1];
double ion = 0.0, L1, P1, PC, P1_P2, P1_C1, vari, gamma;
double ion = 0.0;
double L1;
double P1;
double PC;
double P1_P2;
double P1_C1;
double vari;
double gamma;
int i;
trace(4, "corrmeas:\n");
@ -1168,8 +1278,12 @@ void udclk_ppp(rtk_t *rtk)
/* temporal update of tropospheric parameters --------------------------------*/
void udtrop_ppp(rtk_t *rtk)
{
double pos[3], azel[] = {0.0, PI / 2.0}, ztd, var;
int i = IT_PPP(&rtk->opt), j;
double pos[3];
double azel[] = {0.0, PI / 2.0};
double ztd;
double var;
int i = IT_PPP(&rtk->opt);
int j;
trace(3, "udtrop_ppp:\n");
@ -1205,7 +1319,8 @@ void udtrop_ppp(rtk_t *rtk)
/* detect cycle slip by LLI --------------------------------------------------*/
void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n)
{
int i, j;
int i;
int j;
trace(3, "detslp_ll: n=%d\n", n);
@ -1229,8 +1344,10 @@ void detslp_ll(rtk_t *rtk, const obsd_t *obs, int n)
/* detect cycle slip by geometry free phase jump -----------------------------*/
void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{
double g0, g1;
int i, j;
double g0;
double g1;
int i;
int j;
trace(3, "detslp_gf: n=%d\n", n);
@ -1263,8 +1380,16 @@ void detslp_gf(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
/* temporal update of phase biases -------------------------------------------*/
void udbias_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{
double meas[2], var[2], bias[MAXOBS] = {0}, offset = 0.0, pos[3] = {0};
int i, j, k, sat, brk = 0;
double meas[2];
double var[2];
double bias[MAXOBS] = {0};
double offset = 0.0;
double pos[3] = {0};
int i;
int j;
int k;
int sat;
int brk = 0;
trace(3, "udbias : n=%d\n", n);
@ -1380,7 +1505,12 @@ void udstate_ppp(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
void satantpcv(const double *rs, const double *rr, const pcv_t *pcv,
double *dant)
{
double ru[3], rz[3], eu[3], ez[3], nadir, cosa;
double ru[3];
double rz[3];
double eu[3];
double ez[3];
double nadir;
double cosa;
int i;
for (i = 0; i < 3; i++)
@ -1407,7 +1537,12 @@ double prectrop(gtime_t time, const double *pos, const double *azel,
double *var)
{
const double zazel[] = {0.0, PI / 2.0};
double zhd, m_h, m_w, cotz, grad_n, grad_e;
double zhd;
double m_h;
double m_w;
double cotz;
double grad_n;
double grad_e;
/* zenith hydrostatic delay */
zhd = tropmodel(time, pos, zazel, 0.0);
@ -1438,9 +1573,28 @@ int res_ppp(int iter __attribute__((unused)), const obsd_t *obs, int n, const do
double *H, double *R, double *azel)
{
prcopt_t *opt = &rtk->opt;
double r, rr[3], disp[3], pos[3], e[3], meas[2], dtdx[3], dantr[NFREQ] = {0};
double dants[NFREQ] = {0}, var[MAXOBS * 2], dtrp = 0.0, vart = 0.0, varm[2] = {0};
int i, j, k, sat, sys, nv = 0, nx = rtk->nx, brk, tideopt;
double r;
double rr[3];
double disp[3];
double pos[3];
double e[3];
double meas[2];
double dtdx[3];
double dantr[NFREQ] = {0};
double dants[NFREQ] = {0};
double var[MAXOBS * 2];
double dtrp = 0.0;
double vart = 0.0;
double varm[2] = {0};
int i;
int j;
int k;
int sat;
int sys;
int nv = 0;
int nx = rtk->nx;
int brk;
int tideopt;
trace(3, "res_ppp : n=%d nx=%d\n", n, nx);
@ -1636,8 +1790,20 @@ int pppnx(const prcopt_t *opt)
void pppos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
{
const prcopt_t *opt = &rtk->opt;
double *rs, *dts, *var, *v, *H, *R, *azel, *xp, *Pp;
int i, nv, info, svh[MAXOBS], stat = SOLQ_SINGLE;
double *rs;
double *dts;
double *var;
double *v;
double *H;
double *R;
double *azel;
double *xp;
double *Pp;
int i;
int nv;
int info;
int svh[MAXOBS];
int stat = SOLQ_SINGLE;
trace(3, "pppos : nx=%d n=%d\n", rtk->nx, n);

View File

@ -99,7 +99,12 @@ int code2sys(char code)
int readsp3h(FILE *fp, gtime_t *time, char *type, int *sats,
double *bfact, char *tsys)
{
int i, j, k = 0, ns = 0, sys, prn;
int i;
int j;
int k = 0;
int ns = 0;
int sys;
int prn;
char buff[1024];
trace(3, "readsp3h:\n");
@ -179,8 +184,18 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co
{
peph_t peph;
gtime_t time;
double val, std, base;
int i, j, sat, sys, prn, n = ns * (type == 'P' ? 1 : 2), pred_o, pred_c, v;
double val;
double std;
double base;
int i;
int j;
int sat;
int sys;
int prn;
int n = ns * (type == 'P' ? 1 : 2);
int pred_o;
int pred_c;
int v;
char buff[1024];
trace(3, "readsp3b: type=%c ns=%d index=%d opt=%d\n", type, ns, index, opt);
@ -309,7 +324,8 @@ void readsp3b(FILE *fp, char type, int *sats __attribute__((unused)), int ns, co
/* compare precise ephemeris -------------------------------------------------*/
int cmppeph(const void *p1, const void *p2)
{
auto *q1 = (peph_t *)p1, *q2 = (peph_t *)p2;
auto *q1 = (peph_t *)p1;
auto *q2 = (peph_t *)p2;
double tt = timediff(q1->time, q2->time);
return tt < -1e-9 ? -1 : (tt > 1e-9 ? 1 : q1->index - q2->index);
}
@ -318,7 +334,10 @@ int cmppeph(const void *p1, const void *p2)
/* combine precise ephemeris -------------------------------------------------*/
void combpeph(nav_t *nav, int opt)
{
int i, j, k, m;
int i;
int j;
int k;
int m;
trace(3, "combpeph: ne=%d\n", nav->ne);
@ -387,8 +406,15 @@ void readsp3(const char *file, nav_t *nav, int opt)
FILE *fp;
gtime_t time = {0, 0};
double bfact[2] = {};
int i, j, n, ns, sats[MAXSAT] = {};
char *efiles[MAXEXFILE], *ext, type = ' ', tsys[4] = "";
int i;
int j;
int n;
int ns;
int sats[MAXSAT] = {};
char *efiles[MAXEXFILE];
char *ext;
char type = ' ';
char tsys[4] = "";
trace(3, "readpephs: file=%s\n", file);
@ -456,7 +482,8 @@ void readsp3(const char *file, nav_t *nav, int opt)
int readsap(const char *file, gtime_t time, nav_t *nav)
{
pcvs_t pcvs = {0, 0, (pcv_t *){nullptr}};
pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}}, *pcv;
pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
pcv_t *pcv;
int i;
trace(3, "readsap : file=%s time=%s\n", file, time_str(time, 0));
@ -481,8 +508,13 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta)
{
FILE *fp;
double cbias;
char buff[256], str1[32], str2[32] = "";
int i, j, sat, type = 0;
char buff[256];
char str1[32];
char str2[32] = "";
int i;
int j;
int sat;
int type = 0;
trace(3, "readdcbf: file=%s\n", file);
@ -553,7 +585,9 @@ int readdcbf(const char *file, nav_t *nav, const sta_t *sta)
*-----------------------------------------------------------------------------*/
int readdcb(const char *file, nav_t *nav, const sta_t *sta)
{
int i, j, n;
int i;
int j;
int n;
char *efiles[MAXEXFILE] = {};
trace(3, "readdcb : file=%s\n", file);
@ -596,7 +630,8 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat,
const double *bias, const double *std)
{
fcbd_t *nav_fcb;
int i, j;
int i;
int j;
if (nav->nf > 0 && fabs(timediff(ts, nav->fcb[nav->nf - 1].ts)) <= 1e-3)
{
@ -640,9 +675,15 @@ int addfcb(nav_t *nav, gtime_t ts, gtime_t te, int sat,
int readfcbf(const char *file, nav_t *nav)
{
FILE *fp;
gtime_t ts, te;
double ep1[6], ep2[6], bias[3] = {}, std[3] = {};
char buff[1024], str[32], *p;
gtime_t ts;
gtime_t te;
double ep1[6];
double ep2[6];
double bias[3] = {};
double std[3] = {};
char buff[1024];
char str[32];
char *p;
int sat;
trace(3, "readfcbf: file=%s\n", file);
@ -687,7 +728,8 @@ int readfcbf(const char *file, nav_t *nav)
/* compare satellite fcb -----------------------------------------------------*/
int cmpfcb(const void *p1, const void *p2)
{
auto *q1 = (fcbd_t *)p1, *q2 = (fcbd_t *)p2;
auto *q1 = (fcbd_t *)p1;
auto *q2 = (fcbd_t *)p2;
double tt = timediff(q1->ts, q2->ts);
return tt < -1e-3 ? -1 : (tt > 1e-3 ? 1 : 0);
}
@ -703,7 +745,8 @@ int cmpfcb(const void *p1, const void *p2)
int readfcb(const char *file, nav_t *nav)
{
char *efiles[MAXEXFILE] = {};
int i, n;
int i;
int n;
trace(3, "readfcb : file=%s\n", file);
@ -740,7 +783,8 @@ int readfcb(const char *file, nav_t *nav)
/* polynomial interpolation by Neville's algorithm ---------------------------*/
double interppol(const double *x, double *y, int n)
{
int i, j;
int i;
int j;
for (j = 1; j < n; j++)
{
@ -757,8 +801,18 @@ double interppol(const double *x, double *y, int n)
int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs,
double *dts, double *vare, double *varc)
{
double t[NMAX + 1], p[3][NMAX + 1], c[2], *pos, std = 0.0, s[3], sinl, cosl;
int i, j, k, index;
double t[NMAX + 1];
double p[3][NMAX + 1];
double c[2];
double *pos;
double std = 0.0;
double s[3];
double sinl;
double cosl;
int i;
int j;
int k;
int index;
trace(4, "pephpos : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -886,8 +940,13 @@ int pephpos(gtime_t time, int sat, const nav_t *nav, double *rs,
int pephclk(gtime_t time, int sat, const nav_t *nav, double *dts,
double *varc)
{
double t[2], c[2], std;
int i, j, k, index;
double t[2];
double c[2];
double std;
int i;
int j;
int k;
int index;
trace(4, "pephclk : time=%s sat=%2d\n", time_str(time, 3), sat);
@ -970,9 +1029,22 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav,
{
const double *lam = nav->lam[sat - 1];
const pcv_t *pcv = nav->pcvs + sat - 1;
double ex[3], ey[3], ez[3], es[3], r[3], rsun[3], gmst, erpv[5] = {};
double gamma, C1, C2, dant1, dant2;
int i, j = 0, k = 1;
double ex[3];
double ey[3];
double ez[3];
double es[3];
double r[3];
double rsun[3];
double gmst;
double erpv[5] = {};
double gamma;
double C1;
double C2;
double dant1;
double dant2;
int i;
int j = 0;
int k = 1;
trace(4, "satantoff: time=%s sat=%2d\n", time_str(time, 3), sat);
@ -1048,7 +1120,14 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav,
int peph2pos(gtime_t time, int sat, const nav_t *nav, int opt,
double *rs, double *dts, double *var)
{
double rss[3], rst[3], dtss[1], dtst[1], dant[3] = {}, vare = 0.0, varc = 0.0, tt = 1e-3;
double rss[3];
double rst[3];
double dtss[1];
double dtst[1];
double dant[3] = {};
double vare = 0.0;
double varc = 0.0;
double tt = 1e-3;
int i;
trace(4, "peph2pos: time=%s sat=%2d opt=%d\n", time_str(time, 3), sat, opt);

View File

@ -73,7 +73,8 @@ int init_rtcm(rtcm_t *rtcm)
geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0};
ssr_t ssr0 = {{{0, 0.0}}, {0.0}, {0}, 0, 0, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, {0.0}, {0.0}, {0.0}, 0.0, 0.0, '0'};
int i, j;
int i;
int j;
trace(3, "init_rtcm:\n");
@ -369,7 +370,9 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data)
*-----------------------------------------------------------------------------*/
int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
{
int i, data = 0, ret;
int i;
int data = 0;
int ret;
trace(4, "input_rtcm2f: data=%02x\n", data);
@ -397,7 +400,9 @@ int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
*-----------------------------------------------------------------------------*/
int input_rtcm3f(rtcm_t *rtcm, FILE *fp)
{
int i, data = 0, ret;
int i;
int data = 0;
int ret;
trace(4, "input_rtcm3f: data=%02x\n", data);

View File

@ -59,7 +59,9 @@
/* adjust hourly rollover of rtcm 2 time -------------------------------------*/
void adjhour(rtcm_t *rtcm, double zcnt)
{
double tow, hour, sec;
double tow;
double hour;
double sec;
int week;
/* if no time, get cpu time */
@ -85,7 +87,8 @@ void adjhour(rtcm_t *rtcm, double zcnt)
/* get observation data index ------------------------------------------------*/
int obsindex(obs_t *obs, gtime_t time, int sat)
{
int i, j;
int i;
int j;
for (i = 0; i < obs->n; i++)
{
@ -116,8 +119,14 @@ int obsindex(obs_t *obs, gtime_t time, int sat)
/* decode type 1/9: differential gps correction/partial correction set -------*/
int decode_type1(rtcm_t *rtcm)
{
int i = 48, fact, udre, prn, sat, iod;
double prc, rrc;
int i = 48;
int fact;
int udre;
int prn;
int sat;
int iod;
double prc;
double rrc;
trace(4, "decode_type1: len=%d\n", rtcm->len);
@ -186,7 +195,10 @@ int decode_type3(rtcm_t *rtcm)
int decode_type14(rtcm_t *rtcm)
{
double zcnt;
int i = 48, week, hour, leaps;
int i = 48;
int week;
int hour;
int leaps;
trace(4, "decode_type14: len=%d\n", rtcm->len);
@ -214,7 +226,8 @@ int decode_type14(rtcm_t *rtcm)
/* decode type 16: gps special message ---------------------------------------*/
int decode_type16(rtcm_t *rtcm)
{
int i = 48, n = 0;
int i = 48;
int n = 0;
trace(4, "decode_type16: len=%d\n", rtcm->len);
@ -236,8 +249,12 @@ int decode_type17(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
int i = 48, week, prn, sat;
double toc;
double sqrtA;
int i = 48;
int week;
int prn;
int sat;
trace(4, "decode_type17: len=%d\n", rtcm->len);
@ -327,8 +344,18 @@ int decode_type17(rtcm_t *rtcm)
int decode_type18(rtcm_t *rtcm)
{
gtime_t time;
double usec, cp, tt;
int i = 48, index, freq, sync = 1, code, sys, prn, sat, loss;
double usec;
double cp;
double tt;
int i = 48;
int index;
int freq;
int sync = 1;
int code;
int sys;
int prn;
int sat;
int loss;
trace(4, "decode_type18: len=%d\n", rtcm->len);
@ -403,8 +430,17 @@ int decode_type18(rtcm_t *rtcm)
int decode_type19(rtcm_t *rtcm)
{
gtime_t time;
double usec, pr, tt;
int i = 48, index, freq, sync = 1, code, sys, prn, sat;
double usec;
double pr;
double tt;
int i = 48;
int index;
int freq;
int sync = 1;
int code;
int sys;
int prn;
int sat;
trace(4, "decode_type19: len=%d\n", rtcm->len);
@ -474,8 +510,11 @@ int decode_type19(rtcm_t *rtcm)
/* decode type 22: extended reference station parameter ----------------------*/
int decode_type22(rtcm_t *rtcm)
{
double del[2][3] = {{0}}, hgt = 0.0;
int i = 48, j, noh;
double del[2][3] = {{0}};
double hgt = 0.0;
int i = 48;
int j;
int noh;
trace(4, "decode_type22: len=%d\n", rtcm->len);
@ -579,7 +618,11 @@ int decode_type59(rtcm_t *rtcm __attribute((unused)))
int decode_rtcm2(rtcm_t *rtcm)
{
double zcnt;
int staid, seqno, stah, ret = 0, type = getbitu(rtcm->buff, 8, 6);
int staid;
int seqno;
int stah;
int ret = 0;
int type = getbitu(rtcm->buff, 8, 6);
trace(3, "decode_rtcm2: type=%2d len=%3d\n", type, rtcm->len);

View File

@ -149,7 +149,8 @@ int adjbdtweek(int week)
void adjday_glot(rtcm_t *rtcm, double tod)
{
gtime_t time;
double tow, tod_p;
double tow;
double tod_p;
int week;
if (rtcm->time.time == 0)
@ -212,7 +213,8 @@ unsigned char snratio(double snr)
/* get observation data index ------------------------------------------------*/
int obsindex3(obs_t *obs, gtime_t time, int sat)
{
int i, j;
int i;
int j;
for (i = 0; i < obs->n; i++)
{
@ -244,7 +246,8 @@ int obsindex3(obs_t *obs, gtime_t time, int sat)
int test_staid(rtcm_t *rtcm, int staid)
{
char *p;
int type, id;
int type;
int id;
/* test station id option */
if ((p = strstr(rtcm->opt, "-STA=")) && sscanf(p, "-STA=%d", &id) == 1)
@ -277,7 +280,10 @@ int decode_head1001(rtcm_t *rtcm, int *sync)
{
double tow;
char *msg;
int i = 24, staid, nsat, type;
int i = 24;
int staid;
int nsat;
int type;
type = getbitu(rtcm->buff, i, 12);
i += 12;
@ -334,8 +340,22 @@ int decode_type1001(rtcm_t *rtcm)
/* decode type 1002: extended L1-only gps rtk observables --------------------*/
int decode_type1002(rtcm_t *rtcm)
{
double pr1, cnr1, tt, cp1;
int i = 24 + 64, j, index, nsat, sync, prn, code, sat, ppr1, lock1, amb, sys;
double pr1;
double cnr1;
double tt;
double cp1;
int i = 24 + 64;
int j;
int index;
int nsat;
int sync;
int prn;
int code;
int sat;
int ppr1;
int lock1;
int amb;
int sys;
if ((nsat = decode_head1001(rtcm, &sync)) < 0)
{
@ -413,9 +433,28 @@ int decode_type1003(rtcm_t *rtcm)
int decode_type1004(rtcm_t *rtcm)
{
const int L2codes[] = {CODE_L2X, CODE_L2P, CODE_L2D, CODE_L2W};
double pr1, cnr1, cnr2, tt, cp1, cp2;
int i = 24 + 64, j, index, nsat, sync, prn, sat, code1, code2, pr21, ppr1, ppr2;
int lock1, lock2, amb, sys;
double pr1;
double cnr1;
double cnr2;
double tt;
double cp1;
double cp2;
int i = 24 + 64;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int code1;
int code2;
int pr21;
int ppr1;
int ppr2;
int lock1;
int lock2;
int amb;
int sys;
if ((nsat = decode_head1001(rtcm, &sync)) < 0)
{
@ -510,9 +549,14 @@ double getbits_38(const unsigned char *buff, int pos)
/* decode type 1005: stationary rtk reference station arp --------------------*/
int decode_type1005(rtcm_t *rtcm)
{
double rr[3], re[3], pos[3];
double rr[3];
double re[3];
double pos[3];
char *msg;
int i = 24 + 12, j, staid, itrf;
int i = 24 + 12;
int j;
int staid;
int itrf;
if (i + 140 == rtcm->len * 8)
{
@ -563,9 +607,15 @@ int decode_type1005(rtcm_t *rtcm)
/* decode type 1006: stationary rtk reference station arp with height --------*/
int decode_type1006(rtcm_t *rtcm)
{
double rr[3], re[3], pos[3], anth;
double rr[3];
double re[3];
double pos[3];
double anth;
char *msg;
int i = 24 + 12, j, staid, itrf;
int i = 24 + 12;
int j;
int staid;
int itrf;
if (i + 156 <= rtcm->len * 8)
{
@ -620,7 +670,11 @@ int decode_type1007(rtcm_t *rtcm)
{
char des[32] = "";
char *msg;
int i = 24 + 12, j, staid, n, setup;
int i = 24 + 12;
int j;
int staid;
int n;
int setup;
n = getbitu(rtcm->buff, i + 12, 8);
@ -662,9 +716,15 @@ int decode_type1007(rtcm_t *rtcm)
/* decode type 1008: antenna descriptor & serial number ----------------------*/
int decode_type1008(rtcm_t *rtcm)
{
char des[32] = "", sno[32] = "";
char des[32] = "";
char sno[32] = "";
char *msg;
int i = 24 + 12, j, staid, n, m, setup;
int i = 24 + 12;
int j;
int staid;
int n;
int m;
int setup;
n = getbitu(rtcm->buff, i + 12, 8);
m = getbitu(rtcm->buff, i + 28 + 8 * n, 8);
@ -716,7 +776,10 @@ int decode_head1009(rtcm_t *rtcm, int *sync)
{
double tod;
char *msg;
int i = 24, staid, nsat, type;
int i = 24;
int staid;
int nsat;
int type;
type = getbitu(rtcm->buff, i, 12);
i += 12;
@ -773,8 +836,24 @@ int decode_type1009(rtcm_t *rtcm)
/* decode type 1010: extended L1-only glonass rtk observables ----------------*/
int decode_type1010(rtcm_t *rtcm)
{
double pr1, cnr1, tt, cp1, lam1;
int i = 24 + 61, j, index, nsat, sync, prn, sat, code, freq, ppr1, lock1, amb, sys = SYS_GLO;
double pr1;
double cnr1;
double tt;
double cp1;
double lam1;
int i = 24 + 61;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int code;
int freq;
int ppr1;
int lock1;
int amb;
int sys = SYS_GLO;
if ((nsat = decode_head1009(rtcm, &sync)) < 0)
{
@ -845,9 +924,31 @@ int decode_type1011(rtcm_t *rtcm)
/* decode type 1012: extended L1&L2 glonass rtk observables ------------------*/
int decode_type1012(rtcm_t *rtcm)
{
double pr1, cnr1, cnr2, tt, cp1, cp2, lam1, lam2;
int i = 24 + 61, j, index, nsat, sync, prn, sat, freq, code1, code2, pr21, ppr1, ppr2;
int lock1, lock2, amb, sys = SYS_GLO;
double pr1;
double cnr1;
double cnr2;
double tt;
double cp1;
double cp2;
double lam1;
double lam2;
int i = 24 + 61;
int j;
int index;
int nsat;
int sync;
int prn;
int sat;
int freq;
int code1;
int code2;
int pr21;
int ppr1;
int ppr2;
int lock1;
int lock2;
int amb;
int sys = SYS_GLO;
if ((nsat = decode_head1009(rtcm, &sync)) < 0)
{
@ -940,9 +1041,14 @@ int decode_type1019(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_GPS;
int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_GPS;
if (i + 476 <= rtcm->len * 8)
{
@ -1053,9 +1159,21 @@ int decode_type1020(rtcm_t *rtcm)
{
geph_t geph = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0};
double tk_h, tk_m, tk_s, toe, tow, tod, tof;
double tk_h;
double tk_m;
double tk_s;
double toe;
double tow;
double tod;
double tof;
char *msg;
int i = 24 + 12, prn, sat, week, tb, bn, sys = SYS_GLO;
int i = 24 + 12;
int prn;
int sat;
int week;
int tb;
int bn;
int sys = SYS_GLO;
if (i + 348 <= rtcm->len * 8)
{
@ -1218,7 +1336,10 @@ int decode_type1027(rtcm_t *rtcm __attribute__((unused)))
int decode_type1029(rtcm_t *rtcm)
{
char *msg;
int i = 24 + 12, j, staid, nchar; // mjd, tod, nchar, cunit;
int i = 24 + 12;
int j;
int staid;
int nchar; // mjd, tod, nchar, cunit;
if (i + 60 <= rtcm->len * 8)
{
@ -1283,9 +1404,21 @@ int decode_type1032(rtcm_t *rtcm __attribute__((unused)))
/* decode type 1033: receiver and antenna descriptor -------------------------*/
int decode_type1033(rtcm_t *rtcm)
{
char des[32] = "", sno[32] = "", rec[32] = "", ver[32] = "", rsn[32] = "";
char des[32] = "";
char sno[32] = "";
char rec[32] = "";
char ver[32] = "";
char rsn[32] = "";
char *msg;
int i = 24 + 12, j, staid, n, m, n1, n2, n3, setup;
int i = 24 + 12;
int j;
int staid;
int n;
int m;
int n1;
int n2;
int n3;
int setup;
n = getbitu(rtcm->buff, i + 12, 8);
m = getbitu(rtcm->buff, i + 28 + 8 * n, 8);
@ -1407,9 +1540,14 @@ int decode_type1044(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_QZS;
int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_QZS;
if (i + 473 <= rtcm->len * 8)
{
@ -1515,9 +1653,16 @@ int decode_type1045(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL;
int i = 24 + 12;
int prn;
int sat;
int week;
int e5a_hs;
int e5a_dvs;
int sys = SYS_GAL;
if (i + 484 <= rtcm->len * 8)
{
@ -1622,9 +1767,16 @@ int decode_type1046(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, e5a_hs, e5a_dvs, sys = SYS_GAL;
int i = 24 + 12;
int prn;
int sat;
int week;
int e5a_hs;
int e5a_dvs;
int sys = SYS_GAL;
if (i + 484 <= rtcm->len * 8)
{
@ -1730,9 +1882,14 @@ int decode_type1047(rtcm_t *rtcm)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
;
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_BDS;
int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_BDS;
if (i + 476 <= rtcm->len * 8)
{
@ -1842,9 +1999,14 @@ int decode_type63(rtcm_t *rtcm)
eph_t eph = {0, -1, -1, 0, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0, 0.0},
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {0.0}, {0.0}, 0.0, 0.0};
double toc, sqrtA;
double toc;
double sqrtA;
char *msg;
int i = 24 + 12, prn, sat, week, sys = SYS_BDS;
int i = 24 + 12;
int prn;
int sat;
int week;
int sys = SYS_BDS;
if (i + 499 <= rtcm->len * 8)
{
@ -1948,9 +2110,15 @@ int decode_type63(rtcm_t *rtcm)
int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *refd, int *hsize)
{
double tod, tow;
double tod;
double tow;
char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6;
int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6;
@ -2006,9 +2174,15 @@ int decode_ssr1_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *hsize)
{
double tod, tow;
double tod;
double tow;
char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6;
int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6;
@ -2062,9 +2236,15 @@ int decode_ssr2_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
double *udint, int *dispe, int *mw, int *hsize)
{
double tod, tow;
double tod;
double tow;
char *msg;
int i = 24 + 12, nsat, udi, provid = 0, solid = 0, ns = 6;
int i = 24 + 12;
int nsat;
int udi;
int provid = 0;
int solid = 0;
int ns = 6;
#ifndef SSR_QZSS_DRAFT_V05
ns = sys == SYS_QZS ? 4 : 6;
@ -2121,8 +2301,25 @@ int decode_ssr7_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
/* decode ssr 1: orbit corrections -------------------------------------------*/
int decode_ssr1(rtcm_t *rtcm, int sys)
{
double udint, deph[3], ddeph[3];
int i, j, k, type, sync, iod, nsat, prn, sat, iode, iodcrc, refd = 0, np, ni, nj, offp;
double udint;
double deph[3];
double ddeph[3];
int i;
int j;
int k;
int type;
int sync;
int iod;
int nsat;
int prn;
int sat;
int iode;
int iodcrc;
int refd = 0;
int np;
int ni;
int nj;
int offp;
type = getbitu(rtcm->buff, 24, 12);
@ -2219,8 +2416,19 @@ int decode_ssr1(rtcm_t *rtcm, int sys)
/* decode ssr 2: clock corrections -------------------------------------------*/
int decode_ssr2(rtcm_t *rtcm, int sys)
{
double udint, dclk[3];
int i, j, k, type, sync, iod, nsat, prn, sat, np, offp;
double udint;
double dclk[3];
int i;
int j;
int k;
int type;
int sync;
int iod;
int nsat;
int prn;
int sat;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12);
@ -2292,8 +2500,23 @@ int decode_ssr2(rtcm_t *rtcm, int sys)
int decode_ssr3(rtcm_t *rtcm, int sys)
{
const int *codes;
double udint, bias, cbias[MAXCODE];
int i, j, k, type, mode, sync, iod, nsat, prn, sat, nbias, np, offp, ncode;
double udint;
double bias;
double cbias[MAXCODE];
int i;
int j;
int k;
int type;
int mode;
int sync;
int iod;
int nsat;
int prn;
int sat;
int nbias;
int np;
int offp;
int ncode;
type = getbitu(rtcm->buff, 24, 12);
@ -2391,8 +2614,26 @@ int decode_ssr3(rtcm_t *rtcm, int sys)
/* decode ssr 4: combined orbit and clock corrections ------------------------*/
int decode_ssr4(rtcm_t *rtcm, int sys)
{
double udint, deph[3], ddeph[3], dclk[3];
int i, j, k, type, nsat, sync, iod, prn, sat, iode, iodcrc, refd = 0, np, ni, nj, offp;
double udint;
double deph[3];
double ddeph[3];
double dclk[3];
int i;
int j;
int k;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int iode;
int iodcrc;
int refd = 0;
int np;
int ni;
int nj;
int offp;
type = getbitu(rtcm->buff, 24, 12);
@ -2498,7 +2739,17 @@ int decode_ssr4(rtcm_t *rtcm, int sys)
int decode_ssr5(rtcm_t *rtcm, int sys)
{
double udint;
int i, j, type, nsat, sync, iod, prn, sat, ura, np, offp;
int i;
int j;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int ura;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12);
@ -2561,8 +2812,18 @@ int decode_ssr5(rtcm_t *rtcm, int sys)
/* decode ssr 6: high rate clock correction ----------------------------------*/
int decode_ssr6(rtcm_t *rtcm, int sys)
{
double udint, hrclk;
int i, j, type, nsat, sync, iod, prn, sat, np, offp;
double udint;
double hrclk;
int i;
int j;
int type;
int nsat;
int sync;
int iod;
int prn;
int sat;
int np;
int offp;
type = getbitu(rtcm->buff, 24, 12);
@ -2626,9 +2887,29 @@ int decode_ssr6(rtcm_t *rtcm, int sys)
int decode_ssr7(rtcm_t *rtcm, int sys)
{
const int *codes;
double udint, bias, std, pbias[MAXCODE], stdpb[MAXCODE];
int i, j, k, type, mode, sync, iod, nsat, prn, sat, nbias, ncode, np, mw, offp;
int dispe, yaw_ang, yaw_rate;
double udint;
double bias;
double std;
double pbias[MAXCODE];
double stdpb[MAXCODE];
int i;
int j;
int k;
int type;
int mode;
int sync;
int iod;
int nsat;
int prn;
int sat;
int nbias;
int ncode;
int np;
int mw;
int offp;
int dispe;
int yaw_ang;
int yaw_rate;
type = getbitu(rtcm->buff, 24, 12);
@ -2733,7 +3014,12 @@ int decode_ssr7(rtcm_t *rtcm, int sys)
void sigindex(int sys, const unsigned char *code, const int *freq, int n,
const char *opt, int *ind)
{
int i, nex, pri, pri_h[8] = {0}, index[8] = {0}, ex[32] = {0};
int i;
int nex;
int pri;
int pri_h[8] = {0};
int index[8] = {0};
int ex[32] = {0};
/* test code priority */
for (i = 0; i < n; i++)
@ -2796,10 +3082,21 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r,
const int *ex, const int *half)
{
const char *sig[32];
double tt, wl;
double tt;
double wl;
unsigned char code[32];
char *msm_type = (char *)"", *q = nullptr;
int i, j, k, type, prn, sat, fn, index = 0, freq[32], ind[32];
char *msm_type = (char *)"";
char *q = nullptr;
int i;
int j;
int k;
int type;
int prn;
int sat;
int fn;
int index = 0;
int freq[32];
int ind[32];
type = getbitu(rtcm->buff, 24, 12);
@ -2963,9 +3260,15 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
msm_h_t *h, int *hsize)
{
msm_h_t h0 = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double tow, tod;
double tow;
double tod;
char *msg;
int i = 24, j, mask, staid, type, ncell = 0;
int i = 24;
int j;
int mask;
int staid;
int type;
int ncell = 0;
type = getbitu(rtcm->buff, i, 12);
i += 12;
@ -3080,7 +3383,9 @@ int decode_msm_head(rtcm_t *rtcm, int sys, int *sync, int *iod,
int decode_msm0(rtcm_t *rtcm, int sys)
{
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
int i, sync, iod;
int i;
int sync;
int iod;
if (decode_msm_head(rtcm, sys, &sync, &iod, &h, &i) < 0)
{
return -1;
@ -3094,8 +3399,22 @@ int decode_msm0(rtcm_t *rtcm, int sys)
int decode_msm4(rtcm_t *rtcm, int sys)
{
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], pr[64], cp[64], cnr[64];
int i, j, type, sync, iod, ncell, rng, rng_m, prv, cpv, lock[64], half[64];
double r[64];
double pr[64];
double cp[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int prv;
int cpv;
int lock[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12);
@ -3185,9 +3504,27 @@ int decode_msm4(rtcm_t *rtcm, int sys)
int decode_msm5(rtcm_t *rtcm, int sys)
{
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], rr[64], pr[64], cp[64], rrf[64], cnr[64];
int i, j, type, sync, iod, ncell, rng, rng_m, rate, prv, cpv, rrv, lock[64];
int ex[64], half[64];
double r[64];
double rr[64];
double pr[64];
double cp[64];
double rrf[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int rate;
int prv;
int cpv;
int rrv;
int lock[64];
int ex[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12);
@ -3301,8 +3638,22 @@ int decode_msm5(rtcm_t *rtcm, int sys)
int decode_msm6(rtcm_t *rtcm, int sys)
{
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], pr[64], cp[64], cnr[64];
int i, j, type, sync, iod, ncell, rng, rng_m, prv, cpv, lock[64], half[64];
double r[64];
double pr[64];
double cp[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int prv;
int cpv;
int lock[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12);
@ -3392,9 +3743,27 @@ int decode_msm6(rtcm_t *rtcm, int sys)
int decode_msm7(rtcm_t *rtcm, int sys)
{
msm_h_t h = {0, 0, 0, 0, 0, 0, 0, 0, {0}, {0}, {0}};
double r[64], rr[64], pr[64], cp[64], rrf[64], cnr[64];
int i, j, type, sync, iod, ncell, rng, rng_m, rate, prv, cpv, rrv, lock[64];
int ex[64], half[64];
double r[64];
double rr[64];
double pr[64];
double cp[64];
double rrf[64];
double cnr[64];
int i;
int j;
int type;
int sync;
int iod;
int ncell;
int rng;
int rng_m;
int rate;
int prv;
int cpv;
int rrv;
int lock[64];
int ex[64];
int half[64];
type = getbitu(rtcm->buff, 24, 12);
@ -3516,7 +3885,9 @@ int decode_type1230(rtcm_t *rtcm __attribute__((unused)))
int decode_rtcm3(rtcm_t *rtcm)
{
double tow;
int ret = 0, type = getbitu(rtcm->buff, 24, 12), week;
int ret = 0;
int type = getbitu(rtcm->buff, 24, 12);
int week;
trace(3, "decode_rtcm3: len=%3d type=%d\n", rtcm->len, type);

View File

@ -396,7 +396,8 @@ int satsys(int sat, int *prn)
*-----------------------------------------------------------------------------*/
int satid2no(const char *id)
{
int sys, prn;
int sys;
int prn;
char code;
if (sscanf(id, "%d", &prn) == 1)
@ -564,7 +565,8 @@ int satexclude(int sat, int svh, const prcopt_t *opt)
int testsnr(int base, int freq, double el, double snr,
const snrmask_t *mask)
{
double minsnr, a;
double minsnr;
double a;
int i;
if (!mask->ena[base] || freq < 0 || freq >= NFREQ)
@ -713,9 +715,12 @@ void setcodepri(int sys, int freq, const char *pri)
*-----------------------------------------------------------------------------*/
int getcodepri(int sys, unsigned char code, const char *opt)
{
const char *p, *optstr;
char *obs, str[8] = "";
int i, j;
const char *p;
const char *optstr;
char *obs;
char str[8] = "";
int i;
int j;
switch (sys)
{
@ -850,7 +855,8 @@ void setbits(unsigned char *buff, int pos, int len, int data)
unsigned int rtk_crc32(const unsigned char *buff, int len)
{
unsigned int crc = 0;
int i, j;
int i;
int j;
trace(4, "rtk_crc32: len=%d\n", len);
@ -930,7 +936,8 @@ int decode_word(unsigned int word, unsigned char *data)
{
const unsigned int hamming[] = {
0xBB1F3480, 0x5D8F9A40, 0xAEC7CD00, 0x5763E680, 0x6BB1F340, 0x8B7A89C0};
unsigned int parity = 0, w;
unsigned int parity = 0;
unsigned int w;
int i;
trace(5, "decodeword: word=%08x\n", word);
@ -1142,7 +1149,8 @@ void matcpy(double *A, const double *B, int n, int m)
void matmul(const char *tr, int n, int k, int m, double alpha,
const double *A, const double *B, double beta, double *C)
{
int lda = tr[0] == 'T' ? m : n, ldb = tr[1] == 'T' ? k : m;
int lda = tr[0] == 'T' ? m : n;
int ldb = tr[1] == 'T' ? k : m;
dgemm_(const_cast<char *>(tr), const_cast<char *>(tr) + 1, &n, &k, &m, &alpha, const_cast<double *>(A), &lda, const_cast<double *>(B),
&ldb, &beta, C, &n);
@ -1158,7 +1166,9 @@ void matmul(const char *tr, int n, int k, int m, double alpha,
int matinv(double *A, int n)
{
double *work;
int info, lwork = n * 16, *ipiv = imat(n, 1);
int info;
int lwork = n * 16;
int *ipiv = imat(n, 1);
work = mat(lwork, 1);
dgetrf_(&n, &n, A, &n, ipiv, &info);
@ -1187,7 +1197,8 @@ int solve(const char *tr, const double *A, const double *Y, int n,
int m, double *X)
{
double *B = mat(n, n);
int info, *ipiv = imat(n, 1);
int info;
int *ipiv = imat(n, 1);
matcpy(B, A, n, n);
matcpy(X, Y, n, m);
@ -1258,7 +1269,10 @@ int filter_(const double *x, const double *P, const double *H,
const double *v, const double *R, int n, int m,
double *xp, double *Pp)
{
double *F = mat(n, m), *Q = mat(m, m), *K = mat(n, m), *I = eye(n);
double *F = mat(n, m);
double *Q = mat(m, m);
double *K = mat(n, m);
double *I = eye(n);
int info;
matcpy(Q, R, m, m);
@ -1283,8 +1297,16 @@ int filter_(const double *x, const double *P, const double *H,
int filter(double *x, double *P, const double *H, const double *v,
const double *R, int n, int m)
{
double *x_, *xp_, *P_, *Pp_, *H_;
int i, j, k, info, *ix;
double *x_;
double *xp_;
double *P_;
double *Pp_;
double *H_;
int i;
int j;
int k;
int info;
int *ix;
ix = imat(n, 1);
for (i = k = 0; i < n; i++)
@ -1349,8 +1371,11 @@ int filter(double *x, double *P, const double *H, const double *v,
int smoother(const double *xf, const double *Qf, const double *xb,
const double *Qb, int n, double *xs, double *Qs)
{
double *invQf = mat(n, n), *invQb = mat(n, n), *xx = mat(n, 1);
int i, info = -1;
double *invQf = mat(n, n);
double *invQb = mat(n, n);
double *xx = mat(n, 1);
int i;
int info = -1;
matcpy(invQf, Qf, n, n);
matcpy(invQb, Qb, n, n);
@ -1385,7 +1410,8 @@ int smoother(const double *xf, const double *Qf, const double *xb,
*-----------------------------------------------------------------------------*/
void matfprint(const double A[], int n, int m, int p, int q, FILE *fp)
{
int i, j;
int i;
int j;
for (i = 0; i < n; i++)
{
@ -1399,7 +1425,8 @@ void matfprint(const double A[], int n, int m, int p, int q, FILE *fp)
void matsprint(const double A[], int n, int m, int p, int q, std::string &buffer)
{
int i, j;
int i;
int j;
buffer += '\n';
for (i = 0; i < n; i++)
{
@ -1430,7 +1457,8 @@ void matprint(const double A[], int n, int m, int p, int q)
double str2num(const char *s, int i, int n)
{
double value;
char str[256], *p = str;
char str[256];
char *p = str;
if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < n)
{
@ -1455,7 +1483,8 @@ double str2num(const char *s, int i, int n)
int str2time(const char *s, int i, int n, gtime_t *t)
{
double ep[6];
char str[256], *p = str;
char str[256];
char *p = str;
if (i < 0 || static_cast<int>(strlen(s)) < i || static_cast<int>(sizeof(str)) - 1 < i)
{
@ -1489,7 +1518,11 @@ gtime_t epoch2time(const double *ep)
{
const int doy[] = {1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
gtime_t time = {0, 0};
int days, sec, year = static_cast<int>(ep[0]), mon = static_cast<int>(ep[1]), day = static_cast<int>(ep[2]);
int days;
int sec;
int year = static_cast<int>(ep[0]);
int mon = static_cast<int>(ep[1]);
int day = static_cast<int>(ep[2]);
if (year < 1970 || 2099 < year || mon < 1 || 12 < mon)
{
@ -1517,7 +1550,10 @@ void time2epoch(gtime_t t, double *ep)
const int mday[] = {/* # of days in a month */
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int days, sec, mon, day;
int days;
int sec;
int mon;
int day;
/* leap year if year%4==0 in 1901-2099 */
days = static_cast<int>(t.time / 86400);
@ -1760,8 +1796,12 @@ void timeset(gtime_t t)
/* read leap seconds table by text -------------------------------------------*/
int read_leaps_text(FILE *fp)
{
char buff[256], *p;
int i, n = 0, ep[6], ls;
char buff[256];
char *p;
int i;
int n = 0;
int ep[6];
int ls;
rewind(fp);
@ -1791,9 +1831,17 @@ int read_leaps_usno(FILE *fp)
{
static const char *months[] = {
"JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
double jd, tai_utc;
char buff[256], month[32], ls[MAXLEAPS][7] = {};
int i, j, y, m, d, n = 0;
double jd;
double tai_utc;
char buff[256];
char month[32];
char ls[MAXLEAPS][7] = {};
int i;
int j;
int y;
int m;
int d;
int n = 0;
rewind(fp);
@ -1849,7 +1897,8 @@ int read_leaps_usno(FILE *fp)
int read_leaps(const char *file)
{
FILE *fp;
int i, n;
int i;
int n;
if (!(fp = fopen(file, "re")))
{
@ -1944,7 +1993,8 @@ gtime_t bdt2gpst(gtime_t t)
/* time to day and sec -------------------------------------------------------*/
double time2sec(gtime_t time, gtime_t *day)
{
double ep[6], sec;
double ep[6];
double sec;
time2epoch(time, ep);
sec = ep[3] * 3600.0 + ep[4] * 60.0 + ep[5];
ep[3] = ep[4] = ep[5] = 0.0;
@ -1962,8 +2012,14 @@ double time2sec(gtime_t time, gtime_t *day)
double utc2gmst(gtime_t t, double ut1_utc)
{
const double ep2000[] = {2000, 1, 1, 12, 0, 0};
gtime_t tut, tut0;
double ut, t1, t2, t3, gmst0, gmst;
gtime_t tut;
gtime_t tut0;
double ut;
double t1;
double t2;
double t3;
double gmst0;
double gmst;
tut = timeadd(t, ut1_utc);
ut = time2sec(tut, &tut0);
@ -2120,7 +2176,8 @@ void sleepms(int ms)
*-----------------------------------------------------------------------------*/
void deg2dms(double deg, double *dms, int ndec)
{
double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg);
double sign = deg < 0.0 ? -1.0 : 1.0;
double a = fabs(deg);
double unit = pow(0.1, ndec);
dms[0] = floor(a);
a = (a - dms[0]) * 60.0;
@ -2142,7 +2199,8 @@ void deg2dms(double deg, double *dms, int ndec)
void deg2dms(double deg, double *dms)
{
double sign = deg < 0.0 ? -1.0 : 1.0, a = fabs(deg);
double sign = deg < 0.0 ? -1.0 : 1.0;
double a = fabs(deg);
dms[0] = floor(a);
a = (a - dms[0]) * 60.0;
dms[1] = floor(a);
@ -2172,7 +2230,12 @@ double dms2deg(const double *dms)
*-----------------------------------------------------------------------------*/
void ecef2pos(const double *r, double *pos)
{
double e2 = FE_WGS84 * (2.0 - FE_WGS84), r2 = dot(r, r, 2), z, zk, v = RE_WGS84, sinp;
double e2 = FE_WGS84 * (2.0 - FE_WGS84);
double r2 = dot(r, r, 2);
double z;
double zk;
double v = RE_WGS84;
double sinp;
for (z = r[2], zk = 0.0; fabs(z - zk) >= 1e-4;)
{
@ -2196,8 +2259,12 @@ void ecef2pos(const double *r, double *pos)
*-----------------------------------------------------------------------------*/
void pos2ecef(const double *pos, double *r)
{
double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]), cosl = cos(pos[1]);
double e2 = FE_WGS84 * (2.0 - FE_WGS84), v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp);
double sinp = sin(pos[0]);
double cosp = cos(pos[0]);
double sinl = sin(pos[1]);
double cosl = cos(pos[1]);
double e2 = FE_WGS84 * (2.0 - FE_WGS84);
double v = RE_WGS84 / sqrt(1.0 - e2 * sinp * sinp);
r[0] = (v + pos[2]) * cosp * cosl;
r[1] = (v + pos[2]) * cosp * sinl;
@ -2214,7 +2281,10 @@ void pos2ecef(const double *pos, double *r)
*-----------------------------------------------------------------------------*/
void xyz2enu(const double *pos, double *E)
{
double sinp = sin(pos[0]), cosp = cos(pos[0]), sinl = sin(pos[1]), cosl = cos(pos[1]);
double sinp = sin(pos[0]);
double cosp = cos(pos[0]);
double sinl = sin(pos[1]);
double cosl = cos(pos[1]);
E[0] = -sinl;
E[3] = cosl;
@ -2269,7 +2339,8 @@ void enu2ecef(const double *pos, const double *e, double *r)
*-----------------------------------------------------------------------------*/
void covenu(const double *pos, const double *P, double *Q)
{
double E[9], EP[9];
double E[9];
double EP[9];
xyz2enu(pos, E);
matmul("NN", 3, 3, 3, 1.0, E, P, 0.0, EP);
@ -2286,7 +2357,8 @@ void covenu(const double *pos, const double *P, double *Q)
*-----------------------------------------------------------------------------*/
void covecef(const double *pos, const double *Q, double *P)
{
double E[9], EQ[9];
double E[9];
double EQ[9];
xyz2enu(pos, E);
matmul("TN", 3, 3, 3, 1.0, E, Q, 0.0, EQ);
@ -2304,7 +2376,8 @@ void ast_args(double t, double *f)
{297.85019547, 1602961601.2090, -6.3706, 0.006593, -0.00003169},
{125.04455501, -6962890.2665, 7.4722, 0.007702, -0.00005939}};
double tt[4];
int i, j;
int i;
int j;
for (tt[0] = t, i = 1; i < 4; i++)
{
@ -2433,7 +2506,8 @@ void nut_iau1980(double t, const double *f, double *dpsi, double *deps)
{-1, -1, 0, 2, 1, 35.0, 1, 0.0, 0, 0.0},
{0, 1, 0, 1, 0, 27.3, 1, 0.0, 0, 0.0}};
double ang;
int i, j;
int i;
int j;
*dpsi = *deps = 0.0;
@ -2467,10 +2541,28 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst)
{
const double ep2000[] = {2000, 1, 1, 12, 0, 0};
static gtime_t tutc_;
static double U_[9], gmst_;
static double U_[9];
static double gmst_;
gtime_t tgps;
double eps, ze, th, z, t, t2, t3, dpsi, deps, gast, f[5];
double R1[9], R2[9], R3[9], R[9], W[9], N[9], P[9], NP[9];
double eps;
double ze;
double th;
double z;
double t;
double t2;
double t3;
double dpsi;
double deps;
double gast;
double f[5];
double R1[9];
double R2[9];
double R3[9];
double R[9];
double W[9];
double N[9];
double P[9];
double NP[9];
int i;
trace(4, "eci2ecef: tutc=%s\n", time_str(tutc, 3));
@ -2674,7 +2766,11 @@ int readantex(const char *file, pcvs_t *pcvs)
static const pcv_t pcv0 = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
pcv_t pcv = {0, {}, {}, {0, 0}, {0, 0}, {{}, {}}, {{}, {}}};
double neu[3];
int i, f, freq = 0, state = 0, freqs[] = {1, 2, 5, 6, 7, 8, 0};
int i;
int f;
int freq = 0;
int state = 0;
int freqs[] = {1, 2, 5, 6, 7, 8, 0};
char buff[256];
trace(3, "readantex: file=%s\n", file);
@ -2803,7 +2899,8 @@ int readpcv(const char *file, pcvs_t *pcvs)
{
pcv_t *pcv;
const char *ext;
int i, stat;
int i;
int stat;
trace(3, "readpcv: file=%s\n", file);
@ -2843,8 +2940,12 @@ pcv_t *searchpcv(int sat, const char *type, gtime_t time,
const pcvs_t *pcvs)
{
pcv_t *pcv;
char buff[MAXANT] = "", *types[2], *p;
int i, j, n = 0;
char buff[MAXANT] = "";
char *types[2];
char *p;
int i;
int j;
int n = 0;
trace(3, "searchpcv: sat=%2d type=%s\n", sat, type);
@ -2934,8 +3035,12 @@ void readpos(const char *file, const char *rcv, double *pos)
static double poss[2048][3];
static char stas[2048][16];
FILE *fp;
int i, j, len, np = 0;
char buff[256], str[256];
int i;
int j;
int len;
int np = 0;
char buff[256];
char str[256];
trace(3, "readpos: file=%s\n", file);
@ -2984,7 +3089,8 @@ int readblqrecord(FILE *fp, double *odisp)
{
double v[11];
char buff[256];
int i, n = 0;
int i;
int n = 0;
while (fgets(buff, sizeof(buff), fp))
{
@ -3020,7 +3126,10 @@ int readblqrecord(FILE *fp, double *odisp)
int readblq(const char *file, const char *sta, double *odisp)
{
FILE *fp;
char buff[256], staname[32] = "", name[32], *p;
char buff[256];
char staname[32] = "";
char name[32];
char *p;
/* station name to upper case */
sscanf(sta, "%16s", staname);
@ -3131,8 +3240,12 @@ int readerp(const char *file, erp_t *erp)
int geterp(const erp_t *erp, gtime_t time, double *erpv)
{
const double ep[] = {2000, 1, 1, 12, 0, 0};
double mjd, day, a;
int i, j, k;
double mjd;
double day;
double a;
int i;
int j;
int k;
trace(4, "geterp:\n");
@ -3191,7 +3304,8 @@ int geterp(const erp_t *erp, gtime_t time, double *erpv)
/* compare ephemeris ---------------------------------------------------------*/
int cmpeph(const void *p1, const void *p2)
{
auto *q1 = (eph_t *)p1, *q2 = (eph_t *)p2;
auto *q1 = (eph_t *)p1;
auto *q2 = (eph_t *)p2;
return q1->ttr.time != q2->ttr.time ? static_cast<int>(q1->ttr.time - q2->ttr.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
}
@ -3200,7 +3314,8 @@ int cmpeph(const void *p1, const void *p2)
void uniqeph(nav_t *nav)
{
eph_t *nav_eph;
int i, j;
int i;
int j;
trace(3, "uniqeph: n=%d\n", nav->n);
@ -3239,7 +3354,8 @@ void uniqeph(nav_t *nav)
/* compare glonass ephemeris -------------------------------------------------*/
int cmpgeph(const void *p1, const void *p2)
{
auto *q1 = (geph_t *)p1, *q2 = (geph_t *)p2;
auto *q1 = (geph_t *)p1;
auto *q2 = (geph_t *)p2;
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->toe.time != q2->toe.time ? static_cast<int>(q1->toe.time - q2->toe.time) : q1->sat - q2->sat);
}
@ -3248,7 +3364,8 @@ int cmpgeph(const void *p1, const void *p2)
void uniqgeph(nav_t *nav)
{
geph_t *nav_geph;
int i, j;
int i;
int j;
trace(3, "uniqgeph: ng=%d\n", nav->ng);
@ -3288,7 +3405,8 @@ void uniqgeph(nav_t *nav)
/* compare sbas ephemeris ----------------------------------------------------*/
int cmpseph(const void *p1, const void *p2)
{
auto *q1 = (seph_t *)p1, *q2 = (seph_t *)p2;
auto *q1 = (seph_t *)p1;
auto *q2 = (seph_t *)p2;
return q1->tof.time != q2->tof.time ? static_cast<int>(q1->tof.time - q2->tof.time) : (q1->t0.time != q2->t0.time ? static_cast<int>(q1->t0.time - q2->t0.time) : q1->sat - q2->sat);
}
@ -3297,7 +3415,8 @@ int cmpseph(const void *p1, const void *p2)
void uniqseph(nav_t *nav)
{
seph_t *nav_seph;
int i, j;
int i;
int j;
trace(3, "uniqseph: ns=%d\n", nav->ns);
@ -3340,7 +3459,8 @@ void uniqseph(nav_t *nav)
*-----------------------------------------------------------------------------*/
void uniqnav(nav_t *nav)
{
int i, j;
int i;
int j;
trace(3, "uniqnav: neph=%d ngeph=%d nseph=%d\n", nav->n, nav->ng, nav->ns);
@ -3363,7 +3483,8 @@ void uniqnav(nav_t *nav)
/* compare observation data -------------------------------------------------*/
int cmpobs(const void *p1, const void *p2)
{
auto *q1 = (obsd_t *)p1, *q2 = (obsd_t *)p2;
auto *q1 = (obsd_t *)p1;
auto *q2 = (obsd_t *)p2;
double tt = timediff(q1->time, q2->time);
if (fabs(tt) > DTTOL)
{
@ -3384,7 +3505,9 @@ int cmpobs(const void *p1, const void *p2)
*-----------------------------------------------------------------------------*/
int sortobs(obs_t *obs)
{
int i, j, n;
int i;
int j;
int n;
trace(3, "sortobs: nobs=%d\n", obs->n);
@ -3449,9 +3572,15 @@ int readnav(const char *file, nav_t *nav)
eph_t eph0 = {0, 0, 0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}, {}, 0.0, 0.0};
geph_t geph0 = {0, 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {}, {}, {}, 0.0, 0.0, 0.0};
char buff[4096], *p;
int32_t toe_time, tof_time, toc_time, ttr_time;
int i, sat, prn;
char buff[4096];
char *p;
int32_t toe_time;
int32_t tof_time;
int32_t toc_time;
int32_t ttr_time;
int i;
int sat;
int prn;
trace(3, "loadnav: file=%s\n", file);
@ -3956,7 +4085,8 @@ int execcmd(const char *cmd)
*-----------------------------------------------------------------------------*/
void createdir(const char *path)
{
char buff[1024], *p;
char buff[1024];
char *p;
//tracet(3, "createdir: path=%s\n", path);
if (strlen(path) < 1025)
@ -3984,7 +4114,10 @@ void createdir(const char *path)
int repstr(char *str, const char *pat, const char *rep)
{
int len = static_cast<int>(strlen(pat));
char buff[1024], *p, *q, *r;
char buff[1024];
char *p;
char *q;
char *r;
for (p = str, r = buff; *p; p = q + len)
{
@ -4045,8 +4178,12 @@ int repstr(char *str, const char *pat, const char *rep)
int reppath(const char *path, char *rpath, gtime_t time, const char *rov,
const char *base)
{
double ep[6], ep0[6] = {2000, 1, 1, 0, 0, 0};
int week, dow, doy, stat = 0;
double ep[6];
double ep0[6] = {2000, 1, 1, 0, 0, 0};
int week;
int dow;
int doy;
int stat = 0;
char rep[64];
strcpy(rpath, path);
@ -4130,8 +4267,11 @@ int reppaths(const char *path, char *rpath[], int nmax, gtime_t ts,
gtime_t te, const char *rov, const char *base)
{
gtime_t time;
double tow, tint = 86400.0;
int i, n = 0, week;
double tow;
double tint = 86400.0;
int i;
int n = 0;
int week;
trace(3, "reppaths: path =%s nmax=%d rov=%s base=%s\n", path, nmax, rov, base);
@ -4180,7 +4320,8 @@ double satwavelen(int sat, int frq, const nav_t *nav)
{
const double freq_glo[] = {FREQ1_GLO, FREQ2_GLO};
const double dfrq_glo[] = {DFRQ1_GLO, DFRQ2_GLO};
int i, sys = satsys(sat, nullptr);
int i;
int sys = satsys(sat, nullptr);
if (sys == SYS_GLO)
{
@ -4290,7 +4431,9 @@ double geodist(const double *rs, const double *rr, double *e)
*-----------------------------------------------------------------------------*/
double satazel(const double *pos, const double *e, double *azel)
{
double az = 0.0, el = PI / 2.0, enu[3];
double az = 0.0;
double el = PI / 2.0;
double enu[3];
if (pos[2] > -RE_WGS84)
{
@ -4322,8 +4465,12 @@ double satazel(const double *pos, const double *e, double *azel)
*-----------------------------------------------------------------------------*/
void dops(int ns, const double *azel, double elmin, double *dop)
{
double H[4 * MAXSAT], Q[16], cosel, sinel;
int i, n;
double H[4 * MAXSAT];
double Q[16];
double cosel;
double sinel;
int i;
int n;
for (i = 0; i < 4; i++)
{
@ -4372,7 +4519,14 @@ double ionmodel(gtime_t t, const double *ion, const double *pos,
const double ion_default[] = {/* 2004/1/1 */
0.1118E-07, -0.7451e-08, -0.5961e-07, 0.1192E-06,
0.1167E+06, -0.2294E+06, -0.1311e+06, 0.1049E+07};
double tt, f, psi, phi, lam, amp, per, x;
double tt;
double f;
double psi;
double phi;
double lam;
double amp;
double per;
double x;
int week;
if (pos[2] < -1e3 || azel[1] <= 0)
@ -4450,7 +4604,11 @@ double ionmapf(const double *pos, const double *azel)
double ionppp(const double *pos, const double *azel, double re,
double hion, double *posp)
{
double cosaz, rp, ap, sinap, tanap;
double cosaz;
double rp;
double ap;
double sinap;
double tanap;
rp = re / (re + hion) * cos(azel[1]);
ap = PI / 2.0 - azel[1] - asin(rp);
@ -4484,7 +4642,13 @@ double tropmodel(gtime_t time __attribute__((unused)), const double *pos, const
double humi)
{
const double temp0 = 15.0; /* temparature at sea level */
double hgt, pres, temp, e, z, trph, trpw;
double hgt;
double pres;
double temp;
double e;
double z;
double trph;
double trpw;
if (pos[2] < -100.0 || 1e4 < pos[2] || azel[1] <= 0)
{
@ -4548,7 +4712,14 @@ double nmf(gtime_t time, const double pos[], const double azel[],
{4.3472961e-2, 4.6729510E-2, 4.3908931e-2, 4.4626982E-2, 5.4736038E-2}};
const double aht[] = {2.53E-5, 5.49E-3, 1.14E-3}; /* height correction */
double y, cosy, ah[3], aw[3], dm, el = azel[1], lat = pos[0] * R2D, hgt = pos[2];
double y;
double cosy;
double ah[3];
double aw[3];
double dm;
double el = azel[1];
double lat = pos[0] * R2D;
double hgt = pos[2];
int i;
if (el <= 0.0)
@ -4660,8 +4831,11 @@ double interpvar(double ang, const double *var)
void antmodel(const pcv_t *pcv, const double *del, const double *azel,
int opt, double *dant)
{
double e[3], off[3], cosel = cos(azel[1]);
int i, j;
double e[3];
double off[3];
double cosel = cos(azel[1]);
int i;
int j;
trace(4, "antmodel: azel=%6.1f %4.1f opt=%d\n", azel[0] * R2D, azel[1] * R2D, opt);
@ -4707,7 +4881,21 @@ void antmodel_s(const pcv_t *pcv, double nadir, double *dant)
void sunmoonpos_eci(gtime_t tut, double *rsun, double *rmoon)
{
const double ep2000[] = {2000, 1, 1, 12, 0, 0};
double t, f[5], eps, Ms, ls, rs, lm, pm, rm, sine, cose, sinp, cosp, sinl, cosl;
double t;
double f[5];
double eps;
double Ms;
double ls;
double rs;
double lm;
double pm;
double rm;
double sine;
double cose;
double sinp;
double cosp;
double sinl;
double cosl;
trace(4, "sunmoonpos_eci: tut=%s\n", time_str(tut, 3));
@ -4771,7 +4959,10 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
double *rmoon, double *gmst)
{
gtime_t tut;
double rs[3], rm[3], U[9], gmst_;
double rs[3];
double rm[3];
double U[9];
double gmst_;
trace(4, "sunmoonpos: tutc=%s\n", time_str(tutc, 3));
@ -4807,8 +4998,14 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
*-----------------------------------------------------------------------------*/
void csmooth(obs_t *obs, int ns)
{
double Ps[2][MAXSAT][NFREQ] = {}, Lp[2][MAXSAT][NFREQ] = {}, dcp;
int i, j, s, r, n[2][MAXSAT][NFREQ] = {};
double Ps[2][MAXSAT][NFREQ] = {};
double Lp[2][MAXSAT][NFREQ] = {};
double dcp;
int i;
int j;
int s;
int r;
int n[2][MAXSAT][NFREQ] = {};
obsd_t *p;
trace(3, "csmooth: nobs=%d,ns=%d\n", obs->n, ns);
@ -4866,7 +5063,12 @@ void csmooth(obs_t *obs, int ns)
int rtk_uncompress(const char *file, char *uncfile)
{
int stat = 0;
char *p, cmd[2048] = "", tmpfile[1024] = "", buff[1024], *fname, *dir = (char *)"";
char *p;
char cmd[2048] = "";
char tmpfile[1024] = "";
char buff[1024];
char *fname;
char *dir = (char *)"";
trace(3, "rtk_uncompress: file=%s\n", file);
@ -5001,12 +5203,19 @@ int rtk_uncompress(const char *file, char *uncfile)
*-----------------------------------------------------------------------------*/
int expath(const char *path, char *paths[], int nmax)
{
int i, j, n = 0;
int i;
int j;
int n = 0;
char tmp[1024] = "";
struct dirent *d;
DIR *dp;
const char *file = path;
char dir[1024] = "", s1[1024], s2[1024], *p, *q, *r;
char dir[1024] = "";
char s1[1024];
char s2[1024];
char *p;
char *q;
char *r;
trace(3, "expath : path=%s nmax=%d\n", path, nmax);
@ -5083,8 +5292,25 @@ int expath(const char *path, char *paths[], int nmax)
/* From RTKLIB 2.4.2 */
void windupcorr(gtime_t time, const double *rs, const double *rr, double *phw)
{
double ek[3], exs[3], eys[3], ezs[3], ess[3], exr[3], eyr[3], eks[3], ekr[3], E[9];
double dr[3], ds[3], drs[3], r[3], pos[3], rsun[3], cosp, ph, erpv[5] = {0};
double ek[3];
double exs[3];
double eys[3];
double ezs[3];
double ess[3];
double exr[3];
double eyr[3];
double eks[3];
double ekr[3];
double E[9];
double dr[3];
double ds[3];
double drs[3];
double r[3];
double pos[3];
double rsun[3];
double cosp;
double ph;
double erpv[5] = {0};
int i;
trace(4, "windupcorr: time=%s\n", time_str(time, 0));

View File

@ -198,8 +198,19 @@ void rtkclosestat(void)
void rtkoutstat(rtk_t *rtk, char *buff __attribute__((unused)))
{
ssat_t *ssat;
double tow, pos[3], vel[3], acc[3], vela[3] = {0}, acca[3] = {0}, xa[3];
int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt);
double tow;
double pos[3];
double vel[3];
double acc[3];
double vela[3] = {0};
double acca[3] = {0};
double xa[3];
int i;
int j;
int week;
int est;
int nfreq;
int nf = NF_RTK(&rtk->opt);
char id[32];
if (statlevel <= 0 || !fp_stat)
@ -363,8 +374,19 @@ void swapsolstat(void)
void outsolstat(rtk_t *rtk)
{
ssat_t *ssat;
double tow, pos[3], vel[3], acc[3], vela[3] = {0}, acca[3] = {0}, xa[3];
int i, j, week, est, nfreq, nf = NF_RTK(&rtk->opt);
double tow;
double pos[3];
double vel[3];
double acc[3];
double vela[3] = {0};
double acca[3] = {0};
double xa[3];
int i;
int j;
int week;
int est;
int nfreq;
int nf = NF_RTK(&rtk->opt);
char id[32];
if (statlevel <= 0 || !fp_stat)
@ -496,7 +518,8 @@ void outsolstat(rtk_t *rtk)
/* save error message --------------------------------------------------------*/
void errmsg(rtk_t *rtk, const char *format, ...)
{
char buff[256], tstr[32];
char buff[256];
char tstr[32];
int n;
va_list ap;
time2str(rtk->sol.time, tstr, 2);
@ -523,14 +546,16 @@ double sdobs(const obsd_t *obs, int i, int j, int f)
/* single-differenced geometry-free linear combination of phase --------------*/
double gfobs_L1L2(const obsd_t *obs, int i, int j, const double *lam)
{
double pi = sdobs(obs, i, j, 0) * lam[0], pj = sdobs(obs, i, j, 1) * lam[1];
double pi = sdobs(obs, i, j, 0) * lam[0];
double pj = sdobs(obs, i, j, 1) * lam[1];
return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj;
}
double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam)
{
double pi = sdobs(obs, i, j, 0) * lam[0], pj = sdobs(obs, i, j, 2) * lam[2];
double pi = sdobs(obs, i, j, 0) * lam[0];
double pj = sdobs(obs, i, j, 2) * lam[2];
return pi == 0.0 || pj == 0.0 ? 0.0 : pi - pj;
}
@ -539,9 +564,14 @@ double gfobs_L1L5(const obsd_t *obs, int i, int j, const double *lam)
double varerr(int sat __attribute((unused)), int sys, double el, double bl, double dt, int f,
const prcopt_t *opt)
{
double a, b, c = opt->err[3] * bl / 1e4, d = SPEED_OF_LIGHT * opt->sclkstab * dt, fact = 1.0;
double a;
double b;
double c = opt->err[3] * bl / 1e4;
double d = SPEED_OF_LIGHT * opt->sclkstab * dt;
double fact = 1.0;
double sinel = sin(el);
int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0), nf = NF_RTK(opt);
int i = sys == SYS_GLO ? 1 : (sys == SYS_GAL ? 2 : 0);
int nf = NF_RTK(opt);
/* extended error model */
if (f >= nf && opt->exterr.ena[0])
@ -610,7 +640,9 @@ void initx_rtk(rtk_t *rtk, double xi, double var, int i)
int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
const prcopt_t *opt, int *sat, int *iu, int *ir)
{
int i, j, k = 0;
int i;
int j;
int k = 0;
trace(3, "selsat : nu=%d nr=%d\n", nu, nr);
@ -639,8 +671,15 @@ int selsat(const obsd_t *obs, const double *azel, int nu, int nr,
/* temporal update of position/velocity/acceleration -------------------------*/
void udpos(rtk_t *rtk, double tt)
{
double *F, *FP, *xp, pos[3], Q[9] = {0}, Qv[9], var = 0.0;
int i, j;
double *F;
double *FP;
double *xp;
double pos[3];
double Q[9] = {0};
double Qv[9];
double var = 0.0;
int i;
int j;
trace(3, "udpos : tt=%.3f\n", tt);
@ -748,8 +787,10 @@ void udpos(rtk_t *rtk, double tt)
/* temporal update of ionospheric parameters ---------------------------------*/
void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns)
{
double el, fact;
int i, j;
double el;
double fact;
int i;
int j;
trace(3, "udion : tt=%.1f bl=%.0f ns=%d\n", tt, bl, ns);
@ -784,7 +825,9 @@ void udion(rtk_t *rtk, double tt, double bl, const int *sat, int ns)
/* temporal update of tropospheric parameters --------------------------------*/
void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused)))
{
int i, j, k;
int i;
int j;
int k;
trace(3, "udtrop : tt=%.1f\n", tt);
@ -823,7 +866,8 @@ void udtrop(rtk_t *rtk, double tt, double bl __attribute((unused)))
/* temporal update of receiver h/w biases ------------------------------------*/
void udrcvbias(rtk_t *rtk, double tt)
{
int i, j;
int i;
int j;
trace(3, "udrcvbias: tt=%.1f\n", tt);
@ -851,8 +895,10 @@ void udrcvbias(rtk_t *rtk, double tt)
/* detect cycle slip by LLI --------------------------------------------------*/
void detslp_ll(rtk_t *rtk, const obsd_t *obs, int i, int rcv)
{
unsigned int slip, LLI;
int f, sat = obs[i].sat;
unsigned int slip;
unsigned int LLI;
int f;
int sat = obs[i].sat;
trace(3, "detslp_ll: i=%d rcv=%d\n", i, rcv);
@ -921,7 +967,8 @@ void detslp_gf_L1L2(rtk_t *rtk, const obsd_t *obs, int i, int j,
const nav_t *nav)
{
int sat = obs[i].sat;
double g0, g1;
double g0;
double g1;
trace(3, "detslp_gf_L1L2: i=%d j=%d\n", i, j);
@ -948,7 +995,8 @@ void detslp_gf_L1L5(rtk_t *rtk, const obsd_t *obs, int i, int j,
const nav_t *nav)
{
int sat = obs[i].sat;
double g0, g1;
double g0;
double g1;
trace(3, "detslp_gf_L1L5: i=%d j=%d\n", i, j);
@ -1012,8 +1060,25 @@ void detslp_dop(rtk_t *rtk __attribute__((unused)), const obsd_t *obs __attribut
void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
const int *iu, const int *ir, int ns, const nav_t *nav)
{
double cp, pr, cp1, cp2, pr1, pr2, *bias, offset, lami, lam1, lam2, C1, C2;
int i, j, f, slip, reset, nf = NF_RTK(&rtk->opt);
double cp;
double pr;
double cp1;
double cp2;
double pr1;
double pr2;
double *bias;
double offset;
double lami;
double lam1;
double lam2;
double C1;
double C2;
int i;
int j;
int f;
int slip;
int reset;
int nf = NF_RTK(&rtk->opt);
trace(3, "udbias : tt=%.1f ns=%d\n", tt, ns);
@ -1150,7 +1215,9 @@ void udbias(rtk_t *rtk, double tt, const obsd_t *obs, const int *sat,
void udstate(rtk_t *rtk, const obsd_t *obs, const int *sat,
const int *iu, const int *ir, int ns, const nav_t *nav)
{
double tt = fabs(rtk->tt), bl = 0.0, dr[3];
double tt = fabs(rtk->tt);
double bl = 0.0;
double dr[3];
trace(3, "udstate : ns=%d\n", ns);
@ -1187,8 +1254,13 @@ void zdres_sat(int base, double r, const obsd_t *obs, const nav_t *nav,
const prcopt_t *opt, double *y)
{
const double *lam = nav->lam[obs->sat - 1];
double f1, f2, C1, C2, dant_if;
int i, nf = NF_RTK(opt);
double f1;
double f2;
double C1;
double C2;
double dant_if;
int i;
int nf = NF_RTK(opt);
if (opt->ionoopt == IONOOPT_IFLC)
{ /* iono-free linear combination */
@ -1252,9 +1324,15 @@ int zdres(int base, const obsd_t *obs, int n, const double *rs,
const double *rr, const prcopt_t *opt, int index, double *y,
double *e, double *azel)
{
double r, rr_[3], pos[3], dant[NFREQ] = {0}, disp[3];
double zhd, zazel[] = {0.0, 90.0 * D2R};
int i, nf = NF_RTK(opt);
double r;
double rr_[3];
double pos[3];
double dant[NFREQ] = {0};
double disp[3];
double zhd;
double zazel[] = {0.0, 90.0 * D2R};
int i;
int nf = NF_RTK(opt);
trace(3, "zdres : n=%d\n", n);
@ -1345,7 +1423,10 @@ int validobs(int i, int j, int f, int nf, const double *y)
void ddcov(const int *nb, int n, const double *Ri, const double *Rj,
int nv, double *R)
{
int i, j, k = 0, b;
int i;
int j;
int k = 0;
int b;
trace(3, "ddcov : n=%d\n", n);
@ -1373,7 +1454,10 @@ int constbl(rtk_t *rtk, const double *x, const double *P, double *v,
double *H, double *Ri, double *Rj, int index)
{
const double thres = 0.1; /* threshold for nonliearity (v.2.3.0) */
double xb[3], b[3], bb, var = 0.0;
double xb[3];
double b[3];
double bb;
double var = 0.0;
int i;
trace(3, "constbl : \n");
@ -1430,7 +1514,10 @@ double prectrop(gtime_t time, const double *pos, int r,
const double *azel, const prcopt_t *opt, const double *x,
double *dtdx)
{
double m_w = 0.0, cotz, grad_n, grad_e;
double m_w = 0.0;
double cotz;
double grad_n;
double grad_e;
int i = IT_RTK(r, opt);
/* wet mapping function */
@ -1501,9 +1588,37 @@ int ddres(rtk_t *rtk, const nav_t *nav, double dt, const double *x,
double *H, double *R, int *vflg)
{
prcopt_t *opt = &rtk->opt;
double bl, dr[3], posu[3], posr[3], didxi = 0.0, didxj = 0.0, *im;
double *tropr, *tropu, *dtdxr, *dtdxu, *Ri, *Rj, lami, lamj, fi, fj, df, *Hi = nullptr;
int i, j, k, m, f, ff, nv = 0, nb[NFREQ * 4 * 2 + 2] = {0}, b = 0, sysi, sysj, nf = NF_RTK(opt);
double bl;
double dr[3];
double posu[3];
double posr[3];
double didxi = 0.0;
double didxj = 0.0;
double *im;
double *tropr;
double *tropu;
double *dtdxr;
double *dtdxu;
double *Ri;
double *Rj;
double lami;
double lamj;
double fi;
double fj;
double df;
double *Hi = nullptr;
int i;
int j;
int k;
int m;
int f;
int ff;
int nv = 0;
int nb[NFREQ * 4 * 2 + 2] = {0};
int b = 0;
int sysi;
int sysj;
int nf = NF_RTK(opt);
trace(3, "ddres : dt=%.1f nx=%d ns=%d\n", dt, rtk->nx, ns);
@ -1778,12 +1893,23 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
rtk_t *rtk, double *y)
{
static obsd_t obsb[MAXOBS];
static double yb[MAXOBS * NFREQ * 2], rs[MAXOBS * 6], dts[MAXOBS * 2], var[MAXOBS];
static double e[MAXOBS * 3], azel[MAXOBS * 2];
static int nb = 0, svh[MAXOBS * 2];
static double yb[MAXOBS * NFREQ * 2];
static double rs[MAXOBS * 6];
static double dts[MAXOBS * 2];
static double var[MAXOBS];
static double e[MAXOBS * 3];
static double azel[MAXOBS * 2];
static int nb = 0;
static int svh[MAXOBS * 2];
prcopt_t *opt = &rtk->opt;
double tt = timediff(time, obs[0].time), ttb, *p, *q;
int i, j, k, nf = NF_RTK(opt);
double tt = timediff(time, obs[0].time);
double ttb;
double *p;
double *q;
int i;
int j;
int k;
int nf = NF_RTK(opt);
trace(3, "intpres : n=%d tt=%.1f\n", n, tt);
@ -1840,7 +1966,16 @@ double intpres(gtime_t time, const obsd_t *obs, int n, const nav_t *nav,
/* single to double-difference transformation matrix (D') --------------------*/
int ddmat(rtk_t *rtk, double *D)
{
int i, j, k, m, f, nb = 0, nx = rtk->nx, na = rtk->na, nf = NF_RTK(&rtk->opt), nofix;
int i;
int j;
int k;
int m;
int f;
int nb = 0;
int nx = rtk->nx;
int na = rtk->na;
int nf = NF_RTK(&rtk->opt);
int nofix;
trace(3, "ddmat :\n");
@ -1912,7 +2047,13 @@ int ddmat(rtk_t *rtk, double *D)
/* restore single-differenced ambiguity --------------------------------------*/
void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), double *xa)
{
int i, n, m, f, index[MAXSAT], nv = 0, nf = NF_RTK(&rtk->opt);
int i;
int n;
int m;
int f;
int index[MAXSAT];
int nv = 0;
int nf = NF_RTK(&rtk->opt);
trace(3, "restamb :\n");
@ -1956,8 +2097,18 @@ void restamb(rtk_t *rtk, const double *bias, int nb __attribute((unused)), doubl
/* hold integer ambiguity ----------------------------------------------------*/
void holdamb(rtk_t *rtk, const double *xa)
{
double *v, *H, *R;
int i, n, m, f, info, index[MAXSAT], nb = rtk->nx - rtk->na, nv = 0, nf = NF_RTK(&rtk->opt);
double *v;
double *H;
double *R;
int i;
int n;
int m;
int f;
int info;
int index[MAXSAT];
int nb = rtk->nx - rtk->na;
int nv = 0;
int nf = NF_RTK(&rtk->opt);
trace(3, "holdamb :\n");
@ -2013,8 +2164,23 @@ void holdamb(rtk_t *rtk, const double *xa)
int resamb_LAMBDA(rtk_t *rtk, double *bias, double *xa)
{
prcopt_t *opt = &rtk->opt;
int i, j, ny, nb, info, nx = rtk->nx, na = rtk->na;
double *D, *DP, *y, *Qy, *b, *db, *Qb, *Qab, *QQ, s[2];
int i;
int j;
int ny;
int nb;
int info;
int nx = rtk->nx;
int na = rtk->na;
double *D;
double *DP;
double *y;
double *Qy;
double *b;
double *db;
double *Qb;
double *Qab;
double *QQ;
double s[2];
trace(3, "resamb_LAMBDA : nx=%d\n", nx);
@ -2152,7 +2318,12 @@ int valpos(rtk_t *rtk, const double *v, const double *R, const int *vflg,
double vv = 0.0;
#endif
double fact = thres * thres;
int i, stat = 1, sat1, sat2, type, freq;
int i;
int stat = 1;
int sat1;
int sat2;
int type;
int freq;
char stype;
trace(3, "valpos : nv=%d thres=%.1f\n", nv, thres);
@ -2201,9 +2372,34 @@ int relpos(rtk_t *rtk, const obsd_t *obs, int nu, int nr,
{
prcopt_t *opt = &rtk->opt;
gtime_t time = obs[0].time;
double *rs, *dts, *var, *y, *e, *azel, *v, *H, *R, *xp, *Pp, *xa, *bias, dt;
int i, j, f, n = nu + nr, ns, ny, nv, sat[MAXSAT], iu[MAXSAT], ir[MAXSAT], niter;
int info, vflg[MAXOBS * NFREQ * 2 + 1], svh[MAXOBS * 2];
double *rs;
double *dts;
double *var;
double *y;
double *e;
double *azel;
double *v;
double *H;
double *R;
double *xp;
double *Pp;
double *xa;
double *bias;
double dt;
int i;
int j;
int f;
int n = nu + nr;
int ns;
int ny;
int nv;
int sat[MAXSAT];
int iu[MAXSAT];
int ir[MAXSAT];
int niter;
int info;
int vflg[MAXOBS * NFREQ * 2 + 1];
int svh[MAXOBS * 2];
int stat = rtk->opt.mode <= PMODE_DGPS ? SOLQ_DGPS : SOLQ_FLOAT;
int nf = opt->ionoopt == IONOOPT_IFLC ? 1 : opt->nf;
@ -2593,7 +2789,9 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
prcopt_t *opt = &rtk->opt;
sol_t solb = {{0, 0}, {}, {}, {}, '0', '0', '0', 0.0, 0.0, 0.0};
gtime_t time;
int i, nu, nr;
int i;
int nu;
int nr;
char msg[128] = "";
trace(3, "rtkpos : time=%s n=%d\n", time_str(obs[0].time, 3), n);

View File

@ -89,7 +89,8 @@ void writesol(rtksvr_t *svr, int index)
{
solopt_t solopt = SOLOPT_DEFAULT;
unsigned char buff[1024];
int i, n;
int i;
int n;
tracet(4, "writesol: index=%d\n", index);
@ -128,7 +129,8 @@ void writesol(rtksvr_t *svr, int index)
/* update navigation data ----------------------------------------------------*/
void updatenav(nav_t *nav)
{
int i, j;
int i;
int j;
for (i = 0; i < MAXSAT; i++)
{
for (j = 0; j < NFREQ; j++)
@ -142,7 +144,10 @@ void updatenav(nav_t *nav)
/* update glonass frequency channel number in raw data struct ----------------*/
void updatefcn(rtksvr_t *svr)
{
int i, j, sat, frq;
int i;
int j;
int sat;
int frq;
for (i = 0; i < MAXPRNGLO; i++)
{
@ -178,11 +183,22 @@ void updatefcn(rtksvr_t *svr)
void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat,
sbsmsg_t *sbsmsg, int index, int iobs)
{
eph_t *eph1, *eph2, *eph3;
geph_t *geph1, *geph2, *geph3;
eph_t *eph1;
eph_t *eph2;
eph_t *eph3;
geph_t *geph1;
geph_t *geph2;
geph_t *geph3;
// gtime_t tof;
double pos[3], del[3] = {0}, dr[3];
int i, n = 0, prn, sbssat = svr->rtk.opt.sbassatsel, sys, iode;
double pos[3];
double del[3] = {0};
double dr[3];
int i;
int n = 0;
int prn;
int sbssat = svr->rtk.opt.sbassatsel;
int sys;
int iode;
tracet(4, "updatesvr: ret=%d sat=%2d index=%d\n", ret, sat, index);
@ -383,7 +399,10 @@ int decoderaw(rtksvr_t *svr, int index)
obs_t *obs;
nav_t *nav;
sbsmsg_t *sbsmsg = nullptr;
int i, ret = 0, sat, fobs = 0;
int i;
int ret = 0;
int sat;
int fobs = 0;
tracet(4, "decoderaw: index=%d\n", index);
@ -556,9 +575,16 @@ void *rtksvrthread(void *arg)
obs_t obs;
obsd_t data[MAXOBS * 2];
double tt;
unsigned int tick, ticknmea;
unsigned char *p, *q;
int i, j, n, fobs[3] = {0}, cycle, cputime;
unsigned int tick;
unsigned int ticknmea;
unsigned char *p;
unsigned char *q;
int i;
int j;
int n;
int fobs[3] = {0};
int cycle;
int cputime;
tracet(3, "rtksvrthread:\n");
@ -708,7 +734,8 @@ int rtksvrinit(rtksvr_t *svr)
geph_t geph0 = {0, -1, 0, 0, 0, 0, {0, 0.0}, {0, 0.0}, {0.0}, {0.0}, {0.0},
0.0, 0.0, 0.0};
seph_t seph0 = {0, {0, 0.0}, {0, 0.0}, 0, 0, {0.0}, {0.0}, {0.0}, 0.0, 0.0};
int i, j;
int i;
int j;
tracet(3, "rtksvrinit:\n");
@ -833,7 +860,8 @@ int rtksvrinit(rtksvr_t *svr)
*-----------------------------------------------------------------------------*/
void rtksvrfree(rtksvr_t *svr)
{
int i, j;
int i;
int j;
free(svr->nav.eph);
free(svr->nav.geph);
@ -904,8 +932,11 @@ int rtksvrstart(rtksvr_t *svr, int cycle, int buffsize, int *strs,
const double *nmeapos, prcopt_t *prcopt,
solopt_t *solopt, stream_t *moni)
{
gtime_t time, time0 = {0, 0.0};
int i, j, rw;
gtime_t time;
gtime_t time0 = {0, 0.0};
int i;
int j;
int rw;
tracet(3, "rtksvrstart: cycle=%d buffsize=%d navsel=%d nmeacycle=%d nmeareq=%d\n",
cycle, buffsize, navsel, nmeacycle, nmeareq);
@ -1181,7 +1212,9 @@ void rtksvrclosestr(rtksvr_t *svr, int index)
int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat,
double *az, double *el, int **snr, int *vsat)
{
int i, j, ns;
int i;
int j;
int ns;
tracet(4, "rtksvrostat: rcv=%d\n", rcv);
@ -1228,7 +1261,8 @@ int rtksvrostat(rtksvr_t *svr, int rcv, gtime_t *time, int *sat,
void rtksvrsstat(rtksvr_t *svr, int *sstat, char *msg)
{
int i;
char s[MAXSTRMSG], *p = msg;
char s[MAXSTRMSG];
char *p = msg;
tracet(4, "rtksvrsstat:\n");

View File

@ -110,7 +110,9 @@ double degfcorr(int ai)
/* decode type 1: prn masks --------------------------------------------------*/
int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat)
{
int i, n, sat;
int i;
int n;
int sat;
trace(4, "decode_sbstype1:\n");
@ -164,8 +166,13 @@ int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 2-5,0: fast corrections ---------------------------------------*/
int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat)
{
int i, j, iodf, type, udre;
double prc, dt;
int i;
int j;
int iodf;
int type;
int udre;
double prc;
double dt;
gtime_t t0;
trace(4, "decode_sbstype2:\n");
@ -211,7 +218,9 @@ int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 6: integrity info ---------------------------------------------*/
int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat)
{
int i, iodf[4], udre;
int i;
int iodf[4];
int udre;
trace(4, "decode_sbstype6:\n");
@ -259,7 +268,9 @@ int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat)
int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
{
seph_t seph = {0, {0, 0}, {0, 0}, 0, 0, {}, {}, {}, 0.0, 0.0};
int i, sat, t;
int i;
int sat;
int t;
trace(4, "decode_sbstype9:\n");
@ -313,7 +324,11 @@ int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
{
const sbsigpband_t *p;
int i, j, n, m, band = getbitu(msg->msg, 18, 4);
int i;
int j;
int n;
int m;
int band = getbitu(msg->msg, 18, 4);
trace(4, "decode_sbstype18:\n");
@ -361,7 +376,8 @@ int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
/* decode half long term correction (vel code=0) -----------------------------*/
int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
{
int i, n = getbitu(msg->msg, p, 6);
int i;
int n = getbitu(msg->msg, p, 6);
trace(4, "decode_longcorr0:\n");
@ -389,7 +405,9 @@ int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
/* decode half long term correction (vel code=1) -----------------------------*/
int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
{
int i, n = getbitu(msg->msg, p, 6), t;
int i;
int n = getbitu(msg->msg, p, 6);
int t;
trace(4, "decode_longcorr1:\n");
@ -447,7 +465,11 @@ int decode_longcorrh(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
/* decode type 24: mixed fast/long term correction ---------------------------*/
int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat)
{
int i, j, iodf, blk, udre;
int i;
int j;
int iodf;
int blk;
int udre;
trace(4, "decode_sbstype24:\n");
@ -488,7 +510,12 @@ int decode_sbstype25(const sbsmsg_t *msg, sbssat_t *sbssat)
/* decode type 26: ionospheric deley corrections -----------------------------*/
int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion)
{
int i, j, block, delay, give, band = getbitu(msg->msg, 14, 4);
int i;
int j;
int block;
int delay;
int give;
int band = getbitu(msg->msg, 14, 4);
trace(4, "decode_sbstype26:\n");
@ -533,7 +560,8 @@ int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion)
*-----------------------------------------------------------------------------*/
int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav)
{
int type = getbitu(msg->msg, 8, 6), stat = -1;
int type = getbitu(msg->msg, 8, 6);
int stat = -1;
trace(3, "sbsupdatecorr: type=%d\n", type);
@ -591,10 +619,16 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
sbs_t *sbs)
{
sbsmsg_t *sbs_msgs;
int i, week, prn, ch, msg;
int i;
int week;
int prn;
int ch;
int msg;
unsigned int b;
double tow, ep[6] = {};
char buff[256], *p;
double tow;
double ep[6] = {};
char buff[256];
char *p;
gtime_t time;
FILE *fp;
@ -715,7 +749,8 @@ void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te,
/* compare sbas messages -----------------------------------------------------*/
int cmpmsgs(const void *p1, const void *p2)
{
auto *q1 = (sbsmsg_t *)p1, *q2 = (sbsmsg_t *)p2;
auto *q1 = (sbsmsg_t *)p1;
auto *q2 = (sbsmsg_t *)p2;
return q1->week != q2->week ? q1->week - q2->week : (q1->tow < q2->tow ? -1 : (q1->tow > q2->tow ? 1 : q1->prn - q2->prn));
}
@ -738,8 +773,10 @@ int cmpmsgs(const void *p1, const void *p2)
int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te,
sbs_t *sbs)
{
char *efiles[MAXEXFILE] = {}, *ext;
int i, n;
char *efiles[MAXEXFILE] = {};
char *ext;
int i;
int n;
trace(3, "sbsreadmsgt: file=%s sel=%d\n", file, sel);
@ -787,7 +824,8 @@ int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te,
int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
{
gtime_t ts = {0, 0}, te = {0, 0};
gtime_t ts = {0, 0};
gtime_t te = {0, 0};
trace(3, "sbsreadmsg: file=%s sel=%d\n", file, sel);
@ -803,7 +841,8 @@ int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
*-----------------------------------------------------------------------------*/
void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
{
int i, type = sbsmsg->msg[1] >> 2;
int i;
int type = sbsmsg->msg[1] >> 2;
trace(4, "sbsoutmsg:\n");
@ -820,8 +859,11 @@ void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sbsion_t *ion,
const sbsigp_t **igp, double *x, double *y)
{
int i, latp[2], lonp[4];
double lat = pos[0] * R2D, lon = pos[1] * R2D;
int i;
int latp[2];
int lonp[4];
double lat = pos[0] * R2D;
double lon = pos[1] * R2D;
const sbsigp_t *p;
trace(4, "searchigp: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -928,9 +970,16 @@ void searchigp(gtime_t time __attribute__((unused)), const double *pos, const sb
int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos,
const double *azel, double *delay, double *var)
{
const double re = 6378.1363, hion = 350.0;
int i, err = 0;
double fp, posp[2], x = 0.0, y = 0.0, t, w[4] = {};
const double re = 6378.1363;
const double hion = 350.0;
int i;
int err = 0;
double fp;
double posp[2];
double x = 0.0;
double y = 0.0;
double t;
double w[4] = {};
const sbsigp_t *igp[4] = {}; /* {ws,wn,es,en} */
trace(4, "sbsioncorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D,
@ -1030,7 +1079,8 @@ void getmet(double lat, double *met)
{1015.75, 283.15, 11.66, 5.58E-3, 2.57, -2.25, 11.00, 7.24, 0.32E-3, 0.46},
{1011.75, 272.15, 6.78, 5.39E-3, 1.81, -1.75, 15.00, 5.36, 0.81E-3, 0.74},
{1013.00, 263.65, 4.11, 4.53E-3, 1.55, -0.50, 14.50, 3.39, 0.62E-3, 0.30}};
int i, j;
int i;
int j;
double a;
lat = fabs(lat);
if (lat <= 15.0)
@ -1070,10 +1120,20 @@ void getmet(double lat, double *met)
double sbstropcorr(gtime_t time, const double *pos, const double *azel,
double *var)
{
const double k1 = 77.604, k2 = 382000.0, rd = 287.054, gm = 9.784, g = 9.80665;
static double pos_[3] = {}, zh = 0.0, zw = 0.0;
const double k1 = 77.604;
const double k2 = 382000.0;
const double rd = 287.054;
const double gm = 9.784;
const double g = 9.80665;
static double pos_[3] = {};
static double zh = 0.0;
static double zw = 0.0;
int i;
double c, met[10], sinel = sin(azel[1]), h = pos[2], m;
double c;
double met[10];
double sinel = sin(azel[1]);
double h = pos[2];
double m;
trace(4, "sbstropcorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D,
azel[0] * R2D, azel[1] * R2D);
@ -1216,7 +1276,9 @@ int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat,
int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs,
double *dts, double *var)
{
double drs[3] = {}, dclk = 0.0, prc = 0.0;
double drs[3] = {};
double dclk = 0.0;
double prc = 0.0;
int i;
trace(3, "sbssatcorr : sat=%2d\n", sat);
@ -1256,7 +1318,8 @@ int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs,
int sbsdecodemsg(gtime_t time, int prn, const unsigned int *words,
sbsmsg_t *sbsmsg)
{
int i, j;
int i;
int j;
unsigned char f[29];
double tow;

View File

@ -93,8 +93,10 @@ const char *opt2sep(const solopt_t *opt)
/* separate fields -----------------------------------------------------------*/
int tonum(char *buff, const char *sep, double *v)
{
int n, len = static_cast<int>(strlen(sep));
char *p, *q;
int n;
int len = static_cast<int>(strlen(sep));
char *p;
char *q;
for (p = buff, n = 0; n < MAXFIELD; p = q + len)
{
@ -166,9 +168,20 @@ void covtosol(const double *P, sol_t *sol)
/* decode nmea gprmc: recommended minimum data for gps -----------------------*/
int decode_nmearmc(char **val, int n, sol_t *sol)
{
double tod = 0.0, lat = 0.0, lon = 0.0, vel = 0.0, dir = 0.0, date = 0.0, ang = 0.0, ep[6];
double tod = 0.0;
double lat = 0.0;
double lon = 0.0;
double vel = 0.0;
double dir = 0.0;
double date = 0.0;
double ang = 0.0;
double ep[6];
double pos[3] = {0};
char act = ' ', ns = 'N', ew = 'E', mew = 'E', mode = 'A';
char act = ' ';
char ns = 'N';
char ew = 'E';
char mew = 'E';
char mode = 'A';
int i;
trace(4, "decode_nmearmc: n=%d\n", n);
@ -246,10 +259,22 @@ int decode_nmearmc(char **val, int n, sol_t *sol)
int decode_nmeagga(char **val, int n, sol_t *sol)
{
gtime_t time;
double tod = 0.0, lat = 0.0, lon = 0.0, hdop = 0.0, alt = 0.0, msl = 0.0, ep[6], tt;
double tod = 0.0;
double lat = 0.0;
double lon = 0.0;
double hdop = 0.0;
double alt = 0.0;
double msl = 0.0;
double ep[6];
double tt;
double pos[3] = {0};
char ns = 'N', ew = 'E', ua = ' ', um = ' ';
int i, solq = 0, nrcv = 0;
char ns = 'N';
char ew = 'E';
char ua = ' ';
char um = ' ';
int i;
int solq = 0;
int nrcv = 0;
trace(4, "decode_nmeagga: n=%d\n", n);
@ -342,7 +367,9 @@ int decode_nmeagga(char **val, int n, sol_t *sol)
/* decode nmea ---------------------------------------------------------------*/
int decode_nmea(char *buff, sol_t *sol)
{
char *p, *q, *val[MAXFIELD] = {nullptr};
char *p;
char *q;
char *val[MAXFIELD] = {nullptr};
int n = 0;
trace(4, "decode_nmea: buff=%s\n", buff);
@ -377,8 +404,11 @@ int decode_nmea(char *buff, sol_t *sol)
char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time)
{
double v[MAXFIELD];
char *p, *q, s[64] = " ";
int n, len;
char *p;
char *q;
char s[64] = " ";
int n;
int len;
trace(4, "decode_soltime:\n");
@ -463,8 +493,11 @@ char *decode_soltime(char *buff, const solopt_t *opt, gtime_t *time)
/* decode x/y/z-ecef ---------------------------------------------------------*/
int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol)
{
double val[MAXFIELD], P[9] = {0};
int i = 0, j, n;
double val[MAXFIELD];
double P[9] = {0};
int i = 0;
int j;
int n;
const char *sep = opt2sep(opt);
trace(4, "decode_solxyz:\n");
@ -527,8 +560,12 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol)
/* decode lat/lon/height -----------------------------------------------------*/
int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol)
{
double val[MAXFIELD], pos[3], Q[9] = {0}, P[9];
int i = 0, n;
double val[MAXFIELD];
double pos[3];
double Q[9] = {0};
double P[9];
int i = 0;
int n;
const char *sep = opt2sep(opt);
trace(4, "decode_solllh:\n");
@ -607,8 +644,11 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol)
/* decode e/n/u-baseline -----------------------------------------------------*/
int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol)
{
double val[MAXFIELD], Q[9] = {0};
int i = 0, j, n;
double val[MAXFIELD];
double Q[9] = {0};
int i = 0;
int j;
int n;
const char *sep = opt2sep(opt);
trace(4, "decode_solenu:\n");
@ -672,7 +712,8 @@ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol)
int decode_solgsi(char *buff, const solopt_t *opt __attribute((unused)), sol_t *sol)
{
double val[MAXFIELD];
int i = 0, j;
int i = 0;
int j;
trace(4, "decode_solgsi:\n");
@ -724,8 +765,10 @@ int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol)
/* decode reference position -------------------------------------------------*/
void decode_refpos(char *buff, const solopt_t *opt, double *rb)
{
double val[MAXFIELD], pos[3];
int i, n;
double val[MAXFIELD];
double pos[3];
int i;
int n;
const char *sep = opt2sep(opt);
trace(3, "decode_refpos: buff=%s\n", buff);
@ -955,7 +998,8 @@ int readsoldata(FILE *fp, gtime_t ts, gtime_t te, double tint, int qflag,
/* compare solution data -----------------------------------------------------*/
int cmpsol(const void *p1, const void *p2)
{
auto *q1 = (sol_t *)p1, *q2 = (sol_t *)p2;
auto *q1 = (sol_t *)p1;
auto *q2 = (sol_t *)p2;
double tt = timediff(q1->time, q2->time);
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
}
@ -1183,7 +1227,8 @@ void freesolstatbuf(solstatbuf_t *solstatbuf)
/* compare solution status ---------------------------------------------------*/
int cmpsolstat(const void *p1, const void *p2)
{
auto *q1 = (solstat_t *)p1, *q2 = (solstat_t *)p2;
auto *q1 = (solstat_t *)p1;
auto *q2 = (solstat_t *)p2;
double tt = timediff(q1->time, q2->time);
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
}
@ -1220,9 +1265,25 @@ int sort_solstat(solstatbuf_t *statbuf)
int decode_solstat(char *buff, solstat_t *stat)
{
static const solstat_t stat0 = {{0, 0.0}, '0', '0', 0, 0, 0, 0, '0', '0', 0, 0, 0, 0};
double tow, az, el, resp, resc;
int n, week, sat, frq, vsat, snr, fix, slip, lock, outc, slipc, rejc;
char id[32] = "", *p;
double tow;
double az;
double el;
double resp;
double resc;
int n;
int week;
int sat;
int frq;
int vsat;
int snr;
int fix;
int slip;
int lock;
int outc;
int slipc;
int rejc;
char id[32] = "";
char *p;
trace(4, "decode_solstat: buff=%s\n", buff);
@ -1396,7 +1457,11 @@ int outecef(unsigned char *buff, const char *s, const sol_t *sol,
int outpos(unsigned char *buff, const char *s, const sol_t *sol,
const solopt_t *opt)
{
double pos[3], dms1[3], dms2[3], P[9], Q[9];
double pos[3];
double dms1[3];
double dms2[3];
double P[9];
double Q[9];
const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff);
@ -1433,7 +1498,11 @@ int outpos(unsigned char *buff, const char *s, const sol_t *sol,
int outenu(unsigned char *buff, const char *s, const sol_t *sol,
const double *rb, const solopt_t *opt)
{
double pos[3], rr[3], enu[3], P[9], Q[9];
double pos[3];
double rr[3];
double enu[3];
double P[9];
double Q[9];
int i;
const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff);
@ -1461,8 +1530,18 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol)
{
static double dirp = 0.0;
gtime_t time;
double ep[6], pos[3], enuv[3], dms1[3], dms2[3], vel, dir, amag = 0.0;
char *p = reinterpret_cast<char *>(buff), *q, sum, *emag = (char *)"E";
double ep[6];
double pos[3];
double enuv[3];
double dms1[3];
double dms2[3];
double vel;
double dir;
double amag = 0.0;
char *p = reinterpret_cast<char *>(buff);
char *q;
char sum;
char *emag = (char *)"E";
trace(3, "outnmea_rmc:\n");
@ -1519,9 +1598,16 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol)
int outnmea_gga(unsigned char *buff, const sol_t *sol)
{
gtime_t time;
double h, ep[6], pos[3], dms1[3], dms2[3], dop = 1.0;
double h;
double ep[6];
double pos[3];
double dms1[3];
double dms2[3];
double dop = 1.0;
int solq;
char *p = reinterpret_cast<char *>(buff), *q, sum;
char *p = reinterpret_cast<char *>(buff);
char *q;
char sum;
trace(3, "outnmea_gga:\n");
@ -1574,9 +1660,17 @@ int outnmea_gga(unsigned char *buff, const sol_t *sol)
int outnmea_gsa(unsigned char *buff, const sol_t *sol,
const ssat_t *ssat)
{
double azel[MAXSAT * 2], dop[4];
int i, sat, sys, nsat, prn[MAXSAT];
char *p = reinterpret_cast<char *>(buff), *q, *s, sum;
double azel[MAXSAT * 2];
double dop[4];
int i;
int sat;
int sys;
int nsat;
int prn[MAXSAT];
char *p = reinterpret_cast<char *>(buff);
char *q;
char *s;
char sum;
trace(3, "outnmea_gsa:\n");
@ -1724,9 +1818,22 @@ int outnmea_gsa(unsigned char *buff, const sol_t *sol,
int outnmea_gsv(unsigned char *buff, const sol_t *sol,
const ssat_t *ssat)
{
double az, el, snr;
int i, j, k, n, sat, prn, sys, nmsg, sats[MAXSAT];
char *p = reinterpret_cast<char *>(buff), *q, *s, sum;
double az;
double el;
double snr;
int i;
int j;
int k;
int n;
int sat;
int prn;
int sys;
int nmsg;
int sats[MAXSAT];
char *p = reinterpret_cast<char *>(buff);
char *q;
char *s;
char sum;
trace(3, "outnmea_gsv:\n");
@ -1984,8 +2091,10 @@ int outprcopts(unsigned char *buff, const prcopt_t *opt)
*-----------------------------------------------------------------------------*/
int outsolheads(unsigned char *buff, const solopt_t *opt)
{
const char *s1[] = {"WGS84", "Tokyo"}, *s2[] = {"ellipsoidal", "geodetic"};
const char *s3[] = {"GPST", "UTC ", "JST "}, *sep = opt2sep(opt);
const char *s1[] = {"WGS84", "Tokyo"};
const char *s2[] = {"ellipsoidal", "geodetic"};
const char *s3[] = {"GPST", "UTC ", "JST "};
const char *sep = opt2sep(opt);
char *p = reinterpret_cast<char *>(buff);
int timeu = opt->timeu < 0 ? 0 : (opt->timeu > 20 ? 20 : opt->timeu);
@ -2061,9 +2170,11 @@ int outsolheads(unsigned char *buff, const solopt_t *opt)
int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
const solopt_t *opt)
{
gtime_t time, ts = {0, 0.0};
gtime_t time;
gtime_t ts = {0, 0.0};
double gpst;
int week, timeu;
int week;
int timeu;
const char *sep = opt2sep(opt);
char s[255];
unsigned char *p = buff;

View File

@ -86,8 +86,15 @@ serial_t *openserial(const char *path, int mode, char *msg)
const int br[] = {
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400};
serial_t *serial;
int i, brate = 9600, bsize = 8, stopb = 1;
char *p, parity = 'N', dev[128], port[128], fctr[64] = "";
int i;
int brate = 9600;
int bsize = 8;
int stopb = 1;
char *p;
char parity = 'N';
char dev[128];
char port[128];
char fctr[64] = "";
const speed_t bs[] = {
B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400};
@ -240,7 +247,8 @@ int stateserial(serial_t *serial)
int openfile_(file_t *file, gtime_t time, char *msg)
{
FILE *fp;
char *rw, tagpath[MAXSTRPATH + 4] = "";
char *rw;
char tagpath[MAXSTRPATH + 4] = "";
char tagh[TIMETAGH_LEN + 1] = "";
tracet(3, "openfile_: path=%s time=%s\n", file->path, time_str(time, 0));
@ -362,8 +370,11 @@ void closefile_(file_t *file)
file_t *openfile(const char *path, int mode, char *msg)
{
file_t *file;
gtime_t time, time0 = {0, 0.0};
double speed = 0.0, start = 0.0, swapintv = 0.0;
gtime_t time;
gtime_t time0 = {0, 0.0};
double speed = 0.0;
double start = 0.0;
double swapintv = 0.0;
char *p;
int timetag = 0;
@ -512,7 +523,8 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
{
struct timeval tv = {0, 0};
fd_set rs;
unsigned int t, tick;
unsigned int t;
unsigned int tick;
int nr = 0;
size_t fpos;
@ -612,10 +624,15 @@ int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
int writefile(file_t *file, unsigned char *buff, int n, char *msg)
{
gtime_t wtime;
unsigned int ns, tick = tickget();
int week1, week2;
double tow1, tow2, intv;
size_t fpos, fpos_tmp;
unsigned int ns;
unsigned int tick = tickget();
int week1;
int week2;
double tow1;
double tow2;
double intv;
size_t fpos;
size_t fpos_tmp;
if (!file)
{
@ -697,7 +714,9 @@ void syncfile(file_t *file1, file_t *file2)
void decodetcppath(const char *path, char *addr, char *port, char *user,
char *passwd, char *mntpnt, char *str)
{
char buff[MAXSTRPATH], *p, *q;
char buff[MAXSTRPATH];
char *p;
char *q;
tracet(4, "decodetcpepath: path=%s\n", path);
@ -791,7 +810,8 @@ int errsock(void) { return errno; }
/* set socket option ---------------------------------------------------------*/
int setsock(socket_t sock, char *msg)
{
int bs = buffsize, mode = 1;
int bs = buffsize;
int mode = 1;
struct timeval tv = {0, 0};
tracet(3, "setsock: sock=%d\n", sock);
@ -838,8 +858,10 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len)
int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len)
{
struct timeval tv = {0, 0};
fd_set rs, ws;
int err, flag;
fd_set rs;
fd_set ws;
int err;
int flag;
flag = fcntl(sock, F_GETFL, 0);
if (fcntl(sock, F_SETFL, flag | O_NONBLOCK) == -1)
@ -975,7 +997,8 @@ void discontcp(tcp_t *tcp, int tcon)
/* open tcp server -----------------------------------------------------------*/
tcpsvr_t *opentcpsvr(const char *path, char *msg)
{
tcpsvr_t *tcpsvr, tcpsvr0{};
tcpsvr_t *tcpsvr;
tcpsvr_t tcpsvr0{};
char port[256] = "";
tracet(3, "opentcpsvr: path=%s\n", path);
@ -1023,7 +1046,9 @@ void closetcpsvr(tcpsvr_t *tcpsvr)
void updatetcpsvr(tcpsvr_t *tcpsvr, char *msg)
{
char saddr[256] = "";
int i, j, n = 0;
int i;
int j;
int n = 0;
tracet(3, "updatetcpsvr: state=%d\n", tcpsvr->svr.state);
@ -1084,7 +1109,8 @@ int accsock(tcpsvr_t *tcpsvr, char *msg)
};
socket_t sock;
socklen_t len = sizeof(addr);
int i, err;
int i;
int err;
tracet(3, "accsock: sock=%d\n", tcpsvr->svr.sock);
@ -1152,7 +1178,8 @@ int waittcpsvr(tcpsvr_t *tcpsvr, char *msg)
/* read tcp server -----------------------------------------------------------*/
int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
{
int nr, err;
int nr;
int err;
tracet(4, "readtcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n);
@ -1182,7 +1209,9 @@ int readtcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
/* write tcp server ----------------------------------------------------------*/
int writetcpsvr(tcpsvr_t *tcpsvr, unsigned char *buff, int n, char *msg)
{
int i, ns = 0, err;
int i;
int ns = 0;
int err;
tracet(3, "writetcpsvr: state=%d n=%d\n", tcpsvr->svr.state, n);
@ -1227,7 +1256,8 @@ int statetcpsvr(tcpsvr_t *tcpsvr)
/* connect server ------------------------------------------------------------*/
int consock(tcpcli_t *tcpcli, char *msg)
{
int stat, err;
int stat;
int err;
tracet(3, "consock: sock=%d\n", tcpcli->svr.sock);
@ -1264,7 +1294,8 @@ int consock(tcpcli_t *tcpcli, char *msg)
/* open tcp client -----------------------------------------------------------*/
tcpcli_t *opentcpcli(const char *path, char *msg)
{
tcpcli_t *tcpcli, tcpcli0{};
tcpcli_t *tcpcli;
tcpcli_t tcpcli0{};
char port[256] = "";
tracet(3, "opentcpcli: path=%s\n", path);
@ -1340,7 +1371,8 @@ int waittcpcli(tcpcli_t *tcpcli, char *msg)
/* read tcp client -----------------------------------------------------------*/
int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
{
int nr, err;
int nr;
int err;
tracet(4, "readtcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n);
@ -1369,7 +1401,8 @@ int readtcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
/* write tcp client ----------------------------------------------------------*/
int writetcpcli(tcpcli_t *tcpcli, unsigned char *buff, int n, char *msg)
{
int ns, err;
int ns;
int err;
tracet(3, "writetcpcli: sock=%d state=%d n=%d\n", tcpcli->svr.sock, tcpcli->svr.state, n);
@ -1407,7 +1440,10 @@ int encbase64(char *str, const unsigned char *byte, int n)
{
const char table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i, j, k, b;
int i;
int j;
int k;
int b;
tracet(4, "encbase64: n=%d\n", n);
@ -1436,7 +1472,8 @@ int encbase64(char *str, const unsigned char *byte, int n)
/* send ntrip server request -------------------------------------------------*/
int reqntrip_s(ntrip_t *ntrip, char *msg)
{
char buff[256 + NTRIP_MAXSTR], *p = buff;
char buff[256 + NTRIP_MAXSTR];
char *p = buff;
tracet(3, "reqntrip_s: state=%d\n", ntrip->state);
@ -1460,7 +1497,9 @@ int reqntrip_s(ntrip_t *ntrip, char *msg)
/* send ntrip client request -------------------------------------------------*/
int reqntrip_c(ntrip_t *ntrip, char *msg)
{
char buff[1024], user[512], *p = buff;
char buff[1024];
char user[512];
char *p = buff;
tracet(3, "reqntrip_c: state=%d\n", ntrip->state);
@ -1496,8 +1535,10 @@ int reqntrip_c(ntrip_t *ntrip, char *msg)
/* test ntrip server response ------------------------------------------------*/
int rspntrip_s(ntrip_t *ntrip, char *msg)
{
int i, nb;
char *p, *q;
int i;
int nb;
char *p;
char *q;
tracet(3, "rspntrip_s: state=%d nb=%d\n", ntrip->state, ntrip->nb);
ntrip->buff[ntrip->nb] = '0';
@ -1553,7 +1594,8 @@ int rspntrip_s(ntrip_t *ntrip, char *msg)
int rspntrip_c(ntrip_t *ntrip, char *msg)
{
int i;
char *p, *q;
char *p;
char *q;
tracet(3, "rspntrip_c: state=%d nb=%d\n", ntrip->state, ntrip->nb);
ntrip->buff[ntrip->nb] = '0';
@ -1669,7 +1711,9 @@ ntrip_t *openntrip(const char *path, int type, char *msg)
{
ntrip_t *ntrip;
int i;
char addr[256] = "", port[256] = "", tpath[MAXSTRPATH];
char addr[256] = "";
char port[256] = "";
char tpath[MAXSTRPATH];
tracet(3, "openntrip: path=%s type=%d\n", path, type);
@ -1780,7 +1824,9 @@ int statentrip(ntrip_t *ntrip)
void decodeftppath(const char *path, char *addr, char *file, char *user,
char *passwd, int *topts)
{
char buff[MAXSTRPATH], *p, *q;
char buff[MAXSTRPATH];
char *p;
char *q;
tracet(4, "decodeftpath: path=%s\n", path);
@ -1852,7 +1898,8 @@ gtime_t nextdltime(const int *topts, int stat)
{
gtime_t time;
double tow;
int week, tint;
int week;
int tint;
tracet(3, "nextdltime: topts=%d %d %d %d stat=%d\n", topts[0], topts[1],
topts[2], topts[3], stat);
@ -1882,8 +1929,16 @@ void *ftpthread(void *arg)
auto *ftp = static_cast<ftp_t *>(arg);
FILE *fp;
gtime_t time;
char remote[1024], local[1024], tmpfile[1024], errfile[1024], *p;
char cmd[2048], env[1024] = "", opt[1024], *proxyopt = (char *)"", *proto;
char remote[1024];
char local[1024];
char tmpfile[1024];
char errfile[1024];
char *p;
char cmd[2048];
char env[1024] = "";
char opt[1024];
char *proxyopt = (char *)"";
char *proto;
int ret;
tracet(3, "ftpthread:\n");
@ -2097,7 +2152,8 @@ void closeftp(ftp_t *ftp)
int readftp(ftp_t *ftp, unsigned char *buff, int n, char *msg)
{
gtime_t time;
unsigned char *p, *q;
unsigned char *p;
unsigned char *q;
tracet(4, "readftp: n=%d\n", n);
@ -2339,7 +2395,8 @@ void strclose(stream_t *stream)
*-----------------------------------------------------------------------------*/
void strsync(stream_t *stream1, stream_t *stream2)
{
file_t *file1, *file2;
file_t *file1;
file_t *file2;
if (stream1->type != STR_FILE || stream2->type != STR_FILE)
{
return;
@ -2710,7 +2767,8 @@ void strsendnmea(stream_t *stream, const double *pos)
{
sol_t sol = {{0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, '0', '0', '0', 0, 0, 0};
unsigned char buff[1024];
int i, n;
int i;
int n;
tracet(3, "strsendnmea: pos=%.3f %.3f %.3f\n", pos[0], pos[1], pos[2]);
@ -2729,9 +2787,12 @@ void strsendnmea(stream_t *stream, const double *pos)
int gen_hex(const char *msg, unsigned char *buff)
{
unsigned char *q = buff;
char mbuff[1024] = "", *args[256], *p;
char mbuff[1024] = "";
char *args[256];
char *p;
unsigned int byte;
int i, narg = 0;
int i;
int narg = 0;
trace(4, "gen_hex: msg=%s\n", msg);
@ -2760,9 +2821,13 @@ int gen_hex(const char *msg, unsigned char *buff)
void strsendcmd(stream_t *str, const char *cmd)
{
unsigned char buff[1024];
const char *p = cmd, *q;
char msg[1024], cmdend[] = "\r\n";
int n, m, ms;
const char *p = cmd;
const char *q;
char msg[1024];
char cmdend[] = "\r\n";
int n;
int m;
int ms;
tracet(3, "strsendcmd: cmd=%s\n", cmd);

View File

@ -59,8 +59,23 @@
void tide_pl(const double *eu, const double *rp, double GMp,
const double *pos, double *dr)
{
const double H3 = 0.292, L3 = 0.015;
double r, ep[3], latp, lonp, p, K2, K3, a, H2, L2, dp, du, cosp, sinl, cosl;
const double H3 = 0.292;
const double L3 = 0.015;
double r;
double ep[3];
double latp;
double lonp;
double p;
double K2;
double K3;
double a;
double H2;
double L2;
double dp;
double du;
double cosp;
double sinl;
double cosl;
int i;
trace(4, "tide_pl : pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -112,7 +127,13 @@ void tide_solid(const double *rsun, const double *rmoon,
const double *pos, const double *E, double gmst, int opt,
double *dr)
{
double dr1[3], dr2[3], eu[3], du, dn, sinl, sin2l;
double dr1[3];
double dr2[3];
double eu[3];
double du;
double dn;
double sinl;
double sin2l;
trace(3, "tide_solid: pos=%.3f %.3f opt=%d\n", pos[0] * R2D, pos[1] * R2D, opt);
@ -163,8 +184,17 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu)
{0.03982E-5, 2.0, 0.0, 0.0, 0.00} /* Ssa */
};
const double ep1975[] = {1975, 1, 1, 0, 0, 0};
double ep[6], fday, days, t, t2, t3, a[5], ang, dp[3] = {0};
int i, j;
double ep[6];
double fday;
double days;
double t;
double t2;
double t3;
double a[5];
double ang;
double dp[3] = {0};
int i;
int j;
trace(3, "tide_oload:\n");
@ -208,7 +238,9 @@ void tide_oload(gtime_t tut, const double *odisp, double *denu)
void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar)
{
const double ep2000[] = {2000, 1, 1, 0, 0, 0};
double y, y2, y3;
double y;
double y2;
double y3;
y = timediff(tut, epoch2time(ep2000)) / 86400.0 / 365.25;
@ -231,7 +263,12 @@ void iers_mean_pole(gtime_t tut, double *xp_bar, double *yp_bar)
void tide_pole(gtime_t tut, const double *pos, const double *erpv,
double *denu)
{
double xp_bar, yp_bar, m1, m2, cosl, sinl;
double xp_bar;
double yp_bar;
double m1;
double m2;
double cosl;
double sinl;
trace(3, "tide_pole: pos=%.3f %.3f\n", pos[0] * R2D, pos[1] * R2D);
@ -282,7 +319,14 @@ void tidedisp(gtime_t tutc, const double *rr, int opt, const erp_t *erp,
const double *odisp, double *dr)
{
gtime_t tut;
double pos[2], E[9], drt[3], denu[3], rs[3], rm[3], gmst, erpv[5] = {0};
double pos[2];
double E[9];
double drt[3];
double denu[3];
double rs[3];
double rm[3];
double gmst;
double erpv[5] = {0};
int i;
#ifdef IERS_MODEL
double ep[6], fhr;

View File

@ -48,7 +48,8 @@ DirectResamplerConditioner::DirectResamplerConditioner(
{
std::string default_item_type = "short";
std::string default_dump_file = "./data/signal_conditioner.dat";
double fs_in_deprecated, fs_in;
double fs_in_deprecated;
double fs_in;
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);

View File

@ -43,7 +43,8 @@ MmseResamplerConditioner::MmseResamplerConditioner(
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_conditioner.dat";
double fs_in_deprecated, fs_in;
double fs_in_deprecated;
double fs_in;
fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000.0);
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
sample_freq_in_ = configuration->property(role_ + ".sample_freq_in", 4000000.0);

View File

@ -130,7 +130,8 @@ beidou_b1i_telemetry_decoder_gs::~beidou_b1i_telemetry_decoder_gs()
void beidou_b1i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits, std::array<int32_t, 15> &decbits)
{
int32_t bit, err;
int32_t bit;
int32_t err;
std::array<int32_t, 4> reg{1, 1, 1, 1};
const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2};

View File

@ -131,7 +131,8 @@ beidou_b3i_telemetry_decoder_gs::~beidou_b3i_telemetry_decoder_gs()
void beidou_b3i_telemetry_decoder_gs::decode_bch15_11_01(const int32_t *bits,
std::array<int32_t, 15> &decbits)
{
int32_t bit, err;
int32_t bit;
int32_t err;
std::array<int32_t, 4> reg{1, 1, 1, 1};
const std::array<int32_t, 15> errind{14, 13, 10, 12, 6, 9, 4, 11, 0, 5, 7, 8, 1, 3, 2};

View File

@ -135,7 +135,15 @@ gps_l1_ca_telemetry_decoder_gs::~gps_l1_ca_telemetry_decoder_gs()
bool gps_l1_ca_telemetry_decoder_gs::gps_word_parityCheck(uint32_t gpsword)
{
uint32_t d1, d2, d3, d4, d5, d6, d7, t, parity;
uint32_t d1;
uint32_t d2;
uint32_t d3;
uint32_t d4;
uint32_t d5;
uint32_t d6;
uint32_t d7;
uint32_t t;
uint32_t parity;
// XOR as many bits in parallel as possible. The magic constants pick
// up bits which are to be XOR'ed together to implement the GPS parity
// check algorithm described in IS-GPS-200E. This avoids lengthy shift-

View File

@ -95,7 +95,10 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count,
/* C-language butterfly */
#define BFLY(i) \
{ \
unsigned int metric, m0, m1, decision; \
unsigned int metric; \
unsigned int m0; \
unsigned int m1; \
unsigned int decision; \
metric = (v->poly->c0[i] ^ sym0) + (v->poly->c1[i] ^ sym1); \
m0 = v->old_metrics[i] + metric; \
m1 = v->old_metrics[(i) + 32] + (510 - metric); \
@ -118,7 +121,8 @@ void v27_init(v27_t *v, v27_decision_t *decisions, unsigned int decisions_count,
*/
void v27_update(v27_t *v, const unsigned char *syms, int nbits)
{
unsigned char sym0, sym1;
unsigned char sym0;
unsigned char sym1;
unsigned int *tmp;
int normalize = 0;

View File

@ -164,7 +164,9 @@ void Viterbi_Decoder::init_trellis_state()
int Viterbi_Decoder::do_acs(const double sym[], int nbits)
{
int t, i, state_at_t;
int t;
int i;
int state_at_t;
float metric;
float max_val;
std::vector<float> pm_t_next(d_states);
@ -365,7 +367,8 @@ void Viterbi_Decoder::nsc_transit(int output_p[], int trans_p[], int input, cons
int KK, int nn)
{
int nextstate[1];
int state, states;
int state;
int states;
states = (1U << (KK - 1)); /* The number of states: 2^mm */
/* Determine the output and next state for each possible starting state */
@ -399,7 +402,8 @@ int Viterbi_Decoder::nsc_enc_bit(int state_out_p[], int input, int state_in,
const int g[], int KK, int nn)
{
/* declare variables */
int state, i;
int state;
int i;
int out = 0;
/* create a word made up of state and new input */

View File

@ -1230,7 +1230,11 @@ void dll_pll_veml_tracking::log_data()
// Dump results to file
float prompt_I;
float prompt_Q;
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL;
float tmp_VE;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VL;
float tmp_float;
double tmp_double;
uint64_t tmp_long_int;

View File

@ -991,7 +991,11 @@ void dll_pll_veml_tracking_fpga::log_data()
// Dump results to file
float prompt_I;
float prompt_Q;
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL;
float tmp_VE;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VL;
float tmp_float;
double tmp_double;
uint64_t tmp_long_int;

View File

@ -479,7 +479,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -250,7 +250,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -832,7 +833,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -246,7 +246,8 @@ void glonass_l1_ca_dll_pll_c_aid_tracking_sc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -822,7 +823,9 @@ int glonass_l1_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -207,7 +207,8 @@ void Glonass_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -675,7 +676,9 @@ int Glonass_L1_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_float;
float tmp_VE = 0.0;
float tmp_VL = 0.0;

View File

@ -247,7 +247,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -830,7 +831,9 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_cc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -245,7 +245,8 @@ void glonass_l2_ca_dll_pll_c_aid_tracking_sc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -821,7 +822,9 @@ int glonass_l2_ca_dll_pll_c_aid_tracking_sc::general_work(int noutput_items __at
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -207,7 +207,8 @@ void Glonass_L2_Ca_Dll_Pll_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -675,7 +676,9 @@ int Glonass_L2_Ca_Dll_Pll_Tracking_cc::general_work(int noutput_items __attribut
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_float;
float tmp_VE = 0.0;
float tmp_VL = 0.0;

View File

@ -304,7 +304,8 @@ void Gps_L1_Ca_Kf_Tracking_cc::start_tracking()
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
double corrected_acq_phase_samples, delay_correction_samples;
double corrected_acq_phase_samples;
double delay_correction_samples;
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -853,7 +854,9 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -211,7 +211,8 @@ void Gps_L1_Ca_Tcp_Connector_Tracking_cc::start_tracking()
T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
float N_prn_diff;
N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
float corrected_acq_phase_samples, delay_correction_samples;
float corrected_acq_phase_samples;
float delay_correction_samples;
corrected_acq_phase_samples = std::fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
if (corrected_acq_phase_samples < 0)
{
@ -514,7 +515,9 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attrib
// MULTIPLEXED FILE RECORDING - Record results to file
float prompt_I;
float prompt_Q;
float tmp_E, tmp_P, tmp_L;
float tmp_E;
float tmp_P;
float tmp_L;
float tmp_VE = 0.0;
float tmp_VL = 0.0;
float tmp_float;

View File

@ -127,7 +127,8 @@ Fpga_Multicorrelator_8sc::~Fpga_Multicorrelator_8sc()
uint64_t Fpga_Multicorrelator_8sc::read_sample_counter()
{
uint64_t sample_counter_tmp, sample_counter_msw_tmp;
uint64_t sample_counter_tmp;
uint64_t sample_counter_msw_tmp;
sample_counter_tmp = d_map_base[sample_counter_reg_addr_lsw];
sample_counter_msw_tmp = d_map_base[sample_counter_reg_addr_msw];
sample_counter_msw_tmp = sample_counter_msw_tmp << 32;

View File

@ -64,7 +64,8 @@ double phase_unwrap(double phase_rad)
*/
double fll_four_quadrant_atan(gr_complex prompt_s1, gr_complex prompt_s2, double t1, double t2)
{
double cross, dot;
double cross;
double dot;
dot = prompt_s1.real() * prompt_s2.real() + prompt_s1.imag() * prompt_s2.imag();
cross = prompt_s1.real() * prompt_s2.imag() - prompt_s2.real() * prompt_s1.imag();
return atan2(cross, dot) / (t2 - t1);

View File

@ -194,7 +194,8 @@ int gnss_sdr_fpga_sample_counter::general_work(int noutput_items __attribute__((
{
wait_for_interrupt();
uint64_t sample_counter_tmp, sample_counter_msw_tmp;
uint64_t sample_counter_tmp;
uint64_t sample_counter_msw_tmp;
sample_counter_tmp = map_base[0];
sample_counter_msw_tmp = map_base[1];
sample_counter_msw_tmp = sample_counter_msw_tmp << 32;

View File

@ -50,7 +50,7 @@ ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td
}
rval = NativeEnumerated_decode_uper(opt_codec_ctx, td, constraints,
&vptr, pd);
(void **)&vptr, pd);
if(rval.code == RC_OK)
if(asn_long2INTEGER(st, value))
rval.code = RC_FAIL;

View File

@ -227,7 +227,9 @@ static int
INTEGER__compar_enum2value(const void *kp, const void *am) {
const struct e2v_key *key = (const struct e2v_key *)kp;
const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
const char *ptr, *end, *name;
const char *ptr;
const char *end;
const char *name;
/* Remap the element (sort by different criterion) */
el = key->vemap + key->evmap[el - key->vemap];
@ -763,7 +765,8 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
int
asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
uint8_t *b, *end;
uint8_t *b;
uint8_t *end;
size_t size;
long l;
@ -823,7 +826,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
int
asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
uint8_t *b, *end;
uint8_t *b;
uint8_t *end;
unsigned long l;
size_t size;
@ -880,7 +884,8 @@ asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
int
asn_long2INTEGER(INTEGER_t *st, long value) {
uint8_t *buf, *bp;
uint8_t *buf;
uint8_t *bp;
uint8_t *p;
uint8_t *pstart;
uint8_t *pend1;

View File

@ -141,7 +141,8 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t er;
long native, value;
long native;
long value;
asn_per_constraint_t *ct;
int inext = 0;
asn_INTEGER_enum_map_t key;

View File

@ -121,7 +121,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
rval.consumed += length;
ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
(long)rval.consumed, (long)length, td->name, *native);
(long)rval.consumed, (long)length, td->name, (long)*native);
return rval;
}

View File

@ -242,16 +242,18 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
ber_tlv_tag_t tlv_tag;
ber_tlv_len_t tlv_len;
ber_tlv_tag_t expected_tag;
ssize_t tl, ll, tlvl;
ssize_t tl;
ssize_t ll;
ssize_t tlvl;
/* This one works even if (sel->left == -1) */
ssize_t Left = ((!sel||(size_t)sel->left >= size)
?(ssize_t)size:sel->left);
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
(sel?sel->left:0),
(long)(sel?sel->left:0),
(long)(sel?sel->want_nulls:0),
(sel?sel->got:0)
(long)(sel?sel->got:0)
);
if(sel && sel->left <= 0 && sel->want_nulls == 0) {
if(sel->prev) {
@ -275,7 +277,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
(long)size, (long)Left, sel?"":"!",
(sel?sel->left:0),
(long)(sel?sel->left:0),
(long)(sel?sel->want_nulls:0),
(long)tl);
switch(tl) {
@ -738,7 +740,8 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er;
uint8_t *buf, *end;
uint8_t *buf;
uint8_t *end;
uint8_t *ss; /* Sequence start */
ssize_t encoded_len = 0;
@ -1273,7 +1276,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
int code;
uint32_t value;
switch(bpc) {
case 1: value = *buf; break;
case 1: value = *(const uint8_t *)buf; break;
case 2: value = (buf[0] << 8) | buf[1]; break;
case 4: value = (buf[0] << 24) | (buf[1] << 16)
| (buf[2] << 8) | buf[3]; break;
@ -1300,7 +1303,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
int ch;
uint32_t value;
switch(bpc) {
case 1: value = *buf; break;
case 1: value = *(const uint8_t *)buf; break;
case 2: value = (buf[0] << 8) | buf[1]; break;
case 4: value = (buf[0] << 24) | (buf[1] << 16)
| (buf[2] << 8) | buf[3]; break;

View File

@ -131,7 +131,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx,
case 0: RETURN(RC_WMORE);
}
ASN_DEBUG("Advancing %ld in ANY case",
(tag_len + len_len));
(long)(tag_len + len_len));
ADVANCE(tag_len + len_len);
} else {
assert(tagno < td->tags_count); /* At least one loop */

View File

@ -15,7 +15,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
if(size == 0)
return 0; /* Want more */
oct = *buf;
oct = *(const uint8_t *)buf;
if((oct & 0x80) == 0) {
/*
* Short definite length.

View File

@ -319,7 +319,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) {
asn_TYPE_tag2member_t *best = 0;
asn_TYPE_tag2member_t *t2m_f, *t2m_l;
asn_TYPE_tag2member_t *t2m_f;
asn_TYPE_tag2member_t *t2m_l;
int edx_max = edx + elements[edx].optional;
/*
* Rewind to the first element with that tag,
@ -447,7 +448,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Skip everything until the end of the SEQUENCE.
*/
while(ctx->left) {
ssize_t tl, ll;
ssize_t tl;
ssize_t ll;
tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
switch(tl) {

View File

@ -1,95 +1,93 @@
#include "constraints.h"
#include "asn_internal.h"
#include "constraints.h"
int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key)
{
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
int
asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) {
/* Nothing to check */
return 0;
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
/* Nothing to check */
return 0;
}
int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key)
{
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
int
asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) {
/* Unknown how to check */
return 0;
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
/* Unknown how to check */
return 0;
}
struct errbufDesc
{
asn_TYPE_descriptor_t *failed_type;
const void *failed_struct_ptr;
char *errbuf;
size_t errlen;
struct errbufDesc {
asn_TYPE_descriptor_t *failed_type;
const void *failed_struct_ptr;
char *errbuf;
size_t errlen;
};
static void
_asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...)
{
struct errbufDesc *arg = key;
va_list ap;
ssize_t vlen;
ssize_t maxlen;
_asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) {
struct errbufDesc *arg = key;
va_list ap;
ssize_t vlen;
ssize_t maxlen;
arg->failed_type = td;
arg->failed_struct_ptr = sptr;
arg->failed_type = td;
arg->failed_struct_ptr = sptr;
maxlen = arg->errlen;
if (maxlen <= 0)
return;
maxlen = arg->errlen;
if(maxlen <= 0)
return;
va_start(ap, fmt);
vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
va_end(ap);
if (vlen >= maxlen)
{
arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */
arg->errlen = maxlen - 1; /* Not counting termination */
return;
}
else if (vlen >= 0)
{
arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */
arg->errlen = vlen; /* Not counting termination */
}
else
{
/*
va_start(ap, fmt);
vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
va_end(ap);
if(vlen >= maxlen) {
arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */
arg->errlen = maxlen - 1; /* Not counting termination */
return;
} else if(vlen >= 0) {
arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */
arg->errlen = vlen; /* Not counting termination */
} else {
/*
* The libc on this system is broken.
*/
vlen = sizeof("<broken vsnprintf>") - 1;
maxlen--;
arg->errlen = vlen < maxlen ? vlen : maxlen;
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0;
}
vlen = sizeof("<broken vsnprintf>") - 1;
maxlen--;
arg->errlen = vlen < maxlen ? vlen : maxlen;
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0;
}
return;
}
int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, char *errbuf, size_t *errlen)
{
struct errbufDesc arg;
int ret;
int
asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, char *errbuf, size_t *errlen) {
struct errbufDesc arg;
int ret;
arg.failed_type = 0;
arg.failed_struct_ptr = 0;
arg.errbuf = errbuf;
arg.errlen = errlen ? *errlen : 0;
arg.failed_type = 0;
arg.failed_struct_ptr = 0;
arg.errbuf = errbuf;
arg.errlen = errlen ? *errlen : 0;
ret = type_descriptor->check_constraints(type_descriptor,
struct_ptr, _asn_i_ctfailcb, &arg);
if (ret == -1 && errlen)
*errlen = arg.errlen;
ret = type_descriptor->check_constraints(type_descriptor,
struct_ptr, _asn_i_ctfailcb, &arg);
if(ret == -1 && errlen)
*errlen = arg.errlen;
return ret;
return ret;
}

View File

@ -629,20 +629,20 @@ data_decode_from_file(asn_TYPE_descriptor_t *pduType, FILE *file, const char *na
switch(iform) {
case INP_BER:
rval = ber_decode(opt_codec_ctx, pduType,
&structure, i_bptr, i_size);
(void **)&structure, i_bptr, i_size);
break;
case INP_XER:
rval = xer_decode(opt_codec_ctx, pduType,
&structure, i_bptr, i_size);
(void **)&structure, i_bptr, i_size);
break;
case INP_PER:
if(opt_nopad)
rval = uper_decode(opt_codec_ctx, pduType,
&structure, i_bptr, i_size, 0,
(void **)&structure, i_bptr, i_size, 0,
DynamicBuffer.unbits);
else
rval = uper_decode_complete(opt_codec_ctx, pduType,
&structure, i_bptr, i_size);
(void **)&structure, i_bptr, i_size);
switch(rval.code) {
case RC_OK:
/* Fall through */

View File

@ -321,7 +321,8 @@ static int
uper_ugot_refill(asn_per_data_t *pd)
{
uper_ugot_key *arg = pd->refill_key;
ssize_t next_chunk_bytes, next_chunk_bits;
ssize_t next_chunk_bytes;
ssize_t next_chunk_bits;
ssize_t avail;
asn_per_data_t *oldpd = &arg->oldpd;

View File

@ -46,11 +46,12 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
nleft = pd->nbits - pd->nboff;
if(nbits > nleft) {
int32_t tailv, vhead;
int32_t tailv;
int32_t vhead;
if(!pd->refill || nbits > 31) return -1;
/* Accumulate unused bytes before refill */
ASN_DEBUG("Obtain the rest %d bits (want %d)",
(int)nleft, nbits);
(int)nleft, (int)nbits);
tailv = per_get_few_bits(pd, nleft);
if(tailv < 0) return -1;
/* Refill (replace pd contents with new data) */
@ -105,7 +106,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
accum &= (((uint32_t)1 << nbits) - 1);
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
nbits, (int)nleft,
(int)nbits, (int)nleft,
(int)pd->moved,
(((long)pd->buffer) & 0xf),
(int)pd->nboff, (int)pd->nbits,
@ -429,7 +430,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
(int)bits, (int)bits, buf[0],
(po->buffer - po->tmpspace));
(long)(po->buffer - po->tmpspace));
return 0;
}

View File

@ -139,7 +139,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
* Determine the tag name.
*/
for(end = buf + size; buf < end; buf++, need_tag++) {
int b = *buf, n = *need_tag;
int b = *buf;
int n = *need_tag;
if(b != n) {
if(n == 0) {
switch(b) {

View File

@ -13,7 +13,8 @@ asn_enc_rval_t
xer_encode(asn_TYPE_descriptor_t *td, void *sptr,
enum xer_encoder_flags_e xer_flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er, tmper;
asn_enc_rval_t er;
asn_enc_rval_t tmper;
const char *mname;
size_t mlen;
int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;

View File

@ -50,7 +50,7 @@ ENUMERATED_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td
}
rval = NativeEnumerated_decode_uper(opt_codec_ctx, td, constraints,
&vptr, pd);
(void **)&vptr, pd);
if(rval.code == RC_OK)
if(asn_long2INTEGER(st, value))
rval.code = RC_FAIL;

View File

@ -210,7 +210,8 @@ GeneralizedTime_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
GeneralizedTime_t *st = (GeneralizedTime_t *)sptr;
asn_enc_rval_t erval;
int fv, fd; /* seconds fraction value and number of digits */
int fv;
int fd; /* seconds fraction value and number of digits */
struct tm tm;
time_t tloc;
@ -244,7 +245,8 @@ GeneralizedTime_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
if(flags & XER_F_CANONICAL) {
GeneralizedTime_t *gt;
asn_enc_rval_t rv;
int fv, fd; /* fractional parts */
int fv;
int fd; /* fractional parts */
struct tm tm;
errno = EPERM;
@ -304,7 +306,8 @@ asn_GT2time(const GeneralizedTime_t *st, struct tm *ret_tm, int as_gmt) {
time_t
asn_GT2time_prec(const GeneralizedTime_t *st, int *frac_value, int frac_digits, struct tm *ret_tm, int as_gmt) {
time_t tloc;
int fv, fd = 0;
int fv;
int fd = 0;
if(frac_value)
tloc = asn_GT2time_frac(st, &fv, &fd, ret_tm, as_gmt);

View File

@ -59,7 +59,7 @@ IA5String_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
"%s: value byte %ld out of range: "
"%d > 127 (%s:%d)",
td->name,
((buf - st->buf) + 1),
(long)((buf - st->buf) + 1),
*buf,
__FILE__, __LINE__);
return -1;

View File

@ -227,7 +227,9 @@ static int
INTEGER__compar_enum2value(const void *kp, const void *am) {
const struct e2v_key *key = (const struct e2v_key *)kp;
const asn_INTEGER_enum_map_t *el = (const asn_INTEGER_enum_map_t *)am;
const char *ptr, *end, *name;
const char *ptr;
const char *end;
const char *name;
/* Remap the element (sort by different criterion) */
el = key->vemap + key->evmap[el - key->vemap];
@ -763,7 +765,8 @@ INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
int
asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
uint8_t *b, *end;
uint8_t *b;
uint8_t *end;
size_t size;
long l;
@ -823,7 +826,8 @@ asn_INTEGER2long(const INTEGER_t *iptr, long *lptr) {
int
asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
uint8_t *b, *end;
uint8_t *b;
uint8_t *end;
unsigned long l;
size_t size;
@ -880,7 +884,8 @@ asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
int
asn_long2INTEGER(INTEGER_t *st, long value) {
uint8_t *buf, *bp;
uint8_t *buf;
uint8_t *bp;
uint8_t *p;
uint8_t *pstart;
uint8_t *pend1;

View File

@ -141,7 +141,8 @@ NativeEnumerated_encode_uper(asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t er;
long native, value;
long native;
long value;
asn_per_constraint_t *ct;
int inext = 0;
asn_INTEGER_enum_map_t key;

View File

@ -121,7 +121,7 @@ NativeInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
rval.consumed += length;
ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
(long)rval.consumed, (long)length, td->name, *native);
(long)rval.consumed, (long)length, td->name, (long)*native);
return rval;
}

View File

@ -242,16 +242,18 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
ber_tlv_tag_t tlv_tag;
ber_tlv_len_t tlv_len;
ber_tlv_tag_t expected_tag;
ssize_t tl, ll, tlvl;
ssize_t tl;
ssize_t ll;
ssize_t tlvl;
/* This one works even if (sel->left == -1) */
ssize_t Left = ((!sel||(size_t)sel->left >= size)
?(ssize_t)size:sel->left);
ASN_DEBUG("%p, s->l=%ld, s->wn=%ld, s->g=%ld\n", sel,
(sel?sel->left:0),
(long)(sel?sel->left:0),
(long)(sel?sel->want_nulls:0),
(sel?sel->got:0)
(long)(sel?sel->got:0)
);
if(sel && sel->left <= 0 && sel->want_nulls == 0) {
if(sel->prev) {
@ -275,7 +277,7 @@ OCTET_STRING_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
tl = ber_fetch_tag(buf_ptr, Left, &tlv_tag);
ASN_DEBUG("fetch tag(size=%ld,L=%ld), %sstack, left=%ld, wn=%ld, tl=%ld",
(long)size, (long)Left, sel?"":"!",
(sel?sel->left:0),
(long)(sel?sel->left:0),
(long)(sel?sel->want_nulls:0),
(long)tl);
switch(tl) {
@ -738,7 +740,8 @@ OCTET_STRING_encode_xer_utf8(asn_TYPE_descriptor_t *td, void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er;
uint8_t *buf, *end;
uint8_t *buf;
uint8_t *end;
uint8_t *ss; /* Sequence start */
ssize_t encoded_len = 0;
@ -1273,7 +1276,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
int code;
uint32_t value;
switch(bpc) {
case 1: value = *buf; break;
case 1: value = *(const uint8_t *)buf; break;
case 2: value = (buf[0] << 8) | buf[1]; break;
case 4: value = (buf[0] << 24) | (buf[1] << 16)
| (buf[2] << 8) | buf[3]; break;
@ -1300,7 +1303,7 @@ OCTET_STRING_per_put_characters(asn_per_outp_t *po, const uint8_t *buf,
int ch;
uint32_t value;
switch(bpc) {
case 1: value = *buf; break;
case 1: value = *(const uint8_t *)buf; break;
case 2: value = (buf[0] << 8) | buf[1]; break;
case 4: value = (buf[0] << 24) | (buf[1] << 16)
| (buf[2] << 8) | buf[3]; break;

View File

@ -62,7 +62,7 @@ VisibleString_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
"%s: value byte %ld (%d) "
"not in VisibleString alphabet (%s:%d)",
td->name,
((buf - st->buf) + 1),
(long)((buf - st->buf) + 1),
*buf,
__FILE__, __LINE__);
return -1;

View File

@ -131,7 +131,7 @@ ber_check_tags(asn_codec_ctx_t *opt_codec_ctx,
case 0: RETURN(RC_WMORE);
}
ASN_DEBUG("Advancing %ld in ANY case",
(tag_len + len_len));
(long)(tag_len + len_len));
ADVANCE(tag_len + len_len);
} else {
assert(tagno < td->tags_count); /* At least one loop */

View File

@ -15,7 +15,7 @@ ber_fetch_length(int _is_constructed, const void *bufptr, size_t size,
if(size == 0)
return 0; /* Want more */
oct = *buf;
oct = *(const uint8_t *)buf;
if((oct & 0x80) == 0) {
/*
* Short definite length.

View File

@ -319,7 +319,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
sizeof(specs->tag2el[0]), _t2e_cmp);
if(t2m) {
asn_TYPE_tag2member_t *best = 0;
asn_TYPE_tag2member_t *t2m_f, *t2m_l;
asn_TYPE_tag2member_t *t2m_f;
asn_TYPE_tag2member_t *t2m_l;
int edx_max = edx + elements[edx].optional;
/*
* Rewind to the first element with that tag,
@ -447,7 +448,8 @@ SEQUENCE_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
* Skip everything until the end of the SEQUENCE.
*/
while(ctx->left) {
ssize_t tl, ll;
ssize_t tl;
ssize_t ll;
tl = ber_fetch_tag(ptr, LEFT, &tlv_tag);
switch(tl) {

View File

@ -1,95 +1,93 @@
#include "constraints.h"
#include "asn_internal.h"
#include "constraints.h"
int asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key)
{
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
int
asn_generic_no_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) {
/* Nothing to check */
return 0;
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
/* Nothing to check */
return 0;
}
int asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key)
{
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
int
asn_generic_unknown_constraint(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, asn_app_constraint_failed_f *cb, void *key) {
/* Unknown how to check */
return 0;
(void)type_descriptor; /* Unused argument */
(void)struct_ptr; /* Unused argument */
(void)cb; /* Unused argument */
(void)key; /* Unused argument */
/* Unknown how to check */
return 0;
}
struct errbufDesc
{
asn_TYPE_descriptor_t *failed_type;
const void *failed_struct_ptr;
char *errbuf;
size_t errlen;
struct errbufDesc {
asn_TYPE_descriptor_t *failed_type;
const void *failed_struct_ptr;
char *errbuf;
size_t errlen;
};
static void
_asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...)
{
struct errbufDesc *arg = key;
va_list ap;
ssize_t vlen;
ssize_t maxlen;
_asn_i_ctfailcb(void *key, asn_TYPE_descriptor_t *td, const void *sptr, const char *fmt, ...) {
struct errbufDesc *arg = key;
va_list ap;
ssize_t vlen;
ssize_t maxlen;
arg->failed_type = td;
arg->failed_struct_ptr = sptr;
arg->failed_type = td;
arg->failed_struct_ptr = sptr;
maxlen = arg->errlen;
if (maxlen <= 0)
return;
maxlen = arg->errlen;
if(maxlen <= 0)
return;
va_start(ap, fmt);
vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
va_end(ap);
if (vlen >= maxlen)
{
arg->errbuf[maxlen - 1] = '\0'; /* Ensuring libc correctness */
arg->errlen = maxlen - 1; /* Not counting termination */
return;
}
else if (vlen >= 0)
{
arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */
arg->errlen = vlen; /* Not counting termination */
}
else
{
/*
va_start(ap, fmt);
vlen = vsnprintf(arg->errbuf, maxlen, fmt, ap);
va_end(ap);
if(vlen >= maxlen) {
arg->errbuf[maxlen-1] = '\0'; /* Ensuring libc correctness */
arg->errlen = maxlen - 1; /* Not counting termination */
return;
} else if(vlen >= 0) {
arg->errbuf[vlen] = '\0'; /* Ensuring libc correctness */
arg->errlen = vlen; /* Not counting termination */
} else {
/*
* The libc on this system is broken.
*/
vlen = sizeof("<broken vsnprintf>") - 1;
maxlen--;
arg->errlen = vlen < maxlen ? vlen : maxlen;
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0;
}
vlen = sizeof("<broken vsnprintf>") - 1;
maxlen--;
arg->errlen = vlen < maxlen ? vlen : maxlen;
memcpy(arg->errbuf, "<broken vsnprintf>", arg->errlen);
arg->errbuf[arg->errlen] = 0;
}
return;
}
int asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, char *errbuf, size_t *errlen)
{
struct errbufDesc arg;
int ret;
int
asn_check_constraints(asn_TYPE_descriptor_t *type_descriptor,
const void *struct_ptr, char *errbuf, size_t *errlen) {
struct errbufDesc arg;
int ret;
arg.failed_type = 0;
arg.failed_struct_ptr = 0;
arg.errbuf = errbuf;
arg.errlen = errlen ? *errlen : 0;
arg.failed_type = 0;
arg.failed_struct_ptr = 0;
arg.errbuf = errbuf;
arg.errlen = errlen ? *errlen : 0;
ret = type_descriptor->check_constraints(type_descriptor,
struct_ptr, _asn_i_ctfailcb, &arg);
if (ret == -1 && errlen)
*errlen = arg.errlen;
ret = type_descriptor->check_constraints(type_descriptor,
struct_ptr, _asn_i_ctfailcb, &arg);
if(ret == -1 && errlen)
*errlen = arg.errlen;
return ret;
return ret;
}

View File

@ -321,7 +321,8 @@ static int
uper_ugot_refill(asn_per_data_t *pd)
{
uper_ugot_key *arg = pd->refill_key;
ssize_t next_chunk_bytes, next_chunk_bits;
ssize_t next_chunk_bytes;
ssize_t next_chunk_bits;
ssize_t avail;
asn_per_data_t *oldpd = &arg->oldpd;

View File

@ -46,11 +46,12 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
nleft = pd->nbits - pd->nboff;
if(nbits > nleft) {
int32_t tailv, vhead;
int32_t tailv;
int32_t vhead;
if(!pd->refill || nbits > 31) return -1;
/* Accumulate unused bytes before refill */
ASN_DEBUG("Obtain the rest %d bits (want %d)",
(int)nleft, nbits);
(int)nleft, (int)nbits);
tailv = per_get_few_bits(pd, nleft);
if(tailv < 0) return -1;
/* Refill (replace pd contents with new data) */
@ -105,7 +106,7 @@ per_get_few_bits(asn_per_data_t *pd, int nbits) {
accum &= (((uint32_t)1 << nbits) - 1);
ASN_DEBUG(" [PER got %2d<=%2d bits => span %d %+ld[%d..%d]:%02x (%d) => 0x%x]",
nbits, (int)nleft,
(int)nbits, (int)nleft,
(int)pd->moved,
(((long)pd->buffer) & 0xf),
(int)pd->nboff, (int)pd->nbits,
@ -429,7 +430,7 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
ASN_DEBUG("[PER out %u/%x => %02x buf+%ld]",
(int)bits, (int)bits, buf[0],
(po->buffer - po->tmpspace));
(long)(po->buffer - po->tmpspace));
return 0;
}

View File

@ -139,7 +139,8 @@ xer_check_tag(const void *buf_ptr, int size, const char *need_tag) {
* Determine the tag name.
*/
for(end = buf + size; buf < end; buf++, need_tag++) {
int b = *buf, n = *need_tag;
int b = *buf;
int n = *need_tag;
if(b != n) {
if(n == 0) {
switch(b) {

View File

@ -13,7 +13,8 @@ asn_enc_rval_t
xer_encode(asn_TYPE_descriptor_t *td, void *sptr,
enum xer_encoder_flags_e xer_flags,
asn_app_consume_bytes_f *cb, void *app_key) {
asn_enc_rval_t er, tmper;
asn_enc_rval_t er;
asn_enc_rval_t tmper;
const char *mname;
size_t mlen;
int xcan = (xer_flags & XER_F_CANONICAL) ? 1 : 2;

View File

@ -76,7 +76,7 @@ int EXPORT supl_ulp_encode(supl_ulp_t *pdu)
memset(pdu->buffer, 0, sizeof(pdu->buffer));
pdu_len = (ret.encoded + 7) >> 3;
(pdu->pdu)->length = pdu_len;
((ULP_PDU_t *)pdu->pdu)->length = pdu_len;
ret = uper_encode_to_buffer(&asn_DEF_ULP_PDU, pdu->pdu, pdu->buffer, sizeof(pdu->buffer));
if (ret.encoded > 0)
@ -249,7 +249,7 @@ int EXPORT supl_server_connect(supl_ctx_t *ctx, char *server)
SSLeay_add_ssl_algorithms();
// meth = TLSv1_client_method();
meth = SSLv23_client_method();
meth = (SSL_METHOD *)SSLv23_client_method();
SSL_load_error_strings();
ctx->ssl_ctx = SSL_CTX_new(meth);
if (!ctx->ssl_ctx)
@ -306,7 +306,8 @@ void EXPORT supl_close(supl_ctx_t *ctx)
static int server_connect(char *server)
{
int fd = -1;
struct addrinfo *ailist, *aip;
struct addrinfo *ailist;
struct addrinfo *aip;
struct addrinfo hint;
int err;
@ -677,7 +678,8 @@ int EXPORT supl_collect_rrlp(supl_assist_t *assist, PDU_t *rrlp, struct timeval
loc = &hdr->refLocation->threeDLocation;
if (loc->size == 14 && loc->buf[0] == 0x90)
{
double lat, lon;
double lat;
double lon;
long l;
/* from 3GPP TS 23.032 V4.0.0 (2001-04) */

View File

@ -948,7 +948,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double sat_pos_variance_m2;
eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s,
&sat_pos_variance_m2);
double Az, El, dist_m;
double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -971,7 +973,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
double sat_pos_variance_m2;
eph2pos(gps_gtime, &rtklib_eph, r_sat.data(), &clock_bias_s,
&sat_pos_variance_m2);
double Az, El, dist_m;
double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -995,7 +999,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
aux_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
aux_gtime.sec = 0.0;
alm2pos(aux_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s);
double Az, El, dist_m;
double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx);
@ -1023,7 +1029,9 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
gal_gtime.time = fmod(utc2gpst(gps_gtime).time + 345600, 604800);
gal_gtime.sec = 0.0;
alm2pos(gal_gtime, &rtklib_alm, r_sat.data(), &clock_bias_s);
double Az, El, dist_m;
double Az;
double El;
double dist_m;
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx);

View File

@ -137,7 +137,11 @@ std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine
// }
// str_stream << "--------------------------------------------------------\n";
double longitude_deg, latitude_deg, height_m, ground_speed_kmh, course_over_ground_deg;
double longitude_deg;
double latitude_deg;
double height_m;
double ground_speed_kmh;
double course_over_ground_deg;
time_t UTC_time;
if (PVT_sptr_->get_latest_PVT(&longitude_deg,
&latitude_deg,

View File

@ -114,7 +114,8 @@ void Glonass_Gnav_Ephemeris::glot_to_gpst(double tod_offset, double glot2utc_cor
double tod = 0.0;
double glot2utc = 3 * 3600;
double days = 0.0;
double total_sec = 0.0, sec_of_day = 0.0;
double total_sec = 0.0;
double sec_of_day = 0.0;
int i = 0;
boost::gregorian::date gps_epoch{1980, 1, 6};

View File

@ -144,7 +144,8 @@ int main(int argc, char** argv)
}
}
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now();
int return_code = 0;
try

View File

@ -449,7 +449,8 @@ TEST_F(TtffTest /*unused*/, ColdStart /*unused*/)
// record startup time
std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now();
// start receiver
try
@ -532,7 +533,8 @@ TEST_F(TtffTest /*unused*/, HotStart /*unused*/)
}
// record startup time
std::cout << "Starting measurement " << num_measurements + 1 << " / " << FLAGS_num_measurements << std::endl;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
start = std::chrono::system_clock::now();
// start receiver

View File

@ -260,7 +260,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
{
int fs_in = 4000000;
int nsamples = 4000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
@ -291,7 +292,8 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
TEST_F(GpsL1CaPcpsAcquisitionTest, ValidationOfResults)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0.0);
top_block = gr::make_top_block("Acquisition test");

View File

@ -189,7 +189,8 @@ TEST_F(FirFilterTest, InstantiateCbyteGrComplex)
TEST_F(FirFilterTest, ConnectAndRun)
{
int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test");
@ -220,7 +221,8 @@ TEST_F(FirFilterTest, ConnectAndRun)
TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test");
@ -261,7 +263,8 @@ TEST_F(FirFilterTest, ConnectAndRunGrcomplex)
TEST_F(FirFilterTest, ConnectAndRunCshorts)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test");
@ -305,7 +308,8 @@ TEST_F(FirFilterTest, ConnectAndRunCshorts)
TEST_F(FirFilterTest, ConnectAndRunCbytes)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test");
@ -349,7 +353,8 @@ TEST_F(FirFilterTest, ConnectAndRunCbytes)
TEST_F(FirFilterTest, ConnectAndRunCbyteGrcomplex)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Fir filter test");

View File

@ -105,7 +105,8 @@ TEST_F(NotchFilterLiteTest, InstantiateGrComplexGrComplex)
TEST_F(NotchFilterLiteTest, ConnectAndRun)
{
int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter lite test");
init();
@ -135,7 +136,8 @@ TEST_F(NotchFilterLiteTest, ConnectAndRun)
TEST_F(NotchFilterLiteTest, ConnectAndRunGrcomplex)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter lite test");
init();

View File

@ -105,7 +105,8 @@ TEST_F(NotchFilterTest, InstantiateGrComplexGrComplex)
TEST_F(NotchFilterTest, ConnectAndRun)
{
int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter test");
init();
@ -135,7 +136,8 @@ TEST_F(NotchFilterTest, ConnectAndRun)
TEST_F(NotchFilterTest, ConnectAndRunGrcomplex)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Notch filter test");
init();

View File

@ -104,7 +104,8 @@ TEST_F(PulseBlankingFilterTest, InstantiateGrComplexGrComplex)
TEST_F(PulseBlankingFilterTest, ConnectAndRun)
{
int fs_in = 4000000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Pulse Blanking filter test");
init();
@ -134,7 +135,8 @@ TEST_F(PulseBlankingFilterTest, ConnectAndRun)
TEST_F(PulseBlankingFilterTest, ConnectAndRunGrcomplex)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Pulse Blanking filter test");
init();

View File

@ -67,7 +67,8 @@ void run_correlator_cpu_real_codes(Cpu_Multicorrelator_Real_Codes* correlator,
TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
int max_threads = FLAGS_cpu_multicorrelator_real_codes_max_threads_test;
std::vector<std::thread> thread_pool;

View File

@ -111,7 +111,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
{
int fs_in = 8000000;
int nsamples = 40000000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
init();
queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
@ -154,7 +155,8 @@ TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ConnectAndRun)
TEST_F(GalileoE1DllPllVemlTrackingInternalTest, ValidationOfResults)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
// int num_samples = 40000000; // 4 Msps
// unsigned int skiphead_sps = 24000000; // 4 Msps

View File

@ -454,7 +454,8 @@ TEST_F(GpsL1CADllPllTrackingTestFpga, ValidationOfResultsFpga)
// DO not generate signal raw signal samples and observations RINEX file by default
//generate_signal();
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds(0);
configure_receiver();

View File

@ -327,7 +327,8 @@ double FrontEndCal::estimate_doppler_from_eph(unsigned int PRN, double TOW, doub
if (eph_it != eph_map.end())
{
arma::vec SV_pos_ecef = "0.0 0.0 0.0 0.0";
double obs_time_start, obs_time_stop;
double obs_time_start;
double obs_time_stop;
obs_time_start = TOW - num_secs / 2;
obs_time_stop = TOW + num_secs / 2;
int n_points = round((obs_time_stop - obs_time_start) / step_secs);

View File

@ -406,7 +406,8 @@ int main(int argc, char** argv)
std::thread ch_thread;
// record startup time
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::time_point<std::chrono::system_clock> start;
std::chrono::time_point<std::chrono::system_clock> end;
std::chrono::duration<double> elapsed_seconds{};
start = std::chrono::system_clock::now();
@ -555,7 +556,9 @@ int main(int argc, char** argv)
std::cout << " " << it.first << " " << it.second << " " << doppler_estimated_hz << std::endl;
// 7. Compute front-end IF and sampling frequency estimation
// Compare with the measurements and compute clock drift using FE model
double estimated_fs_Hz, estimated_f_if_Hz, f_osc_err_ppm;
double estimated_fs_Hz;
double estimated_f_if_Hz;
double f_osc_err_ppm;
front_end_cal.GPS_L1_front_end_model_E4000(doppler_estimated_hz, it.second, fs_in_, &estimated_fs_Hz, &estimated_f_if_Hz, &f_osc_err_ppm);
f_if_estimation_Hz_map.insert(std::pair<int, double>(it.first, estimated_f_if_Hz));