[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    arts/flow/gsl
From:       Kevin Puetz <puetzk () iastate ! edu>
Date:       2003-02-03 18:55:53
[Download RAW message or body]

CVS commit by puetzk: 

sanity += 0.001 // a little bit, even though it will truncate off anyway :-)

({ ... }) sure is a strange one, and g++ is complaining that it's not ISO C++.

use do { } while(0) to create a local scope for this stuff... that's 
the normal usage, ugly as it is, and valid ISO C++.


  M +3 -3      gslcommon.h   1.11


--- arts/flow/gsl/gslcommon.h  #1.10:1.11
@@ -58,12 +58,12 @@ const GslConfig*	gsl_get_config	(void) G
 #define gsl_new_struct(type, n)         ((type*) gsl_alloc_memblock (sizeof (type) * \
(n)))  #define gsl_new_struct0(type, n)        ((type*) gsl_alloc_memblock0 (sizeof \
                (type) * (n)))
-#define gsl_delete_struct(type, mem)    (gsl_delete_structs (type, 1, (mem)))
+#define gsl_delete_struct(type, mem)    gsl_delete_structs (type, 1, (mem))
 #ifndef __GNUC__
 #  define gsl_delete_structs(type, n, mem)      (gsl_free_memblock (sizeof (type) * \
(n), (mem)))  #else                                   /* provide typesafety if \
                possible */
-#  define gsl_delete_structs(type, n, mem)      ({ \
+#  define gsl_delete_structs(type, n, mem)      do { \
   type *__typed_pointer = (mem); \
   gsl_free_memblock (sizeof (type) * (n), __typed_pointer); \
-})
+} while(0)
 #endif
 #define GSL_ALIGNED_SIZE(size,align)    ((align) > 0 ? _GSL_INTERN_ALIGN (((gsize) \
(size)), ((gsize) (align))) : (gsize) (size))


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic