Skip to content

Commit e6fd3ff

Browse files
mysterywolfBernardXiong
authored andcommitted
[libc]修理一些细节问题
1 parent e1a17f0 commit e6fd3ff

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

components/libc/compilers/armlibc/syscalls.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,7 @@ char *_sys_command_string(char *cmd, int len)
276276
void _ttywrch(int ch)
277277
{
278278
#ifdef RT_USING_CONSOLE
279-
char c;
280-
281-
c = (char)ch;
282-
rt_kprintf(&c);
279+
rt_kprintf("%c", (char)ch);
283280
#endif /* RT_USING_CONSOLE */
284281
}
285282

@@ -337,10 +334,7 @@ int remove(const char *filename)
337334
int fputc(int c, FILE *f)
338335
{
339336
#ifdef RT_USING_CONSOLE
340-
char ch[2] = {0};
341-
342-
ch[0] = c;
343-
rt_kprintf(&ch[0]);
337+
rt_kprintf("%c", (char)c);
344338
return 1;
345339
#else
346340
return 0; /* error */

components/libc/compilers/common/compiler_private.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
#ifndef __COMPILER_PRIVATE_H__
1111
#define __COMPILER_PRIVATE_H__
1212

13-
#include <rtconfig.h>
14-
1513
#define _WARNING_WITHOUT_FS "Please enable RT_USING_POSIX_FS"
1614
#define _WARNING_WITHOUT_STDIO "Please enable RT_USING_POSIX_FS and RT_USING_POSIX_STDIO"
1715

components/libc/compilers/common/time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ static const short __spm[13] =
5656
(31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31),
5757
};
5858

59-
ALIGN(4) static const char days[] = "Sun Mon Tue Wed Thu Fri Sat ";
60-
ALIGN(4) static const char months[] = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ";
59+
ALIGN(4) static const char *days = "Sun Mon Tue Wed Thu Fri Sat ";
60+
ALIGN(4) static const char *months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ";
6161

6262
static int __isleap(int year)
6363
{

0 commit comments

Comments
 (0)