From a46e6475aa6fc84c269b98a1c1018f43c09e5435 Mon Sep 17 00:00:00 2001 From: agiersch Date: Tue, 22 Feb 2011 13:19:15 +0000 Subject: [PATCH 1/1] Remove useless double parentheses in function calls. But protect macro parameter with parentheses. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9680 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/xbt_queue.c | 2 +- win32_test_app/include/TBuffer.h | 2 +- win32_test_app/include/TDefs.h | 2 +- win32_test_app/src/TTestSuite.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xbt/xbt_queue.c b/src/xbt/xbt_queue.c index ba6315e89e..ee9df908bd 100644 --- a/src/xbt/xbt_queue.c +++ b/src/xbt/xbt_queue.c @@ -55,7 +55,7 @@ void xbt_queue_free(xbt_queue_t * queue) xbt_mutex_destroy((*queue)->mutex); xbt_cond_destroy((*queue)->not_full); xbt_cond_destroy((*queue)->not_empty); - free((*queue)); + free(*queue); *queue = NULL; } diff --git a/win32_test_app/include/TBuffer.h b/win32_test_app/include/TBuffer.h index c5166e3479..ceb46613cf 100644 --- a/win32_test_app/include/TBuffer.h +++ b/win32_test_app/include/TBuffer.h @@ -13,7 +13,7 @@ typedef struct s_Buffer { } s_Buffer_t, *Buffer_t; /* Asserts that a s_Buffer is valid. */ -#define ASSERT_VALID_Buffer(p) ( ASSERT_NOT_NULL((p)) /*&& ASSERT_NOT_NULL((p)->data)*/ ) +#define ASSERT_VALID_Buffer(p) ( ASSERT_NOT_NULL(p) /*&& ASSERT_NOT_NULL((p)->data)*/ ) /* The default buffer capacity (512 bytes). */ #define DEFAULT_Buffer_CAPACITY ((size_t)512) diff --git a/win32_test_app/include/TDefs.h b/win32_test_app/include/TDefs.h index e0852f0fa9..bd7a33817f 100644 --- a/win32_test_app/include/TDefs.h +++ b/win32_test_app/include/TDefs.h @@ -33,7 +33,7 @@ typedef int ssize_t; /* Asserts that a condition is true.*/ #define ASSERT(c) assert(c) /* Asserts that a pointer is not NULL.*/ -#define ASSERT_NOT_NULL(p) assert(NULL != p) +#define ASSERT_NOT_NULL(p) assert(NULL != (p)) /* Error number type (int) */ #ifndef __ERRNO_TYPE_DEFINED diff --git a/win32_test_app/src/TTestSuite.c b/win32_test_app/src/TTestSuite.c index e2c49bea32..30fc661900 100644 --- a/win32_test_app/src/TTestSuite.c +++ b/win32_test_app/src/TTestSuite.c @@ -809,14 +809,14 @@ unsigned long WINAPI TestSuite_runSyncTestCase(void *param) /* Close inheritable copies of the handles you do not want to be inherited. */ - if (!CloseHandle((context->hChildStdoutReadTmp))) { + if (!CloseHandle(context->hChildStdoutReadTmp)) { setErrno(E_CANNOT_CLOSE_CHILD_STDIN_TEMPORY_HANDLE); return getErrno(); } context->hChildStdoutReadTmp = NULL; - if (!CloseHandle((context->hChildStdinWriteTmp))) { + if (!CloseHandle(context->hChildStdinWriteTmp)) { setErrno(E_CANNOT_CLOSE_CHILD_STDOUT_TEMPORY_HANDLE); return getErrno(); } -- 2.20.1