diff options
author | FreeArtMan <dos21h@gmail.com> | 2017-05-20 15:28:07 +0100 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2017-05-20 15:28:07 +0100 |
commit | f5e6f56a82e56cfd72a0e2f1ce9b583398636545 (patch) | |
tree | a8705da438f341dc7a329db964747bf3ad379936 /cmd | |
parent | eca4a1364bc1313fe0c40c07b7776d3fd8a8e6fc (diff) | |
download | agni-f5e6f56a82e56cfd72a0e2f1ce9b583398636545.tar.gz agni-f5e6f56a82e56cfd72a0e2f1ce9b583398636545.zip |
Fixed warnings all over the code
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/cmd_botu.c | 2 | ||||
-rw-r--r-- | cmd/cmd_cmd.c | 6 | ||||
-rw-r--r-- | cmd/cmd_cookie.c | 1 | ||||
-rw-r--r-- | cmd/cmd_date.c | 1 | ||||
-rw-r--r-- | cmd/cmd_fir.c | 18 | ||||
-rw-r--r-- | cmd/cmd_fir1p.c | 2 | ||||
-rw-r--r-- | cmd/cmd_loadavg.c | 1 | ||||
-rw-r--r-- | cmd/cmd_ping.c | 2 | ||||
-rw-r--r-- | cmd/cmd_rand.c | 1 | ||||
-rw-r--r-- | cmd/cmd_rand_libc.c | 3 | ||||
-rw-r--r-- | cmd/cmd_sha1.c | 2 | ||||
-rw-r--r-- | cmd/cmd_uptime.c | 5 | ||||
-rw-r--r-- | cmd/cmd_version.c | 3 |
13 files changed, 19 insertions, 28 deletions
diff --git a/cmd/cmd_botu.c b/cmd/cmd_botu.c index f284ba9..d5a9e4e 100644 --- a/cmd/cmd_botu.c +++ b/cmd/cmd_botu.c @@ -35,7 +35,7 @@ void *cmd_botu(void *data) proc_sec = start.tv_sec - file_stat.st_ctim.tv_sec; - snprintf(buf, buf_size, "%llud %lluh %llum %llus\n", + snprintf(buf, buf_size, "%lud %luh %lum %lus\n", (proc_sec/(3600*24)), (proc_sec/(3600))%24, (proc_sec/60)%60, diff --git a/cmd/cmd_cmd.c b/cmd/cmd_cmd.c index e893687..0eabfe1 100644 --- a/cmd/cmd_cmd.c +++ b/cmd/cmd_cmd.c @@ -2,17 +2,15 @@ void *cmd_cmd(void *data) { + char *param = (char *)data; char *ret = NULL; - int fret=-1; const int buf_size = 128; char buf[buf_size+1]; printf("CMD\n"); - snprintf(buf, buf_size, "%s\n", data); - - + snprintf(buf, buf_size, "%s\n", param); ret = alloc_new_str(buf); diff --git a/cmd/cmd_cookie.c b/cmd/cmd_cookie.c index 8071e10..0c9c5dd 100644 --- a/cmd/cmd_cookie.c +++ b/cmd/cmd_cookie.c @@ -2,7 +2,6 @@ void *cmd_cookie(void *data) { - char *param = (char *)data; char *ret = NULL; const int buf_size = 128; diff --git a/cmd/cmd_date.c b/cmd/cmd_date.c index ac44bd5..3ccb75a 100644 --- a/cmd/cmd_date.c +++ b/cmd/cmd_date.c @@ -2,7 +2,6 @@ void *cmd_date(void *data) { - char *param = (char *)data; char *ret = NULL; printf("DATE\n"); diff --git a/cmd/cmd_fir.c b/cmd/cmd_fir.c index 95e0b53..33bb949 100644 --- a/cmd/cmd_fir.c +++ b/cmd/cmd_fir.c @@ -415,21 +415,21 @@ void filter_calc(filter_t *filt, double *hc, int hc_sz) void *cmd_fir(void *data) { char *ret = NULL; - int i=0,j=0; + int i=0; int count; sds params; sds out_result; sds *tokens; - double arg_fs; - int arg_ftype; - double arg_fc1; - double arg_fc2; - double arg_beta; - int arg_wtype; - int arg_n; - double *lp_coef; + double arg_fs=0.0; + int arg_ftype=0; + double arg_fc1=0.0; + double arg_fc2=0.0; + double arg_beta=0.0; + int arg_wtype=0; + int arg_n=0; + double *lp_coef=NULL; filter_t filt; printf("FIR\n"); diff --git a/cmd/cmd_fir1p.c b/cmd/cmd_fir1p.c index b011719..716d432 100644 --- a/cmd/cmd_fir1p.c +++ b/cmd/cmd_fir1p.c @@ -46,7 +46,7 @@ int fir1filter(double *coeffs, double *input, double *output, void *cmd_fir1p(void *data) { char *ret = NULL; - int i=0,j=0; + int i=0; if (data == NULL) { diff --git a/cmd/cmd_loadavg.c b/cmd/cmd_loadavg.c index a9a4b28..330376e 100644 --- a/cmd/cmd_loadavg.c +++ b/cmd/cmd_loadavg.c @@ -2,7 +2,6 @@ void *cmd_loadavg(void *data) { - char *param = (char *)data; char *ret = NULL; int fret=-1; diff --git a/cmd/cmd_ping.c b/cmd/cmd_ping.c index a8e3c59..c26c234 100644 --- a/cmd/cmd_ping.c +++ b/cmd/cmd_ping.c @@ -2,7 +2,7 @@ void *cmd_ping(void *data) { - char *param = (char *)data; + //char *param = (char *)data; char *ret = NULL; printf("PONG\n"); diff --git a/cmd/cmd_rand.c b/cmd/cmd_rand.c index 58f2efe..d5f90e1 100644 --- a/cmd/cmd_rand.c +++ b/cmd/cmd_rand.c @@ -4,7 +4,6 @@ void *cmd_rand(void *data) { char *ret = NULL; - int fret=-1; const int buf_size = 128; char buf[buf_size+1]; diff --git a/cmd/cmd_rand_libc.c b/cmd/cmd_rand_libc.c index d72bc45..1860a77 100644 --- a/cmd/cmd_rand_libc.c +++ b/cmd/cmd_rand_libc.c @@ -4,7 +4,6 @@ void *cmd_rand_libc(void *data) { char *ret = NULL; - int fret=-1; const int buf_size = 128; char buf[buf_size+1]; @@ -25,7 +24,7 @@ void *cmd_rand_libc(void *data) } else { //cut output to 512 char str_integer[16]; - int rand_state; + unsigned int rand_state; params = sdsnew(data); out_result = sdsempty(); diff --git a/cmd/cmd_sha1.c b/cmd/cmd_sha1.c index 4472ed1..d7d06d5 100644 --- a/cmd/cmd_sha1.c +++ b/cmd/cmd_sha1.c @@ -4,8 +4,6 @@ void *cmd_sha1(void *data) { char *param = (char *)data; char *ret = NULL; - int fret=-1; - int i; char hash_result[21]; diff --git a/cmd/cmd_uptime.c b/cmd/cmd_uptime.c index 6a9c963..4f0a4f3 100644 --- a/cmd/cmd_uptime.c +++ b/cmd/cmd_uptime.c @@ -5,7 +5,7 @@ void *cmd_uptime(void *data) { - char *param = (char *)data; + //char *param = (char *)data; char *ret = NULL; const int buf_size = 128; @@ -15,7 +15,7 @@ void *cmd_uptime(void *data) FILE *f=NULL; double d1,d2; - int i1,i2; + int i1; f = fopen(PROCFS_UPTIME_PATH,"r"); fscanf(f,"%lf %lf", &d1, &d2); @@ -23,7 +23,6 @@ void *cmd_uptime(void *data) printf("Readed %lf %lf\n", d1, d2); i1 = d1; - i2 = d2; printf("Days %d Hours %d Minutes %d\n",i1/(3600*24),i1/(3600)%24, (i1/60)%60); snprintf(buf, buf_size,"%dd %dh %dm\n",i1/(3600*24),i1/(3600)%24, (i1/60)%60); diff --git a/cmd/cmd_version.c b/cmd/cmd_version.c index d919c60..e2e74c4 100644 --- a/cmd/cmd_version.c +++ b/cmd/cmd_version.c @@ -2,7 +2,6 @@ void *cmd_version(void *data) { - char *param = (char *)data; char *ret = NULL; const int buf_size = 128; @@ -13,4 +12,6 @@ void *cmd_version(void *data) snprintf(buf, buf_size, "VERSION:0.0.3" " DATE:" VERSION_DATE " COMMIT:" VERSION_COMMIT "\n"); ret = alloc_new_str(buf); + + return ret; }
\ No newline at end of file |