From 882448de92cd793aa01c2a4d585d02306411e7ed Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 2 May 2012 15:36:19 +0000 Subject: Fix some warnings and fix some simulator builds git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4688 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/sched/prctl.c | 2 +- nuttx/sched/pthread_exit.c | 5 +++-- nuttx/sched/sem_open.c | 4 ++-- nuttx/sched/sig_deliver.c | 11 ++--------- nuttx/sched/wd_start.c | 11 ++--------- 5 files changed, 10 insertions(+), 23 deletions(-) (limited to 'nuttx/sched') diff --git a/nuttx/sched/prctl.c b/nuttx/sched/prctl.c index bc55992b4..817083561 100644 --- a/nuttx/sched/prctl.c +++ b/nuttx/sched/prctl.c @@ -140,7 +140,7 @@ int prctl(int option, ...) /* The returned value will be null-terminated, truncating if necessary */ strncpy(name, tcb->name, CONFIG_TASK_NAME_SIZE-1); - name[CONFIG_TASK_NAME_SIZE-1]; + name[CONFIG_TASK_NAME_SIZE-1] = '\0'; } } break; diff --git a/nuttx/sched/pthread_exit.c b/nuttx/sched/pthread_exit.c index 31ac62362..b8183142a 100644 --- a/nuttx/sched/pthread_exit.c +++ b/nuttx/sched/pthread_exit.c @@ -1,7 +1,7 @@ /************************************************************************ * sched/pthread_exit.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -92,7 +93,7 @@ void pthread_exit(FAR void *exit_value) { - int error_code = (int)exit_value; + int error_code = (int)((intptr_t)exit_value); int status; sdbg("exit_value=%p\n", exit_value); diff --git a/nuttx/sched/sem_open.c b/nuttx/sched/sem_open.c index cd9ca6129..d5b22f018 100644 --- a/nuttx/sched/sem_open.c +++ b/nuttx/sched/sem_open.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/sem_open.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/nuttx/sched/sig_deliver.c b/nuttx/sched/sig_deliver.c index 2244ca2fe..bbfe0965c 100644 --- a/nuttx/sched/sig_deliver.c +++ b/nuttx/sched/sig_deliver.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/sig_deliver.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -86,7 +86,6 @@ void sig_deliver(FAR _TCB *stcb) { - pid_t rpid; FAR sigq_t *sigq; FAR sigq_t *next; sigset_t savesigprocmask; @@ -129,12 +128,6 @@ void sig_deliver(FAR _TCB *stcb) savesigprocmask = stcb->sigprocmask; stcb->sigprocmask = savesigprocmask | sigq->mask | SIGNO2SET(sigq->info.si_signo); - /* The current tasks process.ID. We'll need this later to see if - * the signal handler caused a context switch. - */ - - rpid = getpid(); - /* Deliver the signal */ (*sigq->action.sighandler)(sigq->info.si_signo, &sigq->info, NULL); diff --git a/nuttx/sched/wd_start.c b/nuttx/sched/wd_start.c index 1f37dbf99..a2f19fbdc 100644 --- a/nuttx/sched/wd_start.c +++ b/nuttx/sched/wd_start.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/wd_start.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -294,7 +294,6 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) void wd_timer(void) { - pid_t pid; FAR wdog_t *wdog; /* Check if there are any active watchdogs to process */ @@ -333,12 +332,6 @@ void wd_timer(void) wdog->active = false; - /* Get the current task's process ID. We'll need this later to - * see if the watchdog function caused a context switch. - */ - - pid = getpid(); - /* Execute the watchdog function */ up_setpicbase(wdog->picbase); -- cgit v1.2.3