mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Clean up signedness confusion in statistics.c
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7d1c2a142f
commit
6920480463
2 changed files with 5 additions and 5 deletions
|
|
@ -48,7 +48,7 @@ static void process_temperatures(struct dive *dp, stats_t *stats)
|
||||||
static void process_dive(struct dive *dp, stats_t *stats)
|
static void process_dive(struct dive *dp, stats_t *stats)
|
||||||
{
|
{
|
||||||
int old_tt, sac_time = 0;
|
int old_tt, sac_time = 0;
|
||||||
int duration = dp->duration.seconds;
|
uint32_t duration = dp->duration.seconds;
|
||||||
|
|
||||||
old_tt = stats->total_time.seconds;
|
old_tt = stats->total_time.seconds;
|
||||||
stats->total_time.seconds += duration;
|
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 (amount_selected == 1) {
|
||||||
if (current_dive)
|
if (current_dive)
|
||||||
snprintf(buffer, size, translate("gettextFromC", "for dive #%d"), current_dive->number);
|
snprintf(buffer, size, translate("gettextFromC", "for dive #%d"), current_dive->number);
|
||||||
else
|
else
|
||||||
snprintf(buffer, size, "%s", translate("gettextFromC", "for selected dive"));
|
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"));
|
snprintf(buffer, size, "%s", translate("gettextFromC", "for all dives"));
|
||||||
} else if (amount_selected == 0) {
|
} else if (amount_selected == 0) {
|
||||||
snprintf(buffer, size, "%s", translate("gettextFromC", "(no dives)"));
|
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) {
|
if (strlen(buffer) == size - 1) {
|
||||||
/* add our own ellipse... the way Pango does this is ugly
|
/* add our own ellipse... the way Pango does this is ugly
|
||||||
* as it will leave partial numbers there which I don't like */
|
* 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]))
|
while (offset < size && isdigit(buffer[size - offset]))
|
||||||
offset++;
|
offset++;
|
||||||
strcpy(buffer + size - offset, "...");
|
strcpy(buffer + size - offset, "...");
|
||||||
|
|
|
||||||
|
|
@ -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_time_string_s(int seconds, int maxdays, bool freediving);
|
||||||
extern char *get_minutes(int seconds);
|
extern char *get_minutes(int seconds);
|
||||||
extern void process_all_dives(struct dive *dive, struct dive **prev_dive);
|
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 get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]);
|
||||||
extern void process_selected_dives(void);
|
extern void process_selected_dives(void);
|
||||||
void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot);
|
void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue