diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index 80b6b116b..e236c773b 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -52,6 +52,7 @@ * joh 12 082091 db_event_get_field() comented out * joh 13 091191 updated for v5 vxWorks * jba 14 112691 Added 'return NULL;' to end of db_event_list + * jba 15 022892 ANSI C changes */ #include @@ -561,11 +562,11 @@ register struct event_block *pevent; ev_que->valque[putix].sevr = sevr; ev_que->valque[putix].time = precord->time; /* - * use bcopy to avoid a bus error on + * use memcpy to avoid a bus error on * union copy of char in the db at an odd * address */ - bcopy( pevent->paddr->pfield, + memcpy( pevent->paddr->pfield, &ev_que->valque[putix].field, dbr_size[pevent->paddr->field_type]); @@ -639,11 +640,11 @@ register unsigned int select; ev_que->valque[putix].time = precord->time; /* - * use bcopy to avoid a bus error on + * use memcpy to avoid a bus error on * union copy of char in the db at an odd * address */ - bcopy( pvalue, + memcpy( pvalue, &ev_que->valque[putix].field, dbr_size[event->paddr->field_type]); diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 6de750db2..723c2cd9d 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -33,6 +33,7 @@ * .02 10-23-91 mrk Changed dbior so it also reports device support * .03 11-26-91 jba Fixed initializations and added hex print to printBuffer * .04 02-05-92 jba Changed function arguments from paddr to precord + * .05 02-28-92 jba ANSI C changes */ /* Global Database Test Routines - All can be invoked via vxWorks shell @@ -74,7 +75,7 @@ #include #include -#include +#include #include #include @@ -1002,7 +1003,7 @@ static int dbpr_report(pname, paddr, interest_level, pMsgBuff, tab_size) short n,n2; long status; long buffer[100]; - caddr_t pbuffer; + void *pbuffer; long options; long nRequest; int sv_tab_size; @@ -1292,7 +1293,7 @@ static void dbpr_msg_flush(pMsgBuff, tab_size) /* skip print if buffer empty */ if (pMsgBuff->pNext != pMsgBuff->out_buff) printf("%s\n", pMsgBuff->out_buff); - bzero(pMsgBuff->out_buff, (int) MAXLINE + 1); + memset(pMsgBuff->out_buff,'\0', (int) MAXLINE + 1); pMsgBuff->pNext = pMsgBuff->out_buff; pMsgBuff->pNexTab = pMsgBuff->out_buff + tab_size; return; diff --git a/src/db/db_access.c b/src/db/db_access.c index e2d758d8d..fbae30bb5 100644 --- a/src/db/db_access.c +++ b/src/db/db_access.c @@ -32,6 +32,7 @@ * .02 08-06-91 mrk Make extra values 0 * .03 08-13-91 mrk Add pfl argument to dbGetField calls * .04 02-05-92 jba Changed function arguments from paddr to precord + * .05 02-28-92 jba ANSI C changes */ @@ -533,7 +534,7 @@ new_alarm(){ * see DBR_ defines in db_access.h * pbuffer return buffer * no_elements number of elements - * caddr_t pfl; + * void *pfl; * returns * 0 successful * -1 failed @@ -583,7 +584,7 @@ struct dbAddr *paddr; short buffer_type; char *pbuffer; unsigned short no_elements; -caddr_t pfl; +void *pfl; { long status; long options; @@ -1232,7 +1233,7 @@ caddr_t pfl; short no_str; short *pvalue = &pold->value; - bzero(pold,sizeof(struct dbr_ctrl_enum)); + memset(pold,'\0',sizeof(struct dbr_ctrl_enum)); /* first get status and severity */ options=DBR_STATUS|DBR_ENUM_STRS; nRequest=0; diff --git a/src/db/dbls.c b/src/db/dbls.c index 9294ea5ef..1669d3125 100644 --- a/src/db/dbls.c +++ b/src/db/dbls.c @@ -29,6 +29,7 @@ * Modification Log: * ----------------- * .01 11-26-91 jba Initialized fp to null + * .01 02-28-92 jba ANSI C changes */ @@ -770,8 +771,8 @@ DbRecDes(fp, fflag) &dbRecDes->papRecTypDes[i]->papFldDes[j]->interest, dbRecDes->papRecTypDes[i]->papFldDes[j]->interest); bufOut(fp, fflag); - bcopy((caddr_t) & dbRecDes->papRecTypDes[i]->papFldDes[j]->initial, - (caddr_t) buff, 8); + memcpy((void *) & dbRecDes->papRecTypDes[i]->papFldDes[j]->initial, + (void *) buff, 8); sprintf(buffer, "%8x[%8x][%8x]\tinitial", &dbRecDes->papRecTypDes[i]->papFldDes[j]->initial, buff[0], buff[1]); @@ -780,8 +781,8 @@ DbRecDes(fp, fflag) &dbRecDes->papRecTypDes[i]->papFldDes[j]->range1.fldnum, dbRecDes->papRecTypDes[i]->papFldDes[j]->range1.fldnum); bufOut(fp, fflag); - bcopy((caddr_t) & dbRecDes->papRecTypDes[i]->papFldDes[j]->range1.value, - (caddr_t) buff, 8); + memcpy((void *) & dbRecDes->papRecTypDes[i]->papFldDes[j]->range1.value, + (void *) buff, 8); sprintf(buffer, "%8x[%8x][%8x]\trange1.value", &dbRecDes->papRecTypDes[i]->papFldDes[j]->range1.value, buff[0], buff[1]); @@ -790,8 +791,8 @@ DbRecDes(fp, fflag) &dbRecDes->papRecTypDes[i]->papFldDes[j]->range2.fldnum, dbRecDes->papRecTypDes[i]->papFldDes[j]->range2.fldnum); bufOut(fp, fflag); - bcopy((caddr_t) & dbRecDes->papRecTypDes[i]->papFldDes[j]->range2.value, - (caddr_t) buff, 8); + memcpy((void *) & dbRecDes->papRecTypDes[i]->papFldDes[j]->range2.value, + (void *) buff, 8); sprintf(buffer, "%8x[%8x][%8x]\trange2.value", &dbRecDes->papRecTypDes[i]->papFldDes[j]->range2.value, buff[0], buff[1]); diff --git a/src/db/iocInit.c b/src/db/iocInit.c index ccc469b5c..4053c7ade 100644 --- a/src/db/iocInit.c +++ b/src/db/iocInit.c @@ -38,6 +38,7 @@ * parameters in a structure (first try) * .09 12-02-91 mrk Added finishDevSup * .10 02-10-92 jba Changed error messages + * .11 02-28-92 jba ANSI C changes * */ @@ -50,7 +51,7 @@ #include /* for sysSymTbl*/ #include /* for N_TEXT */ #include -#include +#include #include #include @@ -199,7 +200,7 @@ static long initRecSup() errMessage(status,"dbRecType is NULL, i.e. no record types defined"); return(status); } - nbytes = sizeof(struct recSup) + dbRecType->number*sizeof(caddr_t); + nbytes = sizeof(struct recSup) + dbRecType->number*sizeof(void *); recSup = calloc(1,nbytes); recSup->number = dbRecType->number; (long)recSup->papRset = (long)recSup + (long)sizeof(struct recSup); @@ -429,7 +430,7 @@ static long addToSet(precord,record_type,lookAhead,i,j,lset) short j; /*record before 1st following: record number */ short lset; /* current lock set */ { - short k,in,itemp,jn,j1st; + short k,in,jn,j1st; long status; struct fldDes *pfldDes; struct link *plink; @@ -660,7 +661,7 @@ static long getResources(fname) /* Resource Definition File interpreter */ errMessage(-1L, message); } if ( epicsFlag ) - strncpy(pSymAddr+sizeof(caddr_t), s3, len + 1); + strncpy(pSymAddr+sizeof(void *), s3, len + 1); else strncpy(pSymAddr, s3, len + 1); break; @@ -738,10 +739,10 @@ static long getResources(fname) /* Resource Definition File interpreter */ return (-1); break; } -CLEAR: bzero(buff, MAX); - bzero(s1, MAX); - bzero(s2, MAX); - bzero(s3, MAX); +CLEAR: memset(buff, '\0', MAX); + memset(s1, '\0', MAX); + memset(s2, '\0', MAX); + memset(s3, '\0', MAX); } close(fd); return (0);