Passing union parms as const upsets ZDS-II compiler

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@547 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-01-10 19:16:50 +00:00
parent 544a21b80c
commit 0a32f4d20b
6 changed files with 78 additions and 81 deletions

View file

@ -3280,7 +3280,7 @@ the unblocked signal is ignored.
<b>Function Prototype:</b> <b>Function Prototype:</b>
<pre> <pre>
#include &lt;signal.h&gt; #include &lt;signal.h&gt;
int sigqueue (int tid, int signo, const union sigval value); int sigqueue (int tid, int signo, union sigval value);
</pre> </pre>
<p> <p>

View file

@ -1,5 +1,5 @@
############################################################################ ############################################################################
# configs/z16f2800100zcog/Make.defs # configs/z16f2800100zcog/ostest/Make.defs
# #
# Copyright (C) 2008 Gregory Nutt. All rights reserved. # Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr> # Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -122,7 +122,7 @@ EXEEXT = .hex
define COMPILE define COMPILE
@echo "CC: $1" @echo "CC: $1"
@$(CC) $(CFLAGS) $1 @$(CC) $(CFLAGS) $1 1>/dev/null
endef endef
define ASSEMBLE define ASSEMBLE

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* signal.h * include/signal.h
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@ -190,7 +190,7 @@ EXTERN int sigwaitinfo(const sigset_t *set, struct siginfo *value);
EXTERN int sigtimedwait(const sigset_t *set, struct siginfo *value, EXTERN int sigtimedwait(const sigset_t *set, struct siginfo *value,
const struct timespec *timeout); const struct timespec *timeout);
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
EXTERN int sigqueue(int pid, int signo, const union sigval value); EXTERN int sigqueue(int pid, int signo, union sigval value);
#else #else
EXTERN int sigqueue(int pid, int signo, FAR void *sival_ptr); EXTERN int sigqueue(int pid, int signo, FAR void *sival_ptr);
#endif #endif

View file

@ -1,7 +1,7 @@
/************************************************************ /****************************************************************************
* sig_internal.h * sched/sig_internal.h
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@ -31,26 +31,26 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************/ ****************************************************************************/
#ifndef __SIG_INTERNAL_H #ifndef __SIG_INTERNAL_H
#define __SIG_INTERNAL_H #define __SIG_INTERNAL_H
/************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************/ ****************************************************************************/
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
#include <queue.h> #include <queue.h>
#include <sched.h> #include <sched.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
/************************************************************ /****************************************************************************
* Definitions * Definitions
************************************************************/ ****************************************************************************/
/* The following definition determines the number of signal /* The following definition determines the number of signal structures to
* structures to allocate in a block * allocate in a block
*/ */
#define NUM_SIGNAL_ACTIONS 16 #define NUM_SIGNAL_ACTIONS 16
@ -59,9 +59,9 @@
#define NUM_SIGNALS_PENDING 16 #define NUM_SIGNALS_PENDING 16
#define NUM_INT_SIGNALS_PENDING 8 #define NUM_INT_SIGNALS_PENDING 8
/************************************************************ /****************************************************************************
* Public Type Definitions * Public Type Definitions
************************************************************/ ****************************************************************************/
enum sigalloc_e enum sigalloc_e
{ {
@ -113,47 +113,45 @@ struct sigq_s
}; };
typedef struct sigq_s sigq_t; typedef struct sigq_s sigq_t;
/************************************************************ /****************************************************************************
* Global Variables * Global Variables
************************************************************/ ****************************************************************************/
/* The g_sigfreeaction data structure is a list of available /* The g_sigfreeaction data structure is a list of available signal action
* signal action structures. * structures.
*/ */
extern sq_queue_t g_sigfreeaction; extern sq_queue_t g_sigfreeaction;
/* The g_sigpendingaction data structure is a list of available /* The g_sigpendingaction data structure is a list of available pending
* pending signal action structures. * signal action structures.
*/ */
extern sq_queue_t g_sigpendingaction; extern sq_queue_t g_sigpendingaction;
/* The g_sigpendingirqaction is a list of available /* The g_sigpendingirqaction is a list of available pending signal actions
* pending signal actions that are reserved for use by * that are reserved for use by interrupt handlers.
* interrupt handlers.
*/ */
extern sq_queue_t g_sigpendingirqaction; extern sq_queue_t g_sigpendingirqaction;
/* The g_sigpendingsignal data structure is a list of /* The g_sigpendingsignal data structure is a list of available pending
* available pending signal structures. * signal structures.
*/ */
extern sq_queue_t g_sigpendingsignal; extern sq_queue_t g_sigpendingsignal;
/* The g_sigpendingirqsignal data structure is a list /* The g_sigpendingirqsignal data structure is a list of available pending
* of available pending signal structures that are reserved * signal structures that are reserved for use by interrupt handlers.
* for use by interrupt handlers.
*/ */
extern sq_queue_t g_sigpendingirqsignal; extern sq_queue_t g_sigpendingirqsignal;
/************************************************************ /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
************************************************************/ ****************************************************************************/
/* Internal signal-related interfaces ***********************/ /* Internal signal-related interfaces ***************************************/
/* sig_intialize.c */ /* sig_intialize.c */
@ -176,8 +174,7 @@ extern void sig_deliver(FAR _TCB *stcb);
extern FAR sigactq_t *sig_findaction(FAR _TCB *stcb, int signo); extern FAR sigactq_t *sig_findaction(FAR _TCB *stcb, int signo);
extern int sig_lowest(sigset_t *set); extern int sig_lowest(sigset_t *set);
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
extern int sig_mqnotempty(int tid, int signo, extern int sig_mqnotempty(int tid, int signo, union sigval value);
const union sigval value);
#else #else
extern int sig_mqnotempty(int tid, int signo, extern int sig_mqnotempty(int tid, int signo,
void *sival_ptr); void *sival_ptr);

