summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorPetar Dimoski <petar.dimoski@seavus.com>2012-01-25 15:16:39 +0100
committerViktor Mladenovski <viktor.mladenovski@seavus.com>2012-05-25 14:43:12 +0200
commit10184ae5b432f3dd7e014afb9a8f0ea0cd880e26 (patch)
tree135e6fba0d83cbae52db8cd2fbb3ff0c9a494f44 /source
parenta08c80408fca5875a895747e0ea6dc1aca29df18 (diff)
Clean up astyle and coverity errors
ST-Ericsson ID: 410188 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204 Change-Id: I70835353a592d1f1ad40743640a1d0827e56fd2e Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45297 Tested-by: Aleksandar GASOSKI <aleksandar.gasoski@seavus.com> Reviewed-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com> Tested-by: Vlatko PISTOLOV <vlatko.pistolov@seavus.com>
Diffstat (limited to 'source')
-rw-r--r--source/LCDriver.rc6
-rw-r--r--source/LCDriverMethods.cpp4
-rw-r--r--source/LCM/Hash.cpp32
-rw-r--r--source/LcdVersion.cpp6
-rw-r--r--source/LcmInterface.cpp7
-rw-r--r--source/api_wrappers/linux/CThreadWrapper.cpp2
-rw-r--r--source/api_wrappers/linux/CThreadWrapper.h2
-rw-r--r--source/config/a2_commands_marshal_cpp.xsl1
-rw-r--r--source/config/commands_marshal_cpp.xsl1
-rw-r--r--source/security_algorithms/sha/sha2.cpp8
10 files changed, 37 insertions, 32 deletions
diff --git a/source/LCDriver.rc b/source/LCDriver.rc
index 3c8931d..83d56ba 100644
--- a/source/LCDriver.rc
+++ b/source/LCDriver.rc
@@ -81,15 +81,15 @@ BEGIN
BEGIN
BLOCK "000904b0"
BEGIN
- VALUE "Comments", "Build date: 2012-01-23"
+ VALUE "Comments", "Build date: 2012-01-25"
VALUE "CompanyName", "STEricsson AB"
VALUE "FileDescription", "LCDriver Dynamic Link Library"
VALUE "FileVersion", "1, 0, 0, 1"
VALUE "InternalName", "Loader Communication Driver"
VALUE "LegalCopyright", "Copyright (C) STEricsson AB 2011"
- VALUE "PrivateBuild", "Change-Id: I2737059dcca62d769ca1876a4859f7c468fcfdd9"
+ VALUE "PrivateBuild", "Change-Id: I70835353a592d1f1ad40743640a1d0827e56fd2e"
VALUE "ProductName", "CXC 173 0865, LCDriver DLL"
- VALUE "ProductVersion", "P1Y"
+ VALUE "ProductVersion", "P2Y"
END
END
BLOCK "VarFileInfo"
diff --git a/source/LCDriverMethods.cpp b/source/LCDriverMethods.cpp
index 9ce1986..58e0783 100644
--- a/source/LCDriverMethods.cpp
+++ b/source/LCDriverMethods.cpp
@@ -1946,7 +1946,7 @@ int CLCDriverMethods::Do_A2_System_LoaderOnLoader(const char *pchPath, int iPLOf
NumberOfPackets = PL / PacketSize;
- if (NumberOfPackets * PacketSize == PL) {
+ if (NumberOfPackets *PacketSize == PL) {
NumberOfPackets--;
}
@@ -2346,7 +2346,7 @@ int CLCDriverMethods::Do_PROTROM_DownloadLoader(const char *pchPath, int iPLOffs
//Download all packet beside one
NumberOfPackets = PL / PacketSize;
- if (NumberOfPackets * PacketSize == PL) {
+ if (NumberOfPackets *PacketSize == PL) {
NumberOfPackets--;
}
diff --git a/source/LCM/Hash.cpp b/source/LCM/Hash.cpp
index 7836604..94fb585 100644
--- a/source/LCM/Hash.cpp
+++ b/source/LCM/Hash.cpp
@@ -23,21 +23,21 @@
**********************************************************************/
const uint32 red[16] = {
0,
- (0x1 << 16) ^ (0x1021 << 0), \
- (0x2 << 16) ^ (0x1021 << 1), \
- (0x3 << 16) ^ (0x1021 << 1) ^ (0x1021 << 0), \
- (0x4 << 16) ^ (0x1021 << 2), \
- (0x5 << 16) ^ (0x1021 << 2) ^ (0x1021 << 0), \
- (0x6 << 16) ^ (0x1021 << 2) ^ (0x1021 << 1), \
- (0x7 << 16) ^ (0x1021 << 2) ^ (0x1021 << 1) ^ (0x1021 << 0), \
- (0x8 << 16) ^ (0x1021 << 3), \
- (0x9 << 16) ^ (0x1021 << 3) ^ (0x1021 << 0), \
- (0xa << 16) ^ (0x1021 << 3) ^ (0x1021 << 1), \
- (0xb << 16) ^ (0x1021 << 3) ^ (0x1021 << 1) ^ (0x1021 << 0), \
- (0xc << 16) ^ (0x1021 << 3) ^ (0x1021 << 2), \
- (0xd << 16) ^ (0x1021 << 3) ^ (0x1021 << 2) ^ (0x1021 << 0), \
- (0xe << 16) ^ (0x1021 << 3) ^ (0x1021 << 2) ^ (0x1021 << 1), \
- (0xf << 16) ^ (0x1021 << 3) ^ (0x1021 << 2) ^ (0x1021 << 1) ^ (0x1021 << 0)
+ (0x1 << 16) ^(0x1021 << 0), \
+ (0x2 << 16) ^(0x1021 << 1), \
+ (0x3 << 16) ^(0x1021 << 1) ^(0x1021 << 0), \
+ (0x4 << 16) ^(0x1021 << 2), \
+ (0x5 << 16) ^(0x1021 << 2) ^(0x1021 << 0), \
+ (0x6 << 16) ^(0x1021 << 2) ^(0x1021 << 1), \
+ (0x7 << 16) ^(0x1021 << 2) ^(0x1021 << 1) ^(0x1021 << 0), \
+ (0x8 << 16) ^(0x1021 << 3), \
+ (0x9 << 16) ^(0x1021 << 3) ^(0x1021 << 0), \
+ (0xa << 16) ^(0x1021 << 3) ^(0x1021 << 1), \
+ (0xb << 16) ^(0x1021 << 3) ^(0x1021 << 1) ^(0x1021 << 0), \
+ (0xc << 16) ^(0x1021 << 3) ^(0x1021 << 2), \
+ (0xd << 16) ^(0x1021 << 3) ^(0x1021 << 2) ^(0x1021 << 0), \
+ (0xe << 16) ^(0x1021 << 3) ^(0x1021 << 2) ^(0x1021 << 1), \
+ (0xf << 16) ^(0x1021 << 3) ^(0x1021 << 2) ^(0x1021 << 1) ^(0x1021 << 0)
};
Hash::Hash()
@@ -188,7 +188,7 @@ uint16 Hash::crc16(const uint8 *p, int count, uint16 crc_in)
register uint32 crc = crc_in;
while (--count >= 0) {
- crc = crc ^ (uint8) * p++ << 8;
+ crc = crc ^(uint8) * p++ << 8;
crc ^= red[crc >> 16];
crc = (crc << 4);
crc ^= red[crc >> 16];
diff --git a/source/LcdVersion.cpp b/source/LcdVersion.cpp
index 5cd757e..daf7e56 100644
--- a/source/LcdVersion.cpp
+++ b/source/LcdVersion.cpp
@@ -18,6 +18,6 @@
* This table contains compatibility information for the versions of LCM.
* Current LCM version is defined in file lcm_version.c in LCM code.
*/
-char *LCD_LCM_CompatibilityList[] = {"P1Y",
- NULL
- };
+const char *LCD_LCM_CompatibilityList[] = {"P2Y",
+ NULL
+ };
diff --git a/source/LcmInterface.cpp b/source/LcmInterface.cpp
index b7067ed..516e111 100644
--- a/source/LcmInterface.cpp
+++ b/source/LcmInterface.cpp
@@ -16,7 +16,7 @@
#endif
char *LcmInterface::m_pchLCMLibPath = 0;
-extern char *LCD_LCM_CompatibilityList[];
+extern const char *LCD_LCM_CompatibilityList[];
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
@@ -170,10 +170,12 @@ ErrorCode_e LcmInterface::CommunicationInitialize(void *Object_p, Family_t Famil
ReturnValue = Communication.Initialize_Fn(Object_p, &m_pCommunication, Family, HashDevice_p, CommunicationDevice_p, CommandCallback_p, Buffers_p, Timers_p, Queue_p);
ErrorExit:
- if (ReturnValue != E_SUCCESS){
+
+ if (ReturnValue != E_SUCCESS) {
CloseLCMLibrary();
m_hDLL = NULL;
}
+
return static_cast<ErrorCode_e>(ReturnValue);
}
@@ -212,6 +214,7 @@ ErrorCode_e LcmInterface::CommunicationCheckVersion(char *LCMVersion_p, LCM_t LC
ReturnValue = E_SUCCESS;
break;
}
+
i++;
} while (LCD_LCM_CompatibilityList[i] != NULL);
diff --git a/source/api_wrappers/linux/CThreadWrapper.cpp b/source/api_wrappers/linux/CThreadWrapper.cpp
index ab3f69b..4fe9362 100644
--- a/source/api_wrappers/linux/CThreadWrapper.cpp
+++ b/source/api_wrappers/linux/CThreadWrapper.cpp
@@ -30,7 +30,7 @@
// Desc: CEventObject constructor which initializes the class members
// Ret:
// ******************************************************************************
-CThreadWrapper::CThreadWrapper(void * (*pStartAddress)(void *), void *pArgument)
+CThreadWrapper::CThreadWrapper(void *(*pStartAddress)(void *), void *pArgument)
{
m_pStartAddress = pStartAddress;
m_pArgument = pArgument;
diff --git a/source/api_wrappers/linux/CThreadWrapper.h b/source/api_wrappers/linux/CThreadWrapper.h
index c7bfe01..e02a6e8 100644
--- a/source/api_wrappers/linux/CThreadWrapper.h
+++ b/source/api_wrappers/linux/CThreadWrapper.h
@@ -15,7 +15,7 @@ typedef void *(*StartAddress_t)(void *);
class CThreadWrapper : public CWaitableObject
{
public:
- CThreadWrapper(void * (* pStartAddress)(void *), void *pArgument);
+ CThreadWrapper(void *(* pStartAddress)(void *), void *pArgument);
~CThreadWrapper();
void ResumeThread();
void SuspendThread();
diff --git a/source/config/a2_commands_marshal_cpp.xsl b/source/config/a2_commands_marshal_cpp.xsl
index a30be7b..5a9b822 100644
--- a/source/config/a2_commands_marshal_cpp.xsl
+++ b/source/config/a2_commands_marshal_cpp.xsl
@@ -206,6 +206,7 @@ ErrorCode_e <value-of select="concat('A2LoaderRpcInterface::DoneRPC_', ../interf
<apply-templates select="output/value" mode="serialize_size_declaration" />
<apply-templates select="output/value" mode="serialize_size"/>
A2_COMMANDDATA(A2_GENERAL_RESPONSE, <call-template name="groupidmain"/>, <call-template name="commandid"/>, Session, PLSize);
+ (void)(Data_p);
Data_p = CmdData.Payload.Data_p;
<apply-templates select="output/value" mode="serialize"/>
diff --git a/source/config/commands_marshal_cpp.xsl b/source/config/commands_marshal_cpp.xsl
index 14a1c3e..4addd39 100644
--- a/source/config/commands_marshal_cpp.xsl
+++ b/source/config/commands_marshal_cpp.xsl
@@ -160,6 +160,7 @@ ErrorCode_e <value-of select="concat('LoaderRpcInterface::DoRPC_', ../interface[
<apply-templates select="input/value" mode="serialize_size_declaration" />
<apply-templates select="input/value" mode="serialize_size"/>
COMMANDDATAOUT(COMMAND_TYPE, <call-template name="groupidmain"/>, <call-template name="commandid"/>, SessionOut, PLSize);
+ (void)(Data_p);
Data_p = CmdData.Payload.Data_p;
<apply-templates select="input/value" mode="serialize"/>
Answer = lcmInterface_->CommandSend(&amp;CmdData);
diff --git a/source/security_algorithms/sha/sha2.cpp b/source/security_algorithms/sha/sha2.cpp
index f3986ca..07473e7 100644
--- a/source/security_algorithms/sha/sha2.cpp
+++ b/source/security_algorithms/sha/sha2.cpp
@@ -468,8 +468,8 @@ void SHA256_Transform(SHA256_CTX *context, const sha2_word32 *data)
/* Apply the SHA-256 compression function to update a..h */
T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
- /* Apply the SHA-256 compression function to update a..h with copy */
- T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
+/* Apply the SHA-256 compression function to update a..h with copy */
+T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_256(a) + Maj(a, b, c);
h = g;
@@ -810,8 +810,8 @@ void SHA512_Transform(SHA512_CTX *context, const sha2_word64 *data)
/* Apply the SHA-512 compression function to update a..h */
T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j];
#else /* BYTE_ORDER == LITTLE_ENDIAN */
- /* Apply the SHA-512 compression function to update a..h with copy */
- T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
+/* Apply the SHA-512 compression function to update a..h with copy */
+T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++);
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
T2 = Sigma0_512(a) + Maj(a, b, c);
h = g;