summaryrefslogtreecommitdiffstats
path: root/core/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-06 05:49:14 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-08 20:50:05 +0100
commit26371063097dab646fcc33afad99943e4376d621 (patch)
tree90f08e492af8d2197fb0b7828ac62d47090f921c /core/dive.h
parentff47dd9b307a74f181c78be7da0048fbbfe2acf5 (diff)
downloadsubsurface-26371063097dab646fcc33afad99943e4376d621.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'core/dive.h')
-rw-r--r--core/dive.h18
1 files changed, 9 insertions, 9 deletions
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 */