fix more compile errors

Avoid void * arithmetic
Do explicit casts to target type to make c++ happy
This commit is contained in:
Wim Taymans 2019-01-08 11:53:36 +01:00
parent 3fa2ad33e4
commit b0f4be5fbc
26 changed files with 175 additions and 159 deletions

View file

@ -801,7 +801,7 @@ push_frames(struct state *state,
l0 = SPA_MIN(n_bytes, d[0].maxsize - offs);
l1 = n_bytes - l0;
memcpy(d[0].data + offs, src, l0);
memcpy(SPA_MEMBER(d[0].data, offs, void), src, l0);
if (l1 > 0)
memcpy(d[0].data, src + l0, l1);

View file

@ -760,7 +760,7 @@ add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, i
if (layer == 0) {
this->clear(out, len1);
if (len2 > 0)
this->clear(out + len1, len2);
this->clear(SPA_MEMBER(out, len1, void), len2);
}
}
else if (volume < 0.999 || volume > 1.001) {
@ -768,14 +768,14 @@ add_port_data(struct impl *this, void *out, size_t outsize, struct port *port, i
mix(out, SPA_MEMBER(data, offset, void), volume, len1);
if (len2 > 0)
mix(out + len1, data, volume, len2);
mix(SPA_MEMBER(out, len1, void), data, volume, len2);
}
else {
mix_func_t mix = layer == 0 ? this->copy : this->add;
mix(out, SPA_MEMBER(data, offset, void), len1);
if (len2 > 0)
mix(out + len1, data, len2);
mix(SPA_MEMBER(out, len1, void), data, len2);
}
port->queued_bytes -= outsize;

View file

@ -413,7 +413,7 @@ static int add_data(struct impl *this, const void *data, int size)
if (processed < 0)
return 0;
data += processed;
data = SPA_MEMBER(data, processed, void);
size -= processed;
total += processed;
}