[PATCH] Use enum name instead of its int value.

Anton Lundin glance at acc.umu.se
Thu May 8 13:13:55 PDT 2014


SAMPLE_EVENT_GASCHANGE2 is the libdivecomputer name of the event.
Compare with that instead of its int value.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 profile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/profile.c b/profile.c
index 373ac8e..8289f68 100644
--- a/profile.c
+++ b/profile.c
@@ -602,10 +602,10 @@ int get_cylinder_index(struct dive *dive, struct event *ev)
 		distance = delta_o2 * delta_o2;
 
 		/* Check the event type to figure out if we should care about the he part.
-		 * 11 is SAMPLE_EVENT_GASCHANGE, aka without he
-		 * 25 is SAMPLE_EVENT_GASCHANGE2, aka with he
+		 * SAMPLE_EVENT_GASCHANGE, aka without he
+		 * SAMPLE_EVENT_GASCHANGE2, aka with he
 		 */
-		if (ev->type == 25)
+		if (ev->type == SAMPLE_EVENT_GASCHANGE2)
 			distance += delta_he * delta_he;
 		if (distance >= score)
 			continue;
-- 
1.9.1



More information about the subsurface mailing list