diff options
Diffstat (limited to 'equipment.c')
-rw-r--r-- | equipment.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/equipment.c b/equipment.c index 579c45542..abfb0e7b5 100644 --- a/equipment.c +++ b/equipment.c @@ -81,9 +81,8 @@ static int convert_pressure(int mbar, double *p) return decimals; } -static int convert_volume_pressure(int ml, int mbar, double *v, double *p) +static void convert_volume_pressure(int ml, int mbar, double *v, double *p) { - int decimals = 1; double volume, pressure; volume = ml / 1000.0; @@ -95,13 +94,11 @@ static int convert_volume_pressure(int ml, int mbar, double *v, double *p) if (output_units.pressure == PSI) { pressure = mbar_to_PSI(mbar); - decimals = 0; } else pressure = mbar / 1000.0; } *v = volume; *p = pressure; - return decimals; } static int convert_weight(int grams, double *m) @@ -405,7 +402,7 @@ static void show_cylinder(cylinder_t *cyl, struct cylinder_widget *cylinder) o2 = cyl->gasmix.o2.permille / 10.0; he = cyl->gasmix.he.permille / 10.0; if (!o2) - o2 = 21.0; + o2 = AIR_PERMILLE / 10.0; gtk_spin_button_set_value(GTK_SPIN_BUTTON(cylinder->o2), o2); gtk_spin_button_set_value(GTK_SPIN_BUTTON(cylinder->he), he); } @@ -448,7 +445,7 @@ int weightsystem_none(void *_data) return !ws->weight.grams && !ws->description; } -static void set_one_cylinder(int index, void *_data, GtkListStore *model, GtkTreeIter *iter) +static void set_one_cylinder(void *_data, GtkListStore *model, GtkTreeIter *iter) { cylinder_t *cyl = _data; unsigned int start, end; @@ -466,7 +463,7 @@ static void set_one_cylinder(int index, void *_data, GtkListStore *model, GtkTre -1); } -static void set_one_weightsystem(int index, void *_data, GtkListStore *model, GtkTreeIter *iter) +static void set_one_weightsystem(void *_data, GtkListStore *model, GtkTreeIter *iter) { weightsystem_t *ws = _data; @@ -494,7 +491,7 @@ static void show_equipment(struct dive *dive, int max, struct equipment_list *equipment_list, void*(*ptr_function)(struct dive*, int), int(*none_function)(void *), - void(*set_one_function)(int, void*, GtkListStore*, GtkTreeIter *)) + void(*set_one_function)(void*, GtkListStore*, GtkTreeIter *)) { int i, used; void *data; @@ -518,7 +515,7 @@ static void show_equipment(struct dive *dive, int max, for (i = 0; i < used; i++) { data = ptr_function(dive, i); gtk_list_store_append(model, &iter); - set_one_function(i, data, model, &iter); + set_one_function(data, model, &iter); } } @@ -1073,7 +1070,7 @@ static void edit_cb(GtkButton *button, GtkTreeView *tree_view) if (!edit_cylinder_dialog(index, &cyl)) return; - set_one_cylinder(index, &cyl, model, &iter); + set_one_cylinder(&cyl, model, &iter); repaint_dive(); } @@ -1089,7 +1086,7 @@ static void add_cb(GtkButton *button, GtkTreeView *tree_view) return; gtk_list_store_append(model, &iter); - set_one_cylinder(index, &cyl, model, &iter); + set_one_cylinder(&cyl, model, &iter); selection = gtk_tree_view_get_selection(tree_view); gtk_tree_selection_select_iter(selection, &iter); @@ -1153,7 +1150,7 @@ static void ws_edit_cb(GtkButton *button, GtkTreeView *tree_view) if (!edit_weightsystem_dialog(index, &ws)) return; - set_one_weightsystem(index, &ws, model, &iter); + set_one_weightsystem(&ws, model, &iter); repaint_dive(); } @@ -1169,7 +1166,7 @@ static void ws_add_cb(GtkButton *button, GtkTreeView *tree_view) return; gtk_list_store_append(model, &iter); - set_one_weightsystem(index, &ws, model, &iter); + set_one_weightsystem(&ws, model, &iter); selection = gtk_tree_view_get_selection(tree_view); gtk_tree_selection_select_iter(selection, &iter); |