Patch for ticket #457 (air temp and water temp not changing)

Gehad Elrobey gehadelrobey at gmail.com
Wed Mar 12 13:50:36 PDT 2014


Hello all,
I am sending the patch for ticket #457

now the water temp and air temp can be changed if the dive value is not
equals zero.
Please let me know if there is any feedback.


From: Gehad elrobey <gehadelrobey at gmail.com>
Date: Wed, 12 Mar 2014 22:14:58 +0200
Subject: [PATCH] Fixing airtemp watertemp to change more than 1 time

The if condition changes the value to a new one only when is equal to
zero. the condition is changed to check if the pointer is not pointing
to null

Signed-off-by: Gehad elrobey <gehadelrobey at gmail.com>
---
 dive.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dive.c b/dive.c
index 6deee8b..185087b 100644
--- a/dive.c
+++ b/dive.c
@@ -719,7 +719,7 @@ unsigned int dc_watertemp(struct divecomputer *dc)

 static void fixup_watertemp(struct dive *dive)
 {
-    if (!dive->watertemp.mkelvin)
+    if (dive)
         dive->watertemp.mkelvin = dc_watertemp(&dive->dc);
 }

@@ -743,7 +743,7 @@ unsigned int dc_airtemp(struct divecomputer *dc)

 static void fixup_airtemp(struct dive *dive)
 {
-    if (!dive->airtemp.mkelvin)
+    if (dive)
         dive->airtemp.mkelvin = dc_airtemp(&dive->dc);
 }

-- 
1.8.3.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140312/c3097d4a/attachment.html>


More information about the subsurface mailing list