Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless double parentheses in function calls.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Feb 2011 13:19:15 +0000 (13:19 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 22 Feb 2011 13:19:15 +0000 (13:19 +0000)
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
win32_test_app/include/TBuffer.h
win32_test_app/include/TDefs.h
win32_test_app/src/TTestSuite.c

index ba6315e..ee9df90 100644 (file)
@@ -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;
 }
 
index c5166e3..ceb4661 100644 (file)
@@ -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)
index e0852f0..bd7a338 100644 (file)
@@ -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
index e2c49be..30fc661 100644 (file)
@@ -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();
   }