diff Common/Src/calc_crush.c @ 51:8f8ea3a32e82

Resolved warnings pointing to possible invalid memory access
author Ideenmodellierer
date Tue, 31 Jul 2018 22:28:21 +0200
parents 5f11787b4f42
children
line wrap: on
line diff
--- a/Common/Src/calc_crush.c	Mon Jul 30 11:37:39 2018 +0200
+++ b/Common/Src/calc_crush.c	Tue Jul 31 22:28:21 2018 +0200
@@ -724,8 +724,8 @@
 void vpm_init(SVpm* pVpm, short conservatism, short repetitive_dive, long seconds_since_last_dive)
 {
 
-	float critical_radius_n2_microns,
-		critical_radius_he_microns;
+	float critical_radius_n2_microns = 0.82;		 /* be conservative in case of an unexpected parameter value */
+	float critical_radius_he_microns = 0.72;
 	float initial_critical_radius_n2[16];
 	float initial_critical_radius_he[16];
 	int i = 0;
@@ -758,6 +758,10 @@
 			critical_radius_n2_microns=0.82;
 			critical_radius_he_microns=0.72;
 			break;
+		default:
+			critical_radius_n2_microns=0.82;
+			critical_radius_he_microns=0.72;
+			break;
 	}
 
 	 for (i = 0; i < 16; ++i) {