1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00

Remove warnings in gcc

This commit is contained in:
Carles Fernandez 2017-05-13 10:41:35 +02:00
parent 44ba718de4
commit 8f9aba298f
2 changed files with 19 additions and 18 deletions

View File

@ -513,7 +513,7 @@ int decode_solgsi(char *buff, const solopt_t *opt, sol_t *sol)
/* decode solution position --------------------------------------------------*/ /* decode solution position --------------------------------------------------*/
int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol) int decode_solpos(char *buff, const solopt_t *opt, sol_t *sol)
{ {
sol_t sol0 = {{0}}; sol_t sol0 = {{0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, {0,0,0,0,0,0}, '0', '0', '0', 0, 0, 0 };
char *p = buff; char *p = buff;
trace(4,"decode_solpos: buff=%s\n",buff); trace(4,"decode_solpos: buff=%s\n",buff);
@ -678,7 +678,7 @@ void readsolopt(FILE *fp, solopt_t *opt)
int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint, int inputsol(unsigned char data, gtime_t ts, gtime_t te, double tint,
int qflag, const solopt_t *opt, solbuf_t *solbuf) int qflag, const solopt_t *opt, solbuf_t *solbuf)
{ {
sol_t sol = {{0}}; 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 };
int stat; int stat;
trace(4,"inputsol: data=0x%02x\n",data); trace(4,"inputsol: data=0x%02x\n",data);
@ -811,7 +811,7 @@ int readsolt(char *files[], int nfile, gtime_t ts, gtime_t te,
int readsol(char *files[], int nfile, solbuf_t *sol) int readsol(char *files[], int nfile, solbuf_t *sol)
{ {
gtime_t time = {0}; gtime_t time = {0, 0.0};
trace(3,"readsol: nfile=%d\n",nfile); trace(3,"readsol: nfile=%d\n",nfile);
@ -889,7 +889,7 @@ sol_t *getsol(solbuf_t *solbuf, int index)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax) void initsolbuf(solbuf_t *solbuf, int cyclic, int nmax)
{ {
gtime_t time0 = {0}; gtime_t time0 = {0, 0.0};
trace(3,"initsolbuf: cyclic=%d nmax=%d\n",cyclic,nmax); trace(3,"initsolbuf: cyclic=%d nmax=%d\n",cyclic,nmax);
@ -969,7 +969,7 @@ int sort_solstat(solstatbuf_t *statbuf)
/* decode solution status ----------------------------------------------------*/ /* decode solution status ----------------------------------------------------*/
int decode_solstat(char *buff, solstat_t *stat) int decode_solstat(char *buff, solstat_t *stat)
{ {
static const solstat_t stat0 = {{0}}; 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; double tow,az,el,resp,resc;
int n,week,sat,frq,vsat,snr,fix,slip,lock,outc,slipc,rejc; int n,week,sat,frq,vsat,snr,fix,slip,lock,outc,slipc,rejc;
char id[32] = "",*p; char id[32] = "",*p;
@ -1011,6 +1011,7 @@ int decode_solstat(char *buff, solstat_t *stat)
return 1; return 1;
} }
/* add solution status data --------------------------------------------------*/ /* add solution status data --------------------------------------------------*/
void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat) void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat)
{ {
@ -1038,7 +1039,7 @@ void addsolstat(solstatbuf_t *statbuf, const solstat_t *stat)
int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint, int readsolstatdata(FILE *fp, gtime_t ts, gtime_t te, double tint,
solstatbuf_t *statbuf) solstatbuf_t *statbuf)
{ {
solstat_t stat = {{0}}; solstat_t stat = {{0, 0.0}, '0', '0', 0, 0, 0, 0, '0', '0', 0, 0, 0, 0};
char buff[MAXSOLMSG+1]; char buff[MAXSOLMSG+1];
trace(3,"readsolstatdata:\n"); trace(3,"readsolstatdata:\n");
@ -1101,7 +1102,7 @@ int readsolstatt(char *files[], int nfile, gtime_t ts, gtime_t te,
int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf) int readsolstat(char *files[], int nfile, solstatbuf_t *statbuf)
{ {
gtime_t time = {0}; gtime_t time = {0, 0.0};
trace(3,"readsolstat: nfile=%d\n",nfile); trace(3,"readsolstat: nfile=%d\n",nfile);
@ -1622,7 +1623,7 @@ int outsolheads(unsigned char *buff, const solopt_t *opt)
int outsols(unsigned char *buff, const sol_t *sol, const double *rb, int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
const solopt_t *opt) const solopt_t *opt)
{ {
gtime_t time,ts = {0}; gtime_t time,ts = {0, 0.0};
double gpst; double gpst;
int week,timeu; int week,timeu;
const char *sep = opt2sep(opt); const char *sep = opt2sep(opt);
@ -1681,7 +1682,7 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat, int outsolexs(unsigned char *buff, const sol_t *sol, const ssat_t *ssat,
const solopt_t *opt) const solopt_t *opt)
{ {
gtime_t ts = {0}; gtime_t ts = {0, 0.0};
unsigned char *p = buff; unsigned char *p = buff;
trace(3,"outsolexs:\n"); trace(3,"outsolexs:\n");

View File

@ -93,7 +93,7 @@ serial_t *openserial(const char *path, int mode, char *msg)
const speed_t bs[] = { const speed_t bs[] = {
B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400 B300, B600, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200, B230400
}; };
struct termios ios = {0}; struct termios ios;
int rw = 0; int rw = 0;
tracet(3, "openserial: path=%s mode=%d\n", path, mode); tracet(3, "openserial: path=%s mode=%d\n", path, mode);
@ -292,7 +292,7 @@ void closefile_(file_t *file)
file_t *openfile(const char *path, int mode, char *msg) file_t *openfile(const char *path, int mode, char *msg)
{ {
file_t *file; file_t *file;
gtime_t time, time0 = {0}; gtime_t time, time0 = {0, 0.0};
double speed = 0.0, start = 0.0, swapintv = 0.0; double speed = 0.0, start = 0.0, swapintv = 0.0;
char *p; char *p;
int timetag = 0; int timetag = 0;
@ -398,7 +398,7 @@ int statefile(file_t *file)
/* read file -----------------------------------------------------------------*/ /* read file -----------------------------------------------------------------*/
int readfile(file_t *file, unsigned char *buff, int nmax, char *msg) int readfile(file_t *file, unsigned char *buff, int nmax, char *msg)
{ {
struct timeval tv = {0}; struct timeval tv = { 0, 0 };
fd_set rs; fd_set rs;
unsigned int t, tick; unsigned int t, tick;
int nr = 0; int nr = 0;
@ -599,7 +599,7 @@ int errsock(void) {return errno;}
int setsock(socket_t sock, char *msg) int setsock(socket_t sock, char *msg)
{ {
int bs = buffsize, mode = 1; int bs = buffsize, mode = 1;
struct timeval tv = {0}; struct timeval tv = { 0, 0 };
tracet(3, "setsock: sock=%d\n", sock); tracet(3, "setsock: sock=%d\n", sock);
@ -629,7 +629,7 @@ int setsock(socket_t sock, char *msg)
/* non-block accept ----------------------------------------------------------*/ /* non-block accept ----------------------------------------------------------*/
socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len) socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len)
{ {
struct timeval tv = {0}; struct timeval tv = { 0, 0 };
fd_set rs; fd_set rs;
FD_ZERO(&rs); FD_SET(sock, &rs); FD_ZERO(&rs); FD_SET(sock, &rs);
if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0; if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0;
@ -640,7 +640,7 @@ socket_t accept_nb(socket_t sock, struct sockaddr *addr, socklen_t *len)
/* non-block connect ---------------------------------------------------------*/ /* non-block connect ---------------------------------------------------------*/
int connect_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}; struct timeval tv = { 0, 0 };
fd_set rs, ws; fd_set rs, ws;
int err, flag; int err, flag;
@ -660,7 +660,7 @@ int connect_nb(socket_t sock, struct sockaddr *addr, socklen_t len)
/* non-block receive ---------------------------------------------------------*/ /* non-block receive ---------------------------------------------------------*/
int recv_nb(socket_t sock, unsigned char *buff, int n) int recv_nb(socket_t sock, unsigned char *buff, int n)
{ {
struct timeval tv = {0}; struct timeval tv = { 0, 0 };
fd_set rs; fd_set rs;
FD_ZERO(&rs); FD_SET(sock, &rs); FD_ZERO(&rs); FD_SET(sock, &rs);
if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0; if (!select(sock+1, &rs, NULL, NULL, &tv)) return 0;
@ -671,7 +671,7 @@ int recv_nb(socket_t sock, unsigned char *buff, int n)
/* non-block send ------------------------------------------------------------*/ /* non-block send ------------------------------------------------------------*/
int send_nb(socket_t sock, unsigned char *buff, int n) int send_nb(socket_t sock, unsigned char *buff, int n)
{ {
struct timeval tv = {0}; struct timeval tv = { 0, 0 };
fd_set ws; fd_set ws;
FD_ZERO(&ws); FD_SET(sock, &ws); FD_ZERO(&ws); FD_SET(sock, &ws);
if (!select(sock+1, NULL, &ws, NULL, &tv)) return 0; if (!select(sock+1, NULL, &ws, NULL, &tv)) return 0;
@ -2101,7 +2101,7 @@ gtime_t strgettime(stream_t *stream)
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
void strsendnmea(stream_t *stream, const double *pos) void strsendnmea(stream_t *stream, const double *pos)
{ {
sol_t sol = {{0}}; 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]; unsigned char buff[1024];
int i, n; int i, n;