diff options
Diffstat (limited to 'membuffer.c')
-rw-r--r-- | membuffer.c | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/membuffer.c b/membuffer.c index 8ba23ebe2..a222af60b 100644 --- a/membuffer.c +++ b/membuffer.c @@ -127,47 +127,32 @@ void put_milli(struct membuffer *b, const char *pre, int value, const char *post put_format(b, "%s%s%u.%s%s", pre, sign, v, buf, post); } -int put_temperature(struct membuffer *b, temperature_t temp, const char *pre, const char *post) +void put_temperature(struct membuffer *b, temperature_t temp, const char *pre, const char *post) { - if (!temp.mkelvin) - return 0; - - put_milli(b, pre, temp.mkelvin - ZERO_C_IN_MKELVIN, post); - return 1; + if (temp.mkelvin) + put_milli(b, pre, temp.mkelvin - ZERO_C_IN_MKELVIN, post); } -int put_depth(struct membuffer *b, depth_t depth, const char *pre, const char *post) +void put_depth(struct membuffer *b, depth_t depth, const char *pre, const char *post) { - if (!depth.mm) - return 0; - - put_milli(b, pre, depth.mm, post); - return 1; + if (depth.mm) + put_milli(b, pre, depth.mm, post); } -int put_duration(struct membuffer *b, duration_t duration, const char *pre, const char *post) +void put_duration(struct membuffer *b, duration_t duration, const char *pre, const char *post) { - if (!duration.seconds) - return 0; - - put_format(b, "%s%u:%02u%s", pre, FRACTION(duration.seconds, 60), post); - return 1; + if (duration.seconds) + put_format(b, "%s%u:%02u%s", pre, FRACTION(duration.seconds, 60), post); } -int put_pressure(struct membuffer *b, pressure_t pressure, const char *pre, const char *post) +void put_pressure(struct membuffer *b, pressure_t pressure, const char *pre, const char *post) { - if (!pressure.mbar) - return 0; - - put_milli(b, pre, pressure.mbar, post); - return 1; + if (pressure.mbar) + put_milli(b, pre, pressure.mbar, post); } -int put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) +void put_salinity(struct membuffer *b, int salinity, const char *pre, const char *post) { - if (!salinity) - return 0; - - put_format(b, "%s%d%s", pre, salinity / 10, post); - return 1; + if (salinity) + put_format(b, "%s%d%s", pre, salinity / 10, post); } |