Refactoring: Improve Naming of FRACTION and SIGNED_FRAC defines.

Make it more obvious that the FRACTION and SIGNED_FRAC defines return a
tuple / triplet of values.

Fixes https://github.com/subsurface/subsurface/pull/4171#discussion_r1585941133

Complained-about-by: @bstoeger
Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-05-01 21:01:06 +12:00 committed by bstoeger
parent 32a08735c3
commit e65c7cedc8
16 changed files with 57 additions and 57 deletions

View file

@ -163,8 +163,8 @@ static void put_cylinder_HTML(struct membuffer *b, struct dive *dive)
}
if (cylinder->gasmix.o2.permille) {
put_format(b, "\"O2\":\"%u.%u%%\",", FRACTION(cylinder->gasmix.o2.permille, 10));
put_format(b, "\"He\":\"%u.%u%%\"", FRACTION(cylinder->gasmix.he.permille, 10));
put_format(b, "\"O2\":\"%u.%u%%\",", FRACTION_TUPLE(cylinder->gasmix.o2.permille, 10));
put_format(b, "\"He\":\"%u.%u%%\"", FRACTION_TUPLE(cylinder->gasmix.he.permille, 10));
} else {
write_attribute(b, "O2", "Air", "");
}
@ -364,7 +364,7 @@ static void write_one_dive(struct membuffer *b, struct dive *dive, const char *p
put_format(b, "\"surge\":%d,", dive->surge);
put_format(b, "\"chill\":%d,", dive->chill);
put_format(b, "\"dive_duration\":\"%u:%02u min\",",
FRACTION(dive->duration.seconds, 60));
FRACTION_TUPLE(dive->duration.seconds, 60));
put_string(b, "\"temperature\":{");
put_HTML_airtemp(b, dive, "\"air\":\"", "\",");
put_HTML_watertemp(b, dive, "\"water\":\"", "\"");