Fix issues found using static code analysis 89/24589/3
authorGeorge Nash <george.nash@intel.com>
Thu, 5 Apr 2018 18:32:14 +0000 (11:32 -0700)
committerMats Wichmann <mats@linux.com>
Sat, 7 Apr 2018 17:07:48 +0000 (17:07 +0000)
commitd59d87ab6979ab29f3d72151c51c9ff29e0271ab
tree23307507d69a1cc251fa1df37d2e1939ae9352d4
parent9cab58a2699aa7e29706793e0a90c21089eb8fa0
Fix issues found using static code analysis

Fixed possible issue that the for loop could be
accessing element outside the array. Replaced the
variables holding the size of the array with a
compile time calculation. Removed separate member varaible
use to track the size of the resource type array and
the resource interface array.

Changed the initialization of m_dimmingLightServer from
C++11 initializer list style to C++98 initializer style
due to this causing build failure on gcc/g++ v4.8.4.
Issue reported by Abhishek Pandey

Change-Id: I553e661dbd2e6fa3fe38d8694d88273c5b309c58
Signed-off-by: George Nash <george.nash@intel.com>
resource/examples/ocf_light/BinarySwitchResource.cpp
resource/examples/ocf_light/BinarySwitchResource.h
resource/examples/ocf_light/DimmingLightControl.cpp
resource/examples/ocf_light/DimmingResource.cpp
resource/examples/ocf_light/DimmingResource.h