mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix negative value for depths in Information Box
The get_depth_units function was expecting an unsigned int as a first parameter. When it received a negative integer, the function made a cast to an unsigned int, resulting in a very big number. Signed-off-by: Nicu Badescu <badescunicu@yahoo.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a8bce0bb9f
commit
b3c0f8938d
2 changed files with 2 additions and 2 deletions
2
dive.c
2
dive.c
|
@ -123,7 +123,7 @@ unsigned int units_to_depth(double depth)
|
||||||
return feet_to_mm(depth);
|
return feet_to_mm(depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
double get_depth_units(unsigned int mm, int *frac, const char **units)
|
double get_depth_units(int mm, int *frac, const char **units)
|
||||||
{
|
{
|
||||||
int decimals;
|
int decimals;
|
||||||
double d;
|
double d;
|
||||||
|
|
2
dive.h
2
dive.h
|
@ -152,7 +152,7 @@ typedef struct
|
||||||
} weightsystem_t;
|
} weightsystem_t;
|
||||||
|
|
||||||
extern int get_pressure_units(unsigned int mb, const char **units);
|
extern int get_pressure_units(unsigned int mb, const char **units);
|
||||||
extern double get_depth_units(unsigned int mm, int *frac, const char **units);
|
extern double get_depth_units(int mm, int *frac, const char **units);
|
||||||
extern double get_volume_units(unsigned int ml, int *frac, const char **units);
|
extern double get_volume_units(unsigned int ml, int *frac, const char **units);
|
||||||
extern double get_temp_units(unsigned int mk, const char **units);
|
extern double get_temp_units(unsigned int mk, const char **units);
|
||||||
extern double get_weight_units(unsigned int grams, int *frac, const char **units);
|
extern double get_weight_units(unsigned int grams, int *frac, const char **units);
|
||||||
|
|
Loading…
Add table
Reference in a new issue