You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/02/04 22:07:41 UTC
[incubator-nuttx-apps] 02/06: Change telnet_error_u to
telnet_error_e required by the coding standard
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch pr50
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit c282841c5cabca9c02eaa7e0694ca55514b4bd2e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Feb 4 16:20:20 2020 +0800
Change telnet_error_u to telnet_error_e required by the coding standard
Change-Id: I5cc2aaf4edd3f922e577445d73054814fec84810
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
include/netutils/telnetc.h | 6 +++---
netutils/telnetc/telnetc.c | 12 ++++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/netutils/telnetc.h b/include/netutils/telnetc.h
index d3f87a9..394d3a6 100644
--- a/include/netutils/telnetc.h
+++ b/include/netutils/telnetc.h
@@ -1,5 +1,5 @@
/****************************************************************************
- * apps/netutils/telnetc/telnetc.c
+ * apps/include/netutils/telnetc.h
*
* Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet.
* Modified and re-released under the BSD license:
@@ -208,7 +208,7 @@ extern "C"
/* Error codes */
-enum telnet_error_u
+enum telnet_error_e
{
TELNET_EOK = 0, /* No error */
TELNET_EBADVAL, /* Invalid parameter, or API misuse */
@@ -284,7 +284,7 @@ union telnet_event_u
const char *func; /* Function the error occured in */
const char *msg; /* Error message string */
int line; /* Line of file error occured on */
- enum telnet_error_u errcode; /* Error code */
+ enum telnet_error_e errcode; /* Error code */
} error;
/* Command event: for IAC */
diff --git a/netutils/telnetc/telnetc.c b/netutils/telnetc/telnetc.c
index d27e93c..e2fac4a 100644
--- a/netutils/telnetc/telnetc.c
+++ b/netutils/telnetc/telnetc.c
@@ -197,8 +197,8 @@ static const size_t _buffer_sizes_count = sizeof(_buffer_sizes) /
/* Error generation function */
-static enum telnet_error_u _error(struct telnet_s *telnet, unsigned line,
- const char *func, enum telnet_error_u err,
+static enum telnet_error_e _error(struct telnet_s *telnet, unsigned line,
+ const char *func, enum telnet_error_e err,
int fatal, const char *fmt, ...)
{
union telnet_event_u ev;
@@ -230,7 +230,7 @@ static enum telnet_error_u _error(struct telnet_s *telnet, unsigned line,
*/
#if defined(HAVE_ZLIB)
-enum telnet_error_u _init_zlib(struct telnet_s *telnet, int deflate,
+enum telnet_error_e _init_zlib(struct telnet_s *telnet, int deflate,
int err_fatal)
{
z_stream *z;
@@ -361,7 +361,7 @@ static inline int _check_telopt(struct telnet_s *telnet,
return 0;
}
- /* Loop unti found or end marker (us and him both 0) */
+ /* Loop until found or end marker (us and him both 0) */
for (i = 0; telnet->telopts[i].telopt != -1; ++i)
{
@@ -441,7 +441,7 @@ static inline void _set_rfc1143(struct telnet_s *telnet, unsigned char telopt,
qtmp = (struct telnet_rfc1143_s *)
realloc(telnet->q,
- sizeof(struct telnet_rfc1143_s) * (telnet->q_size + 4));
+ sizeof(struct telnet_rfc1143_s) * (telnet->q_size + 4));
if (qtmp == 0)
{
_error(telnet, __LINE__, __func__, TELNET_ENOMEM, 0,
@@ -1248,7 +1248,7 @@ void telnet_free(struct telnet_s *telnet)
/* Push a byte into the telnet buffer */
-static enum telnet_error_u _buffer_byte(struct telnet_s *telnet,
+static enum telnet_error_e _buffer_byte(struct telnet_s *telnet,
unsigned char byte)
{
char *new_buffer;