9
0
Fork 0

stdio: rename getc to getchar

The function we have implemented as getc has the semantics of the
standard function getchar, so rename it accorgingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2016-04-14 08:48:59 +02:00
parent 70bbeea7b2
commit 01f8f60cf0
12 changed files with 32 additions and 32 deletions

View File

@ -99,49 +99,49 @@ static void boot_nand_barebox_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_nand(true);
getc();
getchar();
}
static void boot_nand_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_nand(false);
getc();
getchar();
}
static void boot_m25p80_barebox_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_nand(true);
getc();
getchar();
}
static void boot_m25p80_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_nand(false);
getc();
getchar();
}
static void boot_dataflash_barebox_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_dataflash(true);
getc();
getchar();
}
static void boot_dataflash_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_dataflash(false);
getc();
getchar();
}
static void boot_mmc_disk_action(struct menu *m, struct menu_entry *me)
{
at91bootstrap_boot_mmc();
getc();
getchar();
}
static void boot_reset_action(struct menu *m, struct menu_entry *me)
@ -234,7 +234,7 @@ static int at91_bootstrap(void)
{
if (is_menu()) {
printf("press 'm' to start the menu\n");
if (tstc() && getc() == 'm')
if (tstc() && getchar() == 'm')
at91_bootstrap_menu();
}

View File

@ -367,7 +367,7 @@ static void getwinsize(void)
printf(ESC "7" ESC "[r" ESC "[999;999H" ESC "[6n");
while ((r = getc()) != 'R') {
while ((r = getchar()) != 'R') {
buf[i] = r;
i++;
}

View File

@ -59,7 +59,7 @@ static int do_load_serial(int argc, char *argv[])
*/
for (i=0; i<100; ++i) {
if (tstc()) {
(void) getc();
(void) getchar();
}
udelay(1000);
}
@ -142,7 +142,7 @@ static int read_record(char *buf, ulong len)
--len; /* always leave room for terminating '\0' byte */
for (p=buf; p < buf+len; ++p) {
c = getc(); /* read character */
c = getchar(); /* read character */
if (do_echo)
putchar(c);
@ -180,7 +180,7 @@ static int do_save_serial(int argc, char *argv[])
printf ("## Ready for S-Record upload, press ENTER to proceed ...\n");
for (;;) {
if (getc() == '\r')
if (getchar() == '\r')
break;
}
if (save_serial(offset, size)) {

View File

@ -1867,14 +1867,14 @@ static int request_write_operation(void)
int c;
printf("This is a one time programmable field!\nDo you want to write? [y/N] ");
c = getc();
c = getchar();
/* default is N */
if (c == 0xD) {
printf("\n");
return 0;
}
printf("%c", c);
getc(); /* wait for carriage return */
getchar(); /* wait for carriage return */
printf("\n");
if (c == 'y' || c == 'Y')
return 1;

View File

@ -164,7 +164,7 @@ int console_set_baudrate(struct console_device *cdev, unsigned baudrate)
if (cdev->f_active) {
mdelay(50);
do {
c = getc();
c = getchar();
} while (c != '\r' && c != '\n');
}
@ -345,7 +345,7 @@ static int tstc_raw(void)
return 0;
}
int getc(void)
int getchar(void)
{
unsigned char ch;
uint64_t start;
@ -380,14 +380,14 @@ int getc(void)
return ch;
}
EXPORT_SYMBOL(getc);
EXPORT_SYMBOL(getchar);
int fgetc(int fd)
{
char c;
if (!fd)
return getc();
return getchar();
return read(fd, &c, 1);
}
EXPORT_SYMBOL(fgetc);
@ -476,7 +476,7 @@ int ctrlc (void)
{
poller_call();
if (tstc() && getc() == 3)
if (tstc() && getchar() == 3)
return 1;
return 0;
}

View File

@ -39,7 +39,7 @@ int console_countdown(int timeout_s, unsigned flags, char *out_key)
do {
if (tstc()) {
key = getc();
key = getchar();
if (flags & CONSOLE_COUNTDOWN_ANYKEY)
goto out;
if (flags & CONSOLE_COUNTDOWN_RETURN && key == '\n')

View File

@ -48,13 +48,13 @@ int tstc(void)
}
EXPORT_SYMBOL(tstc);
int getc(void)
int getchar(void)
{
if (!console)
return -EINVAL;
return console->getc(console);
}
EXPORT_SYMBOL(getc);
EXPORT_SYMBOL(getchar);
void console_flush(void)
{
@ -67,7 +67,7 @@ EXPORT_SYMBOL(console_flush);
/* test if ctrl-c was pressed */
int ctrlc (void)
{
if (tstc() && getc() == 3)
if (tstc() && getchar() == 3)
return 1;
return 0;
}

View File

@ -63,7 +63,7 @@ int password(unsigned char *passwd, size_t length, int flags, int timeout)
do {
if (tstc()) {
ch = getc();
ch = getchar();
switch (ch) {
case '\r':

View File

@ -188,7 +188,7 @@ static int do_imx_nand_bbm(int argc, char *argv[])
int c;
printf("create flash bbt (y/n)?");
c = getc();
c = getchar();
if (c == 'y')
yes = 1;
printf("\n");

View File

@ -28,7 +28,7 @@ int tstc(void);
/* stdout */
void console_putc(unsigned int ch, const char c);
int getc(void);
int getchar(void);
int console_puts(unsigned int ch, const char *s);
void console_flush(void);
@ -44,7 +44,7 @@ static inline int console_puts(unsigned int ch, const char *str)
return 0;
}
static inline int getc(void)
static inline int getchar(void)
{
return -EINVAL;
}

View File

@ -53,15 +53,15 @@ int read_key(void)
{
char c;
char esc[5];
c = getc();
c = getchar();
if (c == 27) {
int i = 0;
esc[i++] = getc();
esc[i++] = getc();
esc[i++] = getchar();
esc[i++] = getchar();
if (isdigit(esc[1])) {
while(1) {
esc[i] = getc();
esc[i] = getchar();
if (esc[i++] == '~')
break;
if (i == ARRAY_SIZE(esc))

View File

@ -70,7 +70,7 @@ int readline (const char *prompt, char *line, int len)
show_activity(0);
}
#endif
c = getc();
c = getchar();
/*
* Special character handling