summaryrefslogtreecommitdiffstats
path: root/load-git.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-09 20:55:29 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-09 21:04:05 -0700
commit1fc783aed52e0f60dae68bc97d819392672df668 (patch)
treec4439881bef01ffbf5fb5a4132f88902532411cb /load-git.c
parent4312b155e1f93a139bcbed1d0a5381e353b9a654 (diff)
downloadsubsurface-1fc783aed52e0f60dae68bc97d819392672df668.tar.gz
Read salinity from git objects
Simple oversight on the reading side. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'load-git.c')
-rw-r--r--load-git.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/load-git.c b/load-git.c
index 8bc7aa1d3..636f1efc6 100644
--- a/load-git.c
+++ b/load-git.c
@@ -79,6 +79,11 @@ static pressure_t get_pressure(const char *line)
return p;
}
+static int get_salinity(const char *line)
+{
+ return rint(10*ascii_strtod(line, NULL));
+}
+
static fraction_t get_fraction(const char *line)
{
fraction_t f;
@@ -494,6 +499,9 @@ static void parse_dc_model(char *line, struct membuffer *str, void *_dc)
static void parse_dc_surfacepressure(char *line, struct membuffer *str, void *_dc)
{ struct divecomputer *dc = _dc; dc->surface_pressure = get_pressure(line); }
+static void parse_dc_salinity(char *line, struct membuffer *str, void *_dc)
+{ struct divecomputer *dc = _dc; dc->salinity = get_salinity(line); }
+
static void parse_dc_surfacetime(char *line, struct membuffer *str, void *_dc)
{ struct divecomputer *dc = _dc; dc->surfacetime = get_duration(line); }
@@ -647,7 +655,7 @@ struct keyword_action dc_action[] = {
#undef D
#define D(x) { #x, parse_dc_ ## x }
D(airtemp), D(date), D(deviceid), D(diveid), D(duration),
- D(event), D(maxdepth), D(meandepth), D(model),
+ D(event), D(maxdepth), D(meandepth), D(model), D(salinity),
D(surfacepressure), D(surfacetime), D(time), D(watertemp),
};