]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
simplify calculation
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 11 Jul 2008 14:14:52 +0000 (14:14 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 11 Jul 2008 14:14:52 +0000 (14:14 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129967 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/astmm.c

index bc2cd824a75d3e8e75fb0b08142f922911b11df4..f5ce26f0acc109a09330998e8bc24f3ab1bb5c55 100644 (file)
@@ -476,10 +476,10 @@ static struct ast_cli_entry cli_memory[] = {
 void __ast_mm_init(void)
 {
        char filename[PATH_MAX];
-       int pad;
+       size_t pad = sizeof(struct ast_region) - offsetof(struct ast_region, data);
 
-       if ((pad = (__alignof__(struct ast_region) - (offsetof(struct ast_region, data) % __alignof__(struct ast_region)))) != 0) {
-               ast_log(LOG_ERROR, "struct ast_region has %d bytes of padding! This must be eliminated for low-fence checking to work properly!\n", pad);
+       if (pad) {
+               ast_log(LOG_ERROR, "struct ast_region has %d bytes of padding! This must be eliminated for low-fence checking to work properly!\n", (int) pad);
        }
 
        ast_cli_register_multiple(cli_memory, sizeof(cli_memory) / sizeof(struct ast_cli_entry));