about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Carbonetto2017-10-10 12:12:03 -0500
committerGitHub2017-10-10 12:12:03 -0500
commit5737c5c0cf24982e743ca827d43c9d4bb59f8f08 (patch)
tree83f238f5be4f5e0195c7e6267d4d24c3d7a5ef18
parentab2a1830659ac970d97c107f145105fb410eb219 (diff)
parent8295b73436d732ec048319c9df08f9ef5800cc35 (diff)
downloadpangemma-5737c5c0cf24982e743ca827d43c9d4bb59f8f08.tar.gz
Merge pull request #99 from genenetwork/master
Fix compiler warnings on MacOSX.
-rw-r--r--src/debug.cpp6
-rw-r--r--src/debug.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/debug.cpp b/src/debug.cpp
index da0d06f..6fa17bc 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -23,8 +23,8 @@ void do_validate_K(const gsl_matrix *K, bool do_check, bool strict, const char *
   if (do_check) {
     // debug_msg("Validating K");
     auto eigenvalues = getEigenValues(K);
-    uint count_small;
-    if (count_small = count_small_values(eigenvalues,EIGEN_MINVALUE)>1) {
+    const uint count_small = count_small_values(eigenvalues,EIGEN_MINVALUE);
+    if (count_small>1) {
       std::string msg = "K has ";
       msg += std::to_string(count_small);
       msg += " eigenvalues close to zero";
@@ -38,7 +38,7 @@ void do_validate_K(const gsl_matrix *K, bool do_check, bool strict, const char *
     if (negative_values = has_negative_values_but_one(eigenvalues)) {
       warning_at_msg(__file,__line,"K has more than one negative eigenvalues!");
     }
-    if (count_small>=0 && negative_values && !isMatrixPositiveDefinite(K))
+    if (count_small>0 && negative_values && !isMatrixPositiveDefinite(K))
       fail_at_msg(strict,__file,__line,"K is not positive definite!");
     gsl_vector_free(eigenvalues);
   }
diff --git a/src/debug.h b/src/debug.h
index e910a25..06ca5cb 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -28,6 +28,11 @@ inline void fail_at_msg(bool strict, const char *__file, int __line, const char
   if (strict)
     exit(1);
 }
+
+# ifndef __ASSERT_VOID_CAST
+# define __ASSERT_VOID_CAST (void)
+# endif
+
 #if defined NDEBUG
 
 #define warning_msg(msg) cerr << "**** WARNING: " << msg << endl;