From baeaa29fdb342561019322c8c54b4d1fa688cb97 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Fri, 28 Feb 1992 17:51:33 +0000 Subject: [PATCH] ANSI C changes --- src/rec/recBi.c | 19 ++++++++++--------- src/rec/recBo.c | 21 +++++++++++---------- src/rec/recEvent.c | 11 ++++++----- src/rec/recFanout.c | 5 +++-- src/rec/recHistogram.c | 19 +++++++++---------- src/rec/recMbbi.c | 19 ++++++++++--------- src/rec/recMbbo.c | 20 ++++++++++---------- src/rec/recPermissive.c | 5 +++-- src/rec/recState.c | 8 +++++--- src/rec/recStringin.c | 9 +++++---- src/rec/recStringout.c | 9 +++++---- src/rec/recTimer.c | 9 +++++---- 12 files changed, 82 insertions(+), 72 deletions(-) diff --git a/src/rec/recBi.c b/src/rec/recBi.c index c14bf5b2b..448c232d0 100644 --- a/src/rec/recBi.c +++ b/src/rec/recBi.c @@ -47,13 +47,14 @@ * .13 10-24-91 jba Moved comment * .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .15 02-05-92 jba Changed function arguments from paddr to precord + * .16 02-28-92 jba ANSI C changes */ #include #include #include #include -#include +#include #include #include @@ -67,22 +68,22 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL #define get_units NULL #define get_precision NULL -long get_enum_str(); -long get_enum_strs(); -long put_enum_str(); +static long get_enum_str(); +static long get_enum_strs(); +static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL -struct rset biRSET={ +static struct rset biRSET={ RSETNUMBER, report, initialize, @@ -204,7 +205,7 @@ static long get_enum_strs(paddr,pes) struct biRecord *pbi=(struct biRecord *)paddr->precord; pes->no_str = 2; - bzero(pes->strs,sizeof(pes->strs)); + memset(pes->strs,'\0',sizeof(pes->strs)); strncpy(pes->strs[0],pbi->znam,sizeof(pbi->znam)); strncpy(pes->strs[1],pbi->onam,sizeof(pbi->onam)); return(0); diff --git a/src/rec/recBo.c b/src/rec/recBo.c index c0f366e67..58c81dde1 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -54,13 +54,15 @@ * .18 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .19 01-08-92 jba Added cast in call to wdStart to remove compile warning message * .20 02-05-92 jba Changed function arguments from paddr to precord + * .21 02-28-92 jba ANSI C changes */ #include #include #include #include -#include +#include +#include #include #include @@ -77,18 +79,18 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL #define get_units NULL #define get_precision NULL -long get_enum_str(); -long get_enum_strs(); -long put_enum_str(); +static long get_enum_str(); +static long get_enum_strs(); +static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL @@ -140,7 +142,6 @@ void monitor(); static void myCallback(pcallback) struct callback *pcallback; { - short value=0; struct boRecord *pbo = (struct boRecord *)(pcallback->dbAddr.precord); dbScanLock((struct dbCommon *)pbo); @@ -172,7 +173,7 @@ static long init_record(pbo) pbo->udf = FALSE; } pcallback = (struct callback *)(calloc(1,sizeof(struct callback))); - pbo->dpvt = (caddr_t)pcallback; + pbo->dpvt = (void *)pcallback; pcallback->callback = myCallback; pcallback->priority = priorityMedium; if(dbNameToAddr(pbo->name,&(pcallback->dbAddr))) { @@ -285,7 +286,7 @@ static long get_enum_strs(paddr,pes) struct boRecord *pbo=(struct boRecord *)paddr->precord; pes->no_str = 2; - bzero(pes->strs,sizeof(pes->strs)); + memset(pes->strs,'\0',sizeof(pes->strs)); strncpy(pes->strs[0],pbo->znam,sizeof(pbo->znam)); strncpy(pes->strs[1],pbo->onam,sizeof(pbo->onam)); return(0); diff --git a/src/rec/recEvent.c b/src/rec/recEvent.c index e9ec77719..4aee3d88b 100644 --- a/src/rec/recEvent.c +++ b/src/rec/recEvent.c @@ -29,7 +29,8 @@ * * Modification Log: * ----------------- - * .00 12-13-91 jba Initial definition + 4 .00 12-13-91 jba Initial definition + * .01 02-28-92 jba ANSI C changes */ #include @@ -51,10 +52,10 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL @@ -142,7 +143,7 @@ static long get_value(pevent,pvdes) { pvdes->field_type = DBF_USHORT; pvdes->no_elements=1; - pvdes->pvalue = (caddr_t)(&pevent->val); + pvdes->pvalue = (void *)(&pevent->val); return(0); } diff --git a/src/rec/recFanout.c b/src/rec/recFanout.c index 95883b3f4..fa9ed4900 100644 --- a/src/rec/recFanout.c +++ b/src/rec/recFanout.c @@ -41,6 +41,7 @@ * .10 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .11 02-05-92 jba Changed function arguments from paddr to precord * .12 02-05-92 jba Added FWD scan link + * .13 02-28-92 jba ANSI C changes */ #include @@ -59,8 +60,8 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL #define get_value NULL #define cvt_dbaddr NULL diff --git a/src/rec/recHistogram.c b/src/rec/recHistogram.c index 3d8934a1b..06426af3a 100644 --- a/src/rec/recHistogram.c +++ b/src/rec/recHistogram.c @@ -31,6 +31,7 @@ * ----------------- * .01 10-14-91 jba Added dev sup crtl fld and wd timer * .02 02-05-92 jba Changed function arguments from paddr to precord + * .03 02-28-92 jba ANSI C changes */ #include @@ -41,6 +42,7 @@ #include #include #include +#include #include #include @@ -56,12 +58,12 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); +static long init_record(); static long process(); -long special(); -long get_value(); -long cvt_dbaddr(); -long get_array_info(); +static long special(); +static long get_value(); +static long cvt_dbaddr(); +static long get_array_info(); #define put_array_info NULL #define get_units NULL #define get_precision NULL @@ -158,7 +160,7 @@ static long init_record(phistogram) if(phistogram->wdog==NULL && phistogram->sdel!=0) { /* initialize a watchdog timer */ pcallback = (struct callback *)(calloc(1,sizeof(struct callback))); - phistogram->wdog = (caddr_t)pcallback; + phistogram->wdog = (void *)pcallback; pcallback->callback = wdCallback; pcallback->priority = priorityLow; if(dbNameToAddr(phistogram->name,&(pcallback->dbAddr))) { @@ -238,7 +240,6 @@ static long special(paddr,after) int after; { struct histogramRecord *phistogram = (struct histogramRecord *)(paddr->precord); - struct histogramdset *pdset = (struct histogramdset *) (phistogram->dset); int special_type = paddr->special; if(!after) return(0); @@ -274,7 +275,6 @@ static void monitor(phistogram) { unsigned short monitor_mask; short stat,sevr,nsta,nsev; - struct callback *pcallback=(struct callback *)(phistogram->dpvt); /* get previous stat and sevr and new stat and sevr*/ stat=phistogram->stat; @@ -330,7 +330,7 @@ static long cvt_dbaddr(paddr) /* This may get called before init_record. If so just call it*/ if(phistogram->bptr==NULL) init_record(phistogram); - paddr->pfield = (caddr_t)(phistogram->bptr); + paddr->pfield = (void *)(phistogram->bptr); paddr->no_elements = phistogram->nelm; paddr->field_type = DBF_ULONG; paddr->field_size = sizeof(long); @@ -356,7 +356,6 @@ static long add_count(phistogram) double temp; unsigned long *pdest; int i; - double sgnl; if(phistogram->csta==FALSE) return(0); diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index f039f9a4d..95644bbe3 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -48,13 +48,14 @@ * .13 10-31-90 mrk changes for new record and device support * .14 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .15 02-05-92 jba Changed function arguments from paddr to precord + * .16 02-28-92 jba ANSI C changes */ #include #include #include #include -#include +#include #include #include @@ -68,18 +69,18 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); -long special(); -long get_value(); +static long init_record(); +static long process(); +static long special(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL #define get_units NULL #define get_precision NULL -long get_enum_str(); -long get_enum_strs(); -long put_enum_str(); +static long get_enum_str(); +static long get_enum_strs(); +static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL @@ -275,7 +276,7 @@ static long get_enum_strs(paddr,pes) short no_str; no_str = 0; - bzero(pes->strs,sizeof(pes->strs)); + memset(pes->strs,'\0',sizeof(pes->strs)); for(i=0,psource=(pmbbi->zrst); i<16; i++, psource += sizeof(pmbbi->zrst) ) { strncpy(pes->strs[i],psource,sizeof(pmbbi->zrst)); if(*psource!=0) no_str=i+1; diff --git a/src/rec/recMbbo.c b/src/rec/recMbbo.c index db791e600..cb3188e76 100644 --- a/src/rec/recMbbo.c +++ b/src/rec/recMbbo.c @@ -51,13 +51,14 @@ * .16 10-11-90 mrk make changes for new record and device support * .17 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .18 02-05-92 jba Changed function arguments from paddr to precord + * .19 02-28-92 jba ANSI C changes */ #include #include #include #include -#include +#include #include #include @@ -72,18 +73,18 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); -long special(); -long get_value(); +static long init_record(); +static long process(); +static long special(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL #define get_units NULL #define get_precision NULL -long get_enum_str(); -long get_enum_strs(); -long put_enum_str(); +static long get_enum_str(); +static long get_enum_strs(); +static long put_enum_str(); #define get_graphic_double NULL #define get_control_double NULL #define get_alarm_double NULL @@ -204,7 +205,6 @@ static long process(pmbbo) { struct mbbodset *pdset = (struct mbbodset *)(pmbbo->dset); long status=0; - unsigned short rbv; if( (pdset==NULL) || (pdset->write_mbbo==NULL) ) { pmbbo->pact=TRUE; @@ -321,7 +321,7 @@ static long get_enum_strs(paddr,pes) short no_str; no_str=0; - bzero(pes->strs,sizeof(pes->strs)); + memset(pes->strs,'\0',sizeof(pes->strs)); for(i=0,psource=(pmbbo->zrst); i<16; i++, psource += sizeof(pmbbo->zrst) ) { strncpy(pes->strs[i],psource,sizeof(pmbbo->zrst)); if(*psource!=0)no_str=i+1; diff --git a/src/rec/recPermissive.c b/src/rec/recPermissive.c index dec95aab2..c98b144fc 100644 --- a/src/rec/recPermissive.c +++ b/src/rec/recPermissive.c @@ -33,6 +33,7 @@ * .01 10-10-90 mrk extensible record and device support * .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .03 02-05-92 jba Changed function arguments from paddr to precord + * .04 02-28-92 jba ANSI C changes */ #include @@ -51,9 +52,9 @@ #define report NULL #define initialize NULL #define init_record NULL -long process(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL diff --git a/src/rec/recState.c b/src/rec/recState.c index e1e5d401c..8bd17a47d 100644 --- a/src/rec/recState.c +++ b/src/rec/recState.c @@ -33,12 +33,14 @@ * .01 10-10-90 mrk extensible record and device support * .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .03 02-05-92 jba Changed function arguments from paddr to precord + * .04 02-28-92 jba ANSI C changes */ #include #include #include #include +#include #include #include @@ -52,9 +54,9 @@ #define report NULL #define initialize NULL #define init_record NULL -long process(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL @@ -109,7 +111,7 @@ static long get_value(pstate,pvdes) { pvdes->field_type = DBF_STRING; pvdes->no_elements=1; - pvdes->pvalue = (caddr_t)(&pstate->val[0]); + pvdes->pvalue = (void *)(&pstate->val[0]); return(0); } diff --git a/src/rec/recStringin.c b/src/rec/recStringin.c index a4829a176..d1320ed5d 100644 --- a/src/rec/recStringin.c +++ b/src/rec/recStringin.c @@ -31,6 +31,7 @@ * ----------------- * .01 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .02 02-05-92 jba Changed function arguments from paddr to precord + * .03 02-28-92 jba ANSI C changes */ @@ -52,10 +53,10 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL @@ -157,7 +158,7 @@ static long get_value(pstringin,pvdes) { pvdes->field_type = DBF_STRING; pvdes->no_elements=1; - pvdes->pvalue = (caddr_t)(&pstringin->val[0]); + pvdes->pvalue = (void *)(&pstringin->val[0]); return(0); } diff --git a/src/rec/recStringout.c b/src/rec/recStringout.c index ea466260b..ad749db75 100644 --- a/src/rec/recStringout.c +++ b/src/rec/recStringout.c @@ -32,6 +32,7 @@ * .01 10-24-91 jba Removed unused code * .02 11-11-91 jba Moved set and reset of alarm stat and sevr to macros * .03 02-05-92 jba Changed function arguments from paddr to precord + * .04 02-28-92 jba ANSI C changes */ @@ -53,10 +54,10 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL @@ -181,7 +182,7 @@ static long get_value(pstringout,pvdes) { pvdes->field_type = DBF_STRING; pvdes->no_elements=1; - pvdes->pvalue = (caddr_t)(&pstringout->val[0]); + pvdes->pvalue = (void *)(&pstringout->val[0]); return(0); } diff --git a/src/rec/recTimer.c b/src/rec/recTimer.c index df9dd8894..06760c2c9 100644 --- a/src/rec/recTimer.c +++ b/src/rec/recTimer.c @@ -45,6 +45,7 @@ * .12 12-02-91 jba Added cmd control to io-interrupt processing * .13 12-12-91 jba Set cmd to zero in io-interrupt processing * .14 02-05-92 jba Changed function arguments from paddr to precord + * .15 02-28-92 jba ANSI C changes */ #include @@ -65,10 +66,10 @@ /* Create RSET - Record Support Entry Table*/ #define report NULL #define initialize NULL -long init_record(); -long process(); +static long init_record(); +static long process(); #define special NULL -long get_value(); +static long get_value(); #define cvt_dbaddr NULL #define get_array_info NULL #define put_array_info NULL @@ -102,7 +103,7 @@ struct rset timerRSET={ get_alarm_double }; /* because the driver does all the work just declare device support here*/ -long get_ioint_info(); +static long get_ioint_info(); struct dset devTmMizar8310={4,NULL,NULL,NULL,get_ioint_info}; struct dset devTmDg535={4,NULL,NULL,NULL,get_ioint_info}; struct dset devTmVxiAt5={4,NULL,NULL,NULL,get_ioint_info};