summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-09 18:55:04 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-09 21:47:22 -0800
commit69204804630e51ee7c1e9fddd3620efc327d14a4 (patch)
tree98efe4ac4a09636464a4493afe5faa37489d88c6
parent7d1c2a142fcae4e4085a9f04d0c7a02d4089b6c7 (diff)
downloadsubsurface-69204804630e51ee7c1e9fddd3620efc327d14a4.tar.gz
Clean up signedness confusion in statistics.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--subsurface-core/statistics.c8
-rw-r--r--subsurface-core/statistics.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/subsurface-core/statistics.c b/subsurface-core/statistics.c
index 373a6a0d0..6a05cffc1 100644
--- a/subsurface-core/statistics.c
+++ b/subsurface-core/statistics.c
@@ -48,7 +48,7 @@ static void process_temperatures(struct dive *dp, stats_t *stats)
static void process_dive(struct dive *dp, stats_t *stats)
{
int old_tt, sac_time = 0;
- int duration = dp->duration.seconds;
+ uint32_t duration = dp->duration.seconds;
old_tt = stats->total_time.seconds;
stats->total_time.seconds += duration;
@@ -297,14 +297,14 @@ static void get_ranges(char *buffer, int size)
}
}
-void get_selected_dives_text(char *buffer, int size)
+void get_selected_dives_text(char *buffer, size_t size)
{
if (amount_selected == 1) {
if (current_dive)
snprintf(buffer, size, translate("gettextFromC", "for dive #%d"), current_dive->number);
else
snprintf(buffer, size, "%s", translate("gettextFromC", "for selected dive"));
- } else if (amount_selected == dive_table.nr) {
+ } else if (amount_selected == (unsigned int)dive_table.nr) {
snprintf(buffer, size, "%s", translate("gettextFromC", "for all dives"));
} else if (amount_selected == 0) {
snprintf(buffer, size, "%s", translate("gettextFromC", "(no dives)"));
@@ -313,7 +313,7 @@ void get_selected_dives_text(char *buffer, int size)
if (strlen(buffer) == size - 1) {
/* add our own ellipse... the way Pango does this is ugly
* as it will leave partial numbers there which I don't like */
- int offset = 4;
+ size_t offset = 4;
while (offset < size && isdigit(buffer[size - offset]))
offset++;
strcpy(buffer + size - offset, "...");
diff --git a/subsurface-core/statistics.h b/subsurface-core/statistics.h
index 890e6e53c..015c3481e 100644
--- a/subsurface-core/statistics.h
+++ b/subsurface-core/statistics.h
@@ -44,7 +44,7 @@ extern stats_t *stats_by_type;
extern char *get_time_string_s(int seconds, int maxdays, bool freediving);
extern char *get_minutes(int seconds);
extern void process_all_dives(struct dive *dive, struct dive **prev_dive);
-extern void get_selected_dives_text(char *buffer, int size);
+extern void get_selected_dives_text(char *buffer, size_t size);
extern void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]);
extern void process_selected_dives(void);
void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot);