== has precedence over & and would have needed some parenthesis.

Instead of that, this moves that code into the block below which
already contains a correct CCR check.

Signed-off-by: Anton Lundin <[email protected]>
---
 src/shearwater_predator_parser.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c
index 81c7ba5..bcbd95b 100644
--- a/src/shearwater_predator_parser.c
+++ b/src/shearwater_predator_parser.c
@@ -487,13 +487,11 @@ shearwater_predator_parser_samples_foreach (dc_parser_t 
*abstract, dc_sample_cal
                // Status flags.
                unsigned int status = data[offset + 11];
 
-               // PPO2 -- only return PPO2 if we are in closed circuit mode
-               if (data[offset + 11] & 0x10 == 0) {
+               if ((status & OC) == 0) {
+                       // PPO2 -- only return PPO2 if we are in closed circuit 
mode
                        sample.ppo2 = data[offset + 6] / 100.0;
                        if (callback) callback (DC_SAMPLE_PPO2, sample, 
userdata);
-               }
 
-               if ((status & OC) == 0) {
                        // Setpoint
                        if (parser->petrel) {
                                sample.setpoint = data[offset + 18] / 100.0;
-- 
2.1.4

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to