浏览代码

fix compiling warning.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1971 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong@gmail.com 13 年之前
父节点
当前提交
9d61fc32c8
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      components/pthreads/pthread_tls.c

+ 4 - 1
components/pthreads/pthread_tls.c

@@ -31,7 +31,10 @@ int pthread_setspecific(pthread_key_t key, const void *value)
 	RT_ASSERT(ptd != NULL);
 	RT_ASSERT(ptd != NULL);
 
 
 	/* check tls area */
 	/* check tls area */
-	if (ptd->tls == NULL) ptd->tls = rt_malloc(sizeof(void*) * PTHREAD_KEY_MAX);
+	if (ptd->tls == NULL)
+	{
+		ptd->tls = (void**)rt_malloc(sizeof(void*) * PTHREAD_KEY_MAX);
+	}
 
 
 	if ((key < PTHREAD_KEY_MAX) && _thread_keys[key].is_used)
 	if ((key < PTHREAD_KEY_MAX) && _thread_keys[key].is_used)
 	{
 	{