[svn-commits] kpfleming: branch 1.4 r129967 - /branches/1.4/main/astmm.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jul 11 09:14:53 CDT 2008


Author: kpfleming
Date: Fri Jul 11 09:14:52 2008
New Revision: 129967

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129967
Log:
simplify calculation

Modified:
    branches/1.4/main/astmm.c

Modified: branches/1.4/main/astmm.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/astmm.c?view=diff&rev=129967&r1=129966&r2=129967
==============================================================================
--- branches/1.4/main/astmm.c (original)
+++ branches/1.4/main/astmm.c Fri Jul 11 09:14:52 2008
@@ -476,10 +476,10 @@
 void __ast_mm_init(void)
 {
 	char filename[PATH_MAX];
-	int pad;
-
-	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);
+	size_t pad = sizeof(struct ast_region) - offsetof(struct ast_region, data);
+
+	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));




More information about the svn-commits mailing list