mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 10:46:02 +08:00
libs: fix nxstyle errors
fix erros reported by nxstyle Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
8975a65197
commit
ed8e5e971b
@@ -6,19 +6,14 @@
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
*
|
||||
* crc16_tab calculated by Mark G. Mendel, Network Systems Corporation.
|
||||
* crc16part() logic derived from article Copyright (C) 1986 Stephen Satchell.
|
||||
*
|
||||
* "Programmers may incorporate any or all code into their programs,
|
||||
* giving proper credit within the source. Publication of the
|
||||
* source routines is permitted so long as proper credit is given
|
||||
* to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
|
||||
* Omen Technology."
|
||||
*
|
||||
* Re-released under the Modified BSD license which, I believe, is consistent with the
|
||||
* original authors' intent:
|
||||
* Re-released under the Modified BSD license which, I believe, is
|
||||
* consistent with the original authors' intent:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -49,6 +44,13 @@
|
||||
*
|
||||
************************************************************************************************/
|
||||
|
||||
/* References:
|
||||
*
|
||||
* crc16_tab calculated by Mark G. Mendel, Network Systems Corporation.
|
||||
* crc16part() logic derived from article Copyright (C) 1986 Stephen
|
||||
* Satchell.
|
||||
*/
|
||||
|
||||
/************************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************************/
|
||||
@@ -102,6 +104,7 @@ static uint16_t crc16_tab[256] =
|
||||
/************************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************************/
|
||||
|
||||
/************************************************************************************************
|
||||
* Name: crc16part
|
||||
*
|
||||
@@ -116,7 +119,8 @@ uint16_t crc16part(FAR const uint8_t *src, size_t len, uint16_t crc16val)
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
crc16val = crc16_tab[((crc16val >> 8) & 0xff) ^ src[i]] ^ (crc16val << 8);
|
||||
crc16val = crc16_tab[((crc16val >> 8) & 0xff) ^
|
||||
src[i]] ^ (crc16val << 8);
|
||||
}
|
||||
|
||||
return crc16val;
|
||||
|
||||
@@ -90,6 +90,7 @@ static const uint32_t crc32_tab[] =
|
||||
/************************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************************/
|
||||
|
||||
/************************************************************************************************
|
||||
* Name: crc32part
|
||||
*
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
/****************************************************************************
|
||||
* CRC8 table generated with:
|
||||
*
|
||||
* #define POLY 0xB2 // ((uint8_t) 0x14D) ^ 0xFF
|
||||
* #define POLY 0xB2 ((uint8_t) 0x14D) ^ 0xFF
|
||||
*
|
||||
* printf(" ");
|
||||
* for (y = 0; y < 256; y++)
|
||||
|
||||
@@ -188,18 +188,19 @@ FAR char *envpath_next(ENVPATH_HANDLE handle, FAR const char *relpath)
|
||||
|
||||
path = envpath->next;
|
||||
if (*path == '\0')
|
||||
{
|
||||
/* If it points to a NULL it means that either (1) the PATH varialbe
|
||||
* is empty, or (2) we have already examined all of the paths in the
|
||||
* path variable.
|
||||
{
|
||||
/* If it points to a NULL it means that either (1) the PATH
|
||||
* varialbe is empty, or (2) we have already examined all of the
|
||||
* paths in the path variable.
|
||||
*/
|
||||
|
||||
return (FAR char *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Okay... 'path' points to the beginning of the string. The string may
|
||||
* be terminated either with (1) ':' which separates the path from the
|
||||
* next path in the list, or (2) NUL which marks the end of the list.
|
||||
/* Okay... 'path' points to the beginning of the string. The string
|
||||
* may be terminated either with (1) ':' which separates the path from
|
||||
* the next path in the list, or (2) NUL which marks the end of the
|
||||
* list.
|
||||
*/
|
||||
|
||||
endptr = strchr(path, ':');
|
||||
|
||||
@@ -94,9 +94,9 @@ static int kbd_reget(FAR struct kbd_getstate_s *state, FAR uint8_t *pch)
|
||||
/* Return the next character */
|
||||
|
||||
*pch = state->buf[state->ndx];
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return KBD_PRESS;
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return KBD_PRESS;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -169,7 +169,9 @@ int kbd_decode(FAR struct lib_instream_s *stream,
|
||||
|
||||
if (ch != ASCII_ESC)
|
||||
{
|
||||
/* Not the beginning of an escape sequence. Return the character. */
|
||||
/* Not the beginning of an escape sequence.
|
||||
* Return the character.
|
||||
*/
|
||||
|
||||
return kbd_reget(state, pch);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,8 @@ void kbd_release(uint8_t ch, FAR struct lib_outstream_s *stream)
|
||||
void kbd_specpress(enum kbd_keycode_e keycode,
|
||||
FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
DEBUGASSERT(stream && keycode >= KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
DEBUGASSERT(stream && keycode >=
|
||||
KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
kbd_encode((uint8_t)keycode, stream, ('a' + KBD_SPECPRESS));
|
||||
}
|
||||
|
||||
@@ -146,6 +147,7 @@ void kbd_specpress(enum kbd_keycode_e keycode,
|
||||
void kbd_specrel(enum kbd_keycode_e keycode,
|
||||
FAR struct lib_outstream_s *stream)
|
||||
{
|
||||
DEBUGASSERT(stream && keycode >= KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
DEBUGASSERT(stream && keycode >=
|
||||
KEYCODE_FWDDEL && keycode <= LAST_KEYCODE);
|
||||
kbd_encode((uint8_t)keycode, stream, ('a' + KBD_SPECREL));
|
||||
}
|
||||
|
||||
+187
-160
File diff suppressed because it is too large
Load Diff
@@ -53,7 +53,7 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Indices, counts, helper macros ******************************************/
|
||||
/* Indices, counts, helper macros *******************************************/
|
||||
|
||||
#define NDX_ESC 0
|
||||
#define NDX_BRACKET 1
|
||||
@@ -134,11 +134,11 @@ static enum slcdret_e slcd_reget(FAR struct slcdstate_s *state,
|
||||
*pch = state->buf[state->ndx];
|
||||
*parg = 0;
|
||||
|
||||
/* Bump up the indices and return false (meaning a normal character) */
|
||||
/* Bump up the indices and return false (meaning a normal character) */
|
||||
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return SLCDRET_CHAR;
|
||||
state->ndx++;
|
||||
state->nch--;
|
||||
return SLCDRET_CHAR;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -173,7 +173,6 @@ static enum slcdret_e slcd_reget(FAR struct slcdstate_s *state,
|
||||
enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
|
||||
FAR struct slcdstate_s *state, FAR uint8_t *pch,
|
||||
FAR uint8_t *parg)
|
||||
|
||||
{
|
||||
enum slcdcode_e code;
|
||||
uint8_t count;
|
||||
|
||||
Reference in New Issue
Block a user