[PATCH] Cochran: Fix compile errors

John Van Ostrand john at vanostrand.com
Fri Jun 2 09:53:01 PDT 2017


I really should stop being so excited that i forget to compile.
---
 src/cochran_commander.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/cochran_commander.c b/src/cochran_commander.c
index 5ff46a5..b3e5fed 100644
--- a/src/cochran_commander.c
+++ b/src/cochran_commander.c
@@ -28,6 +28,7 @@
 #include "device-private.h"
 #include "serial.h"
 #include "array.h"
+#include "ringbuffer.h"
 
 #define C_ARRAY_SIZE(array) (sizeof (array) / sizeof *(array))
 
@@ -483,7 +484,7 @@ cochran_commander_profile_size(cochran_commander_device_t *device, cochran_data_
 		// Corrupt dive, guess the end address
 		sample_end_address = cochran_commander_guess_sample_end_address(device, data, dive_num);
 
-	return ringbuffer_distance(sample_start_address, sample_end_address, 0, device->layout->rb_profile_end - device->layout->rb_profile_begin);
+	return ringbuffer_distance(sample_start_address, sample_end_address, 0, device->layout->rb_profile_begin, device->layout->rb_profile_end);
 }
 
 
@@ -528,8 +529,8 @@ cochran_commander_find_fingerprint(cochran_commander_device_t *device, cochran_d
 			break;
 		}
 
-		unsigned int sample_size = cochran_commander_profile_size(device, data, i, PROFILE_FULL_SIZE);
-		unsigned int read_size = cochran_commander_profile_size(device, data, i, PROFILE_READ_SIZE);
+		unsigned int sample_size = cochran_commander_profile_size(device, data, i, PROFILE_SIZE_FULL);
+		unsigned int read_size = cochran_commander_profile_size(device, data, i, PROFILE_SIZE_READ);
 
 		// Determine if sample exists
 		if (profile_capacity_remaining > 0) {
@@ -870,7 +871,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 
 		// Determine if profile exists
 		if (i > data.invalid_profile_dive_num)
-			sample_size = cochran_commander_profile_size(device, &data, i, PROFILE_READ_SIZE);
+			sample_size = cochran_commander_profile_size(device, &data, i, PROFILE_SIZE_READ);
 
 		// Build dive blob
 		unsigned int dive_size = device->layout->rb_logbook_entry_size + sample_size;
@@ -887,7 +888,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 		if (sample_size) {
 			if (sample_end_address == 0xFFFFFFFF)
 				// Corrupt dive, guess the end address
-				sample_end_address = cochran_commander_guess_sample_end_address(device, data, dive_num);
+				sample_end_address = cochran_commander_guess_sample_end_address(device, &data, i);
 
 			if (sample_start_address <= sample_end_address) {
 				do {
@@ -895,7 +896,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 				} while (rc != DC_STATUS_SUCCESS && tries++ < 3);
 				if (rc != DC_STATUS_SUCCESS) {
 					ERROR (abstract->context, "Failed to read the sample data.");
-					status = rc
+					status = rc;
 					goto error;
 				}
 			} else {
@@ -908,7 +909,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 				} while (rc != DC_STATUS_SUCCESS && tries++ < 3);
 				if (rc != DC_STATUS_SUCCESS) {
 					ERROR (abstract->context, "Failed to read the sample data.");
-					status = rc
+					status = rc;
 					goto error;
 				}
 				tries = 0;
@@ -917,7 +918,7 @@ cochran_commander_device_foreach (dc_device_t *abstract, dc_dive_callback_t call
 				} while (rc != DC_STATUS_SUCCESS && tries++ < 3);
 				if (rc != DC_STATUS_SUCCESS) {
 					ERROR (abstract->context, "Failed to read the sample data.");
-					status = rc
+					status = rc;
 					goto error;
 				}
 			}
-- 
2.4.11



More information about the devel mailing list