[PATCH 09/14] Cleanup: be explicit about ignoring the return value of dc_buffer_clear

Dirk Hohndel dirk at hohndel.org
Thu Dec 28 16:35:37 PST 2017


Coverity CID 207756
Coverity CID 207714
Coverity CID 207800
Coverity CID 207729

Signed-off-by: Dirk Hohndel <dirk at hohndel.org>
---
 src/atomics_cobalt.c   | 2 +-
 src/divesystem_idive.c | 2 +-
 src/oceanic_vtpro.c    | 2 +-
 src/suunto_eonsteel.c  | 2 +-
 src/suunto_vyper.c     | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/atomics_cobalt.c b/src/atomics_cobalt.c
index 7c7dccb04876..3b42147197a4 100644
--- a/src/atomics_cobalt.c
+++ b/src/atomics_cobalt.c
@@ -323,7 +323,7 @@ atomics_cobalt_read_dive (dc_device_t *abstract, dc_buffer_t *buffer, int init,
 	// When only two 0xFF bytes are received, there are no more dives.
 	unsigned char *data = dc_buffer_get_data (buffer);
 	if (nbytes == 2 && data[0] == 0xFF && data[1] == 0xFF) {
-		dc_buffer_clear (buffer);
+		(void)dc_buffer_clear (buffer);
 		return DC_STATUS_SUCCESS;
 	}
 
diff --git a/src/divesystem_idive.c b/src/divesystem_idive.c
index 642aaee4a05e..138aac9fb526 100644
--- a/src/divesystem_idive.c
+++ b/src/divesystem_idive.c
@@ -490,7 +490,7 @@ divesystem_idive_device_foreach (dc_device_t *abstract, dc_dive_callback_t callb
 		progress.current = i * NSTEPS + STEP(1, nsamples + 1);
 		device_event_emit (abstract, DC_EVENT_PROGRESS, &progress);
 
-		dc_buffer_clear(buffer);
+		(void)dc_buffer_clear(buffer);
 		dc_buffer_reserve(buffer, commands->header.size + commands->sample.size * nsamples);
 		dc_buffer_append(buffer, packet, commands->header.size);
 
diff --git a/src/oceanic_vtpro.c b/src/oceanic_vtpro.c
index e1ba31ced88a..f200b78fe7cc 100644
--- a/src/oceanic_vtpro.c
+++ b/src/oceanic_vtpro.c
@@ -363,7 +363,7 @@ oceanic_aeris500ai_device_logbook (dc_device_t *abstract, dc_event_progress_t *p
 
 		// Compare the fingerprint to identify previously downloaded entries.
 		if (memcmp (answer, device->base.fingerprint, PAGESIZE / 2) == 0) {
-			dc_buffer_clear (logbook);
+			(void)dc_buffer_clear (logbook);
 		} else {
 			dc_buffer_append (logbook, answer, PAGESIZE / 2);
 		}
diff --git a/src/suunto_eonsteel.c b/src/suunto_eonsteel.c
index cbf1b756d945..cddc8611abe8 100644
--- a/src/suunto_eonsteel.c
+++ b/src/suunto_eonsteel.c
@@ -861,7 +861,7 @@ suunto_eonsteel_device_foreach(dc_device_t *abstract, dc_dive_callback_t callbac
 				break;
 
 			// Reset the membuffer, put the 4-byte length at the head.
-			dc_buffer_clear(file);
+			(void)dc_buffer_clear(file);
 			put_le32(time, buf);
 			dc_buffer_append(file, buf, 4);
 
diff --git a/src/suunto_vyper.c b/src/suunto_vyper.c
index ba5ad20047b7..a59b75953101 100644
--- a/src/suunto_vyper.c
+++ b/src/suunto_vyper.c
@@ -396,7 +396,7 @@ suunto_vyper_read_dive (dc_device_t *abstract, dc_buffer_t *buffer, int init, dc
 		// the current dive has been overwritten with newer data. Therefore,
 		// we discard the current (incomplete) dive and end the transmission.
 		if (len == 0) {
-			dc_buffer_clear (buffer);
+			(void)dc_buffer_clear (buffer);
 			return DC_STATUS_SUCCESS;
 		}
 
-- 
2.15.1



More information about the devel mailing list