sys/shell: remove useless "inline prevention"
There was some code added to "prevent putchar from being inlined", which supposedly enlarged the code size. Co-authored-by: Juan Carrano <j.carrano@fu-berlin.de>
This commit is contained in:
parent
1c22ee8782
commit
268d1b2305
@ -39,17 +39,6 @@
|
|||||||
#include "shell_commands.h"
|
#include "shell_commands.h"
|
||||||
|
|
||||||
#define ETX '\x03' /** ASCII "End-of-Text", or ctrl-C */
|
#define ETX '\x03' /** ASCII "End-of-Text", or ctrl-C */
|
||||||
#if !defined(SHELL_NO_ECHO) || !defined(SHELL_NO_PROMPT)
|
|
||||||
#ifdef MODULE_NEWLIB
|
|
||||||
/* use local copy of putchar, as it seems to be inlined,
|
|
||||||
* enlarging code by 50% */
|
|
||||||
static void _putchar(int c) {
|
|
||||||
putchar(c);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define _putchar putchar
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void flush_if_needed(void)
|
static void flush_if_needed(void)
|
||||||
{
|
{
|
||||||
@ -282,8 +271,8 @@ static int readline(char *buf, size_t size)
|
|||||||
|
|
||||||
buf[curr_pos] = '\0';
|
buf[curr_pos] = '\0';
|
||||||
#ifndef SHELL_NO_ECHO
|
#ifndef SHELL_NO_ECHO
|
||||||
_putchar('\r');
|
putchar('\r');
|
||||||
_putchar('\n');
|
putchar('\n');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return (length_exceeded) ? -ENOBUFS : curr_pos;
|
return (length_exceeded) ? -ENOBUFS : curr_pos;
|
||||||
@ -305,9 +294,9 @@ static int readline(char *buf, size_t size)
|
|||||||
}
|
}
|
||||||
/* white-tape the character */
|
/* white-tape the character */
|
||||||
#ifndef SHELL_NO_ECHO
|
#ifndef SHELL_NO_ECHO
|
||||||
_putchar('\b');
|
putchar('\b');
|
||||||
_putchar(' ');
|
putchar(' ');
|
||||||
_putchar('\b');
|
putchar('\b');
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -319,7 +308,7 @@ static int readline(char *buf, size_t size)
|
|||||||
length_exceeded = true;
|
length_exceeded = true;
|
||||||
}
|
}
|
||||||
#ifndef SHELL_NO_ECHO
|
#ifndef SHELL_NO_ECHO
|
||||||
_putchar(c);
|
putchar(c);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
flush_if_needed();
|
flush_if_needed();
|
||||||
@ -329,8 +318,8 @@ static int readline(char *buf, size_t size)
|
|||||||
static inline void print_prompt(void)
|
static inline void print_prompt(void)
|
||||||
{
|
{
|
||||||
#ifndef SHELL_NO_PROMPT
|
#ifndef SHELL_NO_PROMPT
|
||||||
_putchar('>');
|
putchar('>');
|
||||||
_putchar(' ');
|
putchar(' ');
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
flush_if_needed();
|
flush_if_needed();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user