[MOAB-dev] r5295 - in MOAB/trunk: src/parallel tools/mbcoupler

jvporter at wisc.edu jvporter at wisc.edu
Fri Jan 6 15:54:47 CST 2012


Author: jvporter
Date: 2012-01-06 15:54:46 -0600 (Fri, 06 Jan 2012)
New Revision: 5295

Modified:
   MOAB/trunk/src/parallel/errmem.h
   MOAB/trunk/src/parallel/minmax.h
   MOAB/trunk/tools/mbcoupler/errmem.h
   MOAB/trunk/tools/mbcoupler/minmax.h
Log:
Fix warnings in parallel builds and mbcoupler


Modified: MOAB/trunk/src/parallel/errmem.h
===================================================================
--- MOAB/trunk/src/parallel/errmem.h	2012-01-06 19:57:29 UTC (rev 5294)
+++ MOAB/trunk/src/parallel/errmem.h	2012-01-06 21:54:46 UTC (rev 5295)
@@ -15,6 +15,12 @@
 
 #ifdef __GNUC__
 void fail(const char *fmt, ...) __attribute__ ((noreturn));
+
+static void buffer_init_(buffer *b, size_t size, const char *file)
+  __attribute__ ((unused));
+static void buffer_reserve_(buffer *b, size_t min, const char *file)
+  __attribute__ ((unused));
+static void buffer_free(buffer *b) __attribute__ ((unused));
 #else
 void fail(const char *fmt, ...);
 #endif

Modified: MOAB/trunk/src/parallel/minmax.h
===================================================================
--- MOAB/trunk/src/parallel/minmax.h	2012-01-06 19:57:29 UTC (rev 5294)
+++ MOAB/trunk/src/parallel/minmax.h	2012-01-06 21:54:46 UTC (rev 5295)
@@ -11,32 +11,72 @@
    Min, Max, Norm
   --------------------------------------------------------------------------*/
 
+#ifdef __GNUC__
+#define MAYBE_UNUSED __attribute__ ((unused))
+#else
+#define MAYBE_UNUSED
+#endif
+
 #define DECLMINMAX(type, prefix) \
-static type prefix##min_2(type a, type b) { return b<a?b:a; } \
-static type prefix##max_2(type a, type b) { return a>b?a:b; } \
-static void prefix##minmax_2(type *min, type *max, type a, type b) \
-{ if(b<a) *min=b, *max=a; else *min=a, *max=b; } \
-static type prefix##min_3(type a, type b, type c) \
-{ return b<a?(c<b?c:b):(c<a?c:a); } \
-static type prefix##max_3(type a, type b, type c) \
-{ return a>b?(a>c?a:c):(b>c?b:c); } \
-static void prefix##minmax_3(type *min, type *max, type a, type b, type c) \
-{ if(b<a)  *min=prefix##min_2(b,c), *max=prefix##max_2(a,c); \
-  else    *min=prefix##min_2(a,c), *max=prefix##max_2(b,c); }
+  static type prefix##min_2(type a, type b) MAYBE_UNUSED;               \
+  static type prefix##min_2(type a, type b) {                           \
+    return b<a?b:a;                                                     \
+  }                                                                     \
+  static type prefix##max_2(type a, type b) MAYBE_UNUSED;               \
+  static type prefix##max_2(type a, type b) {                           \
+    return a>b?a:b;                                                     \


More information about the moab-dev mailing list