From 4b95841fcd7eca391ae83f3f09ba89232cc7cf58 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Fri, 28 Mar 2003 20:25:43 +0000 Subject: [PATCH] more changes to get epicsShare to work on win32 --- src/db/dbNotify.c | 4 +- src/db/dbTest.c | 14 +++--- src/db/db_test.c | 6 +-- src/db/recGbl.c | 6 +-- src/dbStatic/devSup.h | 21 +++++--- src/dbStatic/recSup.h | 50 ++++++------------- src/dev/softDev/devAiSoft.c | 3 +- src/dev/softDev/devAiSoftRaw.c | 3 +- src/dev/softDev/devAoSoft.c | 3 +- src/dev/softDev/devAoSoftRaw.c | 3 +- src/dev/softDev/devBiSoft.c | 3 +- src/dev/softDev/devBiSoftRaw.c | 3 +- src/dev/softDev/devBoSoft.c | 3 +- src/dev/softDev/devBoSoftRaw.c | 3 +- src/dev/softDev/devEventSoft.c | 3 +- src/dev/softDev/devHistogramSoft.c | 3 +- src/dev/softDev/devLiSoft.c | 3 +- src/dev/softDev/devLoSoft.c | 3 +- src/dev/softDev/devMbbiDirectSoft.c | 3 +- src/dev/softDev/devMbbiDirectSoftRaw.c | 3 +- src/dev/softDev/devMbbiSoft.c | 3 +- src/dev/softDev/devMbbiSoftRaw.c | 3 +- src/dev/softDev/devMbboDirectSoft.c | 3 +- src/dev/softDev/devMbboDirectSoftRaw.c | 3 +- src/dev/softDev/devMbboSoft.c | 3 +- src/dev/softDev/devMbboSoftRaw.c | 3 +- src/dev/softDev/devSASoft.c | 6 ++- src/dev/softDev/devSiSoft.c | 3 +- src/dev/softDev/devSoSoft.c | 3 +- src/dev/softDev/devWfSoft.c | 6 ++- src/dev/testDev/devAiTestAsyn.c | 6 ++- src/dev/testDev/devAoTestAsyn.c | 6 ++- src/dev/testDev/devBiTestAsyn.c | 6 ++- src/dev/testDev/devBoTestAsyn.c | 6 ++- src/dev/testDev/devEventTestIoEvent.c | 3 +- src/dev/testDev/devHistogramTestAsyn.c | 6 ++- src/dev/testDev/devMbbiTestAsyn.c | 6 ++- src/dev/testDev/devMbboTestAsyn.c | 6 ++- src/dev/testDev/devSiTestAsyn.c | 6 ++- src/dev/testDev/devSoTestAsyn.c | 6 ++- src/dev/testDev/devWfTestAsyn.c | 6 ++- .../top/exampleApp/src/devXxxSoft.c | 3 +- src/registry/registerRecordDeviceDriver.pl | 8 +-- 43 files changed, 142 insertions(+), 111 deletions(-) diff --git a/src/db/dbNotify.c b/src/db/dbNotify.c index d31a6b564..0a5e7b975 100644 --- a/src/db/dbNotify.c +++ b/src/db/dbNotify.c @@ -410,7 +410,7 @@ int epicsShareAPI dbNotifyDump(void) if(precord->ppn->paddr->precord != precord) continue; ppn = precord->ppn; printf("%s state %d ppn %p\n waitList\n", - precord->name,ppn->state,ppn); + precord->name,ppn->state,(void*)ppn); ppnrWait = (putNotifyRecord *)ellFirst(&ppn->waitList); while(ppnrWait) { printf(" %s pact %d\n", @@ -420,7 +420,7 @@ int epicsShareAPI dbNotifyDump(void) printf(" restartList\n"); ppnRestart = (putNotify *)ellFirst(&precord->ppnr->restartList); while(ppnRestart) { - printf(" %p\n", ppnRestart); + printf(" %p\n", (void *)ppnRestart); ppnRestart = (putNotify *)ellNext(&ppnRestart->restartNode.node); } } diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 6cabff850..5629fb653 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -244,8 +244,8 @@ static int specified_by(char *ptest, char *pspec) pspec += inx; /* check for end of specification */ - if (*pspec == NULL) { - if (*ptest == NULL) return(TRUE); + if (*pspec == 0) { + if (*ptest == 0) return(TRUE); else return(FALSE); } } @@ -334,7 +334,7 @@ long epicsShareAPI dbpf(char *pname,char *pvalue) /* If entire field is digits then use DBR_ENUM else DBR_STRING*/ if((addr.dbr_field_type==DBR_ENUM) && (*pvalue!=0) && (strspn(pvalue,"0123456789")==strlen(pvalue))) { - short value; + unsigned short value; sscanf(pvalue,"%hu",&value); status=dbPutField(&addr,DBR_ENUM,&value,1L); @@ -626,8 +626,8 @@ long epicsShareAPI dbtpf(char *pname,char *pvalue) } } else printf("sscanf failed for DBR_DOUBLE\n"); /* DBR_ENUM */ - if(validNumber && sscanf(pvalue,"%hu",&svalue)==1) { - status=dbPutField(&addr,DBR_ENUM,&svalue,1L); + if(validNumber && sscanf(pvalue,"%hu",&usvalue)==1) { + status=dbPutField(&addr,DBR_ENUM,&usvalue,1L); if(status!=0) errMessage(status,"DBR_ENUM failed"); else { printf("DBR_ENUM ok\n"); @@ -744,9 +744,9 @@ static void printDbAddr(long status,DBADDR *paddr) if(status!=0) { errMessage(status,"dbNameToAddr error"); } - printf("Record Address: %p",paddr->precord); + printf("Record Address: %p",(void *)paddr->precord); printf(" Field Address: %p",paddr->pfield); - printf(" Field Description: %p\n",pdbFldDes); + printf(" Field Description: %p\n",(void *)pdbFldDes); printf(" No Elements: %ld\n",paddr->no_elements); printf(" Record Type: %s\n",pdbFldDes->pdbRecordType->name); printf(" FieldType: DBF_"); diff --git a/src/db/db_test.c b/src/db/db_test.c index 412cfdf41..5abba820e 100644 --- a/src/db/db_test.c +++ b/src/db/db_test.c @@ -51,7 +51,7 @@ int epicsShareAPI gft(char *pname) return(1); } printf(" Record Name: %s\n",pname); - printf("Record Address: 0x%p\n",addr.precord); + printf("Record Address: 0x%p\n",(void *)addr.precord); printf(" Field Type: %d\n",addr.dbr_field_type); printf(" Field Address: 0x%p\n",addr.pfield); printf(" Field Size: %d\n",addr.field_size); @@ -107,7 +107,7 @@ int epicsShareAPI pft(char *pname,char *pvalue) return(1); } printf(" Record Name: %s\n",pname); - printf("Record Address: 0x%p\n",addr.precord); + printf("Record Address: 0x%p\n",(void *)addr.precord); printf(" Field Type: %d\n",addr.dbr_field_type); printf(" Field Address: 0x%p\n",addr.pfield); printf(" Field Size: %d\n",addr.field_size); @@ -154,7 +154,7 @@ int epicsShareAPI pft(char *pname,char *pvalue) printf("\n\t CHAR GET failed"); else print_returned(DBR_CHAR,buffer,1); } - if(sscanf(pvalue,"%hu",&shortvalue)==1) { + if(sscanf(pvalue,"%hd",&shortvalue)==1) { if (db_put_field(paddr,DBR_ENUM,&shortvalue,1) < 0) printf("\n\t ENUM failed "); if (db_get_field(paddr,DBR_ENUM,buffer,1,NULL) < 0) diff --git a/src/db/recGbl.c b/src/db/recGbl.c index 675b6974c..609ce1682 100644 --- a/src/db/recGbl.c +++ b/src/db/recGbl.c @@ -208,7 +208,7 @@ int epicsShareAPI recGblInitConstantLink( unsigned short value; unsigned char *pvalue = (unsigned char *)pdest; - sscanf(plink->value.constantStr,"%hi",&value); + sscanf(plink->value.constantStr,"%hu",&value); *pvalue = value; } break; @@ -219,13 +219,13 @@ int epicsShareAPI recGblInitConstantLink( case DBF_ENUM : case DBF_MENU : case DBF_DEVICE : - sscanf(plink->value.constantStr,"%hi",(unsigned short *)pdest); + sscanf(plink->value.constantStr,"%hu",(unsigned short *)pdest); break; case DBF_LONG : sscanf(plink->value.constantStr,"%li",(long *)pdest); break; case DBF_ULONG : - sscanf(plink->value.constantStr,"%li",(unsigned long *)pdest); + sscanf(plink->value.constantStr,"%lu",(unsigned long *)pdest); break; case DBF_FLOAT : sscanf(plink->value.constantStr,"%f",(float *)pdest); diff --git a/src/dbStatic/devSup.h b/src/dbStatic/devSup.h index 163bb0645..7b618b2d0 100644 --- a/src/dbStatic/devSup.h +++ b/src/dbStatic/devSup.h @@ -18,19 +18,20 @@ #define INCdevSuph 1 #ifdef __cplusplus +extern "C" { typedef long (*DEVSUPFUN)(void*); /* ptr to device support function*/ #else typedef long (*DEVSUPFUN)(); /* ptr to device support function*/ #endif -struct dset { /* device support entry table */ - long number; /*number of support routines*/ - DEVSUPFUN report; /*print report*/ - DEVSUPFUN init; /*init support*/ - DEVSUPFUN init_record; /*init support for particular record*/ - DEVSUPFUN get_ioint_info; /* get io interrupt information*/ - /*other functions are record dependent*/ - }; +typedef struct dset { /* device support entry table */ + long number; /*number of support routines*/ + DEVSUPFUN report; /*print report*/ + DEVSUPFUN init; /*init support*/ + DEVSUPFUN init_record; /*init support for particular record*/ + DEVSUPFUN get_ioint_info; /* get io interrupt information*/ + /*other functions are record dependent*/ +}dset; #define S_dev_noDevSup (M_devSup| 1) /*SDR_DEVSUP: Device support missing*/ #define S_dev_noDSET (M_devSup| 3) /*Missing device support entry table*/ @@ -45,4 +46,8 @@ struct dset { /* device support entry table */ #define S_dev_Conflict (M_devSup|21) /*Multiple records accessing same signal*/ #define S_dev_noDeviceFound (M_devSup|23) /*No device found at specified address*/ +#ifdef __cplusplus +} // extern "C" +#endif + #endif diff --git a/src/dbStatic/recSup.h b/src/dbStatic/recSup.h index 53bc0f508..228b1e0e6 100644 --- a/src/dbStatic/recSup.h +++ b/src/dbStatic/recSup.h @@ -16,40 +16,14 @@ #ifndef INCrecSuph #define INCrecSuph 1 -typedef long (*RECSUPFUN) (); /* ptr to record support function*/ - #ifdef __cplusplus -#include -extern "C" -{ - struct rset { // record support entry table - long number; // no of support routines - long (*report) ( const dbCommon * precord ); // print report - long (*init) (); // init support - long (*init_record) ( dbCommon * precord, int pass ); // init record - long (*process) ( dbCommon * precord ); // process record - long (*special) ( DBADDR * paddr, int after ); // special processing - long (*get_value) (); // obsolete - long (*cvt_dbaddr) ( DBADDR * paddr ); // convert dbaddr - long (*get_array_info) ( const DBADDR * paddr, - long * no_elements, long * offset ); - long (*put_array_info) ( const DBADDR * paddr, const long nNew ); - long (*get_units) ( const DBADDR * paddr, char * units ); - long (*get_precision) ( const DBADDR * paddr, long * precision ); - long (*get_enum_str) ( const DBADDR * paddr, char * pstring ); - long (*get_enum_strs) ( const DBADDR * paddr, - struct dbr_enumStrs * pes ); - long (*put_enum_str) ( const DBADDR * paddr, const char * pstring ); - long (*get_graphic_double) ( const DBADDR * paddr, - struct dbr_grDouble * pgd ); - long (*get_control_double) ( const DBADDR * paddr, - struct dbr_ctrlDouble * pcd ); - long (*get_alarm_double) ( const DBADDR * paddr, - struct dbr_alDouble * pad ); - }; -} +extern "C" { +typedef long (*RECSUPFUN) (void *); /* ptr to record support function*/ #else -struct rset { /* record support entry table */ +typedef long (*RECSUPFUN) (); /* ptr to record support function*/ +#endif + +typedef struct rset { /* record support entry table */ long number; /*number of support routines */ RECSUPFUN report; /*print report */ RECSUPFUN init; /*init support */ @@ -68,8 +42,7 @@ struct rset { /* record support entry table */ RECSUPFUN get_graphic_double; RECSUPFUN get_control_double; RECSUPFUN get_alarm_double; - }; -#endif /* ifdef __cplusplus else */ +}rest; #define RSETNUMBER ( (sizeof(struct rset) - sizeof(long))/sizeof(RECSUPFUN) ) @@ -81,11 +54,11 @@ struct rset { /* record support entry table */ /* Definition os structure for routine get_value */ -struct valueDes { +typedef struct valueDes { long field_type; long no_elements; void * pvalue; -}; +}valueDes; /************************************************************************ * report(FILE fp,void *precord); @@ -106,4 +79,9 @@ struct valueDes { * get_control_double(paddr,struct dbr_ctrlDouble *p); * get_alarm_double(paddr,struct dbr_ctrlDouble *p); ***********************************************************************/ + +#ifdef __cplusplus +} // extern "C" +#endif + #endif /*INCrecSuph*/ diff --git a/src/dev/softDev/devAiSoft.c b/src/dev/softDev/devAiSoft.c index e1c54df98..d1f5d91d6 100644 --- a/src/dev/softDev/devAiSoft.c +++ b/src/dev/softDev/devAiSoft.c @@ -33,7 +33,7 @@ /* Create the dset for devAiSoft */ static long init_record(); static long read_ai(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -50,6 +50,7 @@ epicsShareDef struct { read_ai, NULL }; +epicsShareDef dset *pdevAiSoft = (dset *)&devAiSoft; static long init_record(aiRecord *pai) { diff --git a/src/dev/softDev/devAiSoftRaw.c b/src/dev/softDev/devAiSoftRaw.c index 5d77093d3..1b2a88aec 100644 --- a/src/dev/softDev/devAiSoftRaw.c +++ b/src/dev/softDev/devAiSoftRaw.c @@ -34,7 +34,7 @@ /* Create the dset for devAiSoftRaw */ static long init_record(aiRecord *pai); static long read_ai(aiRecord *pai); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -51,6 +51,7 @@ epicsShareDef struct { read_ai, NULL }; +epicsShareDef dset *pdevAiSoftRaw = (dset *)&devAiSoftRaw; static long init_record(aiRecord *pai) { diff --git a/src/dev/softDev/devAoSoft.c b/src/dev/softDev/devAoSoft.c index 7a4d6816a..41b1d88cb 100644 --- a/src/dev/softDev/devAoSoft.c +++ b/src/dev/softDev/devAoSoft.c @@ -38,7 +38,7 @@ static long init_record(); /* Create the dset for devAoSoft */ static long write_ao(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,6 +54,7 @@ epicsShareDef struct { NULL, write_ao, NULL}; +epicsShareDef dset *pdevAoSoft = (dset *)&devAoSoft; static long init_record(aoRecord *pao) diff --git a/src/dev/softDev/devAoSoftRaw.c b/src/dev/softDev/devAoSoftRaw.c index 4b2bfa485..bd394b4e9 100644 --- a/src/dev/softDev/devAoSoftRaw.c +++ b/src/dev/softDev/devAoSoftRaw.c @@ -35,7 +35,7 @@ /* Create the dset for devAoSoftRaw */ static long write_ao(aoRecord *pao); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -51,6 +51,7 @@ epicsShareDef struct { NULL, write_ao, NULL}; +epicsShareDef dset *pdevAoSoftRaw = (dset *)&devAoSoftRaw; static long write_ao(aoRecord *pao) { diff --git a/src/dev/softDev/devBiSoft.c b/src/dev/softDev/devBiSoft.c index b6155e925..bd5a47a77 100644 --- a/src/dev/softDev/devBiSoft.c +++ b/src/dev/softDev/devBiSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devBiSoft */ static long init_record(); static long read_bi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_bi }; +epicsShareDef dset *pdevBiSoft = (dset *)&devBiSoft; static long init_record(biRecord *pbi) { diff --git a/src/dev/softDev/devBiSoftRaw.c b/src/dev/softDev/devBiSoftRaw.c index 10d217eeb..4f2b0ea61 100644 --- a/src/dev/softDev/devBiSoftRaw.c +++ b/src/dev/softDev/devBiSoftRaw.c @@ -31,7 +31,7 @@ /* Create the dset for devBiSoftRaw */ static long init_record(); static long read_bi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_bi }; +epicsShareDef dset *pdevBiSoftRaw = (dset *)&devBiSoftRaw; static long init_record(biRecord *pbi) { diff --git a/src/dev/softDev/devBoSoft.c b/src/dev/softDev/devBoSoft.c index bd98caa57..2f2d36e86 100644 --- a/src/dev/softDev/devBoSoft.c +++ b/src/dev/softDev/devBoSoft.c @@ -38,7 +38,7 @@ static long init_record(); /* Create the dset for devBoSoft */ static long write_bo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -52,6 +52,7 @@ epicsShareDef struct { init_record, NULL, write_bo}; +epicsShareDef dset *pdevBoSoft = (dset *)&devBoSoft; static long init_record(boRecord *pbo) { diff --git a/src/dev/softDev/devBoSoftRaw.c b/src/dev/softDev/devBoSoftRaw.c index 66cac54b2..52d74e804 100644 --- a/src/dev/softDev/devBoSoftRaw.c +++ b/src/dev/softDev/devBoSoftRaw.c @@ -38,7 +38,7 @@ static long init_record(); /* Create the dset for devBoSoftRaw */ static long write_bo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -52,6 +52,7 @@ epicsShareDef struct { init_record, NULL, write_bo}; +epicsShareDef dset *pdevBoSoftRaw = (dset *)&devBoSoftRaw; diff --git a/src/dev/softDev/devEventSoft.c b/src/dev/softDev/devEventSoft.c index 48414eb2b..7eb73bce9 100644 --- a/src/dev/softDev/devEventSoft.c +++ b/src/dev/softDev/devEventSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devEventSoft */ static long init_record(); static long read_event(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_event }; +epicsShareDef dset *pdevEventSoft = (dset *)&devEventSoft; static long init_record(eventRecord *pevent) { diff --git a/src/dev/softDev/devHistogramSoft.c b/src/dev/softDev/devHistogramSoft.c index da85a570c..379962070 100644 --- a/src/dev/softDev/devHistogramSoft.c +++ b/src/dev/softDev/devHistogramSoft.c @@ -32,7 +32,7 @@ /* Create the dset for devHistogramSoft */ static long init_record(); static long read_histogram(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -49,6 +49,7 @@ epicsShareDef struct { read_histogram, NULL }; +epicsShareDef dset *pdevHistogramSoft = (dset *)&devHistogramSoft; static long init_record(histogramRecord *phistogram) { diff --git a/src/dev/softDev/devLiSoft.c b/src/dev/softDev/devLiSoft.c index de811bcfb..627b830c9 100644 --- a/src/dev/softDev/devLiSoft.c +++ b/src/dev/softDev/devLiSoft.c @@ -32,7 +32,7 @@ static long init_record(); static long read_longin(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -47,6 +47,7 @@ epicsShareDef struct { NULL, read_longin }; +epicsShareDef dset *pdevLiSoft = (dset *)&devLiSoft; static long init_record(longinRecord *plongin) { diff --git a/src/dev/softDev/devLoSoft.c b/src/dev/softDev/devLoSoft.c index dfd548ae9..dc360c03c 100644 --- a/src/dev/softDev/devLoSoft.c +++ b/src/dev/softDev/devLoSoft.c @@ -30,7 +30,7 @@ /* Create the dset for devLoSoft */ static long init_record(); static long write_longout(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -45,6 +45,7 @@ epicsShareDef struct { NULL, write_longout }; +epicsShareDef dset *pdevLoSoft = (dset *)&devLoSoft; static long init_record(longoutRecord *plongout) { diff --git a/src/dev/softDev/devMbbiDirectSoft.c b/src/dev/softDev/devMbbiDirectSoft.c index 23fdd7dde..37dca81ea 100644 --- a/src/dev/softDev/devMbbiDirectSoft.c +++ b/src/dev/softDev/devMbbiDirectSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devMbbiSoft */ static long init_record(); static long read_mbbi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_mbbi }; +epicsShareDef dset *pdevMbbiDirectSoft = (dset *)&devMbbiDirectSoft; static long init_record(mbbiDirectRecord *pmbbi) { diff --git a/src/dev/softDev/devMbbiDirectSoftRaw.c b/src/dev/softDev/devMbbiDirectSoftRaw.c index 8cc038cd9..a6bf9665b 100644 --- a/src/dev/softDev/devMbbiDirectSoftRaw.c +++ b/src/dev/softDev/devMbbiDirectSoftRaw.c @@ -31,7 +31,7 @@ /* Create the dset for devMbbiDirectSoftRaw */ static long init_record(); static long read_mbbi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_mbbi }; +epicsShareDef dset *pdevMbbiDirectSoftRaw = (dset *)&devMbbiDirectSoftRaw; static long init_record(mbbiDirectRecord *pmbbi) { diff --git a/src/dev/softDev/devMbbiSoft.c b/src/dev/softDev/devMbbiSoft.c index a7d05dab3..4debcd2f0 100644 --- a/src/dev/softDev/devMbbiSoft.c +++ b/src/dev/softDev/devMbbiSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devMbbiSoft */ static long init_record(); static long read_mbbi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_mbbi }; +epicsShareDef dset *pdevMbbiSoft = (dset *)&devMbbiSoft; static long init_record(mbbiRecord *pmbbi) { diff --git a/src/dev/softDev/devMbbiSoftRaw.c b/src/dev/softDev/devMbbiSoftRaw.c index 1a9985ad7..5453fed05 100644 --- a/src/dev/softDev/devMbbiSoftRaw.c +++ b/src/dev/softDev/devMbbiSoftRaw.c @@ -31,7 +31,7 @@ /* Create the dset for devMbbiSoftRaw */ static long init_record(); static long read_mbbi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, read_mbbi }; +epicsShareDef dset *pdevMbbiSoftRaw = (dset *)&devMbbiSoftRaw; static long init_record(mbbiRecord *pmbbi) { diff --git a/src/dev/softDev/devMbboDirectSoft.c b/src/dev/softDev/devMbboDirectSoft.c index 9449ad87b..d99009ff9 100644 --- a/src/dev/softDev/devMbboDirectSoft.c +++ b/src/dev/softDev/devMbboDirectSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devMbboSoft */ static long init_record(); static long write_mbbo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, write_mbbo }; +epicsShareDef dset *pdevMbboDirectSoft = (dset *)&devMbboDirectSoft; static long init_record(mbboDirectRecord *pmbbo) { diff --git a/src/dev/softDev/devMbboDirectSoftRaw.c b/src/dev/softDev/devMbboDirectSoftRaw.c index d0f2ce48a..b4627cc2e 100644 --- a/src/dev/softDev/devMbboDirectSoftRaw.c +++ b/src/dev/softDev/devMbboDirectSoftRaw.c @@ -32,7 +32,7 @@ /* Create the dset for devMbboDirectSoftRaw */ static long init_record(); static long write_mbbo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -47,6 +47,7 @@ epicsShareDef struct { NULL, write_mbbo }; +epicsShareDef dset *pdevMbboDirectSoftRaw = (dset *)&devMbboDirectSoftRaw; static long init_record(mbboDirectRecord *pmbbo) { diff --git a/src/dev/softDev/devMbboSoft.c b/src/dev/softDev/devMbboSoft.c index 89f45a699..f85f07d58 100644 --- a/src/dev/softDev/devMbboSoft.c +++ b/src/dev/softDev/devMbboSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devMbboSoft */ static long init_record(); static long write_mbbo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, write_mbbo }; +epicsShareDef dset *pdevMbboSoft = (dset *)&devMbboSoft; static long init_record(mbboRecord *pmbbo) { diff --git a/src/dev/softDev/devMbboSoftRaw.c b/src/dev/softDev/devMbboSoftRaw.c index cd298fe9e..cc6d7f67f 100644 --- a/src/dev/softDev/devMbboSoftRaw.c +++ b/src/dev/softDev/devMbboSoftRaw.c @@ -30,7 +30,7 @@ /* Create the dset for devMbboSoftRaw */ static long init_record(); static long write_mbbo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -45,6 +45,7 @@ epicsShareDef struct { NULL, write_mbbo }; +epicsShareDef dset *pdevMbboSoftRaw = (dset *)&devMbboSoftRaw; static long init_record(mbboRecord *pmbbo) { diff --git a/src/dev/softDev/devSASoft.c b/src/dev/softDev/devSASoft.c index 1b0111238..ca015dce5 100644 --- a/src/dev/softDev/devSASoft.c +++ b/src/dev/softDev/devSASoft.c @@ -33,7 +33,7 @@ static int sizeofTypes[] = {MAX_STRING_SIZE,1,1,2,2,4,4,4,8,2}; /* Create the dset for devSASoft */ static long init_record(); static long read_sa(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,7 +46,9 @@ epicsShareDef struct { NULL, init_record, NULL, - read_sa}; + read_sa +}; +epicsShareDef dset *pdevSASoft = (dset *)&devSASoft; static long init_record(subArrayRecord *psa) diff --git a/src/dev/softDev/devSiSoft.c b/src/dev/softDev/devSiSoft.c index e007cbda4..9fa50a622 100644 --- a/src/dev/softDev/devSiSoft.c +++ b/src/dev/softDev/devSiSoft.c @@ -32,7 +32,7 @@ /* Create the dset for devSiSoft */ static long init_record(); static long read_stringin(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -47,6 +47,7 @@ epicsShareDef struct { NULL, read_stringin }; +epicsShareDef dset *pdevSiSoft = (dset *)&devSiSoft; static long init_record(stringinRecord *pstringin) { diff --git a/src/dev/softDev/devSoSoft.c b/src/dev/softDev/devSoSoft.c index 523067a6e..8c140090d 100644 --- a/src/dev/softDev/devSoSoft.c +++ b/src/dev/softDev/devSoSoft.c @@ -31,7 +31,7 @@ /* Create the dset for devSoSoft */ static long init_record(); static long write_stringout(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -46,6 +46,7 @@ epicsShareDef struct { NULL, write_stringout }; +epicsShareDef dset *pdevSoSoft = (dset *)&devSoSoft; static long init_record(stringoutRecord *pstringout) { diff --git a/src/dev/softDev/devWfSoft.c b/src/dev/softDev/devWfSoft.c index 02296ecbf..c6e80ac32 100644 --- a/src/dev/softDev/devWfSoft.c +++ b/src/dev/softDev/devWfSoft.c @@ -36,7 +36,7 @@ /* Create the dset for devWfSoft */ static long init_record(); static long read_wf(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -49,7 +49,9 @@ epicsShareDef struct { NULL, init_record, NULL, - read_wf}; + read_wf +}; +epicsShareDef dset *pdevWfSoft = (dset *)&devWfSoft; static long init_record(waveformRecord *pwf) diff --git a/src/dev/testDev/devAiTestAsyn.c b/src/dev/testDev/devAiTestAsyn.c index 336c7245f..2174cb04b 100644 --- a/src/dev/testDev/devAiTestAsyn.c +++ b/src/dev/testDev/devAiTestAsyn.c @@ -39,7 +39,7 @@ /* Create the dset for devAiTestAsyn */ static long init_record(); static long read_ai(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,7 +54,9 @@ epicsShareDef struct { init_record, NULL, read_ai, - NULL}; + NULL +}; +epicsShareDef dset *pdevAiTestAsyn = (dset *)&devAiTestAsyn; static long init_record(pai) diff --git a/src/dev/testDev/devAoTestAsyn.c b/src/dev/testDev/devAoTestAsyn.c index 55ff76e83..10820a551 100644 --- a/src/dev/testDev/devAoTestAsyn.c +++ b/src/dev/testDev/devAoTestAsyn.c @@ -40,7 +40,7 @@ /* Create the dset for devAoTestAsyn */ static long init_record(); static long write_ao(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -55,7 +55,9 @@ epicsShareDef struct { init_record, NULL, write_ao, - NULL}; + NULL +}; +epicsShareDef dset *pdevAoTestAsyn = (dset *)&devAoTestAsyn; static long init_record(pao) struct aoRecord *pao; diff --git a/src/dev/testDev/devBiTestAsyn.c b/src/dev/testDev/devBiTestAsyn.c index 20f01a175..cdf0fcce1 100644 --- a/src/dev/testDev/devBiTestAsyn.c +++ b/src/dev/testDev/devBiTestAsyn.c @@ -39,7 +39,7 @@ /* Create the dset for devBiTestAsyn */ static long init_record(); static long read_bi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,7 +54,9 @@ epicsShareDef struct { init_record, NULL, read_bi, - NULL}; + NULL +}; +epicsShareDef dset *pdevBiTestAsyn = (dset *)&devBiTestAsyn; static long init_record(pbi) struct biRecord *pbi; diff --git a/src/dev/testDev/devBoTestAsyn.c b/src/dev/testDev/devBoTestAsyn.c index 34eded42a..90cfd67fc 100644 --- a/src/dev/testDev/devBoTestAsyn.c +++ b/src/dev/testDev/devBoTestAsyn.c @@ -40,7 +40,7 @@ /* Create the dset for devBoTestAsyn */ static long init_record(); static long write_bo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -55,7 +55,9 @@ epicsShareDef struct { init_record, NULL, write_bo, - NULL}; + NULL +}; +epicsShareDef dset *pdevBoTestAsyn = (dset *)&devBoTestAsyn; static long init_record(pbo) struct boRecord *pbo; diff --git a/src/dev/testDev/devEventTestIoEvent.c b/src/dev/testDev/devEventTestIoEvent.c index 9689ea535..db9a29dbe 100644 --- a/src/dev/testDev/devEventTestIoEvent.c +++ b/src/dev/testDev/devEventTestIoEvent.c @@ -34,7 +34,7 @@ static long init_record(); static long get_ioint_info(); static long read_event(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -49,6 +49,7 @@ epicsShareDef struct { get_ioint_info, read_event }; +epicsShareDef dset *pdevEventTestIoEvent = (dset *)&devEventTestIoEvent; typedef struct myCallback { CALLBACK callback; diff --git a/src/dev/testDev/devHistogramTestAsyn.c b/src/dev/testDev/devHistogramTestAsyn.c index eb7ffc53c..eb159298d 100644 --- a/src/dev/testDev/devHistogramTestAsyn.c +++ b/src/dev/testDev/devHistogramTestAsyn.c @@ -35,7 +35,7 @@ /* Create the dset for devHistogramTestAsyn */ static long init_record(); static long read_histogram(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -50,7 +50,9 @@ epicsShareDef struct { init_record, NULL, read_histogram, - NULL}; + NULL +}; +epicsShareDef dset *pdevHistogramTestAsyn = (dset *)&devHistogramTestAsyn; static long init_record(phistogram) struct histogramRecord *phistogram; diff --git a/src/dev/testDev/devMbbiTestAsyn.c b/src/dev/testDev/devMbbiTestAsyn.c index af645241a..216b27d95 100644 --- a/src/dev/testDev/devMbbiTestAsyn.c +++ b/src/dev/testDev/devMbbiTestAsyn.c @@ -39,7 +39,7 @@ /* Create the dset for devMbbiTestAsyn */ static long init_record(); static long read_mbbi(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,7 +54,9 @@ epicsShareDef struct { init_record, NULL, read_mbbi, - NULL}; + NULL +}; +epicsShareDef dset *pdevMbbiTestAsyn = (dset *)&devMbbiTestAsyn; static long init_record(pmbbi) struct mbbiRecord *pmbbi; diff --git a/src/dev/testDev/devMbboTestAsyn.c b/src/dev/testDev/devMbboTestAsyn.c index 2016320d9..d77d57102 100644 --- a/src/dev/testDev/devMbboTestAsyn.c +++ b/src/dev/testDev/devMbboTestAsyn.c @@ -40,7 +40,7 @@ /* Create the dset for devMbboTestAsyn */ static long init_record(); static long write_mbbo(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -55,7 +55,9 @@ epicsShareDef struct { init_record, NULL, write_mbbo, - NULL}; + NULL +}; +epicsShareDef dset *pdevMbboTestAsyn = (dset *)&devMbboTestAsyn; static long init_record(pmbbo) struct mbboRecord *pmbbo; diff --git a/src/dev/testDev/devSiTestAsyn.c b/src/dev/testDev/devSiTestAsyn.c index a8248883d..65e875453 100644 --- a/src/dev/testDev/devSiTestAsyn.c +++ b/src/dev/testDev/devSiTestAsyn.c @@ -38,7 +38,7 @@ /* Create the dset for devSiTestAsyn */ static long init_record(); static long read_stringin(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -53,7 +53,9 @@ epicsShareDef struct { init_record, NULL, read_stringin, - NULL}; + NULL +}; +epicsShareDef dset *pdevSiTestAsyn = (dset *)&devSiTestAsyn; static long init_record(pstringin) struct stringinRecord *pstringin; diff --git a/src/dev/testDev/devSoTestAsyn.c b/src/dev/testDev/devSoTestAsyn.c index 26f6f31d7..a9b876855 100644 --- a/src/dev/testDev/devSoTestAsyn.c +++ b/src/dev/testDev/devSoTestAsyn.c @@ -39,7 +39,7 @@ /* Create the dset for devSoTestAsyn */ static long init_record(); static long write_stringout(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,7 +54,9 @@ epicsShareDef struct { init_record, NULL, write_stringout, - NULL}; + NULL +}; +epicsShareDef dset *pdevSoTestAsyn = (dset *)&devSoTestAsyn; static long init_record(pstringout) struct stringoutRecord *pstringout; diff --git a/src/dev/testDev/devWfTestAsyn.c b/src/dev/testDev/devWfTestAsyn.c index a4b135423..0d06d7a0e 100644 --- a/src/dev/testDev/devWfTestAsyn.c +++ b/src/dev/testDev/devWfTestAsyn.c @@ -39,7 +39,7 @@ /* Create the dset for devWfTestAsyn */ static long init_record(); static long read_wf(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -54,7 +54,9 @@ epicsShareDef struct { init_record, NULL, read_wf, - NULL}; + NULL +}; +epicsShareDef dset *pdevWfTestAsyn = (dset *)&devWfTestAsyn; static long init_record(pwf) struct waveformRecord *pwf; diff --git a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c index d839e7e01..98c1a3861 100644 --- a/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c +++ b/src/makeBaseApp/top/exampleApp/src/devXxxSoft.c @@ -21,7 +21,7 @@ /*Create the dset for devXxxSoft */ static long init_record(); static long read_xxx(); -epicsShareDef struct { +static struct { long number; DEVSUPFUN report; DEVSUPFUN init; @@ -36,6 +36,7 @@ epicsShareDef struct { NULL, read_xxx, }; +epicsShareDef dset *pdevXxxSoft = (dset *)&devXxxSoft; static long init_record(pxxx) diff --git a/src/registry/registerRecordDeviceDriver.pl b/src/registry/registerRecordDeviceDriver.pl index da33499b4..c748455f2 100755 --- a/src/registry/registerRecordDeviceDriver.pl +++ b/src/registry/registerRecordDeviceDriver.pl @@ -68,7 +68,7 @@ print "extern \"C\" {\n"; #definitions for recordtype if($numberRecordType>0) { for ($i=0; $i<$numberRecordType; $i++) { - print "epicsShareExtern struct rset $recordType[$i]RSET;\n"; + print "epicsShareExtern rset $recordType[$i]RSET;\n"; print "epicsShareFunc int $recordType[$i]RecordSizeOffset(dbRecordType *pdbRecordType);\n" } print "\nstatic const char * const recordTypeNames[$numberRecordType] = {\n"; @@ -91,7 +91,7 @@ if($numberRecordType>0) { #definitions for device if($numberDeviceSupport>0) { for ($i=0; $i<$numberDeviceSupport; $i++) { - print "epicsShareExtern struct dset $deviceSupport[$i];\n"; + print "epicsShareExtern dset *p$deviceSupport[$i];\n"; } print "\nstatic const char * const deviceSupportNames[$numberDeviceSupport] = {\n"; for ($i=0; $i<$numberDeviceSupport; $i++) { @@ -101,9 +101,9 @@ if($numberDeviceSupport>0) { } print "};\n\n"; - print "static const struct dset * const devsl[$i] = {\n"; + print "static const dset * const devsl[$i] = {\n"; for ($i=0; $i<$numberDeviceSupport; $i++) { - print " &$deviceSupport[$i]"; + print " p$deviceSupport[$i]"; if($i < $numberDeviceSupport-1) { print ",";} print "\n"; }