ANSI C changes

This commit is contained in:
Janet B. Anderson
1992-02-28 18:03:44 +00:00
parent 43818d1eec
commit f029527c6b
5 changed files with 29 additions and 24 deletions

View File

@@ -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 <vxWorks.h>
@@ -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]);

View File

@@ -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 <vxWorks.h>
#include <types.h>
#include <strLib.h>
#include <string.h>
#include <stdioLib.h>
#include <fast_lock.h>
@@ -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;

View File

@@ -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;

View File

@@ -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]);

View File

@@ -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 <sysSymTbl.h> /* for sysSymTbl*/
#include <a_out.h> /* for N_TEXT */
#include <stdioLib.h>
#include <strLib.h>
#include <string.h>
#include <sdrHeader.h>
#include <fast_lock.h>
@@ -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);