diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-15 16:37:20 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-15 16:37:20 +0000 |
commit | 2c0247a19db16916e3fdc831ee5396c75ad852c2 (patch) | |
tree | 2029ba80749910081bbbdbd90439e1f27092d6ef /nuttx/netutils/tftpc/tftpc_packets.c | |
parent | de5703237a8973502fdd4c87e993a998be192863 (diff) | |
download | nuttx-2c0247a19db16916e3fdc831ee5396c75ad852c2.tar.gz nuttx-2c0247a19db16916e3fdc831ee5396c75ad852c2.tar.bz2 nuttx-2c0247a19db16916e3fdc831ee5396c75ad852c2.zip |
Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2347 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils/tftpc/tftpc_packets.c')
-rw-r--r-- | nuttx/netutils/tftpc/tftpc_packets.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nuttx/netutils/tftpc/tftpc_packets.c b/nuttx/netutils/tftpc/tftpc_packets.c index d190c4f1a..169f068cc 100644 --- a/nuttx/netutils/tftpc/tftpc_packets.c +++ b/nuttx/netutils/tftpc/tftpc_packets.c @@ -41,7 +41,8 @@ #include <sys/types.h> #include <sys/socket.h> - +#include <stdint.h> +#include <stdbool.h> #include <stdio.h> #include <string.h> #include <time.h> @@ -59,7 +60,7 @@ #if defined(CONFIG_NET) && defined(CONFIG_NET_UDP) && CONFIG_NFILE_DESCRIPTORS > 0 /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -74,7 +75,7 @@ * Name: tftp_mode ****************************************************************************/ -static inline const char *tftp_mode(boolean binary) +static inline const char *tftp_mode(bool binary) { return binary ? "octet" : "netascii"; } @@ -143,7 +144,7 @@ int tftp_sockinit(struct sockaddr_in *server, in_addr_t addr) * ****************************************************************************/ -int tftp_mkreqpacket(ubyte *buffer, int opcode, const char *path, boolean binary) +int tftp_mkreqpacket(uint8_t *buffer, int opcode, const char *path, bool binary) { buffer[0] = opcode >> 8; buffer[1] = opcode & 0xff; @@ -161,7 +162,7 @@ int tftp_mkreqpacket(ubyte *buffer, int opcode, const char *path, boolean binary * ****************************************************************************/ -int tftp_mkackpacket(ubyte *buffer, uint16 blockno) +int tftp_mkackpacket(uint8_t *buffer, uint16_t blockno) { buffer[0] = TFTP_ACK >> 8; buffer[1] = TFTP_ACK & 0xff; @@ -183,7 +184,7 @@ int tftp_mkackpacket(ubyte *buffer, uint16 blockno) * ****************************************************************************/ -int tftp_mkerrpacket(ubyte *buffer, uint16 errorcode, const char *errormsg) +int tftp_mkerrpacket(uint8_t *buffer, uint16_t errorcode, const char *errormsg) { buffer[0] = TFTP_ERR >> 8; buffer[1] = TFTP_ERR & 0xff; @@ -207,10 +208,10 @@ int tftp_mkerrpacket(ubyte *buffer, uint16 errorcode, const char *errormsg) ****************************************************************************/ #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_NET) -int tftp_parseerrpacket(const ubyte *buffer) +int tftp_parseerrpacket(const uint8_t *buffer) { - uint16 opcode = (uint16)buffer[0] << 8 | (uint16)buffer[1]; - uint16 errcode = (uint16)buffer[2] << 8 | (uint16)buffer[3]; + uint16_t opcode = (uint16_t)buffer[0] << 8 | (uint16_t)buffer[1]; + uint16_t errcode = (uint16_t)buffer[2] << 8 | (uint16_t)buffer[3]; const char *errmsg = (const char *)&buffer[4]; if (opcode == TFTP_ERR) |