[asterisk-commits] rmudgett: branch 1.8 r365476 - /branches/1.8/tests/test_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 7 13:40:39 CDT 2012


Author: rmudgett
Date: Mon May  7 13:40:35 2012
New Revision: 365476

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=365476
Log:
Fix type punned compiler warning in test_config.c

Modified:
    branches/1.8/tests/test_config.c

Modified: branches/1.8/tests/test_config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/tests/test_config.c?view=diff&rev=365476&r1=365475&r2=365476
==============================================================================
--- branches/1.8/tests/test_config.c (original)
+++ branches/1.8/tests/test_config.c Mon May  7 13:40:35 2012
@@ -59,19 +59,22 @@
 		ret = AST_TEST_FAIL; \
 	} else { \
 		if (((flags) & PARSE_TYPE) == PARSE_INT32) { \
-			int32_t *r = (int32_t *) result, e = (int32_t) expected_result; \
+			int32_t *r = (int32_t *) (void *) result; \
+			int32_t e = (int32_t) expected_result; \
 			if (*r != e) { \
 				ast_test_status_update(test, "ast_parse_arg int32_t failed with %d != %d\n", *r, e); \
 				ret = AST_TEST_FAIL; \
 			} \
 		} else if (((flags) & PARSE_TYPE) == PARSE_UINT32) { \
-			uint32_t *r = (uint32_t *) result, e = (uint32_t) expected_result; \
+			uint32_t *r = (uint32_t *) (void *) result; \
+			uint32_t e = (uint32_t) expected_result; \
 			if (*r != e) { \
 				ast_test_status_update(test, "ast_parse_arg uint32_t failed with %u != %u\n", *r, e); \
 				ret = AST_TEST_FAIL; \
 			} \
 		} else if (((flags) & PARSE_TYPE) == PARSE_DOUBLE) { \
-			double *r = (double *) result, e = (double) expected_result; \
+			double *r = (double *) (void *) result; \
+			double e = (double) expected_result; \
 			if (fabs(*r - e) > EPSILON) { \
 				ast_test_status_update(test, "ast_parse_arg double failed with %f != %f\n", *r, e); \
 				ret = AST_TEST_FAIL; \




More information about the asterisk-commits mailing list