diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-09 18:55:04 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-09 21:47:22 -0800 |
commit | 69204804630e51ee7c1e9fddd3620efc327d14a4 (patch) | |
tree | 98efe4ac4a09636464a4493afe5faa37489d88c6 /subsurface-core/statistics.c | |
parent | 7d1c2a142fcae4e4085a9f04d0c7a02d4089b6c7 (diff) | |
download | subsurface-69204804630e51ee7c1e9fddd3620efc327d14a4.tar.gz |
Clean up signedness confusion in statistics.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/statistics.c')
-rw-r--r-- | subsurface-core/statistics.c | 8 |
1 files changed, 4 insertions, 4 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, "..."); |