diff options
author | 2013-01-01 10:29:18 -0800 | |
---|---|---|
committer | 2013-01-01 10:29:18 -0800 | |
commit | 1c72d90b37d5f362a262a521a86f5b089daf8e62 (patch) | |
tree | f538622add1f7a6b40f3865b1293871658a8b69d /profile.c | |
parent | c2e003975e4d11dbfda032a2d8e0386f75b3cde2 (diff) | |
parent | 8f364d0094aa0c2999708dca0e1ac6fefed67837 (diff) | |
download | subsurface-1c72d90b37d5f362a262a521a86f5b089daf8e62.tar.gz |
Merge branch 'updown'
Bring in the keyboard handling change
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1800,11 +1800,24 @@ static void plot_set_scale(scale_mode_t scale) } } +/* make sure you pass this the FIRST dc - it just walks the list */ +static int nr_dcs(struct divecomputer *main) +{ + int i = 1; + struct divecomputer *dc = main; + + while ((dc = dc->next) != NULL) + i++; + return i; +} + static struct divecomputer *select_dc(struct divecomputer *main) { int i = dc_number; struct divecomputer *dc = main; + while (i < 0) + i += nr_dcs(main); do { if (--i < 0) return dc; |