diff options
author | Haru <haru@dotalux.com> | 2015-05-19 01:59:33 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2015-05-19 03:08:22 +0200 |
commit | bd2109d614a443045c7bbbf632bb9035216e3623 (patch) | |
tree | 2e125e4ce2b6a8c60b5e2303b1e2b0a88386ff70 /src/common | |
parent | 6ac5a0ccfb601b81e1b84f6e86175d40bb16864b (diff) | |
download | hercules-bd2109d614a443045c7bbbf632bb9035216e3623.tar.gz hercules-bd2109d614a443045c7bbbf632bb9035216e3623.tar.bz2 hercules-bd2109d614a443045c7bbbf632bb9035216e3623.tar.xz hercules-bd2109d614a443045c7bbbf632bb9035216e3623.zip |
Fixed some issues reported by coverity scan [3/3]
- Automatically zeroed variables are now zeroed in the correct size,
regardless of padding.
- Special thanks to Ind.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cbasetypes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 3ff0db795..dda9c8c42 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -419,4 +419,10 @@ typedef char bool; #define h64BPTRSIZE(y) (y) #endif +/** Support macros for marking blocks to memset to 0 */ +#define BEGIN_ZEROED_BLOCK int8 HERC__zeroed_block_BEGIN +#define END_ZEROED_BLOCK int8 HERC__zeroed_block_END +#define ZEROED_BLOCK_POS(x) (&(x)->HERC__zeroed_block_BEGIN) +#define ZEROED_BLOCK_SIZE(x) ((void*)&((x)->HERC__zeroed_block_END) - (void*)&((x)->HERC__zeroed_block_BEGIN) + sizeof((x)->HERC__zeroed_block_END)) + #endif /* COMMON_CBASETYPES_H */ |