From 288538a029cd0c3bac44ac82bf76a67e4acca34c Mon Sep 17 00:00:00 2001 From: Philipp Toelke Date: Sat, 17 May 2014 10:10:05 +0200 Subject: [PATCH] fix warnings found by clang --- ftpd.c | 56 ++++++++++++++++++++++++++++---------------------------- vfs.h | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/ftpd.c b/ftpd.c index 66dfc75..fea03cf 100644 --- a/ftpd.c +++ b/ftpd.c @@ -598,7 +598,7 @@ static err_t ftpd_datarecv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t if (err == ERR_OK && p != NULL) { struct pbuf *q; - u16_t tot_len; + u16_t tot_len = 0; for (q = p; q != NULL; q = q->next) { int len; @@ -793,7 +793,7 @@ static void cmd_pwd(const char *arg, struct tcp_pcb *pcb, struct ftpd_msgstate * { char *path; - if (path = vfs_getcwd(fsm->vfs, NULL, 0)) { + if ((path = vfs_getcwd(fsm->vfs, NULL, 0))) { send_msg(pcb, fsm, msg257PWD, path); free(path); } @@ -1118,32 +1118,32 @@ struct ftpd_command { }; static struct ftpd_command ftpd_commands[] = { - "USER", cmd_user, - "PASS", cmd_pass, - "PORT", cmd_port, - "QUIT", cmd_quit, - "CWD", cmd_cwd, - "CDUP", cmd_cdup, - "PWD", cmd_pwd, - "XPWD", cmd_pwd, - "NLST", cmd_nlst, - "LIST", cmd_list, - "RETR", cmd_retr, - "STOR", cmd_stor, - "NOOP", cmd_noop, - "SYST", cmd_syst, - "ABOR", cmd_abrt, - "TYPE", cmd_type, - "MODE", cmd_mode, - "RNFR", cmd_rnfr, - "RNTO", cmd_rnto, - "MKD", cmd_mkd, - "XMKD", cmd_mkd, - "RMD", cmd_rmd, - "XRMD", cmd_rmd, - "DELE", cmd_dele, - //"PASV", cmd_pasv, - NULL + {"USER", cmd_user}, + {"PASS", cmd_pass}, + {"PORT", cmd_port}, + {"QUIT", cmd_quit}, + {"CWD", cmd_cwd}, + {"CDUP", cmd_cdup}, + {"PWD", cmd_pwd}, + {"XPWD", cmd_pwd}, + {"NLST", cmd_nlst}, + {"LIST", cmd_list}, + {"RETR", cmd_retr}, + {"STOR", cmd_stor}, + {"NOOP", cmd_noop}, + {"SYST", cmd_syst}, + {"ABOR", cmd_abrt}, + {"TYPE", cmd_type}, + {"MODE", cmd_mode}, + {"RNFR", cmd_rnfr}, + {"RNTO", cmd_rnto}, + {"MKD", cmd_mkd}, + {"XMKD", cmd_mkd}, + {"RMD", cmd_rmd}, + {"XRMD", cmd_rmd}, + {"DELE", cmd_dele}, + //{"PASV", cmd_pasv}, + {NULL, NULL} }; static void send_msgdata(struct tcp_pcb *pcb, struct ftpd_msgstate *fsm) diff --git a/vfs.h b/vfs.h index c17a654..68f7548 100644 --- a/vfs.h +++ b/vfs.h @@ -41,7 +41,7 @@ typedef struct { typedef DIR vfs_dir_t; typedef FIL vfs_file_t; typedef struct { - int st_size; + long st_size; char st_mode; time_t st_mtime; } vfs_stat_t;