summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2022-05-18 14:54:06 -0400
committerPeter Jones <pjones@redhat.com>2022-05-18 16:37:23 -0400
commitf28833f7cbb3f536081b19c8a2cc6f709e772128 (patch)
tree5687880d9999f2a46eaf288826ff155b39f6e775 /include
parent610a1ac7614d2ad97b81b250dc37643df610d4f5 (diff)
downloadefi-boot-shim-f28833f7cbb3f536081b19c8a2cc6f709e772128.tar.gz
efi-boot-shim-f28833f7cbb3f536081b19c8a2cc6f709e772128.zip
peimage.h: make our signature macros force the type
scan-build invoked clang in a way that complains about our SIGNATURE_XX() macro's sizes being used to assign to things that are that size in post-process-pe.c. This patch makes them cast the results to the appropriately sized type. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/peimage.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/peimage.h b/include/peimage.h
index 4bcb940d..e97b29c4 100644
--- a/include/peimage.h
+++ b/include/peimage.h
@@ -17,10 +17,14 @@
#include "wincert.h"
-#define SIGNATURE_16(A, B) ((A) | (B << 8))
-#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
-#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
+#define SIGNATURE_16(A, B) \
+ ((UINT16)(((UINT16)(A)) | (((UINT16)(B)) << ((UINT16)8))))
+#define SIGNATURE_32(A, B, C, D) \
+ ((UINT32)(((UINT32)SIGNATURE_16(A, B)) | \
+ (((UINT32)SIGNATURE_16(C, D)) << (UINT32)16)))
+#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
+ ((UINT64)((UINT64)SIGNATURE_32(A, B, C, D) | \
+ ((UINT64)(SIGNATURE_32(E, F, G, H)) << (UINT64)32)))
#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1)))
#define ALIGN_POINTER(Pointer, Alignment) ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment))))