[PATCH] Silence four compliler warnings

Robert C. Helling helling at atdotde.de
Mon Feb 1 11:38:37 PST 2016


From: "Robert C. Helling" <helling at atdotde.de>

Signed-off-by: Robert C. Helling <helling at atdotde.de>

--

Just as a proof I am still alive...
---
 subsurface-core/divelist.c   | 2 +-
 subsurface-core/profile.h    | 4 ++--
 tests/testunitconversion.cpp | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/subsurface-core/divelist.c b/subsurface-core/divelist.c
index 7ae5e83..4008678 100644
--- a/subsurface-core/divelist.c
+++ b/subsurface-core/divelist.c
@@ -854,7 +854,7 @@ struct dive *merge_two_dives(struct dive *a, struct dive *b)
 
 	// renumber dives from merged one in advance by difference between
 	// merged dives numbers. Do not renumber if actual number is zero.
-	for (j; j < dive_table.nr; j++)
+	for (; j < dive_table.nr; j++)
 		if (!dive_table.dives[j]->number == 0)
 			dive_table.dives[j]->number -= factor;
 
diff --git a/subsurface-core/profile.h b/subsurface-core/profile.h
index 71929f8..abac9dd 100644
--- a/subsurface-core/profile.h
+++ b/subsurface-core/profile.h
@@ -1,12 +1,12 @@
 #ifndef PROFILE_H
 #define PROFILE_H
 
+#include "dive.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "dive.h"
-
 typedef enum {
 	STABLE,
 	SLOW,
diff --git a/tests/testunitconversion.cpp b/tests/testunitconversion.cpp
index 3adf975..8e64fdd 100644
--- a/tests/testunitconversion.cpp
+++ b/tests/testunitconversion.cpp
@@ -17,8 +17,8 @@ void TestUnitConversion::testUnitConversions()
 	QCOMPARE(IS_FP_SAME(psi_to_bar(14.6959488), 1.01325), true);
 	QCOMPARE(psi_to_mbar(14.6959488), (long)1013);
 	QCOMPARE(to_PSI((pressure_t){ 1013 }), (int)15);
-	QCOMPARE(IS_FP_SAME(bar_to_atm(1.013), 1), true);
-	QCOMPARE(IS_FP_SAME(mbar_to_atm(1013), 1), true);
+	QCOMPARE(IS_FP_SAME(bar_to_atm(1.013), 1.0), true);
+	QCOMPARE(IS_FP_SAME(mbar_to_atm(1013), 1.0), true);
 	QCOMPARE(mbar_to_PSI(1013), (int)15);
 	get_units();
 }
-- 
2.5.4 (Apple Git-61)



More information about the subsurface mailing list