X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fwav.c;h=732fe976f0df420c2cae8b8e4b9a935ca0201b45;hb=fe953391bd7782813256c02350afa1996c773659;hp=79ea31e25a8f536ae0cb4d6e2b5040d97cf10b6e;hpb=23eeac46edef25d1be2ff4716cb388296b6222ac;p=libsigrok.git diff --git a/src/output/wav.c b/src/output/wav.c index 79ea31e2..732fe976 100644 --- a/src/output/wav.c +++ b/src/output/wav.c @@ -186,9 +186,9 @@ static GString *gen_header(const struct sr_output *o) */ static void float_to_le(uint8_t *buf, float value) { - char *old; + uint8_t *old; - old = (char *)&value; + old = (uint8_t *)&value; #ifdef WORDS_BIGENDIAN buf[0] = old[3]; buf[1] = old[2]; @@ -219,9 +219,10 @@ static int check_chanbuf_size(const struct sr_output *o) /* Nothing in all the buffers yet. */ size = -1; break; - } else + } else { /* New high water mark. */ size = outc->chanbuf_used[i]; + } } else if (outc->chanbuf_used[i] != size) { /* All channel buffers are not equally full yet. */ size = -1; @@ -265,8 +266,9 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p if (!outc->header_done) { *out = gen_header(o); outc->header_done = TRUE; - } else + } else { *out = g_string_sized_new(512); + } analog = packet->payload; num_samples = analog->num_samples; @@ -365,7 +367,7 @@ static int cleanup(struct sr_output *o) SR_PRIV struct sr_output_module output_wav = { .id = "wav", .name = "WAV", - .desc = "Microsoft WAV file format", + .desc = "Microsoft WAV file format data", .exts = (const char*[]){"wav", NULL}, .flags = 0, .options = get_options,