mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									8ddbe50d29
								
							
						
					
					
						commit
						b01cba13c5
					
				
					 3 changed files with 1 additions and 4 deletions
				
			
		|  | @ -271,7 +271,7 @@ extern int divinglog_dive(void *param, int columns, char **data, char **column) | ||||||
| 	UNUSED(columns); | 	UNUSED(columns); | ||||||
| 	UNUSED(column); | 	UNUSED(column); | ||||||
| 
 | 
 | ||||||
| 	int retval = 0; | 	int retval = 0, diveid; | ||||||
| 	sqlite3 *handle = (sqlite3 *)param; | 	sqlite3 *handle = (sqlite3 *)param; | ||||||
| 	char *err = NULL; | 	char *err = NULL; | ||||||
| 	char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3,Profile4,Profile5 from Logbook where ID = %d"; | 	char get_profile_template[] = "select ProfileInt,Profile,Profile2,Profile3,Profile4,Profile5 from Logbook where ID = %d"; | ||||||
|  |  | ||||||
|  | @ -15,7 +15,6 @@ | ||||||
| #include "gettext.h" | #include "gettext.h" | ||||||
| 
 | 
 | ||||||
| int metric = 1; | int metric = 1; | ||||||
| int diveid = -1; |  | ||||||
| 
 | 
 | ||||||
| event_allocation_t event_allocation = { .event.deleted = 1 }; | event_allocation_t event_allocation = { .event.deleted = 1 }; | ||||||
| struct parser_settings cur_settings; | struct parser_settings cur_settings; | ||||||
|  | @ -48,7 +47,6 @@ struct divecomputer *get_dc(void) | ||||||
| 	return cur_dc ?: &cur_dive->dc; | 	return cur_dc ?: &cur_dive->dc; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| /* Trim a character string by removing leading and trailing white space characters.
 | /* Trim a character string by removing leading and trailing white space characters.
 | ||||||
|  * Parameter: a pointer to a null-terminated character string (buffer); |  * Parameter: a pointer to a null-terminated character string (buffer); | ||||||
|  * Return value: length of the trimmed string, excluding the terminal 0x0 byte |  * Return value: length of the trimmed string, excluding the terminal 0x0 byte | ||||||
|  |  | ||||||
|  | @ -55,7 +55,6 @@ extern struct dive_table dive_table; | ||||||
| extern struct dive_table *target_table; | extern struct dive_table *target_table; | ||||||
| 
 | 
 | ||||||
| extern int metric; | extern int metric; | ||||||
| extern int diveid; |  | ||||||
| 
 | 
 | ||||||
| int trimspace(char *buffer); | int trimspace(char *buffer); | ||||||
| void clear_table(struct dive_table *table); | void clear_table(struct dive_table *table); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue