mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-04 09:47:02 +00:00
Remove all c-style casts
This commit is contained in:
parent
db2638ad46
commit
e89a92469b
@ -324,8 +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;
|
||||
auto *q2 = (peph_t *)p2;
|
||||
auto *q1 = static_cast<const peph_t *>(p1);
|
||||
auto *q2 = static_cast<const peph_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -1e-9 ? -1 : (tt > 1e-9 ? 1 : q1->index - q2->index);
|
||||
}
|
||||
|
@ -3085,7 +3085,7 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r,
|
||||
double tt;
|
||||
double wl;
|
||||
unsigned char code[32];
|
||||
char *msm_type = (char *)"";
|
||||
char *msm_type = const_cast<char *>("");
|
||||
char *q = nullptr;
|
||||
int i;
|
||||
int j;
|
||||
|
@ -643,7 +643,7 @@ char *code2obs(unsigned char code, int *freq)
|
||||
}
|
||||
if (code <= CODE_NONE || MAXCODE < code)
|
||||
{
|
||||
return (char *)"";
|
||||
return const_cast<char *>("");
|
||||
}
|
||||
if (freq)
|
||||
{
|
||||
@ -1450,7 +1450,7 @@ void matsprint(const double A[], int n, int m, int p, int q, std::string &buffer
|
||||
char buf_[256];
|
||||
sprintf(buf_, " %*.*f", p, q, A[i + j * n]);
|
||||
std::string s(buf_);
|
||||
buffer = buffer + s;
|
||||
buffer += s;
|
||||
}
|
||||
buffer += '\n';
|
||||
}
|
||||
@ -3320,8 +3320,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;
|
||||
auto *q2 = (eph_t *)p2;
|
||||
auto *q1 = static_cast<const eph_t *>(p1);
|
||||
auto *q2 = static_cast<const 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);
|
||||
}
|
||||
|
||||
@ -3370,8 +3370,8 @@ void uniqeph(nav_t *nav)
|
||||
/* compare glonass ephemeris -------------------------------------------------*/
|
||||
int cmpgeph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = (geph_t *)p1;
|
||||
auto *q2 = (geph_t *)p2;
|
||||
auto *q1 = static_cast<const geph_t *>(p1);
|
||||
auto *q2 = static_cast<const 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);
|
||||
}
|
||||
|
||||
@ -3421,8 +3421,8 @@ void uniqgeph(nav_t *nav)
|
||||
/* compare sbas ephemeris ----------------------------------------------------*/
|
||||
int cmpseph(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = (seph_t *)p1;
|
||||
auto *q2 = (seph_t *)p2;
|
||||
auto *q1 = static_cast<const seph_t *>(p1);
|
||||
auto *q2 = static_cast<const 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);
|
||||
}
|
||||
|
||||
@ -3499,8 +3499,8 @@ void uniqnav(nav_t *nav)
|
||||
/* compare observation data -------------------------------------------------*/
|
||||
int cmpobs(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = (obsd_t *)p1;
|
||||
auto *q2 = (obsd_t *)p2;
|
||||
auto *q1 = static_cast<const obsd_t *>(p1);
|
||||
auto *q2 = static_cast<const obsd_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
if (fabs(tt) > DTTOL)
|
||||
{
|
||||
@ -5087,7 +5087,7 @@ int rtk_uncompress(const char *file, char *uncfile)
|
||||
char tmpfile[1024] = "";
|
||||
char buff[1024];
|
||||
char *fname;
|
||||
char *dir = (char *)"";
|
||||
char *dir = const_cast<char *>("");
|
||||
|
||||
trace(3, "rtk_uncompress: file=%s\n", file);
|
||||
|
||||
|
@ -749,8 +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;
|
||||
auto *q2 = (sbsmsg_t *)p2;
|
||||
auto *q1 = static_cast<const sbsmsg_t *>(p1);
|
||||
auto *q2 = static_cast<const 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));
|
||||
}
|
||||
|
||||
|
@ -1001,8 +1001,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;
|
||||
auto *q2 = (sol_t *)p2;
|
||||
auto *q1 = static_cast<const sol_t *>(p1);
|
||||
auto *q2 = static_cast<const sol_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
|
||||
}
|
||||
@ -1230,8 +1230,8 @@ void freesolstatbuf(solstatbuf_t *solstatbuf)
|
||||
/* compare solution status ---------------------------------------------------*/
|
||||
int cmpsolstat(const void *p1, const void *p2)
|
||||
{
|
||||
auto *q1 = (solstat_t *)p1;
|
||||
auto *q2 = (solstat_t *)p2;
|
||||
auto *q1 = static_cast<const solstat_t *>(p1);
|
||||
auto *q2 = static_cast<const solstat_t *>(p2);
|
||||
double tt = timediff(q1->time, q2->time);
|
||||
return tt < -0.0 ? -1 : (tt > 0.0 ? 1 : 0);
|
||||
}
|
||||
@ -1544,7 +1544,7 @@ int outnmea_rmc(unsigned char *buff, const sol_t *sol)
|
||||
char *p = reinterpret_cast<char *>(buff);
|
||||
char *q;
|
||||
char sum;
|
||||
char *emag = (char *)"E";
|
||||
char *emag = const_cast<char *>("E");
|
||||
|
||||
trace(3, "outnmea_rmc:\n");
|
||||
|
||||
|
@ -274,11 +274,11 @@ int openfile_(file_t *file, gtime_t time, char *msg)
|
||||
}
|
||||
if (file->mode & STR_MODE_R)
|
||||
{
|
||||
rw = (char *)"rb";
|
||||
rw = const_cast<char *>("rb");
|
||||
}
|
||||
else
|
||||
{
|
||||
rw = (char *)"wb";
|
||||
rw = const_cast<char *>("wb");
|
||||
}
|
||||
|
||||
if (!(file->fp = fopen(file->openpath, rw)))
|
||||
@ -1953,7 +1953,7 @@ void *ftpthread(void *arg)
|
||||
char cmd[2048];
|
||||
char env[1024] = "";
|
||||
char opt[1024];
|
||||
char *proxyopt = (char *)"";
|
||||
char *proxyopt = const_cast<char *>("");
|
||||
char *proto;
|
||||
int ret;
|
||||
|
||||
@ -2021,9 +2021,9 @@ void *ftpthread(void *arg)
|
||||
/* proxy settings for wget (ref [2]) */
|
||||
if (*proxyaddr)
|
||||
{
|
||||
proto = ftp->proto ? (char *)"http" : (char *)"ftp";
|
||||
proto = ftp->proto ? const_cast<char *>("http") : const_cast<char *>("ftp");
|
||||
sprintf(env, "set %s_proxy=http://%s & ", proto, proxyaddr);
|
||||
proxyopt = (char *)"--proxy=on ";
|
||||
proxyopt = const_cast<char *>("--proxy=on ");
|
||||
}
|
||||
/* download command (ref [2]) */
|
||||
if (ftp->proto == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user