浏览代码

remove compile warning.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@308 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong 15 年之前
父节点
当前提交
a57580b9cc
共有 3 个文件被更改,包括 11 次插入4 次删除
  1. 3 1
      finsh/cmd.c
  2. 4 1
      finsh/finsh.h
  3. 4 2
      finsh/shell.c

+ 3 - 1
finsh/cmd.c

@@ -379,7 +379,9 @@ void list_prefix(char* prefix)
 	const char* name_ptr;
 	const char* name_ptr;
 
 
 	func_cnt = 0;
 	func_cnt = 0;
-	var_cnt  = 0;
+	var_cnt  = 0;
+	name_ptr = RT_NULL;
+
 	{
 	{
 		struct finsh_syscall* index;
 		struct finsh_syscall* index;
 		for (index = _syscall_table_begin; index < _syscall_table_end; index ++)
 		for (index = _syscall_table_begin; index < _syscall_table_end; index ++)

+ 4 - 1
finsh/finsh.h

@@ -68,7 +68,10 @@ char *strdup(const char *s);
 
 
 int isalpha( int ch );
 int isalpha( int ch );
 int atoi(const char* s);
 int atoi(const char* s);
-#else
+#else
+/* use libc of armcc */
+#include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
 #include <string.h>
 #endif
 #endif
 #endif
 #endif

+ 4 - 2
finsh/shell.c

@@ -113,7 +113,8 @@ char *strdup(const char *s)
 	return tmp;
 	return tmp;
 }
 }
 #endif
 #endif
-
+
+#if !defined(__CC_ARM) && !defined(__ICCARM__)
 int isalpha( int ch )
 int isalpha( int ch )
 {
 {
 	return (unsigned int)((ch | 0x20) - 'a') < 26u;
 	return (unsigned int)((ch | 0x20) - 'a') < 26u;
@@ -142,7 +143,8 @@ int atoi(const char* s)
 int isprint(unsigned char ch)
 int isprint(unsigned char ch)
 {
 {
     return (unsigned int)(ch - ' ') < 127u - ' ';
     return (unsigned int)(ch - ' ') < 127u - ' ';
-}
+}
+#endif
 #endif
 #endif
 
 
 #ifdef RT_USING_DEVICE
 #ifdef RT_USING_DEVICE