Skip to content
Snippets Groups Projects
Commit 11bc9aa8 authored by kochalas's avatar kochalas Committed by al.schwinn
Browse files

[SIL-317] Declare a local 'area = theBlock_->getAccessArea()' on top

and use this one everywhere.
parent ce91609e
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ int PLCRecvBlockMode::execute(Context* pContext)
int errorCode = 0;
Connection* pConn = theBlock_->getPLC()->getConnection();
AccessArea area = theBlock_->getAccessArea();
try
{
......@@ -69,7 +70,6 @@ int PLCRecvBlockMode::execute(Context* pContext)
Device* pDev = pContext->getDevice();
//Base attributes of the device within the complete data block containing all devices.
AccessArea area = theBlock_->getAccessArea();
unsigned long usedAddress = theBlock_->getAddress();
unsigned long usedSize = theBlock_->getMemSize();
unsigned long usedDeviceOffset = pDev->getInputAddress(area) * usedSize;
......@@ -148,7 +148,6 @@ int PLCRecvBlockMode::execute(Context* pContext)
//begin critical section
Lock lock(bufferMux_);
AccessArea area = theBlock_->getAccessArea();
switch (area)
{
case Digital:
......@@ -204,6 +203,7 @@ int PLCRecvDeviceMode::execute(Context* pContext)
timeval tod; //Time-of-day for register time-stamping
int errorCode = 0;
Connection* pConn = theBlock_->getPLC()->getConnection();
AccessArea area = theBlock_->getAccessArea();
try
{
......@@ -214,7 +214,6 @@ int PLCRecvDeviceMode::execute(Context* pContext)
Device* pDev = pContext->getDevice();
//Set base attributes of the device blocks
AccessArea area = theBlock_->getAccessArea();
unsigned long usedDeviceAddress = pDev->getInputAddress(area);
unsigned long usedBlockAddress = theBlock_->getAddress();
unsigned long usedSize = theBlock_->getMemSize();
......@@ -297,7 +296,6 @@ int PLCRecvDeviceMode::execute(Context* pContext)
}
//begin critical section
Lock lock(bufferMux_);
AccessArea area = theBlock_->getAccessArea();
switch (area)
{
case Digital:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment