summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author陈豪 | Jacob Chen <[email protected]>2015-03-29 18:35:44 +0800
committer陈豪 | Jacob Chen <[email protected]>2015-03-29 18:35:44 +0800
commit9a4dacaad743801c9be2dbae49251c4e1b8f99a9 (patch)
tree34def3bef5c5fc4a9b7594eba5a2729f8c86aab0 /src
parentdaac5388afe5a18d51e9839719de8423b62b00c1 (diff)
parent5af7abd8c2e8b8a39c0bf096bdf9b5cb08f266fa (diff)
Merge pull request #3 from RT-Thread/master
111
Diffstat (limited to 'src')
-rw-r--r--src/kservice.c8
-rw-r--r--src/memheap.c2
-rw-r--r--src/module.c2
-rw-r--r--src/object.c8
-rw-r--r--src/timer.c2
5 files changed, 12 insertions, 10 deletions
diff --git a/src/kservice.c b/src/kservice.c
index 12878e67d1..b5dc92b091 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -513,7 +513,7 @@ void rt_show_version(void)
rt_kprintf("- RT - Thread Operating System\n");
rt_kprintf(" / | \\ %d.%d.%d build %s\n",
RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__);
- rt_kprintf(" 2006 - 2013 Copyright by rt-thread team\n");
+ rt_kprintf(" 2006 - 2015 Copyright by rt-thread team\n");
}
RTM_EXPORT(rt_show_version);
@@ -1114,11 +1114,11 @@ void rt_kprintf(const char *fmt, ...)
}
else
{
- rt_uint16_t old_flag = _console_device->flag;
+ rt_uint16_t old_flag = _console_device->open_flag;
- _console_device->flag |= RT_DEVICE_FLAG_STREAM;
+ _console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
rt_device_write(_console_device, 0, rt_log_buf, length);
- _console_device->flag = old_flag;
+ _console_device->open_flag = old_flag;
}
#else
rt_hw_console_output(rt_log_buf);
diff --git a/src/memheap.c b/src/memheap.c
index e19c83a08c..adb5c86053 100644
--- a/src/memheap.c
+++ b/src/memheap.c
@@ -517,6 +517,8 @@ void rt_memheap_free(void *ptr)
/* check magic */
RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
+ /* check whether this block of memory has been over-written. */
+ RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
/* get pool ptr */
heap = header_ptr->pool_ptr;
diff --git a/src/module.c b/src/module.c
index 5d5d02c580..1c20de731d 100644
--- a/src/module.c
+++ b/src/module.c
@@ -82,7 +82,7 @@ static struct rt_module_symtab *_rt_module_symtab_end = RT_NULL;
*/
int rt_system_module_init(void)
{
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__CC_ARM)
extern int __rtmsymtab_start;
extern int __rtmsymtab_end;
diff --git a/src/object.c b/src/object.c
index 32dc0f2384..6c5a1a026f 100644
--- a/src/object.c
+++ b/src/object.c
@@ -417,7 +417,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
{
const char *name_ptr;
int module_name_length;
-
+
name_ptr = name;
while ((*name_ptr != '\0') && (*name_ptr != '/'))
name_ptr ++;
@@ -434,13 +434,13 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
/* find module */
information = &rt_object_container[RT_Object_Class_Module];
- for (node = information->object_list.next;
+ for (node = information->object_list.next;
node != &(information->object_list);
node = node->next)
{
object = rt_list_entry(node, struct rt_object, list);
if ((rt_strncmp(object->name, name, module_name_length) == 0) &&
- module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0')
+ (module_name_length == RT_NAME_MAX || object->name[module_name_length] == '\0'))
{
/* get module */
module = (struct rt_module*)object;
@@ -450,7 +450,7 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
rt_exit_critical();
/* there is no this module inside the system */
- if (module == RT_NULL) return RT_NULL;
+ if (module == RT_NULL) return RT_NULL;
/* get the object pool of module */
information = &(module->module_object[type]);
diff --git a/src/timer.c b/src/timer.c
index f71e40fcd6..ba2801530d 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -293,7 +293,7 @@ RTM_EXPORT(rt_timer_delete);
*/
rt_err_t rt_timer_start(rt_timer_t timer)
{
- int row_lvl;
+ unsigned int row_lvl;
rt_list_t *timer_list;
register rt_base_t level;
rt_list_t *row_head[RT_TIMER_SKIP_LIST_LEVEL];