From b01cba13c5dc81ed7367ae79b6af361e6abc0da1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 14 Oct 2018 15:09:36 +0200 Subject: Parser: remove global variable dive_id This variable was only used in the divinglog_dive() function. There, it was initialized right at the beginning and therefore there seems to be no point in conserving its value across function-calls. Make the variable local and remove the global version. Signed-off-by: Berthold Stoeger --- core/import-divinglog.c | 2 +- core/parse.c | 2 -- core/parse.h | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) (limited to 'core') diff --git a/core/import-divinglog.c b/core/import-divinglog.c index 3e2f396ba..f718ca087 100644 --- a/core/import-divinglog.c +++ b/core/import-divinglog.c @@ -271,7 +271,7 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) UNUSED(columns); UNUSED(column); - int retval = 0; + int retval = 0, diveid; sqlite3 *handle = (sqlite3 *)param; char *err = NULL; char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3,Profile4,Profile5 from Logbook where ID = %d"; diff --git a/core/parse.c b/core/parse.c index c8f3ae89a..a444dc441 100644 --- a/core/parse.c +++ b/core/parse.c @@ -15,7 +15,6 @@ #include "gettext.h" int metric = 1; -int diveid = -1; event_allocation_t event_allocation = { .event.deleted = 1 }; struct parser_settings cur_settings; @@ -48,7 +47,6 @@ struct divecomputer *get_dc(void) return cur_dc ?: &cur_dive->dc; } - /* Trim a character string by removing leading and trailing white space characters. * Parameter: a pointer to a null-terminated character string (buffer); * Return value: length of the trimmed string, excluding the terminal 0x0 byte diff --git a/core/parse.h b/core/parse.h index 5682e4c03..403988e10 100644 --- a/core/parse.h +++ b/core/parse.h @@ -55,7 +55,6 @@ extern struct dive_table dive_table; extern struct dive_table *target_table; extern int metric; -extern int diveid; int trimspace(char *buffer); void clear_table(struct dive_table *table); -- cgit v1.2.3-70-g09d2