View file

@ -1,7 +1,7 @@
/************************************************************ /****************************************************************************
* sig_mqnotempty.c * sched/sig_mqnotempty.c
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************/ ****************************************************************************/
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
#include <sys/types.h> #include <sys/types.h>
@ -45,31 +45,31 @@
#include "os_internal.h" #include "os_internal.h"
#include "sig_internal.h" #include "sig_internal.h"
/************************************************************ /****************************************************************************
* Definitions * Definitions
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Type Declarations * Private Type Declarations
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Global Variables * Global Variables
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Variables * Private Variables
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Functionss * Private Functionss
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Function: sig_mqnotempty * Function: sig_mqnotempty
* *
* Description: * Description:
@ -79,10 +79,10 @@
* sigqueue(), except that it sets the si_code field in * sigqueue(), except that it sets the si_code field in
* the siginfo structure to SI_MESGQ rather than SI_QUEUE. * the siginfo structure to SI_MESGQ rather than SI_QUEUE.
* *
************************************************************/ ****************************************************************************/
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
int sig_mqnotempty (int pid, int signo, const union sigval value) int sig_mqnotempty (int pid, int signo, union sigval value)
#else #else
int sig_mqnotempty (int pid, int signo, void *sival_ptr) int sig_mqnotempty (int pid, int signo, void *sival_ptr)
#endif #endif

View file

@ -1,7 +1,7 @@
/************************************************************ /****************************************************************************
* sig_queue.c * sched/sig_queue.c
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Included Files * Included Files
************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
@ -47,31 +47,31 @@
#include "os_internal.h" #include "os_internal.h"
#include "sig_internal.h" #include "sig_internal.h"
/************************************************************ /****************************************************************************
* Definitions * Definitions
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Type Declarations * Private Type Declarations
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Global Variables * Global Variables
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Variables * Private Variables
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Private Functions * Private Functions
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Public Functions * Public Functions
************************************************************/ ****************************************************************************/
/************************************************************ /****************************************************************************
* Function: sigqueue * Function: sigqueue
* *
* Description: * Description:
@ -105,10 +105,10 @@
* *
* Assumptions: * Assumptions:
* *
************************************************************/ ****************************************************************************/
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
int sigqueue (int pid, int signo, const union sigval value) int sigqueue (int pid, int signo, union sigval value)
#else #else
int sigqueue(int pid, int signo, void *sival_ptr) int sigqueue(int pid, int signo, void *sival_ptr)
#endif #endif