Browse Source

fixed warnings cause by common compiler options

ftpd.c (trim trailing spaces)
vfs.c (added suggested parentheses)
fixed prototype of main() function
pull/27/head
Vitus Birkmeir 3 years ago
parent
commit
eec613a9f3
  1. 6
      ftpd.c
  2. 2
      test-in-docker/src/main.c
  3. 2
      vfs.c

6
ftpd.c

@ -976,12 +976,12 @@ static void cmd_abrt(const char *arg, struct tcp_pcb *pcb, struct ftpd_msgstate
static void cmd_type(const char *arg, struct tcp_pcb *pcb, struct ftpd_msgstate *fsm) static void cmd_type(const char *arg, struct tcp_pcb *pcb, struct ftpd_msgstate *fsm)
{ {
LWIP_DEBUGF(FTPD_DEBUG, ("Got TYPE -%s-\n", arg)); LWIP_DEBUGF(FTPD_DEBUG, ("Got TYPE -%s-\n", arg));
if(strcmp(arg, "I") != 0) { if(strcmp(arg, "I") != 0) {
send_msg(pcb, fsm, msg502); send_msg(pcb, fsm, msg502);
return; return;
} }
send_msg(pcb, fsm, msg200); send_msg(pcb, fsm, msg200);
} }
@ -1241,7 +1241,7 @@ static err_t ftpd_msgsent(void *arg, struct tcp_pcb *pcb, u16_t len)
ftpd_msgclose(pcb, fsm); ftpd_msgclose(pcb, fsm);
return ERR_OK; return ERR_OK;
} }
if (pcb->state <= ESTABLISHED) send_msgdata(pcb, fsm); if (pcb->state <= ESTABLISHED) send_msgdata(pcb, fsm);
return ERR_OK; return ERR_OK;
} }

2
test-in-docker/src/main.c

@ -120,7 +120,7 @@ static err_t init_callback(struct netif* netif) {
return ERR_OK; return ERR_OK;
} }
int main(size_t argc, char **argv) { int main(int argc, char **argv) {
pcap_t *pcap = pcap_open_live("eth0", 65536, 1, 100, NULL); pcap_t *pcap = pcap_open_live("eth0", 65536, 1, 100, NULL);
char errbuf[PCAP_ERRBUF_SIZE]; char errbuf[PCAP_ERRBUF_SIZE];
int r = pcap_setnonblock(pcap, 1, errbuf); int r = pcap_setnonblock(pcap, 1, errbuf);

2
vfs.c

@ -74,7 +74,7 @@ int vfs_stat(vfs_t* vfs, const char* filename, vfs_stat_t* st) {
.tm_hour = (f.ftime >> 11) & 0x1f, .tm_hour = (f.ftime >> 11) & 0x1f,
.tm_mday = f.fdate & 0x1f, .tm_mday = f.fdate & 0x1f,
.tm_mon = (f.fdate >> 5) & 0xf, .tm_mon = (f.fdate >> 5) & 0xf,
.tm_year = 80 + (f.fdate >> 9) & 0x7f, .tm_year = 80 + ((f.fdate >> 9) & 0x7f),
}; };
st->st_mtime = mktime(&tm); st->st_mtime = mktime(&tm);
return 0; return 0;

Loading…
Cancel
Save