Remove the unnecessary "return;" at the end of function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-28 03:55:23 +08:00 committed by Petro Karashchenko
parent e4376a0e60
commit 8fff07b435
4 changed files with 39 additions and 32 deletions

View File

@ -436,7 +436,6 @@ void lorawan_radioenge_init(config_lorawan_radioenge_t config_lorawan)
clear_uart_rx_buffer();
END_UART_LORAWAN_MODULE_INIT:
return;
}
/****************************************************************************

View File

@ -1,5 +1,5 @@
/****************************************************************************
* apps/interpreters/minibasic/basic.c
* apps/interpreters/ficl/src/nuttx.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
*
@ -113,5 +113,4 @@ long ficlFileSize(ficlFile *ff)
void ficlSystemCompilePlatform(ficlSystem *system)
{
return;
}

View File

@ -53,6 +53,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration */
#ifndef CONFIG_INTERPRETER_MINIBASIC_IOBUFSIZE
@ -375,17 +376,19 @@ static int setup(FAR const char *script)
}
for (i = 1; i < nlines; i++)
if (g_lines[i].no <= g_lines[i - 1].no)
{
if (g_fperr)
{
fprintf(g_fperr, "program lines %d and %d not in order\n",
g_lines[i - 1].no, g_lines[i].no);
}
{
if (g_lines[i].no <= g_lines[i - 1].no)
{
if (g_fperr)
{
fprintf(g_fperr, "program lines %d and %d not in order\n",
g_lines[i - 1].no, g_lines[i].no);
}
free(g_lines);
return -1;
}
free(g_lines);
return -1;
}
}
g_nvariables = 0;
g_variables = 0;
@ -451,7 +454,6 @@ static void cleanup(void)
}
else if (g_dimvariables[i].dval)
{
free(g_dimvariables[i].dval);
}
}
@ -701,6 +703,7 @@ static int line(void)
if (g_token != EOS)
{
/* match(VALUE); */
/* check for a newline */
str = g_string;
@ -874,7 +877,8 @@ static void dodim(void)
break;
case 3:
dimvar = dimension(name, 3, (int)dims[0], (int)dims[1], (int)dims[2]);
dimvar = dimension(name, 3, (int)dims[0],
(int)dims[1], (int)dims[2]);
break;
case 4:
@ -1177,7 +1181,7 @@ static void doinput(void)
* or comma is detected.
*/
for (nch = 0, ptr = g_iobuffer; nch < (IOBUFSIZE-1); nch++)
for (nch = 0, ptr = g_iobuffer; nch < (IOBUFSIZE - 1); nch++)
{
int ch = fgetc(g_fpin);
if (ch == EOF)
@ -1256,7 +1260,6 @@ static void doinput(void)
static void dorem(void)
{
match(REM);
return;
}
/****************************************************************************
@ -1372,7 +1375,8 @@ static void lvalue(FAR struct mb_lvalue_s *lv)
index[2] = integer(expr());
if (g_errorflag == 0)
{
valptr = getdimvar(dimvar, index[0], index[1], index[2]);
valptr = getdimvar(dimvar, index[0],
index[1], index[2]);
}
}
break;
@ -1388,8 +1392,8 @@ static void lvalue(FAR struct mb_lvalue_s *lv)
index[3] = integer(expr());
if (g_errorflag == 0)
{
valptr =
getdimvar(dimvar, index[0], index[1], index[2], index[3]);
valptr = getdimvar(dimvar, index[0],
index[1], index[2], index[3]);
}
}
break;
@ -1407,8 +1411,8 @@ static void lvalue(FAR struct mb_lvalue_s *lv)
index[4] = integer(expr());
if (g_errorflag == 0)
{
valptr =
getdimvar(dimvar, index[0], index[1], index[2], index[3]);
valptr = getdimvar(dimvar, index[0],
index[1], index[2], index[3]);
}
}
break;
@ -1530,6 +1534,7 @@ static int boolfactor(void)
return 0;
}
cmp = strcmp(strleft, strright);
switch (op)
{
@ -1960,6 +1965,7 @@ static double factor(void)
{
srand((unsigned)-answer);
}
answer = 0;
}
break;
@ -2179,8 +2185,8 @@ static double dimvariable(void)
index[3] = integer(expr());
match(COMMA);
index[4] = integer(expr());
answer =
getdimvar(dimvar, index[0], index[1], index[2], index[3], index[4]);
answer = getdimvar(dimvar, index[0], index[1],
index[2], index[3], index[4]);
break;
}
@ -2562,8 +2568,8 @@ static FAR struct mb_dimvar_s *adddimvar(FAR const char *id)
{
FAR struct mb_dimvar_s *vars;
vars =
realloc(g_dimvariables, (g_ndimvariables + 1) * sizeof(struct mb_dimvar_s));
vars = realloc(g_dimvariables,
(g_ndimvariables + 1) * sizeof(struct mb_dimvar_s));
if (vars)
{
g_dimvariables = vars;
@ -2571,7 +2577,7 @@ static FAR struct mb_dimvar_s *adddimvar(FAR const char *id)
g_dimvariables[g_ndimvariables].dval = NULL;
g_dimvariables[g_ndimvariables].str = NULL;
g_dimvariables[g_ndimvariables].ndims = 0;
g_dimvariables[g_ndimvariables].type = strchr(id, '$') ? STRID : FLTID;
g_dimvariables[g_ndimvariables].type = strchr(id, '$') ? STRID : FLTID;
g_ndimvariables++;
return &g_dimvariables[g_ndimvariables - 1];
}
@ -3039,7 +3045,8 @@ static FAR char *stringdimvar(void)
match(COMMA);
index[4] = integer(expr());
answer =
getdimvar(dimvar, index[0], index[1], index[2], index[3], index[4]);
getdimvar(dimvar, index[0], index[1],
index[2], index[3], index[4]);
break;
}
@ -3189,7 +3196,7 @@ static int integer(double x)
* Name: match
*
* Description:
* Check that we have a token of the passed type (if not set the g_errorflag)
* Check that we have a token of the passed type (if not set g_errorflag)
* Move parser on to next token. Sets token and string.
*
****************************************************************************/
@ -3944,7 +3951,10 @@ static FAR char *mystrend(FAR const char *str, char quote)
while (*str != quote)
{
if (*str == '\n' || *str == 0)
return 0;
{
return 0;
}
str++;
}
@ -4133,6 +4143,7 @@ int basic(FAR const char *script, FILE * in, FILE * out, FILE * err)
{
fprintf(g_fperr, "line %d not found\n", nextline);
}
answer = 1;
break;
}

View File

@ -396,7 +396,6 @@ errout_with_400:
errout_with_connection:
finish_connection(conn, tv);
return;
}
static inline int read_buffer(struct connect_s *conn)
@ -490,7 +489,6 @@ static void handle_send(struct connect_s *conn, struct timeval *tv)
errout_clear_connection:
ninfo("Clear connection\n");
clear_connection(conn, tv);
return;
}
static void handle_linger(struct connect_s *conn, struct timeval *tv)