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) ...@@ -59,6 +59,7 @@ int PLCRecvBlockMode::execute(Context* pContext)
int errorCode = 0; int errorCode = 0;
Connection* pConn = theBlock_->getPLC()->getConnection(); Connection* pConn = theBlock_->getPLC()->getConnection();
AccessArea area = theBlock_->getAccessArea();
try try
{ {
...@@ -69,7 +70,6 @@ int PLCRecvBlockMode::execute(Context* pContext) ...@@ -69,7 +70,6 @@ int PLCRecvBlockMode::execute(Context* pContext)
Device* pDev = pContext->getDevice(); Device* pDev = pContext->getDevice();
//Base attributes of the device within the complete data block containing all devices. //Base attributes of the device within the complete data block containing all devices.
AccessArea area = theBlock_->getAccessArea();
unsigned long usedAddress = theBlock_->getAddress(); unsigned long usedAddress = theBlock_->getAddress();
unsigned long usedSize = theBlock_->getMemSize(); unsigned long usedSize = theBlock_->getMemSize();
unsigned long usedDeviceOffset = pDev->getInputAddress(area) * usedSize; unsigned long usedDeviceOffset = pDev->getInputAddress(area) * usedSize;
...@@ -148,7 +148,6 @@ int PLCRecvBlockMode::execute(Context* pContext) ...@@ -148,7 +148,6 @@ int PLCRecvBlockMode::execute(Context* pContext)
//begin critical section //begin critical section
Lock lock(bufferMux_); Lock lock(bufferMux_);
AccessArea area = theBlock_->getAccessArea();
switch (area) switch (area)
{ {
case Digital: case Digital:
...@@ -204,6 +203,7 @@ int PLCRecvDeviceMode::execute(Context* pContext) ...@@ -204,6 +203,7 @@ int PLCRecvDeviceMode::execute(Context* pContext)
timeval tod; //Time-of-day for register time-stamping timeval tod; //Time-of-day for register time-stamping
int errorCode = 0; int errorCode = 0;
Connection* pConn = theBlock_->getPLC()->getConnection(); Connection* pConn = theBlock_->getPLC()->getConnection();
AccessArea area = theBlock_->getAccessArea();
try try
{ {
...@@ -214,7 +214,6 @@ int PLCRecvDeviceMode::execute(Context* pContext) ...@@ -214,7 +214,6 @@ int PLCRecvDeviceMode::execute(Context* pContext)
Device* pDev = pContext->getDevice(); Device* pDev = pContext->getDevice();
//Set base attributes of the device blocks //Set base attributes of the device blocks
AccessArea area = theBlock_->getAccessArea();
unsigned long usedDeviceAddress = pDev->getInputAddress(area); unsigned long usedDeviceAddress = pDev->getInputAddress(area);
unsigned long usedBlockAddress = theBlock_->getAddress(); unsigned long usedBlockAddress = theBlock_->getAddress();
unsigned long usedSize = theBlock_->getMemSize(); unsigned long usedSize = theBlock_->getMemSize();
...@@ -297,7 +296,6 @@ int PLCRecvDeviceMode::execute(Context* pContext) ...@@ -297,7 +296,6 @@ int PLCRecvDeviceMode::execute(Context* pContext)
} }
//begin critical section //begin critical section
Lock lock(bufferMux_); Lock lock(bufferMux_);
AccessArea area = theBlock_->getAccessArea();
switch (area) switch (area)
{ {
case Digital: 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