OSDN Git Service

suppress warning about lvalue assignment.
authortsutsumi <>
Sat, 14 Aug 2010 09:18:12 +0000 (09:18 +0000)
committertsutsumi <>
Sat, 14 Aug 2010 09:18:12 +0000 (09:18 +0000)
src/ccunit/CCUnitConfig.h
src/ccunit/CCUnitTestCase.c
src/ccunit/CCUnitTestFailure.c

index a900a3d..88d38ad 100644 (file)
@@ -57,7 +57,7 @@
  * Omits dmalloc's free(NULL) warning.
  * @param p [in/out] pointer to free. and set NULL.
  */
-#define safe_free(p) (!p ? NULL : (free (p), p = NULL))
+#define safe_free(p) (!p ? NULL : (free ((void*)p), (p) = NULL))
 
 /**
  * safty strdup. Tries not to pass NULL to strdup.
index 4e8be5a..fa5fb36 100755 (executable)
@@ -55,8 +55,8 @@ void ccunit_deleteTestCase (CCUnitTestCase* testCase)
 {
   if (!testCase)
     return;
-  safe_free ((char*)testCase->name);
-  safe_free ((char*)testCase->desc);
+  safe_free (testCase->name);
+  safe_free (testCase->desc);
   free (testCase);
 }
 
index 8cfe701..8e68131 100644 (file)
@@ -48,8 +48,8 @@ CCUnitTestFailure* ccunit_newTestFailure (const char* file,
 
 void ccunit_deleteTestFailure (CCUnitTestFailure* failure)
 {
-  safe_free ((char*)failure->expect);
-  safe_free ((char*)failure->actual);
+  safe_free (failure->expect);
+  safe_free (failure->actual);
   safe_free (failure);
 }