From ad0a8632c7dd2cc5f77d657c526f762278647b8e Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Mon, 26 Jul 1993 14:27:36 +0000 Subject: [PATCH] put away for mda correction of (#elif's) --- src/ca/access.c | 68 +++++++++++++++++++++---------------- src/ca/acctst.c | 4 ++- src/ca/ca_printf.c | 10 ++++-- src/ca/conn.c | 10 ++++-- src/ca/flow_control.c | 10 ++++-- src/ca/gsd_sync_subr.c | 14 ++++---- src/ca/iocinf.c | 42 ++++++++++++++--------- src/ca/iocinf.h | 44 +++++++++++++++--------- src/ca/os_depen.h | 76 ++++++++++++++++++++++++++++-------------- src/ca/repeater.c | 12 ++++--- src/ca/service.c | 10 ++++-- 11 files changed, 193 insertions(+), 107 deletions(-) diff --git a/src/ca/access.c b/src/ca/access.c index 60c62570b..b15ebbb6f 100644 --- a/src/ca/access.c +++ b/src/ca/access.c @@ -122,13 +122,17 @@ static char *sccsId = "$Id$\t$Date$"; # include psldef.h # include prcdef.h # include descrip.h -#elif defined(UNIX) -#elif defined(vxWorks) +#else +# if defined(UNIX) +# else +# if defined(vxWorks) # include # include # include -#else +# else @@@@ dont compile @@@@ +# endif +# endif #endif /* @@ -353,7 +357,8 @@ ca_task_initialize if (status != SS$_NORMAL) lib$signal(status); } -#elif defined(vxWorks) +#else +# if defined(vxWorks) { char name[15]; int status; @@ -364,11 +369,11 @@ ca_task_initialize FASTLOCKINIT(&client_lock); FASTLOCKINIT(&event_lock); -#ifdef V5_vxWorks +# ifdef V5_vxWorks io_done_sem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY); -#else +# else io_done_sem = semCreate(); -#endif +# endif if(!io_done_sem){ abort(); } @@ -391,9 +396,12 @@ ca_task_initialize if (status != OK) abort(); } -#elif defined(UNIX) -#else +# else +# if defined(UNIX) +# else @@@@ dont compile in this case @@@@ +# endif +# endif #endif } @@ -1041,7 +1049,7 @@ int ca_build_and_connect /* Save this channels name for retry if required */ strncpy(chix + 1, name_str, strcnt); - dllAdd(&iiu[BROADCAST_IIU].chidlist, chix); + dllAdd(&iiu[BROADCAST_IIU].chidlist, (DLLNODE *)chix); /* * set the conn tries back to zero so this channel's location * can be found @@ -1220,7 +1228,7 @@ ca_array_get * * */ -ca_array_get_callback +int ca_array_get_callback #ifdef __STDC__ ( chtype type, @@ -1276,7 +1284,7 @@ ca_array_get_callback monix->type = type; monix->count = count; - dllAdd(&pend_read_list, monix); + dllAdd(&pend_read_list, (DLLNODE *)monix); issue_get_callback(monix); @@ -1356,7 +1364,7 @@ issue_get_callback(monix) * * */ -ca_array_put +int ca_array_put #ifdef __STDC__ ( chtype type, @@ -1619,7 +1627,7 @@ void *astarg; return ECA_ALLOCMEM; pioe->io_done_arg = astarg; pioe->io_done_sub = ast; - dllAdd(&ioeventlist,pioe); + dllAdd(&ioeventlist,(DLLNODE *)pioe); UNLOCK; } @@ -1634,7 +1642,7 @@ void *astarg; * * */ -ca_add_masked_array_event +int ca_add_masked_array_event #ifdef __STDC__ ( chtype type, @@ -1763,7 +1771,7 @@ unsigned mask; /* It can be added to the list any place if it is remote */ /* Place in the channel list */ - dllAdd(&chix->eventq, monix); + dllAdd(&chix->eventq, (DLLNODE *)monix); ca_request_event(monix); @@ -2083,7 +2091,7 @@ ca_clear_event piiu->outstanding_ack_count++; } else{ - dllDelete(&monix->chan->eventq, monix); + dllDelete(&monix->chan->eventq, (DLLNODE *)monix); } UNLOCK; @@ -2172,7 +2180,7 @@ ca_clear_channel */ if(old_chan_state != cs_conn){ dllConcat(&free_event_list, &chix->eventq); - dllDelete(&piiu->chidlist, chix); + dllDelete(&piiu->chidlist, (DLLNODE *)chix); if (chix->iocix != BROADCAST_IIU && !piiu->chidlist.count){ close_ioc(piiu); @@ -2247,9 +2255,9 @@ ca_clear_channel /* ca_flush_io() is called by this routine. */ /************************************************************************/ #ifdef __STDC__ -ca_pend(ca_real timeout, int early) +int ca_pend(ca_real timeout, int early) #else -ca_pend(timeout, early) +int ca_pend(timeout, early) ca_real timeout; int early; #endif @@ -2313,7 +2321,7 @@ int early; beg_time = time(NULL); while(TRUE){ -# if defined(UNIX) +#if defined(UNIX) { struct timeval itimeout; @@ -2323,16 +2331,18 @@ int early; recv_msg_select(&itimeout); UNLOCK; } -# elif defined(vxWorks) -#ifdef V5_vxWorks - semTake(io_done_sem, LOCALTICKS); #else +# if defined(vxWorks) +# ifdef V5_vxWorks + semTake(io_done_sem, LOCALTICKS); +# else { int dummy; vrtxPend(&io_done_sem->count, LOCALTICKS, &dummy); } -#endif -# elif defined(VMS) +# endif +# else +# if defined(VMS) { int status; unsigned int systim[2]={-LOCALTICKS,~0}; @@ -2349,9 +2359,11 @@ int early; if(status != SS$_NORMAL) lib$signal(status); } -# else +# else @@@@ dont compile in this case @@@@ -# endif +# endif +# endif +#endif LOCK; manage_conn(TRUE); diff --git a/src/ca/acctst.c b/src/ca/acctst.c index 433b957f6..e8412b72f 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -20,9 +20,11 @@ static char *sccsId = "$Id$\t$Date$"; /* System includes */ #if defined(UNIX) # include -#elif defined(vxWorks) +#else +# if defined(vxWorks) # include # include +# endif #endif #include diff --git a/src/ca/ca_printf.c b/src/ca/ca_printf.c index 0b5f1f5c9..7d25cb70f 100644 --- a/src/ca/ca_printf.c +++ b/src/ca/ca_printf.c @@ -2,8 +2,10 @@ static char *sccsId = "@(#)ca_printf.c 1.2\t7/27/92"; #if defined(UNIX) || defined(VMS) # include -#elif defined(vxWorks) +#else +# if defined(vxWorks) # include +# endif #endif #include @@ -35,7 +37,8 @@ va_dcl pformat, args); } -# elif defined(vxWorks) +# else +# if defined(vxWorks) { int logMsgArgs[6]; int i; @@ -55,8 +58,9 @@ va_dcl logMsgArgs[6]); } -# else +# else #### dont compile in this case #### +# endif # endif va_end(args); diff --git a/src/ca/conn.c b/src/ca/conn.c index bc113941f..da1bd62eb 100644 --- a/src/ca/conn.c +++ b/src/ca/conn.c @@ -37,11 +37,15 @@ static char *sccsId = "$Id$\t$Date$"; #if defined(UNIX) # include -#elif defined(VMS) -#elif defined(vxWorks) -#include #else +# if defined(VMS) +# else +# if defined(vxWorks) +#include +# else @@@@ dont compile @@@@ +# endif +# endif #endif #include diff --git a/src/ca/flow_control.c b/src/ca/flow_control.c index ebd2f5f78..a95193b6b 100644 --- a/src/ca/flow_control.c +++ b/src/ca/flow_control.c @@ -43,7 +43,8 @@ static char *sccsId = "$Id$\t$Date$"; # ifndef V5_vxWorks # include # endif -#elif defined(VMS) +#else +# if defined(VMS) # include # include # if defined(UCX) /* GeG 09-DEC-1992 */ @@ -52,12 +53,15 @@ static char *sccsId = "$Id$\t$Date$"; # else # include # endif -#elif defined(UNIX) +# else +# if defined(UNIX) # include # include # include -#else +# else @@@@ dont compile @@@@ +# endif +# endif #endif #include diff --git a/src/ca/gsd_sync_subr.c b/src/ca/gsd_sync_subr.c index db8f95366..b7f85f333 100644 --- a/src/ca/gsd_sync_subr.c +++ b/src/ca/gsd_sync_subr.c @@ -88,20 +88,22 @@ static char *sccsId = "@(#)gsd_sync_subr.c 1.8\t11/5/92"; # include # include # include -#elif defined(vxWorks) -# define abort(A) taskSuspend(taskIdSelf()) -#ifdef V5vxWorks -# include #else +# if defined(vxWorks) +# define abort(A) taskSuspend(taskIdSelf()) +# ifdef V5vxWorks +# include +# else # include -#endif +# endif # if 0 /* needed ?? */ # include # include # include # endif -#else +# else @@@@ dont compile in this case @@@@ +# endif #endif #include diff --git a/src/ca/iocinf.c b/src/ca/iocinf.c index e4df068b9..120662400 100644 --- a/src/ca/iocinf.c +++ b/src/ca/iocinf.c @@ -69,6 +69,7 @@ static char *sccsId = "$Id$\t$Date$"; /* Allocate storage for global variables in this module */ #define CA_GLBLSOURCE + #if defined(VMS) # include # include @@ -79,21 +80,23 @@ static char *sccsId = "$Id$\t$Date$"; # include # include # include -#if defined(UCX) /* GeG 09-DEC-1992 */ +# if defined(UCX) /* GeG 09-DEC-1992 */ # include # include -#else +# else # include # include -#endif -#elif defined(UNIX) +# endif +#else +# if defined(UNIX) # include # include # include # include # include # include -#elif defined(vxWorks) +# else +# if defined(vxWorks) # include # ifdef V5_vxWorks # include @@ -107,8 +110,11 @@ static char *sccsId = "$Id$\t$Date$"; # include # include # include +# endif +# endif #endif + #include #include #include @@ -131,16 +137,16 @@ void vms_recv_msg_ast(); /* * used to be that some TCP/IPs did not include this */ +#ifndef NBBY +# define NBBY 8 /* number of bits per byte */ +#endif + #ifdef JUNKYARD typedef long fd_mask; typedef struct fd_set { fd_mask fds_bits[64]; } fd_set; -#ifndef NBBY -# define NBBY 8 /* number of bits per byte */ -#endif - #ifndef NFDBITS #define NFDBITS (sizeof(int) * NBBY) /* bits per mask */ #endif @@ -520,7 +526,7 @@ struct ioc_in_use *piiu; /* Set up recv thread for VMS */ -# if defined(VMS) +#if defined(VMS) { /* * request to be informed of future IO @@ -543,7 +549,8 @@ struct ioc_in_use *piiu; exit(); } } -# elif defined(vxWorks) +#else +# if defined(vxWorks) { static void recv_task(); int pri; @@ -573,7 +580,8 @@ struct ioc_in_use *piiu; piiu->recv_tid = status; } -# endif +# endif +#endif return ECA_NORMAL; } @@ -668,12 +676,14 @@ void cac_send_msg() * frees up push pull deadlock only * if recv not already in progress */ -# if defined(UNIX) +#if defined(UNIX) if(post_msg_active==0){ recv_msg_select(¬imeout); } -# elif defined(vxWorks) -# endif +#else +# if defined(vxWorks) +# endif +#endif done = TRUE; for(piiu=iiu; piiu<&iiu[nxtiiu]; piiu++){ @@ -865,7 +875,7 @@ void recv_msg_select(ptimeout) struct timeval *ptimeout; { - long status; + int status; register struct ioc_in_use *piiu; struct timeval *ptmptimeout; diff --git a/src/ca/iocinf.h b/src/ca/iocinf.h index 4e9d7a37b..fda0f0b3f 100644 --- a/src/ca/iocinf.h +++ b/src/ca/iocinf.h @@ -59,24 +59,26 @@ static char *iocinfhSccsId = "$Id$\t$Date$"; #if defined(UNIX) # include # include -#elif defined(VMS) +#else +# if defined(VMS) # include # include # include -#elif defined(vxWorks) +# else +# if defined(vxWorks) # ifdef V5_vxWorks # include # else # include # endif # include -#else +# else DONT_COMPILE +# endif +# endif #endif -#ifndef INCdllLibh -# include -#endif +# include #ifndef INCos_depenh # include @@ -150,7 +152,8 @@ typedef unsigned long ca_time; # define readch (ca_static->ca_readch) # define writech (ca_static->ca_writech) # define excepch (ca_static->ca_excepch) -#elif defined(vxWorks) +#else +# if defined(vxWorks) # define io_done_sem (ca_static->ca_io_done_sem) # define evuser (ca_static->ca_evuser) # define client_lock (ca_static->ca_client_lock) @@ -159,12 +162,15 @@ typedef unsigned long ca_time; # define dbfree_ev_list (ca_static->ca_dbfree_ev_list) # define lcl_buff_list (ca_static->ca_lcl_buff_list) # define event_tid (ca_static->ca_event_tid) -#elif defined(VMS) +# else +# if defined(VMS) # define io_done_flag (ca_static->ca_io_done_flag) # define peek_ast_buf (ca_static->ca_peek_ast_buf) # define ast_lock_count (ca_static->ca_ast_lock_count) -#else +# else DONT_COMPILE +# endif +# endif #endif @@ -190,11 +196,13 @@ struct ca_static{ #if defined(UNIX) fd_set ca_readch; fd_set ca_excepch; -#elif defined(VMS) +#else +# if defined(VMS) int ca_io_done_flag; char ca_peek_ast_buf; long ca_ast_lock_count; -#elif defined(vxWorks) +# else +# if defined(vxWorks) SEM_ID ca_io_done_sem; void *ca_evuser; FAST_LOCK ca_client_lock; @@ -205,8 +213,10 @@ struct ca_static{ DLLLIST ca_lcl_buff_list; int ca_event_tid; unsigned ca_local_ticks; -#else +# else DONT_COMPILE +# endif +# endif #endif struct ioc_in_use{ unsigned outstanding_ack_count; @@ -234,11 +244,15 @@ struct ca_static{ #if defined(VMS) /* for qio ASTs */ struct sockaddr_in recvfrom; struct iosb iosb; -#elif defined(vxWorks) - int recv_tid; -#elif defined(UNIX) #else +# if defined(vxWorks) + int recv_tid; +# else +# if defined(UNIX) +# else DONT_COMPILE +# endif +# endif #endif } ca_iiu[MAXIIU]; }; diff --git a/src/ca/os_depen.h b/src/ca/os_depen.h index 410de1331..6bae8457d 100644 --- a/src/ca/os_depen.h +++ b/src/ca/os_depen.h @@ -38,7 +38,8 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; # ifndef _sys_errno_h # include # endif -#elif defined(vxWorks) +#else +# if defined(vxWorks) # ifndef INCvxWorksh # include # endif @@ -51,9 +52,12 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; # ifndef V5_vxWorks IMPORT ULONG taskIdCurrent; # endif -#elif defined(VMS) -#else +# else +# if defined(VMS) +# else @@@@ dont compile in this case @@@@ +# endif +# endif #endif @@ -109,7 +113,8 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; # define UNLOCKEVENTS # define EVENTLOCKTEST (post_msg_active!=0) # define RECV_ACTIVE(PIIU) (piiu->active) -#elif defined(vxWorks) +#else +# if defined(vxWorks) # define VXTASKIDNONE 0 # define LOCK FASTLOCK(&client_lock); # define UNLOCK FASTUNLOCK(&client_lock); @@ -117,15 +122,18 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; # define UNLOCKEVENTS {event_tid=VXTASKIDNONE; FASTUNLOCK(&event_lock);} # define EVENTLOCKTEST (FASTLOCKTEST(&event_lock)&&taskIdCurrent==event_tid) # define RECV_ACTIVE(PIIU) (piiu->recv_tid == taskIdCurrent) -#elif defined(UNIX) +# else +# if defined(UNIX) # define LOCK # define UNLOCK # define LOCKEVENTS # define UNLOCKEVENTS # define EVENTLOCKTEST (post_msg_active!=0) # define RECV_ACTIVE(PIIU) (piiu->active) -#else +# else @@@@ dont compile in this case @@@@ +# endif +# endif #endif #ifdef vxWorks @@ -137,23 +145,29 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; #if defined(VMS) -# if defined(WINTCP) /* Wallangong */ +# if defined(WINTCP) /* Wallangong */ /* (the VAXC runtime lib has its own close */ # define socket_close(S) netclose(S) # define socket_ioctl(A,B,C) ioctl(A,B,C) -# elif defined(UCX) /* GeG 09-DEC-1992 */ +# else +# if defined(UCX) /* GeG 09-DEC-1992 */ # define socket_close(S) close(S) # define socket_ioctl(A,B,C) ioctl(A,B,C) -# else -# endif -#elif defined(UNIX) -# define socket_close(S) close(S) -# define socket_ioctl(A,B,C) ioctl(A,B,C) -#elif defined(vxWorks) -# define socket_close(S) close(S) -# define socket_ioctl(A,B,C) ioctl(A,B,C) +# else +# endif +# endif #else +# if defined(UNIX) +# define socket_close(S) close(S) +# define socket_ioctl(A,B,C) ioctl(A,B,C) +# else +# if defined(vxWorks) +# define socket_close(S) close(S) +# define socket_ioctl(A,B,C) ioctl(A,B,C) +# else @@@@ dont compile in this case @@@@ +# endif +# endif #endif #if defined(VMS) @@ -164,11 +178,15 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; extern volatile int noshare socket_errno; # define MYERRNO socket_errno # endif -#elif defined(vxWorks) +#else +# if defined(vxWorks) # define MYERRNO (errnoGet()&0xffff) -#elif defined(UNIX) +# else +# if defined(UNIX) extern int errno; # define MYERRNO errno +# endif +# endif #endif #ifdef VMS @@ -183,15 +201,19 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; #if defined(vxWorks) -#ifdef V5_vxWorks +# ifdef V5_vxWorks # define POST_IO_EV semGive(io_done_sem) -#else +# else # define POST_IO_EV vrtxPost(&io_done_sem->count, TRUE) -#endif -#elif defined(VMS) +# endif +#else +# if defined(VMS) # define POST_IO_EV sys$setef(io_done_flag) -#elif defined(UNIX) +# else +# if defined(UNIX) # define POST_IO_EV +# endif +# endif #endif /* delay for when a poll is used */ @@ -219,11 +241,13 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; status = sys$waitfr(ef); \ if(~status&STS$M_SUCCESS)lib$signal(status); \ }; -#elif defined(vxWorks) +#else +# if defined(vxWorks) # define SYSFREQ ((long) sysClkRateGet()) /* usually 60 Hz */ # define TCPDELAY taskDelay(ca_static->ca_local_ticks); # define time(A) (tickGet()/SYSFREQ) -#elif defined(UNIX) +# else +# if defined(UNIX) # define SYSFREQ 1000000L /* 1 MHz */ /* * this version of TCPDELAY copies tcpdelayval into temporary storage @@ -245,6 +269,8 @@ static char *os_depenhSccsId = "$Id$\t$Date$"; # else extern struct timeval tcpdelayval; # endif +# endif +# endif #endif #endif diff --git a/src/ca/repeater.c b/src/ca/repeater.c index 7defb4af9..e6dd759e0 100644 --- a/src/ca/repeater.c +++ b/src/ca/repeater.c @@ -67,22 +67,26 @@ static char *sccsId = "$Id$\t$Date$"; # include # include # include -#elif defined(UNIX) +#else +# if defined(UNIX) # include # include # include # include -#elif defined(vxWorks) +# else +# if defined(vxWorks) # include # include # include # include # include -#else +# else @@@@ dont compile @@@@ +# endif +# endif #endif -#include +#include #include #include diff --git a/src/ca/service.c b/src/ca/service.c index 982c10858..19293545f 100644 --- a/src/ca/service.c +++ b/src/ca/service.c @@ -73,16 +73,20 @@ static char *sccsId = "$Id$\t$Date$"; #if defined(VMS) # include # include -#elif defined(UNIX) +#else +# if defined(UNIX) # include # include -#elif defined(vxWorks) +# else +# if defined(vxWorks) # include # ifndef V5_vxWorks # include # endif -#else +# else @@@@ dont compile @@@@ +# endif +# endif #endif #include