diff options
author | kavsrf <kavsrf@gmail.com> | 2017-02-28 10:56:20 +0300 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-06-05 17:37:36 +0200 |
commit | 33b79a7652cd3503884701ffaf59aa1d2e4e6cab (patch) | |
tree | f3f6d71bb20267b9e3a767dc7df7c73f878ede7b | |
parent | 10ddedbbac7acb326fb9447c6a1c5f1706017e4b (diff) | |
download | VeraCrypt-DCS-33b79a7652cd3503884701ffaf59aa1d2e4e6cab.tar.gz VeraCrypt-DCS-33b79a7652cd3503884701ffaf59aa1d2e4e6cab.zip |
cland static code analyzer fixes
-rw-r--r-- | Include/Library/CommonLib.h | 4 | ||||
-rw-r--r-- | Include/Library/DcsCfgLib.h | 4 | ||||
-rw-r--r-- | Library/DcsCfgLib/GptEdit.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/Include/Library/CommonLib.h b/Include/Library/CommonLib.h index 2c698d0..efc7738 100644 --- a/Include/Library/CommonLib.h +++ b/Include/Library/CommonLib.h @@ -28,6 +28,10 @@ https://opensource.org/licenses/LGPL-3.0 //////////////////////////////////////////////////////////////////////////
extern UINTN gCELine;
#define CE(ex) gCELine = __LINE__; if(EFI_ERROR(res = ex)) goto err
+ +#ifndef CSTATIC_ASSERT +#define CSTATIC_ASSERT(b, name) typedef int StaticAssertFailed##name[b ? 1 : -1]; +#endif //////////////////////////////////////////////////////////////////////////
// defines
diff --git a/Include/Library/DcsCfgLib.h b/Include/Library/DcsCfgLib.h index 4c8153b..ccbaa32 100644 --- a/Include/Library/DcsCfgLib.h +++ b/Include/Library/DcsCfgLib.h @@ -14,6 +14,8 @@ of the [to be defined License, Version]. The full text of the license may be fou #include <Uefi.h>
+#include "CommonLib.h"
+
//////////////////////////////////////////////////////////////////////////
// DeList and GPT
//////////////////////////////////////////////////////////////////////////
@@ -206,7 +208,7 @@ typedef struct _DCS_RND_SAVED { UINT8 pad[512 - 8 - 4 - 4 - 4 - 4 - sizeof(EFI_TIME) - sizeof(DCS_RND_STATE)];
} DCS_RND_SAVED;
#pragma pack()
-static_assert(sizeof(DCS_RND_SAVED) == 512, "Wrong size DCS_RND_SAVED");
+CSTATIC_ASSERT(sizeof(DCS_RND_SAVED) == 512, Wrong_size_DCS_RND_SAVED);
typedef struct _DCS_RND {
DCS_RND_PREPARE Prepare;
diff --git a/Library/DcsCfgLib/GptEdit.c b/Library/DcsCfgLib/GptEdit.c index 5545791..28d2160 100644 --- a/Library/DcsCfgLib/GptEdit.c +++ b/Library/DcsCfgLib/GptEdit.c @@ -415,7 +415,7 @@ DeListParseSaved( if (GptMainEntrys != NULL && GptAltEntrys != NULL && GptMainHdr != NULL) {
if (CompareMem(GptMainEntrys, GptAltEntrys, GptMainHdr->NumberOfPartitionEntries * GptMainHdr->SizeOfPartitionEntry) != 0) {
- ERR_PRINT(L"Alt GPT != Main GPT\n", );
+ ERR_PRINT(L"Alt GPT != Main GPT\n");
return EFI_CRC_ERROR;
}
}
|