Start cleaning up dive accessors
I'm going to add a menu to import (and eventually export) dives, and so we'd like to be able to start out with no dives at all. Right now we croak if that happens - it's not like the code has been written with actual end users in mind. So start cleaning things up. First make the 'current_dive' macro work right even for invalid dives. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
#include <cairo.h>
|
||||
|
||||
extern int selected_dive;
|
||||
#define current_dive (get_dive(selected_dive))
|
||||
|
||||
extern GtkWidget *dive_profile_frame(void);
|
||||
extern GtkWidget *dive_info_frame(void);
|
||||
extern GtkWidget *create_dive_list(void);
|
||||
extern void update_dive_info(struct dive *dive);
|
||||
extern void repaint_dive(void);
|
||||
|
||||
#define current_dive (dive_table.dives[selected_dive])
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user