mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't have the put_something() functions return success
We didn't use the return value anywhere. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
de6e7d894e
commit
37c1e8147a
2 changed files with 20 additions and 35 deletions
45
membuffer.c
45
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);
|
||||
}
|
||||
|
|
10
membuffer.h
10
membuffer.h
|
@ -51,11 +51,11 @@ extern void put_milli(struct membuffer *, const char *, int, const char *);
|
|||
* to the memory buffer (typically the post/pre will be some XML
|
||||
* pattern and unit string or whatever).
|
||||
*/
|
||||
extern int put_temperature(struct membuffer *, temperature_t, const char *, const char *);
|
||||
extern int put_depth(struct membuffer *, depth_t, const char *, const char *);
|
||||
extern int put_duration(struct membuffer *, duration_t, const char *, const char *);
|
||||
extern int put_pressure(struct membuffer *, pressure_t, const char *, const char *);
|
||||
extern int put_salinity(struct membuffer *, int, const char *, const char *);
|
||||
extern void put_temperature(struct membuffer *, temperature_t, const char *, const char *);
|
||||
extern void put_depth(struct membuffer *, depth_t, const char *, const char *);
|
||||
extern void put_duration(struct membuffer *, duration_t, const char *, const char *);
|
||||
extern void put_pressure(struct membuffer *, pressure_t, const char *, const char *);
|
||||
extern void put_salinity(struct membuffer *, int, const char *, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue