diff --git a/dive.c b/dive.c index 54784cdba..52ec64517 100644 --- a/dive.c +++ b/dive.c @@ -277,7 +277,7 @@ static void sanitize_gasmix(struct gasmix *mix) /* Sane mix? */ if (o2 <= 1000 && he <= 1000 && o2+he <= 1000) return; - fprintf(stderr, "Odd gasmix: %d O2 %d He\n", o2, he); + fprintf(stderr, "Odd gasmix: %u O2 %u He\n", o2, he); memset(mix, 0, sizeof(*mix)); } diff --git a/dive.h b/dive.h index d756eba15..e443ce965 100644 --- a/dive.h +++ b/dive.h @@ -366,7 +366,7 @@ extern struct dive_table dive_table; extern int selected_dive; #define current_dive (get_dive(selected_dive)) -static inline struct dive *get_dive(unsigned int nr) +static inline struct dive *get_dive(int nr) { if (nr >= dive_table.nr || nr < 0) return NULL; diff --git a/divelist.c b/divelist.c index 514fdfed1..f032e6243 100644 --- a/divelist.c +++ b/divelist.c @@ -110,7 +110,7 @@ void dump_selection(void) int i; struct dive *dive; - printf("currently selected are %d dives:", amount_selected); + printf("currently selected are %u dives:", amount_selected); for_each_dive(i, dive) { if (dive->selected) printf(" %d", i); diff --git a/equipment.c b/equipment.c index adfb02989..fc31d9729 100644 --- a/equipment.c +++ b/equipment.c @@ -96,13 +96,13 @@ static void convert_volume_pressure(int ml, int mbar, double *v, double *p) volume *= bar_to_atm(mbar / 1000.0); } - if (output_units.pressure == PSI) { + if (output_units.pressure == PSI) pressure = mbar_to_PSI(mbar); - } else + else pressure = mbar / 1000.0; + *p = pressure; } *v = volume; - *p = pressure; } static int convert_weight(int grams, double *m) diff --git a/gtk-gui.c b/gtk-gui.c index d797b8d56..167517ebe 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -226,7 +226,7 @@ static gboolean ask_save_changes() "You have unsaved changes to file: %s \nWould you like to save those before closing the datafile?", existing_filename); label = gtk_label_new (label_text); - g_free(label_text); + free(label_text); } gtk_container_add (GTK_CONTAINER (content), label); gtk_widget_show_all (dialog);