Fix warning about unused variables

Commit 810903bdb9 ("Import: pass a dive table to process_imported_dives()")
introduced the variables

        struct dive *old_dive, *merged;

into process_imported_dives(), but never used them.  It seems to be an
artifact of having split the function to use the try_to_merge_into()
helper function (that has those same variable names and _does_ use
them), but forgetting the original variables from the pre-split case.

Gcc understandably warns about it:

  core/divelist.c: In function ‘process_imported_dives’:
  core/divelist.c:1351:26: warning: unused variable ‘merged’ [-Wunused-variable]
    struct dive *old_dive, *merged;
                            ^~~~~~
  core/divelist.c:1351:15: warning: unused variable ‘old_dive’ [-Wunused-variable]
    struct dive *old_dive, *merged;
                 ^~~~~~~~

and the trivial fix is to just remove that line that declares the stale
and unused variables.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2018-10-07 12:48:17 -07:00 committed by Dirk Hohndel
parent 7618240009
commit d2d9821170

View file

@ -1348,7 +1348,6 @@ static bool try_to_merge_into(struct dive *dive_to_add, int idx, bool prefer_imp
void process_imported_dives(struct dive_table *import_table, bool prefer_imported, bool downloaded)
{
int i, j;
struct dive *old_dive, *merged;
int preexisting;
bool sequence_changed = false;