Skip to content

Commit 7bf35e6

Browse files
committed
output/srzip: rename variables for samples counts
The srzip output module deals with a number of samples that are of a given width (unit size). Rename variables to better tell item counts from byte counts. See a word diff for review.
1 parent e4cfebe commit 7bf35e6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/output/srzip.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int zip_append_queue(const struct sr_output *o,
401401
{
402402
struct out_context *outc;
403403
struct logic_buff *buff;
404-
size_t send_size, remain, copy_size;
404+
size_t send_count, remain, copy_count;
405405
const uint8_t *rdptr;
406406
uint8_t *wrptr;
407407
int ret;
@@ -418,19 +418,19 @@ static int zip_append_queue(const struct sr_output *o,
418418
* Flush to the ZIP archive when the buffer space is exhausted.
419419
*/
420420
rdptr = buf;
421-
send_size = buff->zip_unit_size ? length / buff->zip_unit_size : 0;
422-
while (send_size) {
421+
send_count = buff->zip_unit_size ? length / buff->zip_unit_size : 0;
422+
while (send_count) {
423423
remain = buff->alloc_size - buff->fill_size;
424424
if (remain) {
425425
wrptr = &buff->samples[buff->fill_size * buff->zip_unit_size];
426-
copy_size = MIN(send_size, remain);
427-
send_size -= copy_size;
428-
buff->fill_size += copy_size;
429-
memcpy(wrptr, rdptr, copy_size * buff->zip_unit_size);
430-
rdptr += copy_size * buff->zip_unit_size;
431-
remain -= copy_size;
426+
copy_count = MIN(send_count, remain);
427+
send_count -= copy_count;
428+
buff->fill_size += copy_count;
429+
memcpy(wrptr, rdptr, copy_count * buff->zip_unit_size);
430+
rdptr += copy_count * buff->zip_unit_size;
431+
remain -= copy_count;
432432
}
433-
if (send_size && !remain) {
433+
if (send_count && !remain) {
434434
ret = zip_append(o, buff->samples, buff->zip_unit_size,
435435
buff->fill_size * buff->zip_unit_size);
436436
if (ret != SR_OK)

0 commit comments

Comments
 (0)