[PATCH 3/4] Use unsigned char to store devicesettings.

Anton Lundin glance at acc.umu.se
Thu Oct 9 22:34:14 PDT 2014


C++-11 complains allot about narrowing the int value to unsigned char in
the setting of these values to the OSTC3. This clears that warning, and
any confusion about these values.

Future work: Change these structures to use our "Subsurface"-types
instead.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 devicedetails.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/devicedetails.h b/devicedetails.h
index d754e97..372d5cd 100644
--- a/devicedetails.h
+++ b/devicedetails.h
@@ -6,15 +6,15 @@
 #include "libdivecomputer.h"
 
 struct gas {
-	int oxygen;
-	int helium;
-	int type;
-	int depth;
+	unsigned char oxygen;
+	unsigned char helium;
+	unsigned char type;
+	unsigned char depth;
 };
 
 struct setpoint {
-	int sp;
-	int depth;
+	unsigned char sp;
+	unsigned char depth;
 };
 
 class DeviceDetails : public QObject
-- 
1.9.1



More information about the subsurface mailing list