Mercurial > public > ostc4
comparison 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 |
comparison
equal
deleted
inserted
replaced
50:6310a27fd6d3 | 51:8f8ea3a32e82 |
---|---|
722 | 722 |
723 | 723 |
724 void vpm_init(SVpm* pVpm, short conservatism, short repetitive_dive, long seconds_since_last_dive) | 724 void vpm_init(SVpm* pVpm, short conservatism, short repetitive_dive, long seconds_since_last_dive) |
725 { | 725 { |
726 | 726 |
727 float critical_radius_n2_microns, | 727 float critical_radius_n2_microns = 0.82; /* be conservative in case of an unexpected parameter value */ |
728 critical_radius_he_microns; | 728 float critical_radius_he_microns = 0.72; |
729 float initial_critical_radius_n2[16]; | 729 float initial_critical_radius_n2[16]; |
730 float initial_critical_radius_he[16]; | 730 float initial_critical_radius_he[16]; |
731 int i = 0; | 731 int i = 0; |
732 float surface_time = seconds_since_last_dive / 60; | 732 float surface_time = seconds_since_last_dive / 60; |
733 pVpm->repetitive_variables_not_valid = !repetitive_dive; | 733 pVpm->repetitive_variables_not_valid = !repetitive_dive; |
756 break; | 756 break; |
757 case 5: | 757 case 5: |
758 critical_radius_n2_microns=0.82; | 758 critical_radius_n2_microns=0.82; |
759 critical_radius_he_microns=0.72; | 759 critical_radius_he_microns=0.72; |
760 break; | 760 break; |
761 default: | |
762 critical_radius_n2_microns=0.82; | |
763 critical_radius_he_microns=0.72; | |
764 break; | |
761 } | 765 } |
762 | 766 |
763 for (i = 0; i < 16; ++i) { | 767 for (i = 0; i < 16; ++i) { |
764 initial_critical_radius_n2[i] = critical_radius_n2_microns * 1e-6f; | 768 initial_critical_radius_n2[i] = critical_radius_n2_microns * 1e-6f; |
765 initial_critical_radius_he[i] = critical_radius_he_microns * 1e-6f; | 769 initial_critical_radius_he[i] = critical_radius_he_microns * 1e-6f; |