diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-03-03 21:24:52 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-03 21:40:56 -0800 |
commit | d24d2288f30e8666667c5437802d22533a94e1ec (patch) | |
tree | fdfaa1befe6122a756da19af329b66c7e1778bc1 | |
parent | 99b8e85d739387c0c8342535b28e010cdac74a5f (diff) | |
download | subsurface-d24d2288f30e8666667c5437802d22533a94e1ec.tar.gz |
Remove pointless assignments
tissue_tolerance wasn't used after it was assigned.
type was overwritten after it was assigned.
serial was overwritten after the last /= 100.
event is assigned in the for loop.
clear isn't used after the assignment
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | divelist.c | 2 | ||||
-rw-r--r-- | libdivecomputer.c | 1 | ||||
-rw-r--r-- | profile.c | 4 | ||||
-rw-r--r-- | qt-ui/globe.cpp | 4 | ||||
-rw-r--r-- | uemis-downloader.c | 2 |
5 files changed, 5 insertions, 8 deletions
diff --git a/divelist.c b/divelist.c index 223205e27..2d8918784 100644 --- a/divelist.c +++ b/divelist.c @@ -188,7 +188,7 @@ int total_weight(struct dive *dive) static int active_o2(struct dive *dive, struct divecomputer *dc, duration_t time) { int o2permille = dive->cylinder[0].gasmix.o2.permille; - struct event *event = dc->events; + struct event *event; if (!o2permille) o2permille = O2_IN_AIR; diff --git a/libdivecomputer.c b/libdivecomputer.c index 86cea5a80..312f83c9a 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -577,7 +577,6 @@ static unsigned int undo_libdivecomputer_suunto_nr_changes(unsigned int serial) b2 = serial % 100; serial /= 100; b3 = serial % 100; - serial /= 100; serial = b0 + (b1 << 8) + (b2 << 16) + (b3 << 24); return serial; @@ -1194,8 +1194,8 @@ static void calculate_ndl_tts(double tissue_tolerance, struct plot_data *entry, if (deco_allowed_depth(tissue_tolerance, surface_pressure, dive, 1) <= next_stop) { /* move to the next stop and add the travel between stops */ for (; ascent_depth > next_stop; ascent_depth -= ascent_mm_per_deco_step, entry->tts_calc += ascent_s_per_deco_step) - tissue_tolerance = add_segment(depth_to_mbar(ascent_depth, dive) / 1000.0, - &dive->cylinder[cylinderindex].gasmix, ascent_s_per_deco_step, entry->po2 * 1000, dive); + add_segment(depth_to_mbar(ascent_depth, dive) / 1000.0, + &dive->cylinder[cylinderindex].gasmix, ascent_s_per_deco_step, entry->po2 * 1000, dive); ascent_depth = next_stop; next_stop -= deco_stepsize; } diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 496afb4ac..4c6743770 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -150,10 +150,8 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit) } if (selectedDiveIds.empty()) return; - if (clear) { + if (clear) MainWindow::instance()->dive_list()->unselectDives(); - clear = false; - } MainWindow::instance()->dive_list()->selectDives(selectedDiveIds); } diff --git a/uemis-downloader.c b/uemis-downloader.c index f5467e854..c9d57acfb 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -564,7 +564,7 @@ static void parse_divespot(char *buf) while (*tag && strcmp(tag, "object_id")); if (!*tag) return; - type = next_token(&bp); + next_token(&bp); val = next_token(&bp); divespot = atoi(val); do { |