summaryrefslogtreecommitdiffstats
path: root/display.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-17 08:19:09 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-17 10:53:49 -0700
commit37794e2e236fbbc4a1a55724df3bb1ef160a9ae7 (patch)
tree54130255d041e1019fb48eb5e2a7fb35b634f249 /display.h
parent60ceb8ebc1afb196e66f7decb494c9e4e67fed7a (diff)
downloadsubsurface-37794e2e236fbbc4a1a55724df3bb1ef160a9ae7.tar.gz
Be more careful about dive computer selection
The selection logic was a bit random: some places would return NULL if the dive computer index was out of range, others would return the primary dive computer, and actually moving between dive computers would just blindly increment and decrement the number. This always selects the primary computer if the index is out of bounds, and makes sure we stay in bound when switching beteen dive computers (but switching between dives can then turn an in-bound number into an out-of-bounds one) Fixes #464 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'display.h')
-rw-r--r--display.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/display.h b/display.h
index 35fa3749f..5af5c5612 100644
--- a/display.h
+++ b/display.h
@@ -32,7 +32,7 @@ typedef enum {
SC_PRINT
} scale_mode_t;
-extern struct divecomputer *select_dc(struct divecomputer *main);
+extern struct divecomputer *select_dc(struct dive *);
struct options {
enum {
@@ -46,7 +46,7 @@ struct options {
int profile_height, notes_height, tanks_height;
};
-extern char dc_number;
+extern unsigned int dc_number;
extern unsigned int amount_selected;