Moved new variable definitions to the beginning of their block.
Older C compilers such as vxWorks 5.x insist on this.
This commit is contained in:
@@ -507,6 +507,9 @@ static void read_reply ( void *pArg, struct dbAddr *paddr,
|
||||
const int readAccess = asCheckGet ( pciu->asClientPVT );
|
||||
int status;
|
||||
int v41;
|
||||
int autosize;
|
||||
long item_count;
|
||||
ca_uint32_t payload_size;
|
||||
|
||||
SEND_LOCK ( pClient );
|
||||
|
||||
@@ -531,10 +534,10 @@ static void read_reply ( void *pArg, struct dbAddr *paddr,
|
||||
/* If the client has requested a zero element count we interpret this as a
|
||||
* request for all avaiable elements. In this case we initialise the
|
||||
* header with the maximum element size specified by the database. */
|
||||
int autosize = pevext->msg.m_count == 0;
|
||||
long item_count =
|
||||
autosize = pevext->msg.m_count == 0;
|
||||
item_count =
|
||||
autosize ? paddr->no_elements : pevext->msg.m_count;
|
||||
ca_uint32_t payload_size = dbr_size_n(pevext->msg.m_dataType, item_count);
|
||||
payload_size = dbr_size_n(pevext->msg.m_dataType, item_count);
|
||||
status = cas_copy_in_header(
|
||||
pClient, pevext->msg.m_cmmd, payload_size,
|
||||
pevext->msg.m_dataType, item_count, cid, pevext->msg.m_available,
|
||||
|
||||
@@ -257,6 +257,7 @@ int cas_copy_in_header (
|
||||
{
|
||||
unsigned msgSize;
|
||||
ca_uint32_t alignedPayloadSize;
|
||||
caHdr *pMsg;
|
||||
|
||||
if ( payloadSize > UINT_MAX - sizeof ( caHdr ) - 8u ) {
|
||||
return ECA_TOLARGE;
|
||||
@@ -296,7 +297,7 @@ int cas_copy_in_header (
|
||||
}
|
||||
}
|
||||
|
||||
caHdr *pMsg = (caHdr *) &pclient->send.buf[pclient->send.stk];
|
||||
pMsg = (caHdr *) &pclient->send.buf[pclient->send.stk];
|
||||
pMsg->m_cmmd = htons(response);
|
||||
pMsg->m_dataType = htons(dataType);
|
||||
pMsg->m_cid = htonl(cid);
|
||||
@@ -337,8 +338,10 @@ void cas_set_header_count (struct client *pClient, ca_uint32_t count)
|
||||
{
|
||||
caHdr *pMsg = (caHdr *) &pClient->send.buf[pClient->send.stk];
|
||||
if (pMsg->m_postsize == htons(0xffff)) {
|
||||
ca_uint32_t *pLW;
|
||||
|
||||
assert(pMsg->m_count == 0);
|
||||
ca_uint32_t *pLW = (ca_uint32_t *) (pMsg + 1);
|
||||
pLW = (ca_uint32_t *) (pMsg + 1);
|
||||
pLW[1] = htonl(count);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user