summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-08 06:21:48 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-08 06:21:48 -0600
commit3582df8916902412c927ec3243607d11bef6b990 (patch)
treed1f48814deec6f94a868a1d8cfe20718498684fc /nuttx/sched
parentcb11a060b9ac63b7b9a84dae7317a78be680fbd0 (diff)
downloadpx4-nuttx-3582df8916902412c927ec3243607d11bef6b990.tar.gz
px4-nuttx-3582df8916902412c927ec3243607d11bef6b990.tar.bz2
px4-nuttx-3582df8916902412c927ec3243607d11bef6b990.zip
A const storage class to to phthread parameters. From Freddie Chopin
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/pthread/pthread_condinit.c2
-rw-r--r--nuttx/sched/pthread/pthread_create.c4
-rw-r--r--nuttx/sched/pthread/pthread_mutexinit.c2
-rw-r--r--nuttx/sched/pthread/pthread_setspecific.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/nuttx/sched/pthread/pthread_condinit.c b/nuttx/sched/pthread/pthread_condinit.c
index 358d26711..ce7c1acbf 100644
--- a/nuttx/sched/pthread/pthread_condinit.c
+++ b/nuttx/sched/pthread/pthread_condinit.c
@@ -65,7 +65,7 @@
*
****************************************************************************/
-int pthread_cond_init(FAR pthread_cond_t *cond, FAR pthread_condattr_t *attr)
+int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *attr)
{
int ret = OK;
diff --git a/nuttx/sched/pthread/pthread_create.c b/nuttx/sched/pthread/pthread_create.c
index 34f568c3f..70c00a447 100644
--- a/nuttx/sched/pthread/pthread_create.c
+++ b/nuttx/sched/pthread/pthread_create.c
@@ -228,7 +228,7 @@ static void pthread_start(void)
*
****************************************************************************/
-int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
+int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
pthread_startroutine_t start_routine, pthread_addr_t arg)
{
FAR struct pthread_tcb_s *ptcb;
@@ -245,7 +245,7 @@ int pthread_create(FAR pthread_t *thread, FAR pthread_attr_t *attr,
if (!attr)
{
- attr = (FAR pthread_attr_t *)&g_default_pthread_attr;
+ attr = &g_default_pthread_attr;
}
/* Allocate a TCB for the new task. */
diff --git a/nuttx/sched/pthread/pthread_mutexinit.c b/nuttx/sched/pthread/pthread_mutexinit.c
index 45066b726..d1362e6cb 100644
--- a/nuttx/sched/pthread/pthread_mutexinit.c
+++ b/nuttx/sched/pthread/pthread_mutexinit.c
@@ -86,7 +86,7 @@
*
****************************************************************************/
-int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR pthread_mutexattr_t *attr)
+int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t *attr)
{
int pshared = 0;
#ifdef CONFIG_MUTEX_TYPES
diff --git a/nuttx/sched/pthread/pthread_setspecific.c b/nuttx/sched/pthread/pthread_setspecific.c
index 8edd9c675..4b023fa0f 100644
--- a/nuttx/sched/pthread/pthread_setspecific.c
+++ b/nuttx/sched/pthread/pthread_setspecific.c
@@ -112,7 +112,7 @@
*
****************************************************************************/
-int pthread_setspecific(pthread_key_t key, FAR void *value)
+int pthread_setspecific(pthread_key_t key, FAR const void *value)
{
#if CONFIG_NPTHREAD_KEYS > 0
FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s*)g_readytorun.head;
@@ -128,7 +128,7 @@ int pthread_setspecific(pthread_key_t key, FAR void *value)
{
/* Store the data in the TCB. */
- rtcb->pthread_data[key] = value;
+ rtcb->pthread_data[key] = (FAR void*)value;
/* Return success. */