mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
code cleanup: add empty table structures
It seemed to make sense to combine all three types in one commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
70cabb968c
commit
e1cd055111
13 changed files with 47 additions and 41 deletions
|
|
@ -133,6 +133,8 @@ typedef struct dive_table {
|
|||
struct dive **dives;
|
||||
} dive_table_t;
|
||||
|
||||
static const dive_table_t empty_dive_table = { 0, 0, (struct dive **)0 };
|
||||
|
||||
struct picture;
|
||||
struct dive_site;
|
||||
struct dive_site_table;
|
||||
|
|
|
|||
|
|
@ -992,10 +992,10 @@ static bool merge_dive_tables(struct dive_table *dives_from, struct dive_table *
|
|||
void add_imported_dives(struct dive_table *import_table, struct trip_table *import_trip_table, struct dive_site_table *import_sites_table, int flags)
|
||||
{
|
||||
int i, idx;
|
||||
struct dive_table dives_to_add = { 0 };
|
||||
struct dive_table dives_to_remove = { 0 };
|
||||
struct trip_table trips_to_add = { 0 };
|
||||
struct dive_site_table dive_sites_to_add = { 0 };
|
||||
struct dive_table dives_to_add = empty_dive_table;
|
||||
struct dive_table dives_to_remove = empty_dive_table;
|
||||
struct trip_table trips_to_add = empty_trip_table;
|
||||
struct dive_site_table dive_sites_to_add = empty_dive_site_table;
|
||||
|
||||
/* Process imported dives and generate lists of dives
|
||||
* to-be-added and to-be-removed */
|
||||
|
|
@ -1121,7 +1121,7 @@ void process_imported_dives(struct dive_table *import_table, struct trip_table *
|
|||
/* If the caller didn't pass an import_trip_table because all
|
||||
* dives are tripless, provide a local table. This may be
|
||||
* necessary if the trips are autogrouped */
|
||||
struct trip_table local_trip_table = { 0 };
|
||||
struct trip_table local_trip_table = empty_trip_table;
|
||||
if (!import_trip_table)
|
||||
import_trip_table = &local_trip_table;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ typedef struct dive_site_table {
|
|||
struct dive_site **dive_sites;
|
||||
} dive_site_table_t;
|
||||
|
||||
static const dive_site_table_t empty_dive_site_table = { 0, 0, (struct dive_site **)0 };
|
||||
|
||||
extern struct dive_site_table dive_site_table;
|
||||
|
||||
static inline struct dive_site *get_dive_site(int nr, struct dive_site_table *ds_table)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ typedef struct trip_table {
|
|||
struct dive_trip **trips;
|
||||
} trip_table_t;
|
||||
|
||||
static const trip_table_t empty_trip_table = { 0, 0, (struct dive_trip **)0 };
|
||||
|
||||
extern void add_dive_to_trip(struct dive *, dive_trip_t *);
|
||||
extern struct dive_trip *unregister_dive_from_trip(struct dive *dive);
|
||||
extern void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table_arg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue