summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-12 14:10:13 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-13 09:21:35 +0900
commite1971e9425dfc5266fa1e15579ff36d2b17658da (patch)
tree92d4cfe38b41c6e7e728dbf099a8ce7f3f696c2b
parent6ab05563b3c6564d0a5e88edd8b23cb149a1eb6f (diff)
downloadsubsurface-e1971e9425dfc5266fa1e15579ff36d2b17658da.tar.gz
rename 'get_dive_by_diveid' to 'get_dive_by_uemis_diveid'
A bit longer, but we had a function named get_dive_by_diveid and another one named getDiveByDiveid that did completely different things, it was too easy to hit the wrong one.. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--dive.h7
-rw-r--r--uemis-downloader.c2
2 files changed, 3 insertions, 6 deletions
diff --git a/dive.h b/dive.h
index 31115dfdb..6ad21aa1f 100644
--- a/dive.h
+++ b/dive.h
@@ -421,7 +421,7 @@ static inline struct divecomputer *get_dive_dc(struct dive *dive, int nr)
#define for_each_gps_location(_i, _x) \
for ((_i) = 0; ((_x) = get_gps_location(_i, &gps_location_table)) != NULL; (_i)++)
-static inline struct dive *get_dive_by_diveid(uint32_t diveid, uint32_t deviceid)
+static inline struct dive *get_dive_by_uemis_diveid(uint32_t diveid, uint32_t deviceid)
{
int i;
struct dive *dive;
@@ -435,10 +435,7 @@ static inline struct dive *get_dive_by_diveid(uint32_t diveid, uint32_t deviceid
}
return NULL;
}
-// this is very different from get_dive_by_diveid() (which is only used
-// by the UEMIS downloader) -- this uses the unique diveID to allow us
-// to hold an identifier for a dive across operations that might change
-// the dive_table
+
static inline struct dive *getDiveById(int id)
{
int i;
diff --git a/uemis-downloader.c b/uemis-downloader.c
index 16bba7b27..d0c3de13e 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -751,7 +751,7 @@ static bool process_raw_buffer(uint32_t deviceid, char *inbuf, char **max_divenr
dive->number = atoi(val);
} else if (!log && !strcmp(tag, "logfilenr")) {
/* this one tells us which dive we are adding data to */
- dive = get_dive_by_diveid(atoi(val), deviceid);
+ dive = get_dive_by_uemis_diveid(atoi(val), deviceid);
if (for_dive)
*for_dive = atoi(val);
} else if (!log && dive && !strcmp(tag, "divespot_id")) {