From 018ff6e65dcc563321d27d010e693dd8413e2f45 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 25 Jun 2009 17:44:35 +0000 Subject: Consolidate buffer dumping; fix all occurrences of 'the the' git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1951 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/netutils/tftpc/tftpc_internal.h | 2 +- nuttx/netutils/tftpc/tftpc_packets.c | 50 +---------------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) (limited to 'nuttx/netutils/tftpc') diff --git a/nuttx/netutils/tftpc/tftpc_internal.h b/nuttx/netutils/tftpc/tftpc_internal.h index 9e853efba..214f7306d 100644 --- a/nuttx/netutils/tftpc/tftpc_internal.h +++ b/nuttx/netutils/tftpc/tftpc_internal.h @@ -161,7 +161,7 @@ extern ssize_t tftp_recvfrom(int sd, void *buf, size_t len, struct sockaddr_in * extern ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to); #ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS -extern void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes); +# define tftp_dumpbuffer(msg, buffer, nbytes) nvdbgdumpbuffer(msg, buffer, nbytes) #else # define tftp_dumpbuffer(msg, buffer, nbytes) #endif diff --git a/nuttx/netutils/tftpc/tftpc_packets.c b/nuttx/netutils/tftpc/tftpc_packets.c index 73e4bd110..d190c4f1a 100644 --- a/nuttx/netutils/tftpc/tftpc_packets.c +++ b/nuttx/netutils/tftpc/tftpc_packets.c @@ -1,7 +1,7 @@ /**************************************************************************** * netuils/tftp/tftpc_packets.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -326,52 +326,4 @@ ssize_t tftp_sendto(int sd, const void *buf, size_t len, struct sockaddr_in *to) } } -/**************************************************************************** - * Name: tftp_sendto - * - * Description: - * Dump a buffer of data - * - ****************************************************************************/ - -#ifdef CONFIG_NETUTILS_TFTP_DUMPBUFFERS -void tftp_dumpbuffer(const char *msg, ubyte *buffer, int nbytes) -{ -#ifdef CONFIG_DEBUG - char line[128]; - int ch; - int i; - int j; - - dbg("%s:\n", msg); - for (i = 0; i < nbytes; i += 16) - { - sprintf(line, "%04x: ", i); - - for ( j = 0; j < 16; j++) - { - if (i + j < nbytes) - { - sprintf(&line[strlen(line)], "%02x ", buffer[i+j] ); - } - else - { - strcpy(&line[strlen(line)], " "); - } - } - - for ( j = 0; j < 16; j++) - { - if (i + j < nbytes) - { - ch = buffer[i+j]; - sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.'); - } - } - dbg("%s\n", line); - } -#endif -} -#endif - #endif /* CONFIG_NET && CONFIG_NET_UDP && CONFIG_NFILE_DESCRIPTORS */ -- cgit v1.2.3