diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-14 15:46:31 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-03-14 15:46:31 +0000 |
commit | eda5581788b648ccde1a8fd83f166ac89e948983 (patch) | |
tree | 2ed7dbf5ff57cc2323e2ad3c6c682c8016a8ff46 /nuttx | |
parent | 15e8075f78f2f1cb90cd3d31451dd0605805e64f (diff) | |
download | px4-nuttx-eda5581788b648ccde1a8fd83f166ac89e948983.tar.gz px4-nuttx-eda5581788b648ccde1a8fd83f166ac89e948983.tar.bz2 px4-nuttx-eda5581788b648ccde1a8fd83f166ac89e948983.zip |
Changes for clean compilation with ZDS
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1603 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/examples/nsh/nsh_telnetd.c | 19 | ||||
-rw-r--r-- | nuttx/netutils/tftpc/tftpc_get.c | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/nuttx/examples/nsh/nsh_telnetd.c b/nuttx/examples/nsh/nsh_telnetd.c index 5e0fa7d4d..57d0e7ac6 100644 --- a/nuttx/examples/nsh/nsh_telnetd.c +++ b/nuttx/examples/nsh/nsh_telnetd.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nsh/nsh_telnetd.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * This is a leverage of similar logic from uIP: @@ -284,7 +284,7 @@ static void nsh_putchar(struct telnetd_s *pstate, uint8 ch) { pstate->tn_cmd[tio->tio_bufndx] = '\0'; nsh_telnetdump(&pstate->tn_vtbl, "TELNET CMD", - pstate->tn_cmd, strlen(pstate->tn_cmd)); + (ubyte*)pstate->tn_cmd, strlen(pstate->tn_cmd)); nsh_parse(&pstate->tn_vtbl, pstate->tn_cmd); tio->tio_bufndx = 0; } @@ -335,7 +335,7 @@ static void nsh_flush(FAR struct telnetd_s *pstate) if (pstate->tn_sndlen > 0) { nsh_telnetdump(&pstate->tn_vtbl, "Shell output", - pstate->tn_outbuffer, pstate->tn_sndlen); + (ubyte*)pstate->tn_outbuffer, pstate->tn_sndlen); tio_semtake(tio); /* Only one call to send at a time */ if (send(tio->tio_sockfd, pstate->tn_outbuffer, pstate->tn_sndlen, 0) < 0) { @@ -458,6 +458,7 @@ static void *nsh_connection(void *arg) { struct telnetd_s *pstate = nsh_allocstruct(); struct telnetio_s *tio = (struct telnetio_s *)zalloc(sizeof(struct telnetio_s)); + struct nsh_vtbl_s *vtbl = &pstate->tn_vtbl; int sockfd = (int)arg; int ret = ERROR; @@ -476,12 +477,12 @@ static void *nsh_connection(void *arg) /* Output a greeting */ - nsh_output(&pstate->tn_vtbl, g_nshgreeting); + nsh_output(vtbl, g_nshgreeting); /* Execute the startup script */ #if defined(CONFIG_EXAMPLES_NSH_ROMFSETC) && !defined(CONFIG_EXAMPLES_NSH_CONSOLE) - (void)nsh_script(&pstate->tn_vtbl, "init", NSH_INITPATH); + (void)nsh_script(vtbl, "init", NSH_INITPATH); #endif /* Loop processing each TELNET command */ @@ -490,7 +491,7 @@ static void *nsh_connection(void *arg) { /* Display the prompt string */ - nsh_output(&pstate->tn_vtbl, g_nshprompt); + nsh_output(vtbl, g_nshprompt); nsh_flush(pstate); /* Read a buffer of data from the TELNET client */ @@ -502,8 +503,8 @@ static void *nsh_connection(void *arg) /* Process the received TELNET data */ - nsh_telnetdump(&pstate->tn_vtbl, "Received buffer", - tio->tio_inbuffer, ret); + nsh_telnetdump(vtbl, "Received buffer", + (ubyte*)tio->tio_inbuffer, ret); ret = nsh_receive(pstate, ret); } } @@ -528,7 +529,7 @@ static void *nsh_connection(void *arg) dbg("[%d] Exitting\n", sockfd); close(sockfd); - pthread_exit(NULL); + return NULL; } /**************************************************************************** diff --git a/nuttx/netutils/tftpc/tftpc_get.c b/nuttx/netutils/tftpc/tftpc_get.c index abd34db21..b48c657c1 100644 --- a/nuttx/netutils/tftpc/tftpc_get.c +++ b/nuttx/netutils/tftpc/tftpc_get.c @@ -155,7 +155,7 @@ int tftpget(const char *remote, const char *local, in_addr_t addr, boolean binar int sd; /* Socket descriptor for socket I/O */ int fd; /* File descriptor for file I/O */ int retry; /* Retry counter */ - int nbytesrecvd; /* The number of bytes received in the packet */ + int nbytesrecvd = 0; /* The number of bytes received in the packet */ int ndatabytes; /* The number of data bytes received */ int result = ERROR; /* Assume failure */ int ret; /* Generic return status */ |