From 26371063097dab646fcc33afad99943e4376d621 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 6 Nov 2019 05:49:14 +0100 Subject: core: reorder dive structure elements to avoid padding Memory is cheap these days. Still, this was wasteful. On a 64 bit machine we went from 1620 to 1592 bytes. Signed-off-by: Dirk Hohndel --- core/dive.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/dive.h') diff --git a/core/dive.h b/core/dive.h index 2d17af17f..132cc05d6 100644 --- a/core/dive.h +++ b/core/dive.h @@ -139,23 +139,17 @@ struct dive_site_table; struct dive_trip; struct trip_table; struct dive { - int number; - bool notrip; /* Don't autogroup this dive to a trip */ struct dive_trip *divetrip; - bool selected; - bool hidden_by_filter; -#if defined(SUBSURFACE_MOBILE) - uint8_t collapsed; /* four values: 0 = don't show, 1 = show as dive, 2 = show corresponding trip, 3 = show dive and trip */ -#endif timestamp_t when; struct dive_site *dive_site; char *notes; char *divemaster, *buddy; - int rating; - int visibility; /* 0 - 5 star rating */ cylinder_t cylinder[MAX_CYLINDERS]; struct weightsystem_table weightsystems; char *suit; + int number; + int rating; + int visibility; /* 0 - 5 star rating */ int sac, otu, cns, maxcns; /* Calculated based on dive computer data */ @@ -170,6 +164,12 @@ struct dive { int id; // unique ID for this dive struct picture *picture_list; unsigned char git_id[20]; + bool notrip; /* Don't autogroup this dive to a trip */ + bool selected; + bool hidden_by_filter; +#if defined(SUBSURFACE_MOBILE) + uint8_t collapsed; /* four values: 0 = don't show, 1 = show as dive, 2 = show corresponding trip, 3 = show dive and trip */ +#endif }; /* For the top-level list: an entry is either a dive or a trip */ -- cgit v1.2.3-70-g09d2