1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-06-20 07:24:08 +00:00

Fix more warnings

This commit is contained in:
Carles Fernandez 2017-05-13 12:07:16 +02:00
parent 8f9aba298f
commit 30e634d408
4 changed files with 103 additions and 93 deletions

View File

@ -78,12 +78,6 @@
#define rtk_lock(f) pthread_mutex_lock(f) #define rtk_lock(f) pthread_mutex_lock(f)
#define rtk_unlock(f) pthread_mutex_unlock(f) #define rtk_unlock(f) pthread_mutex_unlock(f)
#define TINTACT 200 /* period for stream active (ms) */
#define SERIBUFFSIZE 4096 /* serial buffer size (bytes) */
#define TIMETAGH_LEN 64 /* time tag file header length */
#define MAXCLI 32 /* max client connection for tcp svr */
#define MAXSTATMSG 32 /* max length of status message */
#define VER_RTKLIB "2.4.2" #define VER_RTKLIB "2.4.2"
#define NTRIP_AGENT "RTKLIB/" VER_RTKLIB #define NTRIP_AGENT "RTKLIB/" VER_RTKLIB
#define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */ #define NTRIP_CLI_PORT 2101 /* default ntrip-client connection port */
@ -98,12 +92,18 @@
#define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */ #define NTRIP_RSP_ERROR "ERROR" /* ntrip response: error */
#define FTP_CMD "wget" /* ftp/http command */ #define FTP_CMD "wget" /* ftp/http command */
#define FTP_TIMEOUT 30 /* ftp/http timeout (s) */
#define MAXRAWLEN 4096 /* max length of receiver raw message */ const int TINTACT = 200; //!< period for stream active (ms)
#define MAXSOLBUF 256 /* max number of solution buffer */ const int SERIBUFFSIZE = 4096; //!< serial buffer size (bytes)
#define MAXSBSMSG 32 /* max number of SBAS msg in RTK server */ const int TIMETAGH_LEN = 64; //!< time tag file header length
#define MAXOBSBUF 128 /* max number of observation data buffer */ const int MAXCLI = 32; //!< max client connection for tcp svr
const int MAXSTATMSG = 32; //!< max length of status message
const int FTP_TIMEOUT = 30; //!< ftp/http timeout (s)
const int MAXRAWLEN = 4096; //!< max length of receiver raw message
const int MAXSOLBUF = 256; //!< max number of solution buffer
const int MAXSBSMSG = 32; //!< max number of SBAS msg in RTK server
const int MAXOBSBUF = 128; //!< max number of observation data buffer
const int FILEPATHSEP = '/'; const int FILEPATHSEP = '/';
const double RE_WGS84 = 6378137.0; //!< earth semimajor axis (WGS84) (m) const double RE_WGS84 = 6378137.0; //!< earth semimajor axis (WGS84) (m)
@ -113,6 +113,7 @@ const double HION = 350000.0; //!< ionosphere height (m)
const double PRN_HWBIAS = 1e-6; //!< process noise of h/w bias (m/MHz/sqrt(s)) const double PRN_HWBIAS = 1e-6; //!< process noise of h/w bias (m/MHz/sqrt(s))
const double INT_SWAP_STAT = 86400.0; //!< swap interval of solution status file (s) const double INT_SWAP_STAT = 86400.0; //!< swap interval of solution status file (s)
const double INT_SWAP_TRAC = 86400.0; //!< swap interval of trace file (s)
const unsigned int POLYCRC32 = 0xEDB88320u; //!< CRC32 polynomial const unsigned int POLYCRC32 = 0xEDB88320u; //!< CRC32 polynomial
const unsigned int POLYCRC24Q = 0x1864CFBu; //!< CRC24Q polynomial const unsigned int POLYCRC24Q = 0x1864CFBu; //!< CRC24Q polynomial
@ -149,11 +150,11 @@ const int TIMES_UTC = 1; //!< time system: utc
const int TIMES_JST = 2; //!< time system: jst const int TIMES_JST = 2; //!< time system: jst
const double ERR_SAAS = 0.3; //!< saastamoinen model error std (m) const double ERR_SAAS = 0.3; //!< saastamoinen model error std (m)
const double ERR_BRDCI = 0.5; //!< broadcast iono model error factor const double ERR_BRDCI = 0.5; //!< broadcast iono model error factor
const double ERR_CBIAS = 0.3; //!< code bias error std (m) const double ERR_CBIAS = 0.3; //!< code bias error std (m)
const double REL_HUMI = 0.7; //!< relative humidity for saastamoinen model const double REL_HUMI = 0.7; //!< relative humidity for saastamoinen model
const double GAP_RESION = 120; //!< default gap to reset ionos parameters (ep) const double GAP_RESION = 120; //!< default gap to reset ionos parameters (ep)
const int MAXFREQ = 7; //!< max NFREQ const int MAXFREQ = 7; //!< max NFREQ
@ -170,16 +171,16 @@ const int MAXPRNGPS = 32; //!< max satellite PRN number of GPS
const int NSATGPS = (MAXPRNGPS - MINPRNGPS + 1); //!< number of GPS satellites const int NSATGPS = (MAXPRNGPS - MINPRNGPS + 1); //!< number of GPS satellites
const int NSYSGPS = 1; const int NSYSGPS = 1;
const int SYS_NONE = 0x00; //!< navigation system: none const int SYS_NONE = 0x00; //!< navigation system: none
const int SYS_GPS = 0x01; //!< navigation system: GPS const int SYS_GPS = 0x01; //!< navigation system: GPS
const int SYS_SBS = 0x02; //!< navigation system: SBAS const int SYS_SBS = 0x02; //!< navigation system: SBAS
const int SYS_GLO = 0x04; //!< navigation system: GLONASS const int SYS_GLO = 0x04; //!< navigation system: GLONASS
const int SYS_GAL = 0x08; //!< navigation system: Galileo const int SYS_GAL = 0x08; //!< navigation system: Galileo
const int SYS_QZS = 0x10; //!< navigation system: QZSS const int SYS_QZS = 0x10; //!< navigation system: QZSS
const int SYS_BDS = 0x20; //!< navigation system: BeiDou const int SYS_BDS = 0x20; //!< navigation system: BeiDou
const int SYS_IRN = 0x40; //!< navigation system: IRNS const int SYS_IRN = 0x40; //!< navigation system: IRNS
const int SYS_LEO = 0x80; //!< navigation system: LEO const int SYS_LEO = 0x80; //!< navigation system: LEO
const int SYS_ALL = 0xFF; //!< navigation system: all const int SYS_ALL = 0xFF; //!< navigation system: all

View File

@ -2951,60 +2951,69 @@ void freenav(nav_t *nav, int opt)
/* debug trace functions -----------------------------------------------------*/ /* debug trace functions -----------------------------------------------------*/
//#ifdef TRACE //#ifdef TRACE
// //
//static FILE *fp_trace=NULL; /* file pointer of trace */ FILE *fp_trace = NULL; /* file pointer of trace */
//static char file_trace[1024]; /* trace file */ char file_trace[1024]; /* trace file */
//static int level_trace=0; /* level of trace */ static int level_trace = 0; /* level of trace */
//static unsigned int tick_trace=0; /* tick time at traceopen (ms) */ unsigned int tick_trace = 0; /* tick time at traceopen (ms) */
//static gtime_t time_trace={0}; /* time at traceopen */ gtime_t time_trace = {0, 0.0}; /* time at traceopen */
//static pthread_mutex_t lock_trace; /* lock for trace */ pthread_mutex_t lock_trace; /* lock for trace */
//
//static void traceswap(void) void traceswap(void)
//{ {
// gtime_t time=utc2gpst(timeget()); gtime_t time = utc2gpst(timeget());
// char path[1024]; char path[1024];
//
// lock(&lock_trace); rtk_lock(&lock_trace);
//
// if ((int)(time2gpst(time ,NULL)/INT_SWAP_TRAC)== if ((int)(time2gpst(time, NULL) / INT_SWAP_TRAC) ==
// (int)(time2gpst(time_trace,NULL)/INT_SWAP_TRAC)) { (int)(time2gpst(time_trace, NULL) / INT_SWAP_TRAC))
// unlock(&lock_trace); {
// return; rtk_unlock(&lock_trace);
// } return;
// time_trace=time; }
// time_trace = time;
// if (!reppath(file_trace,path,time,"","")) {
// unlock(&lock_trace); if (!reppath(file_trace, path, time, "", ""))
// return; {
// } rtk_unlock(&lock_trace);
// if (fp_trace) fclose(fp_trace); return;
// }
// if (!(fp_trace=fopen(path,"w"))) { if (fp_trace) fclose(fp_trace);
// fp_trace=stderr;
// } if (!(fp_trace = fopen(path, "w")))
// unlock(&lock_trace); {
//} fp_trace = stderr;
//extern void traceopen(const char *file) }
//{ rtk_unlock(&lock_trace);
// gtime_t time=utc2gpst(timeget()); }
// char path[1024];
//
// reppath(file,path,time,"",""); void traceopen(const char *file)
// if (!*path||!(fp_trace=fopen(path,"w"))) fp_trace=stderr; {
// strcpy(file_trace,file); gtime_t time = utc2gpst(timeget());
// tick_trace=tickget(); char path[1024];
// time_trace=time;
// initlock(&lock_trace); reppath(file, path, time, "", "");
//} if (!*path || !(fp_trace = fopen(path, "w"))) fp_trace = stderr;
//extern void traceclose(void) strcpy(file_trace, file);
//{ tick_trace = tickget();
// if (fp_trace&&fp_trace!=stderr) fclose(fp_trace); time_trace = time;
// fp_trace=NULL; initlock(&lock_trace);
// file_trace[0]='\0'; }
//}
//extern void tracelevel(int level)
//{ void traceclose(void)
// level_trace=level; {
//} if (fp_trace && fp_trace != stderr) fclose(fp_trace);
fp_trace = NULL;
file_trace[0] = '\0';
}
void tracelevel(int level)
{
level_trace = level;
}
//extern void trace(int level, const char *format, ...) //extern void trace(int level, const char *format, ...)
//{ //{
// va_list ap; // va_list ap;
@ -3020,15 +3029,14 @@ void freenav(nav_t *nav, int opt)
// fflush(fp_trace); // fflush(fp_trace);
//} //}
void tracet(int level __attribute__((unused)), const char *format __attribute__((unused)), ...) void tracet(int level, const char *format, ...)
{ {
// va_list ap; va_list ap;
// if (!fp_trace || level > level_trace) return;
// if (!fp_trace||level>level_trace) return; traceswap();
// traceswap(); fprintf(fp_trace, "%d %9.3f: ", level, (tickget() - tick_trace) /1000.0);
// fprintf(fp_trace,"%d %9.3f: ",level,(tickget()-tick_trace)/1000.0); va_start(ap, format); vfprintf(fp_trace, format, ap); va_end(ap);
// va_start(ap,format); vfprintf(fp_trace,format,ap); va_end(ap); fflush(fp_trace);
// fflush(fp_trace);
} }
void tracemat(int level __attribute__((unused)), const double *A __attribute__((unused)), void tracemat(int level __attribute__((unused)), const double *A __attribute__((unused)),

View File

@ -213,9 +213,10 @@ int savenav(const char *file, const nav_t *nav);
void freeobs(obs_t *obs); void freeobs(obs_t *obs);
void freenav(nav_t *nav, int opt); void freenav(nav_t *nav, int opt);
//void traceopen(const char *file); void traceopen(const char *file);
//void traceclose(void); void traceclose(void);
//void tracelevel(int level); void tracelevel(int level);
void traceswap(void);
void trace (int level, const char *format, ...); void trace (int level, const char *format, ...);
void tracet (int level, const char *format, ...); void tracet (int level, const char *format, ...);
void tracemat(int level, const double *A, int n, int m, int p, int q); void tracemat(int level, const double *A, int n, int m, int p, int q);

View File

@ -759,7 +759,7 @@ void discontcp(tcp_t *tcp, int tcon)
/* open tcp server -----------------------------------------------------------*/ /* open tcp server -----------------------------------------------------------*/
tcpsvr_t *opentcpsvr(const char *path, char *msg) tcpsvr_t *opentcpsvr(const char *path, char *msg)
{ {
tcpsvr_t *tcpsvr, tcpsvr0 = {{0}}; tcpsvr_t *tcpsvr, tcpsvr0; // = {{0}};
char port[256] = ""; char port[256] = "";
tracet(3, "opentcpsvr: path=%s\n", path); tracet(3, "opentcpsvr: path=%s\n", path);
@ -983,7 +983,7 @@ int consock(tcpcli_t *tcpcli, char *msg)
/* open tcp client -----------------------------------------------------------*/ /* open tcp client -----------------------------------------------------------*/
tcpcli_t *opentcpcli(const char *path, char *msg) tcpcli_t *opentcpcli(const char *path, char *msg)
{ {
tcpcli_t *tcpcli, tcpcli0 = {{0}}; tcpcli_t *tcpcli, tcpcli0; // = {{0}};
char port[256] = ""; char port[256] = "";
tracet(3, "opentcpcli: path=%s\n", path); tracet(3, "opentcpcli: path=%s\n", path);